From 4a335142f9eb7be10fdc838a6ab738a073fac6a4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 21 Jun 2012 10:47:19 +0200 Subject: [PATCH] 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 c01b0822035..ae43285123d 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 e27b8297716..571d6e165e9 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 d30e464e3dd..d0eab57fc88 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; }