Jacek Caban : jscript: Use to_int32 in to_uint32 implementation.
Alexandre Julliard
julliard at winehq.org
Tue Feb 19 13:33:04 CST 2013
Module: wine
Branch: master
Commit: 1926b5617d93adf1a779e640553b8635297caa7f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1926b5617d93adf1a779e640553b8635297caa7f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Feb 19 12:45:42 2013 +0100
jscript: Use to_int32 in to_uint32 implementation.
---
dlls/jscript/jscript.h | 2 +-
dlls/jscript/jsutils.c | 12 +++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
index b060378..35e2c3f 100644
--- a/dlls/jscript/jscript.h
+++ b/dlls/jscript/jscript.h
@@ -320,7 +320,7 @@ HRESULT to_boolean(jsval_t,BOOL*) DECLSPEC_HIDDEN;
HRESULT to_number(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_integer(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_int32(script_ctx_t*,jsval_t,INT*) DECLSPEC_HIDDEN;
-HRESULT to_uint32(script_ctx_t*,jsval_t,DWORD*) DECLSPEC_HIDDEN;
+HRESULT to_uint32(script_ctx_t*,jsval_t,UINT32*) DECLSPEC_HIDDEN;
HRESULT to_string(script_ctx_t*,jsval_t,jsstr_t**) DECLSPEC_HIDDEN;
HRESULT to_object(script_ctx_t*,jsval_t,IDispatch**) DECLSPEC_HIDDEN;
diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c
index 863ff33..dd04186 100644
--- a/dlls/jscript/jsutils.c
+++ b/dlls/jscript/jsutils.c
@@ -665,15 +665,13 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
/* ECMA-262 3rd Edition 9.6 */
HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, DWORD *ret)
{
- double n;
+ INT32 n;
HRESULT hres;
- hres = to_number(ctx, val, &n);
- if(FAILED(hres))
- return hres;
-
- *ret = isnan(n) || isinf(n) ? 0 : n;
- return S_OK;
+ hres = to_int32(ctx, val, &n);
+ if(SUCCEEDED(hres))
+ *ret = n;
+ return hres;
}
static jsstr_t *int_to_string(int i)
More information about the wine-cvs
mailing list