Jacek Caban : jscript: Fixed some clang warnings.

Alexandre Julliard julliard at winehq.org
Thu Jan 27 12:43:27 CST 2011


Module: wine
Branch: master
Commit: 020245bba10e15e2a1b415f4a4a08d43f9fb1025
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=020245bba10e15e2a1b415f4a4a08d43f9fb1025

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan 27 13:38:36 2011 +0100

jscript: Fixed some clang warnings.

---

 dlls/jscript/array.c    |    3 +++
 dlls/jscript/engine.c   |    2 +-
 dlls/jscript/function.c |    3 ++-
 dlls/jscript/jscript.c  |    3 ++-
 dlls/jscript/lex.c      |    1 -
 dlls/jscript/number.c   |    2 +-
 6 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c
index b8fabe1..f99fe01 100644
--- a/dlls/jscript/array.c
+++ b/dlls/jscript/array.c
@@ -133,6 +133,9 @@ static HRESULT Array_length(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
         HRESULT hres;
 
         hres = to_number(ctx, get_arg(dp, 0), ei, &num);
+        if(FAILED(hres))
+            return hres;
+
         if(V_VT(&num) == VT_I4)
             len = V_I4(&num);
         else
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 9a5ecbc..1b56e63 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -2415,7 +2415,7 @@ static HRESULT typeof_exprval(script_ctx_t *ctx, exprval_t *exprval, jsexcept_t
     }
 
     VariantClear(&val);
-    return S_OK;
+    return hres;
 }
 
 HRESULT typeof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index ff5364a..765fade 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -441,7 +441,8 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
         }
     }
 
-    hres = call_function(ctx, function, this_obj, &args, retv, ei, caller);
+    if(SUCCEEDED(hres))
+       hres = call_function(ctx, function, this_obj, &args, retv, ei, caller);
 
     if(this_obj)
         IDispatch_Release(this_obj);
diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c
index a17b456..e5123b4 100644
--- a/dlls/jscript/jscript.c
+++ b/dlls/jscript/jscript.c
@@ -522,7 +522,8 @@ static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface,
     item->flags = dwFlags;
     item->name = heap_strdupW(pstrName);
     if(!item->name) {
-        IDispatch_Release(disp);
+        if(disp)
+            IDispatch_Release(disp);
         heap_free(item);
         return E_OUTOFMEMORY;
     }
diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index 723f0ef..6dfe937 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -249,7 +249,6 @@ static BOOL unescape(WCHAR *str)
         }
 
         p++;
-        c = 0;
 
         switch(*p) {
         case '\'':
diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c
index f95a19a..82dd5bc 100644
--- a/dlls/jscript/number.c
+++ b/dlls/jscript/number.c
@@ -150,7 +150,7 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
 
         if(exp) {
             if(log_radix==0)
-                buf[idx++] = '\0';
+                buf[idx] = 0;
             else {
                 static const WCHAR formatW[] = {'(','e','%','c','%','d',')',0};
                 WCHAR ch;




More information about the wine-cvs mailing list