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
75cdc3b6
Commit
75cdc3b6
authored
Jul 22, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't use div and ldiv function.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e407cec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
math.c
dlls/msvcrt/math.c
+24
-16
No files found.
dlls/msvcrt/math.c
View file @
75cdc3b6
...
...
@@ -2059,8 +2059,14 @@ int CDECL MSVCRT__gcvt_s(char *buff, MSVCRT_size_t size, double number, int digi
#ifdef __i386__
unsigned
__int64
CDECL
MSVCRT_div
(
int
num
,
int
denom
)
{
div_t
dt
=
div
(
num
,
denom
);
return
((
unsigned
__int64
)
dt
.
rem
<<
32
)
|
(
unsigned
int
)
dt
.
quot
;
union
{
MSVCRT_div_t
div
;
unsigned
__int64
uint64
;
}
ret
;
ret
.
div
.
quot
=
num
/
denom
;
ret
.
div
.
rem
=
num
%
denom
;
return
ret
.
uint64
;
}
#else
/*********************************************************************
...
...
@@ -2070,13 +2076,11 @@ unsigned __int64 CDECL MSVCRT_div(int num, int denom)
*/
MSVCRT_div_t
CDECL
MSVCRT_div
(
int
num
,
int
denom
)
{
div_t
dt
=
div
(
num
,
denom
);
MSVCRT_div_t
ret
;
ret
.
quot
=
dt
.
quot
;
ret
.
rem
=
dt
.
rem
;
return
ret
;
MSVCRT_div_t
ret
;
ret
.
quot
=
num
/
denom
;
ret
.
rem
=
num
%
denom
;
return
ret
;
}
#endif
/* ifdef __i386__ */
...
...
@@ -2089,8 +2093,14 @@ MSVCRT_div_t CDECL MSVCRT_div(int num, int denom)
#ifdef __i386__
unsigned
__int64
CDECL
MSVCRT_ldiv
(
MSVCRT_long
num
,
MSVCRT_long
denom
)
{
ldiv_t
ldt
=
ldiv
(
num
,
denom
);
return
((
unsigned
__int64
)
ldt
.
rem
<<
32
)
|
(
MSVCRT_ulong
)
ldt
.
quot
;
union
{
MSVCRT_ldiv_t
ldiv
;
unsigned
__int64
uint64
;
}
ret
;
ret
.
ldiv
.
quot
=
num
/
denom
;
ret
.
ldiv
.
rem
=
num
%
denom
;
return
ret
.
uint64
;
}
#else
/*********************************************************************
...
...
@@ -2100,13 +2110,11 @@ unsigned __int64 CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
*/
MSVCRT_ldiv_t
CDECL
MSVCRT_ldiv
(
MSVCRT_long
num
,
MSVCRT_long
denom
)
{
ldiv_t
result
=
ldiv
(
num
,
denom
);
MSVCRT_ldiv_t
ret
;
ret
.
quot
=
result
.
quot
;
ret
.
rem
=
result
.
rem
;
MSVCRT_ldiv_t
ret
;
return
ret
;
ret
.
quot
=
num
/
denom
;
ret
.
rem
=
num
%
denom
;
return
ret
;
}
#endif
/* ifdef __i386__ */
...
...
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