jscript: Use INFINITY macro instead of num_set_inf().

This commit is contained in:
Jacek Caban 2012-06-21 10:47:19 +02:00 committed by Alexandre Julliard
parent ebef43e50d
commit 4a335142f9
3 changed files with 3 additions and 15 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}