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
117faee9
Commit
117faee9
authored
May 09, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
May 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix strtod and wcstod implementation.
parent
7492e773
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+2
-0
string.c
dlls/msvcrt/string.c
+7
-0
wcs.c
dlls/msvcrt/wcs.c
+7
-0
No files found.
dlls/msvcrt/msvcrt.h
View file @
117faee9
...
...
@@ -170,6 +170,8 @@ extern void msvcrt_free_signals(void);
extern
unsigned
msvcrt_create_io_inherit_block
(
WORD
*
,
BYTE
**
);
extern
unsigned
int
__cdecl
_control87
(
unsigned
int
,
unsigned
int
);
/* run-time error codes */
#define _RT_STACK 0
#define _RT_NULLPTR 1
...
...
dlls/msvcrt/string.c
View file @
117faee9
...
...
@@ -164,6 +164,7 @@ void CDECL MSVCRT__swab(char* src, char* dst, int len)
double
CDECL
MSVCRT_strtod_l
(
const
char
*
str
,
char
**
end
,
MSVCRT__locale_t
locale
)
{
unsigned
__int64
d
=
0
,
hlp
;
unsigned
fpcontrol
;
int
exp
=
0
,
sign
=
1
;
const
char
*
p
;
double
ret
;
...
...
@@ -249,11 +250,17 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca
}
}
fpcontrol
=
_control87
(
0
,
0
);
_control87
(
MSVCRT__EM_DENORMAL
|
MSVCRT__EM_INVALID
|
MSVCRT__EM_ZERODIVIDE
|
MSVCRT__EM_OVERFLOW
|
MSVCRT__EM_UNDERFLOW
|
MSVCRT__EM_INEXACT
,
0xffffffff
);
if
(
exp
>
0
)
ret
=
(
double
)
sign
*
d
*
pow
(
10
,
exp
);
else
ret
=
(
double
)
sign
*
d
/
pow
(
10
,
-
exp
);
_control87
(
fpcontrol
,
0xffffffff
);
if
((
d
&&
ret
==
0
.
0
)
||
isinf
(
ret
))
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
...
...
dlls/msvcrt/wcs.c
View file @
117faee9
...
...
@@ -129,6 +129,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
MSVCRT__locale_t
locale
)
{
unsigned
__int64
d
=
0
,
hlp
;
unsigned
fpcontrol
;
int
exp
=
0
,
sign
=
1
;
const
MSVCRT_wchar_t
*
p
;
double
ret
;
...
...
@@ -212,11 +213,17 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
}
}
fpcontrol
=
_control87
(
0
,
0
);
_control87
(
MSVCRT__EM_DENORMAL
|
MSVCRT__EM_INVALID
|
MSVCRT__EM_ZERODIVIDE
|
MSVCRT__EM_OVERFLOW
|
MSVCRT__EM_UNDERFLOW
|
MSVCRT__EM_INEXACT
,
0xffffffff
);
if
(
exp
>
0
)
ret
=
(
double
)
sign
*
d
*
pow
(
10
,
exp
);
else
ret
=
(
double
)
sign
*
d
/
pow
(
10
,
-
exp
);
_control87
(
fpcontrol
,
0xffffffff
);
if
((
d
&&
ret
==
0
.
0
)
||
isinf
(
ret
))
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
...
...
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