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
1fc2896c
Commit
1fc2896c
authored
Sep 26, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added VT_R8 support to to_int.
parent
5c211059
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
global.c
dlls/vbscript/global.c
+9
-0
api.vbs
dlls/vbscript/tests/api.vbs
+12
-0
vbscript.h
dlls/vbscript/vbscript.h
+13
-0
No files found.
dlls/vbscript/global.c
View file @
1fc2896c
...
...
@@ -125,6 +125,15 @@ static HRESULT to_int(VARIANT *v, int *ret)
case
VT_I4
:
*
ret
=
V_I4
(
v
);
break
;
case
VT_R8
:
{
double
n
=
round
(
V_R8
(
v
));
if
(
!
is_int32
(
n
))
{
FIXME
(
"%lf is out of int range
\n
"
,
n
);
return
E_FAIL
;
}
*
ret
=
n
;
break
;
}
default:
FIXME
(
"not supported %s
\n
"
,
debugstr_variant
(
v
));
return
E_NOTIMPL
;
...
...
dlls/vbscript/tests/api.vbs
View file @
1fc2896c
...
...
@@ -124,6 +124,15 @@ Call ok(isNull(x), "InStr returned " & x)
x
=
InStr
(
2
,
null
,
"abcd"
)
Call
ok
(
isNull
(
x
),
"InStr returned "
&
x
)
x
=
InStr
(
1.3
,
"abcd"
,
"bc"
)
Call
ok
(
x
=
2
,
"InStr returned "
&
x
)
x
=
InStr
(
2.3
,
"abcd"
,
"bc"
)
Call
ok
(
x
=
2
,
"InStr returned "
&
x
)
x
=
InStr
(
2.6
,
"abcd"
,
"bc"
)
Call
ok
(
x
=
0
,
"InStr returned "
&
x
)
Sub
TestMid
(
str
,
start
,
len
,
ex
)
x
=
Mid
(
str
,
start
,
len
)
Call
ok
(
x
=
ex
,
"Mid("
&
str
&
", "
&
start
&
", "
&
len
&
") = "
&
x
&
" expected "
&
ex
)
...
...
@@ -182,6 +191,9 @@ Call ok(Len(empty) = 0, "Len(empty) = " & Len(empty))
Call
ok
(
Space
(
1
)
=
" "
,
"Space(1) = "
&
Space
(
1
)
&
"
""
"
)
Call
ok
(
Space
(
0
)
=
""
,
"Space(0) = "
&
Space
(
0
)
&
"
""
"
)
Call
ok
(
Space
(
5
)
=
" "
,
"Space(5) = "
&
Space
(
5
)
&
"
""
"
)
Call
ok
(
Space
(
5.2
)
=
" "
,
"Space(5.2) = "
&
Space
(
5.2
)
&
"
""
"
)
Call
ok
(
Space
(
5.8
)
=
" "
,
"Space(5.8) = "
&
Space
(
5.8
)
&
"
""
"
)
Call
ok
(
Space
(
5.5
)
=
" "
,
"Space(5.5) = "
&
Space
(
5.5
)
&
"
""
"
)
Sub
TestRound
(
val
,
exval
,
vt
)
Call
ok
(
Round
(
val
)
=
exval
,
"Round("
&
val
&
") = "
&
Round
(
val
))
...
...
dlls/vbscript/vbscript.h
View file @
1fc2896c
...
...
@@ -343,6 +343,19 @@ TID_LIST
HRESULT
get_typeinfo
(
tid_t
,
ITypeInfo
**
)
DECLSPEC_HIDDEN
;
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
static
inline
BOOL
is_int32
(
double
d
)
{
return
INT32_MIN
<=
d
&&
d
<=
INT32_MAX
&&
(
double
)(
int
)
d
==
d
;
}
HRESULT
WINAPI
VBScriptFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
const
char
*
debugstr_variant
(
const
VARIANT
*
)
DECLSPEC_HIDDEN
;
...
...
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