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
db737291
Commit
db737291
authored
May 29, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
May 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Get rid of num_set_nan hack.
parent
d0a719a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
52 deletions
+34
-52
date.c
dlls/jscript/date.c
+3
-3
global.c
dlls/jscript/global.c
+5
-5
jscript.h
dlls/jscript/jscript.h
+0
-10
math.c
dlls/jscript/math.c
+22
-33
string.c
dlls/jscript/string.c
+4
-1
No files found.
dlls/jscript/date.c
View file @
db737291
...
...
@@ -1987,7 +1987,7 @@ static HRESULT Date_getYear(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
t
=
local_time
(
date
->
time
,
date
);
if
(
isnan
(
t
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -2023,7 +2023,7 @@ static HRESULT Date_setYear(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
if
(
isnan
(
year
))
{
date
->
time
=
year
;
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -2414,7 +2414,7 @@ static HRESULT DateConstr_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
dlls/jscript/global.c
View file @
db737291
...
...
@@ -456,7 +456,7 @@ static HRESULT JSGlobal_parseInt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
HRESULT
hres
;
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -468,7 +468,7 @@ static HRESULT JSGlobal_parseInt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if
(
radix
&&
(
radix
<
2
||
radix
>
36
))
{
WARN
(
"radix %d out of range
\n
"
,
radix
);
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
}
...
...
@@ -537,7 +537,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -616,7 +616,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
if
(
ret_nan
)
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -1284,7 +1284,7 @@ HRESULT init_global(script_ctx_t *ctx)
if
(
FAILED
(
hres
))
return
hres
;
num_set_
nan
(
&
var
);
num_set_
val
(
&
var
,
NAN
);
hres
=
jsdisp_propput_name
(
ctx
->
global
,
NaNW
,
&
var
,
NULL
/*FIXME*/
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
db737291
...
...
@@ -435,16 +435,6 @@ static inline void num_set_val(VARIANT *v, DOUBLE d)
}
}
static
inline
void
num_set_nan
(
VARIANT
*
v
)
{
V_VT
(
v
)
=
VT_R8
;
#ifdef NAN
V_R8
(
v
)
=
NAN
;
#else
V_UI8
(
v
)
=
(
ULONGLONG
)
0x7ff80000
<<
32
;
#endif
}
static
inline
void
num_set_inf
(
VARIANT
*
v
,
BOOL
positive
)
{
V_VT
(
v
)
=
VT_R8
;
...
...
dlls/jscript/math.c
View file @
db737291
...
...
@@ -68,7 +68,7 @@ static HRESULT Math_abs(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -90,7 +90,7 @@ static HRESULT Math_acos(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -98,12 +98,8 @@ static HRESULT Math_acos(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
if
(
x
<
-
1
.
0
||
x
>
1
.
0
)
num_set_nan
(
retv
);
else
num_set_val
(
retv
,
acos
(
x
));
}
if
(
retv
)
num_set_val
(
retv
,
x
<
-
1
.
0
||
x
>
1
.
0
?
NAN
:
acos
(
x
));
return
S_OK
;
}
...
...
@@ -116,7 +112,7 @@ static HRESULT Math_asin(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -124,12 +120,8 @@ static HRESULT Math_asin(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
if
(
x
<
-
1
.
0
||
x
>
1
.
0
)
num_set_nan
(
retv
);
else
num_set_val
(
retv
,
asin
(
x
));
}
if
(
retv
)
num_set_val
(
retv
,
x
<
-
1
.
0
||
x
>
1
.
0
?
NAN
:
asin
(
x
));
return
S_OK
;
}
...
...
@@ -142,7 +134,7 @@ static HRESULT Math_atan(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -163,7 +155,7 @@ static HRESULT Math_atan2(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPA
TRACE
(
"
\n
"
);
if
(
arg_cnt
(
dp
)
<
2
)
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -190,7 +182,7 @@ static HRESULT Math_ceil(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -212,7 +204,7 @@ static HRESULT Math_cos(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -233,7 +225,7 @@ static HRESULT Math_exp(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -255,7 +247,7 @@ static HRESULT Math_floor(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPA
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -278,7 +270,7 @@ static HRESULT Math_log(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -286,12 +278,8 @@ static HRESULT Math_log(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
if
(
x
<
-
0
.
0
)
num_set_nan
(
retv
);
else
num_set_val
(
retv
,
log
(
x
));
}
if
(
retv
)
num_set_val
(
retv
,
x
<
-
0
.
0
?
NAN
:
log
(
x
));
return
S_OK
;
}
...
...
@@ -373,7 +361,7 @@ static HRESULT Math_pow(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
TRACE
(
"
\n
"
);
if
(
arg_cnt
(
dp
)
<
2
)
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -417,7 +405,8 @@ static HRESULT Math_round(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPA
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
num_set_nan
(
retv
);
if
(
retv
)
num_set_val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -439,7 +428,7 @@ static HRESULT Math_sin(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -460,7 +449,7 @@ static HRESULT Math_sqrt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPAR
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
@@ -481,7 +470,7 @@ static HRESULT Math_tan(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARA
TRACE
(
"
\n
"
);
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
num_set_
nan
(
retv
);
if
(
retv
)
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
dlls/jscript/string.c
View file @
db737291
...
...
@@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include "jscript.h"
#include "wine/debug.h"
...
...
@@ -358,7 +361,7 @@ static HRESULT String_charCodeAt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if
(
!
is_int32
(
d
)
||
d
<
0
||
d
>=
length
)
{
SysFreeString
(
val_str
);
if
(
retv
)
num_set_
nan
(
retv
);
num_set_
val
(
retv
,
NAN
);
return
S_OK
;
}
...
...
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