[VBSCRIPT] Sync with Wine Staging 4.0. CORE-15682

This commit is contained in:
Amine Khaldi 2019-02-04 13:07:56 +01:00
parent 4df86f782f
commit 72fa0fd6cc
7 changed files with 14 additions and 12 deletions

View file

@ -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);

View file

@ -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 '\'':

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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]);
}

View file

@ -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