Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1532037b
Commit
1532037b
authored
Jun 20, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use num_set_int where possible.
parent
7118e6fb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
64 deletions
+33
-64
engine.c
dlls/jscript/engine.c
+2
-4
error.c
dlls/jscript/error.c
+1
-2
function.c
dlls/jscript/function.c
+3
-6
global.c
dlls/jscript/global.c
+6
-12
number.c
dlls/jscript/number.c
+2
-4
regexp.c
dlls/jscript/regexp.c
+5
-8
string.c
dlls/jscript/string.c
+14
-28
No files found.
dlls/jscript/engine.c
View file @
1532037b
...
...
@@ -2030,16 +2030,14 @@ static HRESULT equal_values(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jse
if
(
V_VT
(
rval
)
==
VT_BOOL
)
{
VARIANT
v
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
V_BOOL
(
rval
)
?
1
:
0
;
num_set_int
(
&
v
,
V_BOOL
(
rval
)
?
1
:
0
);
return
equal_values
(
ctx
,
lval
,
&
v
,
ei
,
ret
);
}
if
(
V_VT
(
lval
)
==
VT_BOOL
)
{
VARIANT
v
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
V_BOOL
(
lval
)
?
1
:
0
;
num_set_int
(
&
v
,
V_BOOL
(
lval
)
?
1
:
0
);
return
equal_values
(
ctx
,
&
v
,
rval
,
ei
,
ret
);
}
...
...
dlls/jscript/error.c
View file @
1532037b
...
...
@@ -199,8 +199,7 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
number
;
num_set_int
(
&
v
,
number
);
hres
=
jsdisp_propput_name
(
err
,
numberW
,
&
v
,
NULL
/*FIXME*/
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
err
);
...
...
dlls/jscript/function.c
View file @
1532037b
...
...
@@ -133,8 +133,7 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, DISPPARAMS
}
if
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
arg_cnt
(
dp
);
num_set_int
(
&
var
,
arg_cnt
(
dp
));
hres
=
jsdisp_propput_name
(
args
,
lengthW
,
&
var
,
ei
);
if
(
SUCCEEDED
(
hres
))
{
...
...
@@ -315,8 +314,7 @@ static HRESULT Function_length(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
This
->
length
;
num_set_int
(
retv
,
This
->
length
);
break
;
default:
FIXME
(
"unimplemented flags %x
\n
"
,
flags
);
...
...
@@ -635,8 +633,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
if
(
builtin_info
)
{
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
function
->
length
;
num_set_int
(
&
var
,
function
->
length
);
hres
=
jsdisp_propput_const
(
&
function
->
dispex
,
lengthW
,
&
var
);
}
...
...
dlls/jscript/global.c
View file @
1532037b
...
...
@@ -745,10 +745,8 @@ static HRESULT JSGlobal_ScriptEngineMajorVersion(script_ctx_t *ctx, vdisp_t *jst
{
TRACE
(
"
\n
"
);
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
JSCRIPT_MAJOR_VERSION
;
}
if
(
retv
)
num_set_int
(
retv
,
JSCRIPT_MAJOR_VERSION
);
return
S_OK
;
}
...
...
@@ -757,10 +755,8 @@ static HRESULT JSGlobal_ScriptEngineMinorVersion(script_ctx_t *ctx, vdisp_t *jst
{
TRACE
(
"
\n
"
);
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
JSCRIPT_MINOR_VERSION
;
}
if
(
retv
)
num_set_int
(
retv
,
JSCRIPT_MINOR_VERSION
);
return
S_OK
;
}
...
...
@@ -769,10 +765,8 @@ static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, vdisp_t *jst
{
TRACE
(
"
\n
"
);
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
JSCRIPT_BUILD_VERSION
;
}
if
(
retv
)
num_set_int
(
retv
,
JSCRIPT_BUILD_VERSION
);
return
S_OK
;
}
...
...
dlls/jscript/number.c
View file @
1532037b
...
...
@@ -554,10 +554,8 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
switch
(
flags
)
{
case
INVOKE_FUNC
:
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
0
;
}
if
(
retv
)
num_set_int
(
retv
,
0
);
return
S_OK
;
}
...
...
dlls/jscript/regexp.c
View file @
1532037b
...
...
@@ -3606,13 +3606,12 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res
}
while
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
result
->
str
-
input
;
num_set_int
(
&
var
,
result
->
str
-
input
);
hres
=
jsdisp_propput_name
(
array
,
indexW
,
&
var
,
ei
);
if
(
FAILED
(
hres
))
break
;
V_I4
(
&
var
)
=
result
->
str
-
input
+
result
->
len
;
num_set_int
(
&
var
,
result
->
str
-
input
+
result
->
len
)
;
hres
=
jsdisp_propput_name
(
array
,
lastIndexW
,
&
var
,
ei
);
if
(
FAILED
(
hres
))
break
;
...
...
@@ -3862,8 +3861,7 @@ HRESULT create_regexp(script_ctx_t *ctx, const WCHAR *exp, int len, DWORD flags,
return
E_FAIL
;
}
V_VT
(
&
regexp
->
last_index_var
)
=
VT_I4
;
V_I4
(
&
regexp
->
last_index_var
)
=
0
;
num_set_int
(
&
regexp
->
last_index_var
,
0
);
*
ret
=
&
regexp
->
dispex
;
return
S_OK
;
...
...
@@ -3990,13 +3988,12 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, BSTR str,
}
while
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
match_result
[
match_cnt
-
1
].
str
-
str
;
num_set_int
(
&
var
,
match_result
[
match_cnt
-
1
].
str
-
str
);
hres
=
jsdisp_propput_name
(
array
,
indexW
,
&
var
,
ei
);
if
(
FAILED
(
hres
))
break
;
V_I4
(
&
var
)
=
match_result
[
match_cnt
-
1
].
str
-
str
+
match_result
[
match_cnt
-
1
].
len
;
num_set_int
(
&
var
,
match_result
[
match_cnt
-
1
].
str
-
str
+
match_result
[
match_cnt
-
1
].
len
)
;
hres
=
jsdisp_propput_name
(
array
,
lastIndexW
,
&
var
,
ei
);
if
(
FAILED
(
hres
))
break
;
...
...
dlls/jscript/string.c
View file @
1532037b
...
...
@@ -111,8 +111,7 @@ static HRESULT String_length(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
case
DISPATCH_PROPERTYGET
:
{
StringInstance
*
string
=
string_from_vdisp
(
jsthis
);
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
string
->
length
;
num_set_int
(
retv
,
string
->
length
);
break
;
}
default:
...
...
@@ -368,10 +367,8 @@ static HRESULT String_charCodeAt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
idx
=
d
;
}
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
str
[
idx
];
}
if
(
retv
)
num_set_int
(
retv
,
str
[
idx
]);
SysFreeString
(
val_str
);
return
S_OK
;
...
...
@@ -476,10 +473,8 @@ static HRESULT String_indexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
return
hres
;
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
-
1
;
}
if
(
retv
)
num_set_int
(
retv
,
-
1
);
SysFreeString
(
val_str
);
return
S_OK
;
}
...
...
@@ -513,10 +508,8 @@ static HRESULT String_indexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
ret
;
}
if
(
retv
)
num_set_int
(
retv
,
ret
);
return
S_OK
;
}
...
...
@@ -544,10 +537,8 @@ static HRESULT String_lastIndexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
return
hres
;
if
(
!
arg_cnt
(
dp
))
{
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
-
1
;
}
if
(
retv
)
num_set_int
(
retv
,
-
1
);
SysFreeString
(
val_str
);
return
S_OK
;
}
...
...
@@ -586,10 +577,8 @@ static HRESULT String_lastIndexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
ret
;
}
if
(
retv
)
num_set_int
(
retv
,
ret
);
return
S_OK
;
}
...
...
@@ -729,8 +718,7 @@ static HRESULT rep_call(script_ctx_t *ctx, jsdisp_t *func, const WCHAR *str, mat
if
(
SUCCEEDED
(
hres
))
{
arg
=
get_arg
(
&
dp
,
parens_cnt
+
1
);
V_VT
(
arg
)
=
VT_I4
;
V_I4
(
arg
)
=
match
->
str
-
str
;
num_set_int
(
arg
,
match
->
str
-
str
);
arg
=
get_arg
(
&
dp
,
parens_cnt
+
2
);
V_VT
(
arg
)
=
VT_BSTR
;
...
...
@@ -1046,10 +1034,8 @@ static HRESULT String_search(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
hres
==
S_OK
?
match
.
str
-
str
:
-
1
;
}
if
(
retv
)
num_set_int
(
retv
,
hres
==
S_OK
?
match
.
str
-
str
:
-
1
);
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