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
96123836
Commit
96123836
authored
Mar 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved [efg]cvt functions to msvcrt and fixed them to use a per-thread
buffer.
parent
195574e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
80 deletions
+52
-80
configure
configure
+0
-6
configure.ac
configure.ac
+0
-3
math.c
dlls/msvcrt/math.c
+48
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+3
-3
config.h.in
include/config.h.in
+0
-9
port.c
library/port.c
+0
-59
No files found.
configure
View file @
96123836
...
...
@@ -13078,9 +13078,6 @@ fi
for
ac_func
in
\
_lwp_create
\
_pclose
\
...
...
@@ -13091,13 +13088,10 @@ for ac_func in \
_vsnprintf
\
chsize
\
clone
\
ecvt
\
fcvt
\
finite
\
fpclass
\
ftruncate
\
ftruncate64
\
gcvt
\
getnetbyaddr
\
getnetbyname
\
getopt_long
\
...
...
configure.ac
View file @
96123836
...
...
@@ -916,13 +916,10 @@ AC_CHECK_FUNCS(\
_vsnprintf \
chsize \
clone \
ecvt \
fcvt \
finite \
fpclass \
ftruncate \
ftruncate64 \
gcvt \
getnetbyaddr \
getnetbyname \
getopt_long \
...
...
dlls/msvcrt/math.c
View file @
96123836
...
...
@@ -21,6 +21,7 @@
#include "msvcrt.h"
#include "msvcrt/errno.h"
#include <stdio.h>
#define __USE_ISOC9X 1
#define __USE_ISOC99 1
#include <math.h>
...
...
@@ -681,6 +682,53 @@ double _nextafter(double num, double next)
return
retval
;
}
/*********************************************************************
* _ecvt (MSVCRT.@)
*/
char
*
_ecvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
MSVCRT_thread_data
*
data
=
msvcrt_get_thread_data
();
char
*
dec
;
if
(
!
data
->
efcvt_buffer
)
data
->
efcvt_buffer
=
MSVCRT_malloc
(
80
);
/* ought to be enough */
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*e"
,
ndigits
/* FIXME wrong */
,
number
);
*
sign
=
(
number
<
0
);
dec
=
strchr
(
data
->
efcvt_buffer
,
'.'
);
*
decpt
=
(
dec
)
?
dec
-
data
->
efcvt_buffer
:
-
1
;
return
data
->
efcvt_buffer
;
}
/***********************************************************************
* _fcvt (MSVCRT.@)
*/
char
*
_fcvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
MSVCRT_thread_data
*
data
=
msvcrt_get_thread_data
();
char
*
dec
;
if
(
!
data
->
efcvt_buffer
)
data
->
efcvt_buffer
=
MSVCRT_malloc
(
80
);
/* ought to be enough */
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*e"
,
ndigits
,
number
);
*
sign
=
(
number
<
0
);
dec
=
strchr
(
data
->
efcvt_buffer
,
'.'
);
*
decpt
=
(
dec
)
?
dec
-
data
->
efcvt_buffer
:
-
1
;
return
data
->
efcvt_buffer
;
}
/***********************************************************************
* _gcvt (MSVCRT.@)
*
* FIXME: uses both E and F.
*/
char
*
_gcvt
(
double
number
,
int
ndigit
,
char
*
buff
)
{
sprintf
(
buff
,
"%.*E"
,
ndigit
,
number
);
return
buff
;
}
#include <stdlib.h>
/* div_t, ldiv_t */
/*********************************************************************
...
...
dlls/msvcrt/msvcrt.h
View file @
96123836
...
...
@@ -39,6 +39,7 @@ typedef struct __MSVCRT_thread_data
int
errno
;
unsigned
long
doserrno
;
char
*
mbstok_next
;
/* next ptr for mbstok() */
char
*
efcvt_buffer
;
/* buffer for ecvt/fcvt */
terminate_function
terminate_handler
;
unexpected_function
unexpected_handler
;
_se_translator_function
se_translator
;
...
...
dlls/msvcrt/msvcrt.spec
View file @
96123836
...
...
@@ -197,7 +197,7 @@
@ stub _dstbias
@ cdecl _dup (long)
@ cdecl _dup2 (long long)
@ cdecl _ecvt(
double long ptr ptr) ecvt
@ cdecl _ecvt(
double long ptr ptr)
@ cdecl _endthread ()
@ cdecl _endthreadex(long)
@ extern _environ MSVCRT__environ
...
...
@@ -216,7 +216,7 @@
@ cdecl _exit(long) MSVCRT__exit
@ cdecl _expand(ptr long)
@ cdecl _fcloseall()
@ cdecl _fcvt(
double long ptr ptr) fcvt
@ cdecl _fcvt(
double long ptr ptr)
@ cdecl _fdopen(long str)
@ cdecl _fgetchar()
@ cdecl _fgetwchar()
...
...
@@ -246,7 +246,7 @@
@ cdecl _ftol() ntdll._ftol
@ cdecl _fullpath(ptr str long)
@ cdecl _futime(long ptr)
@ cdecl _gcvt(
double long str) gcvt
@ cdecl _gcvt(
double long str)
@ cdecl _get_osfhandle(long)
@ stub _get_sbh_threshold #()
@ cdecl _getch()
...
...
include/config.h.in
View file @
96123836
...
...
@@ -71,15 +71,9 @@
/* Define if you have dlopen */
#undef HAVE_DLOPEN
/* Define to 1 if you have the `ecvt' function. */
#undef HAVE_ECVT
/* Define to 1 if you have the <elf.h> header file. */
#undef HAVE_ELF_H
/* Define to 1 if you have the `fcvt' function. */
#undef HAVE_FCVT
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
...
...
@@ -125,9 +119,6 @@
/* Define to 1 if you have the `ftruncate64' function. */
#undef HAVE_FTRUNCATE64
/* Define to 1 if you have the `gcvt' function. */
#undef HAVE_GCVT
/* Define to 1 if you have the `getbkgd' function. */
#undef HAVE_GETBKGD
...
...
library/port.c
View file @
96123836
...
...
@@ -189,65 +189,6 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
}
#ifndef HAVE_ECVT
/***********************************************************************
* ecvt
*/
char
*
ecvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
static
char
buf
[
40
];
/* ought to be enough */
char
*
dec
;
sprintf
(
buf
,
"%.*e"
,
ndigits
/* FIXME wrong */
,
number
);
*
sign
=
(
number
<
0
);
dec
=
strchr
(
buf
,
'.'
);
*
decpt
=
(
dec
)
?
(
int
)
dec
-
(
int
)
buf
:
-
1
;
return
buf
;
}
#endif
/* HAVE_ECVT */
#ifndef HAVE_FCVT
/***********************************************************************
* fcvt
*/
char
*
fcvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
static
char
buf
[
40
];
/* ought to be enough */
char
*
dec
;
sprintf
(
buf
,
"%.*e"
,
ndigits
,
number
);
*
sign
=
(
number
<
0
);
dec
=
strchr
(
buf
,
'.'
);
*
decpt
=
(
dec
)
?
(
int
)
dec
-
(
int
)
buf
:
-
1
;
return
buf
;
}
#endif
/* HAVE_FCVT */
#ifndef HAVE_GCVT
/***********************************************************************
* gcvt
*
* FIXME: uses both E and F.
*/
char
*
gcvt
(
double
number
,
size_t
ndigit
,
char
*
buff
)
{
sprintf
(
buff
,
"%.*E"
,
(
int
)
ndigit
,
number
);
return
buff
;
}
#endif
/* HAVE_GCVT */
#ifndef wine_memcpy_unaligned
/***********************************************************************
* wine_memcpy_unaligned
*
* This is necessary to defeat optimizations of memcpy by gcc.
*/
void
*
wine_memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
)
{
return
memcpy
(
dst
,
src
,
size
);
}
#endif
/***********************************************************************
* pthread functions
*/
...
...
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