mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 04:33:12 +00:00
[JSCRIPT] Sync with Wine Staging 3.9. CORE-14656
This commit is contained in:
parent
454e360303
commit
3f071cc527
18 changed files with 1926 additions and 1057 deletions
|
@ -659,11 +659,18 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
|
|||
double n;
|
||||
HRESULT hres;
|
||||
|
||||
const double p32 = (double)0xffffffff + 1;
|
||||
|
||||
hres = to_number(ctx, v, &n);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
*ret = is_finite(n) ? n : 0;
|
||||
if(is_finite(n))
|
||||
n = n > 0 ? fmod(n, p32) : -fmod(-n, p32);
|
||||
else
|
||||
n = 0;
|
||||
|
||||
*ret = (UINT32)n;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue