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
75be5eee
Commit
75be5eee
authored
May 21, 2013
by
Zhan Jianyu
Committed by
Alexandre Julliard
May 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented builtin function CBool.
parent
c6ce31ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
global.c
dlls/vbscript/global.c
+34
-2
api.vbs
dlls/vbscript/tests/api.vbs
+8
-0
No files found.
dlls/vbscript/global.c
View file @
75be5eee
...
...
@@ -114,6 +114,16 @@ static HRESULT return_int(VARIANT *res, int val)
return
S_OK
;
}
static
HRESULT
return_bool
(
VARIANT
*
res
,
int
val
)
{
if
(
res
)
{
V_VT
(
res
)
=
VT_BOOL
;
V_BOOL
(
res
)
=
val
!=
0
?
VARIANT_TRUE
:
VARIANT_FALSE
;
}
return
S_OK
;
}
static
inline
HRESULT
return_double
(
VARIANT
*
res
,
double
val
)
{
if
(
res
)
{
...
...
@@ -400,8 +410,30 @@ static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
static
HRESULT
Global_CBool
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
int
val
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
assert
(
args_cnt
==
1
);
switch
(
V_VT
(
arg
))
{
case
VT_I2
:
val
=
V_I2
(
arg
);
break
;
case
VT_I4
:
val
=
V_I4
(
arg
);
break
;
case
VT_R4
:
val
=
V_R4
(
arg
)
>
0
.
0
||
V_R4
(
arg
)
<
0
.
0
;
break
;
case
VT_R8
:
val
=
V_R8
(
arg
)
>
0
.
0
||
V_R8
(
arg
)
<
0
.
0
;
break
;
default:
ERR
(
"Not a numeric vaule: %s
\n
"
,
debugstr_variant
(
arg
));
return
E_FAIL
;
}
return
return_bool
(
res
,
val
);
}
static
HRESULT
Global_CByte
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
75be5eee
...
...
@@ -456,4 +456,12 @@ Call ok(getVT(CInt(36.50)) = "VT_I2", "getVT(CInt(36.50)) = " & getVT(CInt(36.50
Call
ok
(
CInt
(
36.75
)
=
37
,
"CInt(36.75) = "
&
CInt
(
36.75
))
Call
ok
(
getVT
(
CInt
(
36.75
))
=
"VT_I2"
,
"getVT(CInt(36.75)) = "
&
getVT
(
CInt
(
36.75
)))
Call
ok
(
CBool
(
5
)
=
true
,
"CBool(5) = "
&
CBool
(
5
))
Call
ok
(
getVT
(
CBool
(
5
))
=
"VT_BOOL"
,
"getVT(CBool(5)) = "
&
getVT
(
CBool
(
5
)))
Call
ok
(
CBool
(
0
)
=
false
,
"CBool(0) = "
&
CBool
(
0
))
Call
ok
(
getVT
(
CBool
(
0
))
=
"VT_BOOL"
,
"getVT(CBool(0)) = "
&
getVT
(
CBool
(
0
)))
Call
ok
(
CBool
(
-
5
)
=
true
,
"CBool(-5) = "
&
CBool
(
-
5
))
Call
ok
(
getVT
(
CBool
(
-
5
))
=
"VT_BOOL"
,
"getVT(CBool(-5)) = "
&
getVT
(
CBool
(
-
5
)))
Call
reportSuccess
()
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