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
758460fa
Commit
758460fa
authored
Nov 27, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use type ranges definition from public header.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4a4621f4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
85 deletions
+66
-85
dir.c
dlls/msvcrt/dir.c
+5
-4
file.c
dlls/msvcrt/file.c
+4
-4
math.c
dlls/msvcrt/math.c
+5
-4
msvcrt.h
dlls/msvcrt/msvcrt.h
+0
-26
printf.h
dlls/msvcrt/printf.h
+1
-1
string.c
dlls/msvcrt/string.c
+27
-26
time.c
dlls/msvcrt/time.c
+2
-2
wcs.c
dlls/msvcrt/wcs.c
+18
-18
math.h
include/msvcrt/math.h
+4
-0
No files found.
dlls/msvcrt/dir.c
View file @
758460fa
...
...
@@ -22,6 +22,7 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#include <direct.h>
#include "windef.h"
...
...
@@ -1128,8 +1129,8 @@ do_error:
void
CDECL
MSVCRT__splitpath
(
const
char
*
inpath
,
char
*
drv
,
char
*
dir
,
char
*
fname
,
char
*
ext
)
{
MSVCRT__splitpath_s
(
inpath
,
drv
,
drv
?
MSVCRT__MAX_DRIVE
:
0
,
dir
,
dir
?
MSVCRT__MAX_DIR
:
0
,
fname
,
fname
?
MSVCRT__MAX_FNAME
:
0
,
ext
,
ext
?
MSVCRT__MAX_EXT
:
0
);
MSVCRT__splitpath_s
(
inpath
,
drv
,
drv
?
_MAX_DRIVE
:
0
,
dir
,
dir
?
_MAX_DIR
:
0
,
fname
,
fname
?
_MAX_FNAME
:
0
,
ext
,
ext
?
_MAX_EXT
:
0
);
}
/******************************************************************
...
...
@@ -1222,8 +1223,8 @@ do_error:
void
CDECL
MSVCRT__wsplitpath
(
const
wchar_t
*
inpath
,
wchar_t
*
drv
,
wchar_t
*
dir
,
wchar_t
*
fname
,
wchar_t
*
ext
)
{
MSVCRT__wsplitpath_s
(
inpath
,
drv
,
drv
?
MSVCRT__MAX_DRIVE
:
0
,
dir
,
dir
?
MSVCRT__MAX_DIR
:
0
,
fname
,
fname
?
MSVCRT__MAX_FNAME
:
0
,
ext
,
ext
?
MSVCRT__MAX_EXT
:
0
);
MSVCRT__wsplitpath_s
(
inpath
,
drv
,
drv
?
_MAX_DRIVE
:
0
,
dir
,
dir
?
_MAX_DIR
:
0
,
fname
,
fname
?
_MAX_FNAME
:
0
,
ext
,
ext
?
_MAX_EXT
:
0
);
}
/*********************************************************************
...
...
dlls/msvcrt/file.c
View file @
758460fa
...
...
@@ -3830,7 +3830,7 @@ MSVCRT_wint_t CDECL MSVCRT__fgetwc_nolock(MSVCRT_FILE* file)
*
p
=
(
char
)
ch
;
}
}
else
{
char
mbs
[
M
SVCRT_M
B_LEN_MAX
];
char
mbs
[
MB_LEN_MAX
];
int
len
=
0
;
ch
=
MSVCRT__fgetc_nolock
(
file
);
...
...
@@ -4089,7 +4089,7 @@ MSVCRT_wint_t CDECL MSVCRT__fputwc_nolock(MSVCRT_wint_t wc, MSVCRT_FILE* file)
fdinfo
=
get_ioinfo_nolock
(
file
->
_file
);
if
((
fdinfo
->
wxflag
&
WX_TEXT
)
&&
!
(
fdinfo
->
exflag
&
(
EF_UTF8
|
EF_UTF16
)))
{
char
buf
[
M
SVCRT_M
B_LEN_MAX
];
char
buf
[
MB_LEN_MAX
];
int
char_len
;
char_len
=
MSVCRT_wctomb
(
buf
,
mwc
);
...
...
@@ -4406,7 +4406,7 @@ MSVCRT_size_t CDECL MSVCRT__fread_nolock_s(void *buf, MSVCRT_size_t buf_size, MS
}
if
(
!
elem_size
||
!
count
)
return
0
;
if
(
!
MSVCRT_CHECK_PMT
(
buf
!=
NULL
))
return
0
;
if
(
!
MSVCRT_CHECK_PMT
(
MSVCRT_
SIZE_MAX
/
count
>=
elem_size
))
return
0
;
if
(
!
MSVCRT_CHECK_PMT
(
SIZE_MAX
/
count
>=
elem_size
))
return
0
;
bytes_left
=
elem_size
*
count
;
buf_pos
=
0
;
...
...
@@ -5583,7 +5583,7 @@ MSVCRT_wint_t CDECL MSVCRT__ungetwc_nolock(MSVCRT_wint_t wc, MSVCRT_FILE * file)
return
MSVCRT_WEOF
;
}
}
else
{
char
mbs
[
M
SVCRT_M
B_LEN_MAX
];
char
mbs
[
MB_LEN_MAX
];
int
len
;
len
=
MSVCRT_wctomb
(
mbs
,
mwc
);
...
...
dlls/msvcrt/math.c
View file @
758460fa
...
...
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <fenv.h>
#include <fpieee.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
...
...
@@ -4193,12 +4194,12 @@ int CDECL MSVCR120_ilogb(double x)
if
(
!
e
)
{
u
.
i
<<=
12
;
if
(
u
.
i
==
0
)
return
MSVCRT_
FP_ILOGB0
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x3ff
;
u
.
i
>>
63
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0x7ff
)
return
u
.
i
<<
12
?
MSVCRT_FP_ILOGBNAN
:
MSVCRT_
INT_MAX
;
if
(
e
==
0x7ff
)
return
u
.
i
<<
12
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x3ff
;
}
...
...
@@ -4215,12 +4216,12 @@ int CDECL MSVCR120_ilogbf(float x)
if
(
!
e
)
{
u
.
i
<<=
9
;
if
(
u
.
i
==
0
)
return
MSVCRT_
FP_ILOGB0
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x7f
;
u
.
i
>>
31
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
MSVCRT_FP_ILOGBNAN
:
MSVCRT_
INT_MAX
;
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x7f
;
}
...
...
dlls/msvcrt/msvcrt.h
View file @
758460fa
...
...
@@ -27,31 +27,8 @@
#include "windef.h"
#include "winbase.h"
#define MSVCRT_INT_MAX 0x7fffffff
#define MSVCRT_LONG_MAX 0x7fffffff
#define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
#define MSVCRT_ULONG_MAX 0xffffffff
#define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
#define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
#define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
#define MSVCRT_MB_LEN_MAX 5
#define MSVCRT_FLT_MAX_10_EXP 38
#define MSVCRT_FLT_MIN_10_EXP (-37)
#define MSVCRT_DBL_MAX_10_EXP 308
#define MSVCRT_DBL_MIN_10_EXP (-307)
#define DBL80_MAX_10_EXP 4932
#define DBL80_MIN_10_EXP -4951
#define MSVCRT_DBL_DIG 15
#ifdef _WIN64
#define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
#else
#define MSVCRT_SIZE_MAX MSVCRT_ULONG_MAX
#endif
#define MSVCRT__MAX_DRIVE 3
#define MSVCRT__MAX_DIR 256
#define MSVCRT__MAX_FNAME 256
#define MSVCRT__MAX_EXT 256
typedef
unsigned
char
MSVCRT_bool
;
typedef
wint_t
MSVCRT_wint_t
;
...
...
@@ -1077,9 +1054,6 @@ printf_arg arg_clbk_positional(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
#define MSVCRT__OVERFLOW 3
#define MSVCRT__UNDERFLOW 4
#define MSVCRT_FP_ILOGB0 (-MSVCRT_INT_MAX - 1)
#define MSVCRT_FP_ILOGBNAN MSVCRT_INT_MAX
typedef
struct
{
float
f
;
...
...
dlls/msvcrt/printf.h
View file @
758460fa
...
...
@@ -111,7 +111,7 @@ static inline int FUNC_NAME(pf_fill)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ct
static
inline
int
wcstombs_len
(
char
*
mbstr
,
const
wchar_t
*
wcstr
,
int
len
,
_locale_t
locale
)
{
char
buf
[
M
SVCRT_M
B_LEN_MAX
];
char
buf
[
MB_LEN_MAX
];
int
i
,
r
,
mblen
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
...
...
dlls/msvcrt/string.c
View file @
758460fa
...
...
@@ -28,6 +28,7 @@
#include <limits.h>
#include <locale.h>
#include <errno.h>
#include <float.h>
#include "msvcrt.h"
#include "bnum.h"
#include "winnls.h"
...
...
@@ -552,7 +553,7 @@ int fpnum_ldouble(struct fpnum *fp, MSVCRT__LDOUBLE *d)
/* round mantissa */
if
(
fp
->
mod
==
FP_ROUND_UP
||
(
fp
->
mod
==
FP_ROUND_EVEN
&&
fp
->
m
&
1
))
{
if
(
fp
->
m
==
MSVCRT_
UI64_MAX
)
if
(
fp
->
m
==
UI64_MAX
)
{
fp
->
m
=
(
ULONGLONG
)
1
<<
(
LDBL_MANT_BITS
-
1
);
fp
->
exp
++
;
...
...
@@ -616,7 +617,7 @@ static struct fpnum fpnum_parse16(wchar_t get(void *ctx), void unget(void *ctx),
int
val
,
exp
=
0
;
nch
=
get
(
ctx
);
while
(
m
<
MSVCRT_
UI64_MAX
/
16
)
while
(
m
<
UI64_MAX
/
16
)
{
val
=
hex2int
(
nch
);
if
(
val
==
-
1
)
break
;
...
...
@@ -652,7 +653,7 @@ static struct fpnum fpnum_parse16(wchar_t get(void *ctx), void unget(void *ctx),
return
fpnum
(
0
,
0
,
0
,
0
);
}
while
(
m
<=
MSVCRT_
UI64_MAX
/
16
)
while
(
m
<=
UI64_MAX
/
16
)
{
val
=
hex2int
(
nch
);
if
(
val
==
-
1
)
break
;
...
...
@@ -726,13 +727,13 @@ static struct fpnum fpnum_parse16(wchar_t get(void *ctx), void unget(void *ctx),
/* Return FALSE on overflow */
static
inline
BOOL
bnum_to_mant
(
struct
bnum
*
b
,
ULONGLONG
*
m
)
{
if
(
MSVCRT_
UI64_MAX
/
LIMB_MAX
/
LIMB_MAX
<
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
1
)])
return
FALSE
;
if
(
UI64_MAX
/
LIMB_MAX
/
LIMB_MAX
<
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
1
)])
return
FALSE
;
*
m
=
(
ULONGLONG
)
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
1
)]
*
LIMB_MAX
*
LIMB_MAX
;
if
(
b
->
b
==
b
->
e
-
1
)
return
TRUE
;
if
(
MSVCRT_
UI64_MAX
-
*
m
<
(
ULONGLONG
)
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
2
)]
*
LIMB_MAX
)
return
FALSE
;
if
(
UI64_MAX
-
*
m
<
(
ULONGLONG
)
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
2
)]
*
LIMB_MAX
)
return
FALSE
;
*
m
+=
(
ULONGLONG
)
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
2
)]
*
LIMB_MAX
;
if
(
b
->
b
==
b
->
e
-
2
)
return
TRUE
;
if
(
MSVCRT_
UI64_MAX
-
*
m
<
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
3
)])
return
FALSE
;
if
(
UI64_MAX
-
*
m
<
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
3
)])
return
FALSE
;
*
m
+=
b
->
data
[
bnum_idx
(
b
,
b
->
e
-
3
)];
return
TRUE
;
}
...
...
@@ -928,11 +929,11 @@ static struct fpnum fpnum_parse_bnum(wchar_t (*get)(void *ctx), void (*unget)(vo
if
(
off
<
0
)
off
+=
LIMB_DIGITS
;
if
(
off
)
bnum_mult
(
b
,
p10s
[
off
]);
if
(
dp
-
1
>
(
ldouble
?
DBL80_MAX_10_EXP
:
MSVCRT_
DBL_MAX_10_EXP
))
if
(
dp
-
1
>
(
ldouble
?
DBL80_MAX_10_EXP
:
DBL_MAX_10_EXP
))
return
fpnum
(
sign
,
INT_MAX
,
1
,
FP_ROUND_ZERO
);
/* Count part of exponent stored in denormalized mantissa. */
/* Increase exponent range to handle subnormals. */
if
(
dp
-
1
<
(
ldouble
?
DBL80_MIN_10_EXP
:
MSVCRT_DBL_MIN_10_EXP
-
MSVCRT_
DBL_DIG
-
18
))
if
(
dp
-
1
<
(
ldouble
?
DBL80_MIN_10_EXP
:
DBL_MIN_10_EXP
-
DBL_DIG
-
18
))
return
fpnum
(
sign
,
INT_MIN
,
1
,
FP_ROUND_ZERO
);
while
(
dp
>
3
*
LIMB_DIGITS
)
{
...
...
@@ -1577,11 +1578,11 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, _loca
nptr
++
;
if
(
!
negative
&&
(
ret
>
MSVCRT_I64_MAX
/
base
||
ret
*
base
>
MSVCRT_
I64_MAX
-
v
))
{
ret
=
MSVCRT_
I64_MAX
;
if
(
!
negative
&&
(
ret
>
I64_MAX
/
base
||
ret
*
base
>
I64_MAX
-
v
))
{
ret
=
I64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
negative
&&
(
ret
<
MSVCRT_I64_MIN
/
base
||
ret
*
base
<
MSVCRT_
I64_MIN
-
v
))
{
ret
=
MSVCRT_
I64_MIN
;
}
else
if
(
negative
&&
(
ret
<
I64_MIN
/
base
||
ret
*
base
<
I64_MIN
-
v
))
{
ret
=
I64_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
...
...
@@ -1676,11 +1677,11 @@ MSVCRT_long CDECL MSVCRT__atol_l(const char *str, _locale_t locale)
{
__int64
ret
=
MSVCRT_strtoi64_l
(
str
,
NULL
,
10
,
locale
);
if
(
ret
>
MSVCRT_
LONG_MAX
)
{
ret
=
MSVCRT_
LONG_MAX
;
if
(
ret
>
LONG_MAX
)
{
ret
=
LONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
MSVCRT_
LONG_MIN
)
{
ret
=
MSVCRT_
LONG_MIN
;
}
else
if
(
ret
<
LONG_MIN
)
{
ret
=
LONG_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
return
ret
;
...
...
@@ -1726,11 +1727,11 @@ MSVCRT_long CDECL MSVCRT__strtol_l(const char* nptr,
{
__int64
ret
=
MSVCRT_strtoi64_l
(
nptr
,
end
,
base
,
locale
);
if
(
ret
>
MSVCRT_
LONG_MAX
)
{
ret
=
MSVCRT_
LONG_MAX
;
if
(
ret
>
LONG_MAX
)
{
ret
=
LONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
MSVCRT_
LONG_MIN
)
{
ret
=
MSVCRT_
LONG_MIN
;
}
else
if
(
ret
<
LONG_MIN
)
{
ret
=
LONG_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
...
...
@@ -1752,10 +1753,10 @@ MSVCRT_ulong CDECL MSVCRT_strtoul_l(const char* nptr, char** end, int base, _loc
{
__int64
ret
=
MSVCRT_strtoi64_l
(
nptr
,
end
,
base
,
locale
);
if
(
ret
>
MSVCRT_
ULONG_MAX
)
{
ret
=
MSVCRT_
ULONG_MAX
;
if
(
ret
>
ULONG_MAX
)
{
ret
=
ULONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
-
(
__int64
)
MSVCRT_
ULONG_MAX
)
{
}
else
if
(
ret
<
-
(
__int64
)
ULONG_MAX
)
{
ret
=
1
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
...
...
@@ -1826,8 +1827,8 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
nptr
++
;
if
(
ret
>
MSVCRT_UI64_MAX
/
base
||
ret
*
base
>
MSVCRT_
UI64_MAX
-
v
)
{
ret
=
MSVCRT_
UI64_MAX
;
if
(
ret
>
UI64_MAX
/
base
||
ret
*
base
>
UI64_MAX
-
v
)
{
ret
=
UI64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
...
...
@@ -2015,7 +2016,7 @@ int CDECL MSVCRT__itoa_s(int value, char *str, MSVCRT_size_t size, int radix)
*/
char
*
CDECL
MSVCRT__itoa
(
int
value
,
char
*
str
,
int
radix
)
{
return
ltoa_helper
(
value
,
str
,
MSVCRT_
SIZE_MAX
,
radix
)
?
NULL
:
str
;
return
ltoa_helper
(
value
,
str
,
SIZE_MAX
,
radix
)
?
NULL
:
str
;
}
/*********************************************************************
...
...
dlls/msvcrt/time.c
View file @
758460fa
...
...
@@ -955,7 +955,7 @@ char ** CDECL __p__tzname(void)
#define STRFTIME_TD(td, name) td->wstr.names.name
#endif
#define strftime_str(a,b,c,d) strftime_nstr(a,b,c,d,
MSVCRT_
SIZE_MAX)
#define strftime_str(a,b,c,d) strftime_nstr(a,b,c,d,SIZE_MAX)
static
inline
BOOL
strftime_nstr
(
STRFTIME_CHAR
*
str
,
MSVCRT_size_t
*
pos
,
MSVCRT_size_t
max
,
const
STRFTIME_CHAR
*
src
,
MSVCRT_size_t
len
)
{
...
...
@@ -1142,7 +1142,7 @@ static inline BOOL strftime_format(STRFTIME_CHAR *str, MSVCRT_size_t *pos, MSVCR
}
ret
=
strftime_nstr
(
str
,
pos
,
max
,
mstm
->
tm_hour
<
12
?
STRFTIME_TD
(
time_data
,
am
)
:
STRFTIME_TD
(
time_data
,
pm
),
(
*
format
==
't'
&&
count
==
1
)
?
1
:
MSVCRT_
SIZE_MAX
);
(
*
format
==
't'
&&
count
==
1
)
?
1
:
SIZE_MAX
);
break
;
default:
ret
=
strftime_nstr
(
str
,
pos
,
max
,
format
,
count
);
...
...
dlls/msvcrt/wcs.c
View file @
758460fa
...
...
@@ -2016,7 +2016,7 @@ int CDECL MSVCRT__wctomb_l(char *dst, wchar_t ch, _locale_t locale)
{
int
len
;
MSVCRT__wctomb_s_l
(
&
len
,
dst
,
dst
?
M
SVCRT_M
B_LEN_MAX
:
0
,
ch
,
locale
);
MSVCRT__wctomb_s_l
(
&
len
,
dst
,
dst
?
MB_LEN_MAX
:
0
,
ch
,
locale
);
return
len
;
}
...
...
@@ -2556,11 +2556,11 @@ __int64 CDECL MSVCRT__wcstoi64_l(const wchar_t *nptr,
nptr
++
;
empty
=
FALSE
;
if
(
!
negative
&&
(
ret
>
MSVCRT_I64_MAX
/
base
||
ret
*
base
>
MSVCRT_
I64_MAX
-
v
))
{
ret
=
MSVCRT_
I64_MAX
;
if
(
!
negative
&&
(
ret
>
I64_MAX
/
base
||
ret
*
base
>
I64_MAX
-
v
))
{
ret
=
I64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
negative
&&
(
ret
<
MSVCRT_I64_MIN
/
base
||
ret
*
base
<
MSVCRT_
I64_MIN
-
v
))
{
ret
=
MSVCRT_
I64_MIN
;
}
else
if
(
negative
&&
(
ret
<
I64_MIN
/
base
||
ret
*
base
<
I64_MIN
-
v
))
{
ret
=
I64_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
...
...
@@ -2589,11 +2589,11 @@ MSVCRT_long CDECL MSVCRT__wcstol_l(const wchar_t *s,
{
__int64
ret
=
MSVCRT__wcstoi64_l
(
s
,
end
,
base
,
locale
);
if
(
ret
>
MSVCRT_
LONG_MAX
)
{
ret
=
MSVCRT_
LONG_MAX
;
if
(
ret
>
LONG_MAX
)
{
ret
=
LONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
MSVCRT_
LONG_MIN
)
{
ret
=
MSVCRT_
LONG_MIN
;
}
else
if
(
ret
<
LONG_MIN
)
{
ret
=
LONG_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
return
ret
;
...
...
@@ -2640,11 +2640,11 @@ MSVCRT_long __cdecl MSVCRT__wtol_l(const wchar_t *str, _locale_t locale)
{
__int64
ret
=
MSVCRT__wcstoi64_l
(
str
,
NULL
,
10
,
locale
);
if
(
ret
>
MSVCRT_
LONG_MAX
)
{
ret
=
MSVCRT_
LONG_MAX
;
if
(
ret
>
LONG_MAX
)
{
ret
=
LONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
MSVCRT_
LONG_MIN
)
{
ret
=
MSVCRT_
LONG_MIN
;
}
else
if
(
ret
<
LONG_MIN
)
{
ret
=
LONG_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
return
ret
;
...
...
@@ -2726,8 +2726,8 @@ unsigned __int64 CDECL MSVCRT__wcstoui64_l(const wchar_t *nptr,
nptr
++
;
empty
=
FALSE
;
if
(
ret
>
MSVCRT_UI64_MAX
/
base
||
ret
*
base
>
MSVCRT_
UI64_MAX
-
v
)
{
ret
=
MSVCRT_
UI64_MAX
;
if
(
ret
>
UI64_MAX
/
base
||
ret
*
base
>
UI64_MAX
-
v
)
{
ret
=
UI64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
...
...
@@ -2756,10 +2756,10 @@ MSVCRT_ulong __cdecl MSVCRT__wcstoul_l(const wchar_t *s,
{
__int64
ret
=
MSVCRT__wcstoi64_l
(
s
,
end
,
base
,
locale
);
if
(
ret
>
MSVCRT_
ULONG_MAX
)
{
ret
=
MSVCRT_
ULONG_MAX
;
if
(
ret
>
ULONG_MAX
)
{
ret
=
ULONG_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
ret
<
-
(
__int64
)
MSVCRT_
ULONG_MAX
)
{
}
else
if
(
ret
<
-
(
__int64
)
ULONG_MAX
)
{
ret
=
1
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
...
...
include/msvcrt/math.h
View file @
758460fa
...
...
@@ -219,6 +219,10 @@ static const union {
#define FP_SUBNORMAL -2
#define FP_ZERO 0
#define _C2 1
#define FP_ILOGB0 (-0x7fffffff - _C2)
#define FP_ILOGBNAN 0x7fffffff
_ACRTIMP
short
__cdecl
_dclass
(
double
);
_ACRTIMP
short
__cdecl
_fdclass
(
float
);
_ACRTIMP
int
__cdecl
_dsign
(
double
);
...
...
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