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
123592f0
Commit
123592f0
authored
Jul 01, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 03, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix parsing of hex numbers with 'e' in the string by moving
the exponent parsing to after the hex digit parsing.
parent
19d4378a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
vartest.c
dlls/oleaut32/tests/vartest.c
+5
-3
variant.c
dlls/oleaut32/variant.c
+18
-17
No files found.
dlls/oleaut32/tests/vartest.c
View file @
123592f0
...
...
@@ -957,13 +957,15 @@ static void test_VarParseNumFromStr(void)
EXPECTRGB
(
4
,
FAILDIG
);
/* VB hex lower case and leading zero */
CONVERT
(
"&h0abcd"
,
NUMPRS_HEX_OCT
);
EXPECT
(
4
,
NUMPRS_HEX_OCT
,
0x40
,
7
,
4
,
0
);
CONVERT
(
"&h0abcd
ef
"
,
NUMPRS_HEX_OCT
);
EXPECT
(
6
,
NUMPRS_HEX_OCT
,
0x40
,
9
,
4
,
0
);
EXPECTRGB
(
0
,
10
);
EXPECTRGB
(
1
,
11
);
EXPECTRGB
(
2
,
12
);
EXPECTRGB
(
3
,
13
);
EXPECTRGB
(
4
,
FAILDIG
);
EXPECTRGB
(
4
,
14
);
EXPECTRGB
(
5
,
15
);
EXPECTRGB
(
6
,
FAILDIG
);
/* VB oct */
CONVERT
(
"&O300"
,
NUMPRS_HEX_OCT
);
...
...
dlls/oleaut32/variant.c
View file @
123592f0
...
...
@@ -1732,23 +1732,6 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
}
}
}
else
if
((
*
lpszStr
==
'e'
||
*
lpszStr
==
'E'
)
&&
pNumprs
->
dwInFlags
&
NUMPRS_EXPONENT
&&
!
(
pNumprs
->
dwOutFlags
&
NUMPRS_EXPONENT
))
{
dwState
|=
B_PROCESSING_EXPONENT
;
pNumprs
->
dwOutFlags
|=
NUMPRS_EXPONENT
;
cchUsed
++
;
}
else
if
(
dwState
&
B_PROCESSING_EXPONENT
&&
*
lpszStr
==
chars
.
cPositiveSymbol
)
{
cchUsed
++
;
/* Ignore positive exponent */
}
else
if
(
dwState
&
B_PROCESSING_EXPONENT
&&
*
lpszStr
==
chars
.
cNegativeSymbol
)
{
dwState
|=
B_NEGATIVE_EXPONENT
;
cchUsed
++
;
}
else
if
(((
*
lpszStr
>=
'a'
&&
*
lpszStr
<=
'f'
)
||
(
*
lpszStr
>=
'A'
&&
*
lpszStr
<=
'F'
))
&&
dwState
&
B_PROCESSING_HEX
)
...
...
@@ -1767,6 +1750,23 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
pNumprs
->
cDig
++
;
cchUsed
++
;
}
else
if
((
*
lpszStr
==
'e'
||
*
lpszStr
==
'E'
)
&&
pNumprs
->
dwInFlags
&
NUMPRS_EXPONENT
&&
!
(
pNumprs
->
dwOutFlags
&
NUMPRS_EXPONENT
))
{
dwState
|=
B_PROCESSING_EXPONENT
;
pNumprs
->
dwOutFlags
|=
NUMPRS_EXPONENT
;
cchUsed
++
;
}
else
if
(
dwState
&
B_PROCESSING_EXPONENT
&&
*
lpszStr
==
chars
.
cPositiveSymbol
)
{
cchUsed
++
;
/* Ignore positive exponent */
}
else
if
(
dwState
&
B_PROCESSING_EXPONENT
&&
*
lpszStr
==
chars
.
cNegativeSymbol
)
{
dwState
|=
B_NEGATIVE_EXPONENT
;
cchUsed
++
;
}
else
break
;
/* Stop at an unrecognised character */
...
...
@@ -1783,6 +1783,7 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
if
(
pNumprs
->
dwOutFlags
&
NUMPRS_EXPONENT
&&
dwState
&
B_PROCESSING_EXPONENT
)
{
pNumprs
->
cchUsed
=
cchUsed
;
WARN
(
"didn't completely parse exponent
\n
"
);
return
DISP_E_TYPEMISMATCH
;
/* Failed to completely parse the exponent */
}
...
...
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