diff --git a/dll/win32/vbscript/global.c b/dll/win32/vbscript/global.c index 668a71a78ba..6d26b2c6a5c 100644 --- a/dll/win32/vbscript/global.c +++ b/dll/win32/vbscript/global.c @@ -338,7 +338,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o return E_OUTOFMEMORY; memcpy(title_buf, vbscriptW, sizeof(vbscriptW)); - ptr = title_buf + sizeof(vbscriptW)/sizeof(WCHAR)-1; + ptr = title_buf + ARRAY_SIZE(vbscriptW)-1; *ptr++ = ':'; *ptr++ = ' '; @@ -2450,7 +2450,7 @@ HRESULT init_global(script_ctx_t *ctx) HRESULT hres; ctx->global_desc.ctx = ctx; - ctx->global_desc.builtin_prop_cnt = sizeof(global_props)/sizeof(*global_props); + ctx->global_desc.builtin_prop_cnt = ARRAY_SIZE(global_props); ctx->global_desc.builtin_props = global_props; hres = get_typeinfo(GlobalObj_tid, &ctx->global_desc.typeinfo); @@ -2466,7 +2466,7 @@ HRESULT init_global(script_ctx_t *ctx) return hres; ctx->err_desc.ctx = ctx; - ctx->err_desc.builtin_prop_cnt = sizeof(err_props)/sizeof(*err_props); + ctx->err_desc.builtin_prop_cnt = ARRAY_SIZE(err_props); ctx->err_desc.builtin_props = err_props; hres = get_typeinfo(ErrObj_tid, &ctx->err_desc.typeinfo); diff --git a/dll/win32/vbscript/lex.c b/dll/win32/vbscript/lex.c index 98b4cbb842c..571854db58e 100644 --- a/dll/win32/vbscript/lex.c +++ b/dll/win32/vbscript/lex.c @@ -179,7 +179,7 @@ static int check_keyword(parser_ctx_t *ctx, const WCHAR *word) static int check_keywords(parser_ctx_t *ctx) { - int min = 0, max = sizeof(keywords)/sizeof(keywords[0])-1, r, i; + int min = 0, max = ARRAY_SIZE(keywords)-1, r, i; while(min <= max) { i = (min+max)/2; @@ -383,13 +383,14 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret) static void skip_spaces(parser_ctx_t *ctx) { - while(*ctx->ptr == ' ' || *ctx->ptr == '\t' || *ctx->ptr == '\r') + while(*ctx->ptr == ' ' || *ctx->ptr == '\t') ctx->ptr++; } static int comment_line(parser_ctx_t *ctx) { - ctx->ptr = strchrW(ctx->ptr, '\n'); + static const WCHAR newlineW[] = {'\n','\r',0}; + ctx->ptr = strpbrkW(ctx->ptr, newlineW); if(ctx->ptr) ctx->ptr++; else @@ -421,6 +422,7 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) switch(c) { case '\n': + case '\r': ctx->ptr++; return tNL; case '\'': diff --git a/dll/win32/vbscript/parser.tab.c b/dll/win32/vbscript/parser.tab.c index c39ff414d87..af2c0448591 100644 --- a/dll/win32/vbscript/parser.tab.c +++ b/dll/win32/vbscript/parser.tab.c @@ -3414,7 +3414,7 @@ void *parser_alloc(parser_ctx_t *ctx, size_t size) HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimiter) { - const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0}; + static const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0}; ctx->code = ctx->ptr = code; ctx->end = ctx->code + strlenW(ctx->code); diff --git a/dll/win32/vbscript/parser.y b/dll/win32/vbscript/parser.y index e8ecf4d1fda..020109998e8 100644 --- a/dll/win32/vbscript/parser.y +++ b/dll/win32/vbscript/parser.y @@ -969,7 +969,7 @@ void *parser_alloc(parser_ctx_t *ctx, size_t size) HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimiter) { - const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0}; + static const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0}; ctx->code = ctx->ptr = code; ctx->end = ctx->code + strlenW(ctx->code); diff --git a/dll/win32/vbscript/vbdisp.c b/dll/win32/vbscript/vbdisp.c index daed7ec47cc..a836b1da7c0 100644 --- a/dll/win32/vbscript/vbdisp.c +++ b/dll/win32/vbscript/vbdisp.c @@ -236,7 +236,7 @@ static HRESULT invoke_builtin(vbdisp_t *This, const builtin_prop_t *prop, WORD f return E_FAIL; } - assert(argn < sizeof(args)/sizeof(*args)); + assert(argn < ARRAY_SIZE(args)); for(i=0; i < argn; i++) { if(V_VT(dp->rgvarg+dp->cArgs-i-1) == (VT_BYREF|VT_VARIANT)) @@ -647,7 +647,7 @@ HRESULT create_procedure_disp(script_ctx_t *ctx, vbscode_t *code, IDispatch **re return E_OUTOFMEMORY; desc->ctx = ctx; - desc->builtin_prop_cnt = sizeof(procedure_props)/sizeof(*procedure_props); + desc->builtin_prop_cnt = ARRAY_SIZE(procedure_props); desc->builtin_props = procedure_props; desc->value_func = &code->main_code; diff --git a/dll/win32/vbscript/vbscript_main.c b/dll/win32/vbscript/vbscript_main.c index 7b7161c21ec..786b7fb8987 100644 --- a/dll/win32/vbscript/vbscript_main.c +++ b/dll/win32/vbscript/vbscript_main.c @@ -87,7 +87,7 @@ static void release_typelib(void) if(!typelib) return; - for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++) { + for(i = 0; i < ARRAY_SIZE(typeinfos); i++) { if(typeinfos[i]) ITypeInfo_Release(typeinfos[i]); } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 723f86c8eb4..78330c46548 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -191,7 +191,7 @@ reactos/dll/win32/url # Synced to WineStaging-3.3 reactos/dll/win32/urlmon # Synced to WineStaging-4.0 reactos/dll/win32/usp10 # Synced to WineStaging-4.0 reactos/dll/win32/uxtheme # Forked -reactos/dll/win32/vbscript # Synced to WineStaging-3.9 +reactos/dll/win32/vbscript # Synced to WineStaging-4.0 reactos/dll/win32/version # Synced to WineStaging-3.9 reactos/dll/win32/vssapi # Synced to WineStaging-2.9 reactos/dll/win32/wbemdisp # Synced to WineStaging-3.3