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
1ade6c2b
Commit
1ade6c2b
authored
Dec 10, 2010
by
Eryk Wieliczko
Committed by
Alexandre Julliard
Dec 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement ecvt_s.
parent
a967d985
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
4 deletions
+70
-4
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
math.c
dlls/msvcrt/math.c
+66
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
No files found.
dlls/msvcr100/msvcr100.spec
View file @
1ade6c2b
...
...
@@ -583,7 +583,7 @@
@ cdecl _dup2(long long) msvcrt._dup2
@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s
@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt
@
stub
_ecvt_s
@
cdecl _ecvt_s(str long double long ptr ptr) msvcrt.
_ecvt_s
@ cdecl _encoded_null() msvcr90._encoded_null
@ cdecl _endthread() msvcrt._endthread
@ cdecl _endthreadex(long) msvcrt._endthreadex
...
...
dlls/msvcr80/msvcr80.spec
View file @
1ade6c2b
...
...
@@ -423,7 +423,7 @@
@ cdecl _dup2(long long) msvcrt._dup2
@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s
@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt
@
stub
_ecvt_s
@
cdecl _ecvt_s(str long double long ptr ptr) msvcrt.
_ecvt_s
@ cdecl _encode_pointer(ptr) msvcr90._encode_pointer
@ cdecl _encoded_null() msvcr90._encoded_null
@ cdecl _endthread() msvcrt._endthread
...
...
dlls/msvcr90/msvcr90.spec
View file @
1ade6c2b
...
...
@@ -415,7 +415,7 @@
@ cdecl _dup2(long long) msvcrt._dup2
@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s
@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt
@
stub
_ecvt_s
@
cdecl _ecvt_s(str long double long ptr ptr) msvcrt.
_ecvt_s
@ cdecl _encode_pointer(ptr) MSVCR90_encode_pointer
@ cdecl _encoded_null()
@ cdecl _endthread() msvcrt._endthread
...
...
dlls/msvcrt/math.c
View file @
1ade6c2b
...
...
@@ -1104,6 +1104,72 @@ char * CDECL _ecvt( double number, int ndigits, int *decpt, int *sign )
return
data
->
efcvt_buffer
;
}
/*********************************************************************
* _ecvt_s (MSVCRT.@)
*/
int
CDECL
_ecvt_s
(
char
*
buffer
,
MSVCRT_size_t
length
,
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
int
prec
,
len
;
char
*
result
;
const
char
infret
[]
=
"1#INF"
;
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
decpt
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
sign
!=
NULL
))
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
if
(
!
MSVCRT_CHECK_PMT
(
length
>
2
)
||
!
MSVCRT_CHECK_PMT
(
ndigits
<
(
int
)
length
-
1
))
{
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
/* special case - inf */
if
(
number
==
HUGE_VAL
||
number
==
-
HUGE_VAL
)
{
memset
(
buffer
,
'0'
,
ndigits
);
memcpy
(
buffer
,
infret
,
min
(
ndigits
,
sizeof
(
infret
)
-
1
)
);
buffer
[
ndigits
]
=
'\0'
;
(
*
decpt
)
=
1
;
if
(
number
==
-
HUGE_VAL
)
(
*
sign
)
=
1
;
else
(
*
sign
)
=
0
;
return
0
;
}
result
=
(
char
*
)
MSVCRT_malloc
(
max
(
ndigits
+
7
,
7
));
if
(
number
<
0
)
{
*
sign
=
TRUE
;
number
=
-
number
;
}
else
*
sign
=
FALSE
;
/* handle cases with zero ndigits or less */
prec
=
ndigits
;
if
(
prec
<
1
)
prec
=
2
;
len
=
snprintf
(
result
,
80
,
"%.*le"
,
prec
-
1
,
number
);
/* take the decimal "point away */
if
(
prec
!=
1
)
memmove
(
result
+
1
,
result
+
2
,
len
-
1
);
/* take the exponential "e" out */
result
[
prec
]
=
'\0'
;
/* read the exponent */
sscanf
(
result
+
prec
+
1
,
"%d"
,
decpt
);
(
*
decpt
)
++
;
/* adjust for some border cases */
if
(
result
[
0
]
==
'0'
)
/* value is zero */
*
decpt
=
0
;
/* handle cases with zero ndigits or less */
if
(
ndigits
<
1
){
if
(
result
[
0
]
>=
'5'
)
(
*
decpt
)
++
;
result
[
0
]
=
'\0'
;
}
memcpy
(
buffer
,
result
,
max
(
ndigits
+
1
,
1
)
);
MSVCRT_free
(
result
);
return
0
;
}
/***********************************************************************
* _fcvt (MSVCRT.@)
*/
...
...
dlls/msvcrt/msvcrt.spec
View file @
1ade6c2b
...
...
@@ -378,7 +378,7 @@
@ cdecl _dup (long) MSVCRT__dup
@ cdecl _dup2 (long long) MSVCRT__dup2
@ cdecl _ecvt(double long ptr ptr)
# stub _ecvt_s
@ cdecl _ecvt_s(str long double long ptr ptr)
@ cdecl _endthread ()
@ cdecl _endthreadex(long)
@ extern _environ MSVCRT__environ
...
...
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