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
13608c8b
Commit
13608c8b
authored
Dec 05, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid use of some 16-bit types.
parent
1ac23b9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
53 deletions
+50
-53
enhmetafile.c
dlls/gdi32/enhmetafile.c
+12
-13
metafile.c
dlls/gdi32/metafile.c
+11
-12
graphics.c
dlls/gdi32/mfdrv/graphics.c
+27
-28
No files found.
dlls/gdi32/enhmetafile.c
View file @
13608c8b
...
...
@@ -43,7 +43,6 @@
#include "wingdi.h"
#include "winnls.h"
#include "winerror.h"
#include "wine/wingdi16.h"
#include "gdi_private.h"
#include "wine/debug.h"
...
...
@@ -1074,16 +1073,16 @@ BOOL WINAPI PlayEnhMetaFileRecord(
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
POINT
16
*
pts16
=
(
POINT16
*
)(
pPolyPoly
->
aPolyCounts
+
pPolyPoly
->
nPolys
);
POINT
*
pt
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pPolyPoly
->
cpts
*
sizeof
(
POINT
)
);
POINT
S
*
pts
=
(
POINTS
*
)(
pPolyPoly
->
aPolyCounts
+
pPolyPoly
->
nPolys
);
POINT
*
pt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pPolyPoly
->
cpts
*
sizeof
(
POINT
)
);
DWORD
i
;
for
(
i
=
0
;
i
<
pPolyPoly
->
cpts
;
i
++
)
{
pt
s
[
i
].
x
=
pts16
[
i
].
x
;
pt
s
[
i
].
y
=
pts16
[
i
].
y
;
pt
[
i
].
x
=
pts
[
i
].
x
;
pt
[
i
].
y
=
pts
[
i
].
y
;
}
PolyPolygon
(
hdc
,
pt
s
,
(
INT
*
)
pPolyPoly
->
aPolyCounts
,
pPolyPoly
->
nPolys
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
PolyPolygon
(
hdc
,
pt
,
(
INT
*
)
pPolyPoly
->
aPolyCounts
,
pPolyPoly
->
nPolys
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
);
break
;
}
case
EMR_POLYPOLYLINE16
:
...
...
@@ -1092,16 +1091,16 @@ BOOL WINAPI PlayEnhMetaFileRecord(
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
POINT
16
*
pts16
=
(
POINT16
*
)(
pPolyPoly
->
aPolyCounts
+
pPolyPoly
->
nPolys
);
POINT
*
pt
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pPolyPoly
->
cpts
*
sizeof
(
POINT
)
);
POINT
S
*
pts
=
(
POINTS
*
)(
pPolyPoly
->
aPolyCounts
+
pPolyPoly
->
nPolys
);
POINT
*
pt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pPolyPoly
->
cpts
*
sizeof
(
POINT
)
);
DWORD
i
;
for
(
i
=
0
;
i
<
pPolyPoly
->
cpts
;
i
++
)
{
pt
s
[
i
].
x
=
pts16
[
i
].
x
;
pt
s
[
i
].
y
=
pts16
[
i
].
y
;
pt
[
i
].
x
=
pts
[
i
].
x
;
pt
[
i
].
y
=
pts
[
i
].
y
;
}
PolyPolyline
(
hdc
,
pt
s
,
pPolyPoly
->
aPolyCounts
,
pPolyPoly
->
nPolys
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
PolyPolyline
(
hdc
,
pt
,
pPolyPoly
->
aPolyCounts
,
pPolyPoly
->
nPolys
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
);
break
;
}
...
...
dlls/gdi32/metafile.c
View file @
13608c8b
...
...
@@ -57,7 +57,6 @@
#include "winreg.h"
#include "winnls.h"
#include "winternl.h"
#include "wine/wingdi16.h"
#include "gdi_private.h"
#include "wine/debug.h"
...
...
@@ -139,10 +138,10 @@ static METAHEADER *MF_GetMetaHeader( HMETAFILE hmf )
/******************************************************************
* convert_points
*
* Convert an array of POINT
16
to an array of POINT.
* Convert an array of POINT
S
to an array of POINT.
* Result must be freed by caller.
*/
static
POINT
*
convert_points
(
UINT
count
,
POINT16
*
pt16
)
static
POINT
*
convert_points
(
UINT
count
,
const
POINTS
*
pts
)
{
UINT
i
;
POINT
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
ret
)
);
...
...
@@ -150,8 +149,8 @@ static POINT *convert_points( UINT count, POINT16 *pt16 )
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
ret
[
i
].
x
=
pt
16
[
i
].
x
;
ret
[
i
].
y
=
pt
16
[
i
].
y
;
ret
[
i
].
x
=
pt
s
[
i
].
x
;
ret
[
i
].
y
=
pt
s
[
i
].
y
;
}
}
return
ret
;
...
...
@@ -743,7 +742,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
break
;
case
META_POLYGON
:
if
((
pt
=
convert_points
(
mr
->
rdParm
[
0
],
(
LPPOINT16
)(
mr
->
rdParm
+
1
))))
if
((
pt
=
convert_points
(
mr
->
rdParm
[
0
],
(
POINTS
*
)(
mr
->
rdParm
+
1
))))
{
Polygon
(
hdc
,
pt
,
mr
->
rdParm
[
0
]);
HeapFree
(
GetProcessHeap
(),
0
,
pt
);
...
...
@@ -756,7 +755,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
SHORT
*
counts
=
(
SHORT
*
)(
mr
->
rdParm
+
1
);
for
(
i
=
total
=
0
;
i
<
mr
->
rdParm
[
0
];
i
++
)
total
+=
counts
[
i
];
pt
=
convert_points
(
total
,
(
LPPOINT16
)(
counts
+
mr
->
rdParm
[
0
])
);
pt
=
convert_points
(
total
,
(
POINTS
*
)(
counts
+
mr
->
rdParm
[
0
])
);
if
(
pt
)
{
INT
*
cnt32
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mr
->
rdParm
[
0
]
*
sizeof
(
*
cnt32
)
);
...
...
@@ -772,7 +771,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
break
;
case
META_POLYLINE
:
if
((
pt
=
convert_points
(
mr
->
rdParm
[
0
],
(
LPPOINT16
)(
mr
->
rdParm
+
1
))))
if
((
pt
=
convert_points
(
mr
->
rdParm
[
0
],
(
POINTS
*
)(
mr
->
rdParm
+
1
))))
{
Polyline
(
hdc
,
pt
,
mr
->
rdParm
[
0
]
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
);
...
...
@@ -1432,7 +1431,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC hdc, METARECORD *mr)
{
INT
*
dx
=
NULL
;
int
i
;
LPINT16
dxx
;
SHORT
*
dxx
;
LPSTR
sot
;
DWORD
len
;
WORD
s1
;
...
...
@@ -1441,7 +1440,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC hdc, METARECORD *mr)
s1
=
mr
->
rdParm
[
2
];
/* String length */
len
=
sizeof
(
METARECORD
)
+
(((
s1
+
1
)
>>
1
)
*
2
)
+
2
*
sizeof
(
short
)
+
sizeof
(
UINT16
)
+
(
isrect
?
sizeof
(
RECT16
)
:
0
);
+
sizeof
(
UINT16
)
+
(
isrect
?
4
*
sizeof
(
SHORT
)
:
0
);
/* rec len without dx array */
sot
=
(
LPSTR
)
&
mr
->
rdParm
[
4
];
/* start_of_text */
...
...
@@ -1451,7 +1450,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC hdc, METARECORD *mr)
rect
.
top
=
(
SHORT
)
mr
->
rdParm
[
5
];
rect
.
right
=
(
SHORT
)
mr
->
rdParm
[
6
];
rect
.
bottom
=
(
SHORT
)
mr
->
rdParm
[
7
];
sot
+=
sizeof
(
RECT16
);
/* there is a rectangle, so add offset */
sot
+=
4
*
sizeof
(
SHORT
);
/* there is a rectangle, so add offset */
}
if
(
mr
->
rdSize
==
len
/
2
)
...
...
@@ -1459,7 +1458,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC hdc, METARECORD *mr)
else
if
(
mr
->
rdSize
==
(
len
+
s1
*
sizeof
(
INT16
))
/
2
)
{
dxx
=
(
LPINT16
)(
sot
+
(((
s1
+
1
)
>>
1
)
*
2
));
dxx
=
(
SHORT
*
)(
sot
+
(((
s1
+
1
)
>>
1
)
*
2
));
dx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
s1
*
sizeof
(
INT
));
if
(
dx
)
for
(
i
=
0
;
i
<
s1
;
i
++
)
dx
[
i
]
=
dxx
[
i
];
}
...
...
dlls/gdi32/mfdrv/graphics.c
View file @
13608c8b
...
...
@@ -25,7 +25,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/wingdi16.h"
#include "mfdrv/metafiledrv.h"
#include "wine/debug.h"
...
...
@@ -128,7 +127,7 @@ MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
/******************************************************************
* MFDRV_MetaPoly - implements Polygon and Polyline
*/
static
BOOL
MFDRV_MetaPoly
(
PHYSDEV
dev
,
short
func
,
LPPOINT16
pt
,
short
count
)
static
BOOL
MFDRV_MetaPoly
(
PHYSDEV
dev
,
short
func
,
POINTS
*
pt
,
short
count
)
{
BOOL
ret
;
DWORD
len
;
...
...
@@ -154,20 +153,20 @@ static BOOL MFDRV_MetaPoly(PHYSDEV dev, short func, LPPOINT16 pt, short count)
BOOL
CDECL
MFDRV_Polyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
INT
count
)
{
register
int
i
;
LPPOINT16
pt16
;
BOOL
16
ret
;
int
i
;
POINTS
*
pts
;
BOOL
ret
;
pt
16
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINT16
)
*
count
);
if
(
!
pt
16
)
return
FALSE
;
pt
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINTS
)
*
count
);
if
(
!
pt
s
)
return
FALSE
;
for
(
i
=
count
;
i
--
;)
{
pt
16
[
i
].
x
=
pt
[
i
].
x
;
pt
16
[
i
].
y
=
pt
[
i
].
y
;
pt
s
[
i
].
x
=
pt
[
i
].
x
;
pt
s
[
i
].
y
=
pt
[
i
].
y
;
}
ret
=
MFDRV_MetaPoly
(
dev
,
META_POLYLINE
,
pt
16
,
count
);
ret
=
MFDRV_MetaPoly
(
dev
,
META_POLYLINE
,
pt
s
,
count
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
16
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
return
ret
;
}
...
...
@@ -178,20 +177,20 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
BOOL
CDECL
MFDRV_Polygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
INT
count
)
{
register
int
i
;
LPPOINT16
pt16
;
BOOL
16
ret
;
int
i
;
POINTS
*
pts
;
BOOL
ret
;
pt
16
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINT16
)
*
count
);
if
(
!
pt
16
)
return
FALSE
;
pt
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINTS
)
*
count
);
if
(
!
pt
s
)
return
FALSE
;
for
(
i
=
count
;
i
--
;)
{
pt
16
[
i
].
x
=
pt
[
i
].
x
;
pt
16
[
i
].
y
=
pt
[
i
].
y
;
pt
s
[
i
].
x
=
pt
[
i
].
x
;
pt
s
[
i
].
y
=
pt
[
i
].
y
;
}
ret
=
MFDRV_MetaPoly
(
dev
,
META_POLYGON
,
pt
16
,
count
);
ret
=
MFDRV_MetaPoly
(
dev
,
META_POLYGON
,
pt
s
,
count
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
16
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
return
ret
;
}
...
...
@@ -206,7 +205,7 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
DWORD
len
;
METARECORD
*
mr
;
unsigned
int
i
,
j
;
LPPOINT16
pt16
;
POINTS
*
pts
;
INT16
totalpoint16
=
0
;
INT16
*
pointcounts
;
...
...
@@ -215,7 +214,7 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
}
/* allocate space for all points */
pt
16
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINT16
)
*
totalpoint16
);
pt
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
POINTS
)
*
totalpoint16
);
pointcounts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
INT16
)
*
totalpoint16
);
/* copy point counts */
...
...
@@ -225,14 +224,14 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
/* convert all points */
for
(
j
=
totalpoint16
;
j
--
;){
pt
16
[
j
].
x
=
pt
[
j
].
x
;
pt
16
[
j
].
y
=
pt
[
j
].
y
;
pt
s
[
j
].
x
=
pt
[
j
].
x
;
pt
s
[
j
].
y
=
pt
[
j
].
y
;
}
len
=
sizeof
(
METARECORD
)
+
sizeof
(
WORD
)
+
polygons
*
sizeof
(
INT16
)
+
totalpoint16
*
sizeof
(
POINT16
);
len
=
sizeof
(
METARECORD
)
+
sizeof
(
WORD
)
+
polygons
*
sizeof
(
INT16
)
+
totalpoint16
*
sizeof
(
*
pts
);
if
(
!
(
mr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
pt
16
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
HeapFree
(
GetProcessHeap
(),
0
,
pointcounts
);
return
FALSE
;
}
...
...
@@ -241,10 +240,10 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
mr
->
rdFunction
=
META_POLYPOLYGON
;
*
(
mr
->
rdParm
)
=
polygons
;
memcpy
(
mr
->
rdParm
+
1
,
pointcounts
,
polygons
*
sizeof
(
INT16
));
memcpy
(
mr
->
rdParm
+
1
+
polygons
,
pt
16
,
totalpoint16
*
sizeof
(
POINT16
));
memcpy
(
mr
->
rdParm
+
1
+
polygons
,
pt
s
,
totalpoint16
*
sizeof
(
*
pts
));
ret
=
MFDRV_WriteRecord
(
dev
,
mr
,
mr
->
rdSize
*
2
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
16
);
HeapFree
(
GetProcessHeap
(),
0
,
pt
s
);
HeapFree
(
GetProcessHeap
(),
0
,
pointcounts
);
HeapFree
(
GetProcessHeap
(),
0
,
mr
);
return
ret
;
...
...
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