Jacek Caban : jscript: Use INFINITY macro instead of num_set_inf().
Alexandre Julliard
julliard at winehq.org
Thu Jun 21 15:03:40 CDT 2012
Module: wine
Branch: master
Commit: 4a335142f9eb7be10fdc838a6ab738a073fac6a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4a335142f9eb7be10fdc838a6ab738a073fac6a4
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Jun 21 10:47:19 2012 +0200
jscript: Use INFINITY macro instead of num_set_inf().
---
dlls/jscript/global.c | 2 +-
dlls/jscript/jscript.h | 12 ------------
dlls/jscript/math.c | 4 ++--
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c
index c01b082..ae43285 100644
--- a/dlls/jscript/global.c
+++ b/dlls/jscript/global.c
@@ -1283,7 +1283,7 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- num_set_inf(&var, TRUE);
+ num_set_val(&var, INFINITY);
hres = jsdisp_propput_name(ctx->global, InfinityW, &var, NULL/*FIXME*/);
return hres;
}
diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
index e27b829..571d6e1 100644
--- a/dlls/jscript/jscript.h
+++ b/dlls/jscript/jscript.h
@@ -435,18 +435,6 @@ static inline void num_set_val(VARIANT *v, DOUBLE d)
}
}
-static inline void num_set_inf(VARIANT *v, BOOL positive)
-{
- V_VT(v) = VT_R8;
-#ifdef INFINITY
- V_R8(v) = positive ? INFINITY : -INFINITY;
-#else
- V_UI8(v) = (ULONGLONG)0x7ff00000<<32;
- if(!positive)
- V_R8(v) = -V_R8(v);
-#endif
-}
-
static inline void var_set_jsdisp(VARIANT *v, jsdisp_t *jsdisp)
{
V_VT(v) = VT_DISPATCH;
diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c
index d30e464..d0eab57 100644
--- a/dlls/jscript/math.c
+++ b/dlls/jscript/math.c
@@ -295,7 +295,7 @@ static HRESULT Math_max(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
if(!arg_cnt(dp)) {
if(retv)
- num_set_inf(retv, FALSE);
+ num_set_val(retv, -INFINITY);
return S_OK;
}
@@ -329,7 +329,7 @@ static HRESULT Math_min(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
if(!arg_cnt(dp)) {
if(retv)
- num_set_inf(retv, TRUE);
+ num_set_val(retv, INFINITY);
return S_OK;
}
More information about the wine-cvs
mailing list