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
15467bfb
Commit
15467bfb
authored
Aug 01, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved MulDiv() and VGA routines out of GDI.
parent
ebecf502
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
53 deletions
+55
-53
dos_fs.c
files/dos_fs.c
+53
-0
Makefile.in
graphics/Makefile.in
+1
-2
Makefile.in
msdos/Makefile.in
+1
-0
vga.c
msdos/vga.c
+0
-0
gdiobj.c
objects/gdiobj.c
+0
-51
No files found.
files/dos_fs.c
View file @
15467bfb
...
...
@@ -1868,6 +1868,59 @@ time_t DOSFS_FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder )
/***********************************************************************
* MulDiv (KERNEL32.391)
* RETURNS
* Result of multiplication and division
* -1: Overflow occurred or Divisor was 0
*/
INT
WINAPI
MulDiv
(
INT
nMultiplicand
,
INT
nMultiplier
,
INT
nDivisor
)
{
#if SIZEOF_LONG_LONG >= 8
long
long
ret
;
if
(
!
nDivisor
)
return
-
1
;
/* We want to deal with a positive divisor to simplify the logic. */
if
(
nDivisor
<
0
)
{
nMultiplicand
=
-
nMultiplicand
;
nDivisor
=
-
nDivisor
;
}
/* If the result is positive, we "add" to round. else, we subtract to round. */
if
(
(
(
nMultiplicand
<
0
)
&&
(
nMultiplier
<
0
)
)
||
(
(
nMultiplicand
>=
0
)
&&
(
nMultiplier
>=
0
)
)
)
ret
=
(((
long
long
)
nMultiplicand
*
nMultiplier
)
+
(
nDivisor
/
2
))
/
nDivisor
;
else
ret
=
(((
long
long
)
nMultiplicand
*
nMultiplier
)
-
(
nDivisor
/
2
))
/
nDivisor
;
if
((
ret
>
2147483647
)
||
(
ret
<
-
2147483647
))
return
-
1
;
return
ret
;
#else
if
(
!
nDivisor
)
return
-
1
;
/* We want to deal with a positive divisor to simplify the logic. */
if
(
nDivisor
<
0
)
{
nMultiplicand
=
-
nMultiplicand
;
nDivisor
=
-
nDivisor
;
}
/* If the result is positive, we "add" to round. else, we subtract to round. */
if
(
(
(
nMultiplicand
<
0
)
&&
(
nMultiplier
<
0
)
)
||
(
(
nMultiplicand
>=
0
)
&&
(
nMultiplier
>=
0
)
)
)
return
((
nMultiplicand
*
nMultiplier
)
+
(
nDivisor
/
2
))
/
nDivisor
;
return
((
nMultiplicand
*
nMultiplier
)
-
(
nDivisor
/
2
))
/
nDivisor
;
#endif
}
/***********************************************************************
* DosDateTimeToFileTime (KERNEL32.76)
*/
BOOL
WINAPI
DosDateTimeToFileTime
(
WORD
fatdate
,
WORD
fattime
,
LPFILETIME
ft
)
...
...
graphics/Makefile.in
View file @
15467bfb
...
...
@@ -15,8 +15,7 @@ C_SRCS = \
fontengine.c
\
mapping.c
\
painting.c
\
path.c
\
vga.c
path.c
all
:
$(MODULE).o
...
...
msdos/Makefile.in
View file @
15467bfb
...
...
@@ -36,6 +36,7 @@ C_SRCS = \
int5c.c
\
interrupts.c
\
ioports.c
\
vga.c
\
vxd.c
all
:
$(MODULE).o
...
...
graphic
s/vga.c
→
msdo
s/vga.c
View file @
15467bfb
File moved
objects/gdiobj.c
View file @
15467bfb
...
...
@@ -1118,57 +1118,6 @@ INT16 WINAPI MulDiv16(
}
/***********************************************************************
* MulDiv (KERNEL32.391)
* RETURNS
* Result of multiplication and division
* -1: Overflow occurred or Divisor was 0
*/
INT
WINAPI
MulDiv
(
INT
nMultiplicand
,
INT
nMultiplier
,
INT
nDivisor
)
{
#if SIZEOF_LONG_LONG >= 8
long
long
ret
;
if
(
!
nDivisor
)
return
-
1
;
/* We want to deal with a positive divisor to simplify the logic. */
if
(
nDivisor
<
0
)
{
nMultiplicand
=
-
nMultiplicand
;
nDivisor
=
-
nDivisor
;
}
/* If the result is positive, we "add" to round. else, we subtract to round. */
if
(
(
(
nMultiplicand
<
0
)
&&
(
nMultiplier
<
0
)
)
||
(
(
nMultiplicand
>=
0
)
&&
(
nMultiplier
>=
0
)
)
)
ret
=
(((
long
long
)
nMultiplicand
*
nMultiplier
)
+
(
nDivisor
/
2
))
/
nDivisor
;
else
ret
=
(((
long
long
)
nMultiplicand
*
nMultiplier
)
-
(
nDivisor
/
2
))
/
nDivisor
;
if
((
ret
>
2147483647
)
||
(
ret
<
-
2147483647
))
return
-
1
;
return
ret
;
#else
if
(
!
nDivisor
)
return
-
1
;
/* We want to deal with a positive divisor to simplify the logic. */
if
(
nDivisor
<
0
)
{
nMultiplicand
=
-
nMultiplicand
;
nDivisor
=
-
nDivisor
;
}
/* If the result is positive, we "add" to round. else, we subtract to round. */
if
(
(
(
nMultiplicand
<
0
)
&&
(
nMultiplier
<
0
)
)
||
(
(
nMultiplicand
>=
0
)
&&
(
nMultiplier
>=
0
)
)
)
return
((
nMultiplicand
*
nMultiplier
)
+
(
nDivisor
/
2
))
/
nDivisor
;
return
((
nMultiplicand
*
nMultiplier
)
-
(
nDivisor
/
2
))
/
nDivisor
;
#endif
}
/*******************************************************************
* GetColorAdjustment [GDI32.164]
*
...
...
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