jscript: Use INFINITY macro instead of num_set_inf().
This commit is contained in:
parent
ebef43e50d
commit
4a335142f9
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue