Alexandre Julliard : jscript: Consistently use wcscmp() instead of lstrcmpW().
Alexandre Julliard
julliard at winehq.org
Thu Jun 13 15:40:38 CDT 2019
Module: wine
Branch: master
Commit: 784b3f611a2bb89072650e264b5346feeb7751d4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=784b3f611a2bb89072650e264b5346feeb7751d4
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Jun 13 14:47:56 2019 +0200
jscript: Consistently use wcscmp() instead of lstrcmpW().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/jscript/compile.c | 8 ++++----
dlls/jscript/dispex.c | 4 ++--
dlls/jscript/engine.c | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 7746744..e38e5c5 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -1419,7 +1419,7 @@ static HRESULT compile_continue_statement(compiler_ctx_t *ctx, branch_statement_
for(iter = ctx->stat_ctx; iter; iter = iter->next) {
if(iter->continue_label)
pop_ctx = iter;
- if(iter->labelled_stat && !lstrcmpW(iter->labelled_stat->identifier, stat->identifier))
+ if(iter->labelled_stat && !wcscmp(iter->labelled_stat->identifier, stat->identifier))
break;
}
@@ -1465,7 +1465,7 @@ static HRESULT compile_break_statement(compiler_ctx_t *ctx, branch_statement_t *
if(stat->identifier) {
for(pop_ctx = ctx->stat_ctx; pop_ctx; pop_ctx = pop_ctx->next) {
- if(pop_ctx->labelled_stat && !lstrcmpW(pop_ctx->labelled_stat->identifier, stat->identifier)) {
+ if(pop_ctx->labelled_stat && !wcscmp(pop_ctx->labelled_stat->identifier, stat->identifier)) {
assert(pop_ctx->break_label);
break;
}
@@ -1549,7 +1549,7 @@ static HRESULT compile_labelled_statement(compiler_ctx_t *ctx, labelled_statemen
HRESULT hres;
for(iter = ctx->stat_ctx; iter; iter = iter->next) {
- if(iter->labelled_stat && !lstrcmpW(iter->labelled_stat->identifier, stat->identifier)) {
+ if(iter->labelled_stat && !wcscmp(iter->labelled_stat->identifier, stat->identifier)) {
WARN("Label %s redefined\n", debugstr_w(stat->identifier));
return JS_E_LABEL_REDEFINED;
}
@@ -1825,7 +1825,7 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx,
static int function_local_cmp(const void *key, const struct wine_rb_entry *entry)
{
function_local_t *local = WINE_RB_ENTRY_VALUE(entry, function_local_t, entry);
- return CompareStringOrdinal(key, -1, local->name, -1, FALSE) - 2;
+ return wcscmp(key, local->name);
}
static inline function_local_t *find_local(compiler_ctx_t *ctx, const WCHAR *name)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index 032facd..b1f2914 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -93,7 +93,7 @@ static const builtin_prop_t *find_builtin_prop(jsdisp_t *This, const WCHAR *name
while(min <= max) {
i = (min+max)/2;
- r = CompareStringOrdinal(name, -1, This->builtin_info->props[i].name, -1, FALSE) - 2;
+ r = wcscmp(name, This->builtin_info->props[i].name);
if(!r) {
/* Skip prop if it's available only in higher compatibility mode. */
unsigned version = (This->builtin_info->props[i].flags & PROPF_VERSION_MASK)
@@ -203,7 +203,7 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name,
bucket = get_props_idx(This, hash);
pos = This->props[bucket].bucket_head;
while(pos != 0) {
- if(!lstrcmpW(name, This->props[pos].name)) {
+ if(!wcscmp(name, This->props[pos].name)) {
if(prev != 0) {
This->props[prev].bucket_next = This->props[pos].bucket_next;
This->props[pos].bucket_next = This->props[bucket].bucket_head;
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 7d3eb13..0a68a51 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -612,9 +612,9 @@ static BOOL lookup_global_members(script_ctx_t *ctx, BSTR identifier, exprval_t
return FALSE;
}
-static int local_ref_cmp(const void *key, const void *ref)
+static int __cdecl local_ref_cmp(const void *key, const void *ref)
{
- return CompareStringOrdinal((const WCHAR*)key, -1, ((const local_ref_t*)ref)->name, -1, FALSE) - 2;
+ return wcscmp((const WCHAR*)key, ((const local_ref_t*)ref)->name);
}
local_ref_t *lookup_local(const function_code_t *function, const WCHAR *identifier)
@@ -646,7 +646,7 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
return S_OK;
}
- if(!lstrcmpW(identifier, argumentsW)) {
+ if(!wcscmp(identifier, argumentsW)) {
hres = detach_variable_object(ctx, scope->frame, FALSE);
if(FAILED(hres))
return hres;
@@ -670,7 +670,7 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
}
for(item = ctx->named_items; item; item = item->next) {
- if((item->flags & SCRIPTITEM_ISVISIBLE) && !lstrcmpW(item->name, identifier)) {
+ if((item->flags & SCRIPTITEM_ISVISIBLE) && !wcscmp(item->name, identifier)) {
if(!item->disp) {
IUnknown *unk;
More information about the wine-cvs
mailing list