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
9984a5d6
Commit
9984a5d6
authored
May 18, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import modf implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc5f2888
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
+31
-11
math.c
dlls/msvcrt/math.c
+31
-1
unixlib.c
dlls/msvcrt/unixlib.c
+0
-9
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
No files found.
dlls/msvcrt/math.c
View file @
9984a5d6
...
...
@@ -2000,10 +2000,40 @@ double CDECL frexp( double x, int *exp )
/*********************************************************************
* modf (MSVCRT.@)
*
* Copied from musl: src/math/modf.c
*/
double
CDECL
modf
(
double
x
,
double
*
iptr
)
{
return
unix_funcs
->
modf
(
x
,
iptr
);
union
{
double
f
;
UINT64
i
;}
u
=
{
x
};
UINT64
mask
;
int
e
=
(
u
.
i
>>
52
&
0x7ff
)
-
0x3ff
;
/* no fractional part */
if
(
e
>=
52
)
{
*
iptr
=
x
;
if
(
e
==
0x400
&&
u
.
i
<<
12
!=
0
)
/* nan */
return
x
;
u
.
i
&=
1ULL
<<
63
;
return
u
.
f
;
}
/* no integral part*/
if
(
e
<
0
)
{
u
.
i
&=
1ULL
<<
63
;
*
iptr
=
u
.
f
;
return
x
;
}
mask
=
-
1ULL
>>
12
>>
e
;
if
((
u
.
i
&
mask
)
==
0
)
{
*
iptr
=
x
;
u
.
i
&=
1ULL
<<
63
;
return
u
.
f
;
}
u
.
i
&=
~
mask
;
*
iptr
=
u
.
f
;
return
x
-
u
.
f
;
}
/**********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
9984a5d6
...
...
@@ -460,14 +460,6 @@ static float CDECL unix_logbf( float x )
}
/*********************************************************************
* modf
*/
static
double
CDECL
unix_modf
(
double
x
,
double
*
iptr
)
{
return
modf
(
x
,
iptr
);
}
/*********************************************************************
* modff
*/
static
float
CDECL
unix_modff
(
float
x
,
float
*
iptr
)
...
...
@@ -674,7 +666,6 @@ static const struct unix_funcs funcs =
unix_log2f
,
unix_logb
,
unix_logbf
,
unix_modf
,
unix_modff
,
unix_pow
,
unix_powf
,
...
...
dlls/msvcrt/unixlib.h
View file @
9984a5d6
...
...
@@ -62,7 +62,6 @@ struct unix_funcs
float
(
CDECL
*
log2f
)(
float
x
);
double
(
CDECL
*
logb
)(
double
x
);
float
(
CDECL
*
logbf
)(
float
x
);
double
(
CDECL
*
modf
)(
double
x
,
double
*
iptr
);
float
(
CDECL
*
modff
)(
float
x
,
float
*
iptr
);
double
(
CDECL
*
pow
)(
double
x
,
double
y
);
float
(
CDECL
*
powf
)(
float
x
,
float
y
);
...
...
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