Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e00708e3
Commit
e00708e3
authored
Jan 27, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added new is_finite helper.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1197a15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
global.c
dlls/jscript/global.c
+1
-2
jscript.h
dlls/jscript/jscript.h
+1
-0
jsutils.c
dlls/jscript/jsutils.c
+6
-1
number.c
dlls/jscript/number.c
+4
-7
No files found.
dlls/jscript/global.c
View file @
e00708e3
...
...
@@ -264,8 +264,7 @@ static HRESULT JSGlobal_isFinite(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
isinf
(
n
)
&&
!
isnan
(
n
))
ret
=
TRUE
;
ret
=
is_finite
(
n
);
}
if
(
r
)
...
...
dlls/jscript/jscript.h
View file @
e00708e3
...
...
@@ -339,6 +339,7 @@ HRESULT variant_change_type(script_ctx_t*,VARIANT*,VARIANT*,VARTYPE) DECLSPEC_HI
HRESULT
decode_source
(
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
double_to_string
(
double
,
jsstr_t
**
)
DECLSPEC_HIDDEN
;
BOOL
is_finite
(
double
)
DECLSPEC_HIDDEN
;
typedef
struct
named_item_t
{
IDispatch
*
disp
;
...
...
dlls/jscript/jsutils.c
View file @
e00708e3
...
...
@@ -53,6 +53,11 @@ const char *debugstr_jsval(const jsval_t v)
return
NULL
;
}
BOOL
is_finite
(
double
n
)
{
return
!
isnan
(
n
)
&&
!
isinf
(
n
);
}
#define MIN_BLOCK_SIZE 128
#define ARENA_FREE_FILLER 0xaa
...
...
@@ -641,7 +646,7 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
if
(
FAILED
(
hres
))
return
hres
;
*
ret
=
is
nan
(
n
)
||
isinf
(
n
)
?
0
:
n
;
*
ret
=
is
_finite
(
n
)
?
n
:
0
;
return
S_OK
;
}
...
...
dlls/jscript/number.c
View file @
e00708e3
...
...
@@ -16,9 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <math.h>
#include <assert.h>
...
...
@@ -257,7 +254,7 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
val
=
number
->
value
;
if
(
radix
==
10
||
isnan
(
val
)
||
isinf
(
val
))
{
if
(
radix
==
10
||
!
is_finite
(
val
))
{
hres
=
to_string
(
ctx
,
jsval_number
(
val
),
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -383,7 +380,7 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
}
val
=
number
->
value
;
if
(
isinf
(
val
)
||
isnan
(
val
))
{
if
(
!
is_finite
(
val
))
{
hres
=
to_string
(
ctx
,
jsval_number
(
val
),
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -424,7 +421,7 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
}
val
=
number
->
value
;
if
(
isinf
(
val
)
||
isnan
(
val
))
{
if
(
!
is_finite
(
val
))
{
hres
=
to_string
(
ctx
,
jsval_number
(
val
),
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -465,7 +462,7 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
}
val
=
number
->
value
;
if
(
isinf
(
val
)
||
isnan
(
val
)
||
!
prec
)
{
if
(
!
is_finite
(
val
)
||
!
prec
)
{
hres
=
to_string
(
ctx
,
jsval_number
(
val
),
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment