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
586ae944
Commit
586ae944
authored
Oct 18, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Oct 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Avoid using typeof().
Based on a patch by Alex Henrie. Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f454932b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
download.c
dlls/wineps.drv/download.c
+7
-10
No files found.
dlls/wineps.drv/download.c
View file @
586ae944
...
@@ -65,7 +65,7 @@ static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str
...
@@ -65,7 +65,7 @@ static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str
{
{
USHORT
count
,
i
;
USHORT
count
,
i
;
BYTE
*
strings
;
BYTE
*
strings
;
struct
struct
name_record
{
{
USHORT
platform_id
;
USHORT
platform_id
;
USHORT
encoding_id
;
USHORT
encoding_id
;
...
@@ -78,7 +78,7 @@ static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str
...
@@ -78,7 +78,7 @@ static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str
GetFontData
(
dev
->
hdc
,
MS_MAKE_TAG
(
'n'
,
'a'
,
'm'
,
'e'
),
0
,
name
,
size
);
GetFontData
(
dev
->
hdc
,
MS_MAKE_TAG
(
'n'
,
'a'
,
'm'
,
'e'
),
0
,
name
,
size
);
count
=
GET_BE_WORD
(
name
+
2
);
count
=
GET_BE_WORD
(
name
+
2
);
strings
=
name
+
GET_BE_WORD
(
name
+
4
);
strings
=
name
+
GET_BE_WORD
(
name
+
4
);
name_record
=
(
typeof
(
name_record
)
)(
name
+
6
);
name_record
=
(
struct
name_record
*
)(
name
+
6
);
for
(
i
=
0
;
i
<
count
;
i
++
,
name_record
++
)
for
(
i
=
0
;
i
<
count
;
i
++
,
name_record
++
)
{
{
name_record
->
platform_id
=
GET_BE_WORD
(
&
name_record
->
platform_id
);
name_record
->
platform_id
=
GET_BE_WORD
(
&
name_record
->
platform_id
);
...
@@ -687,7 +687,6 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
...
@@ -687,7 +687,6 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
DWORD
minMemType1
;
DWORD
minMemType1
;
DWORD
maxMemType1
;
DWORD
maxMemType1
;
}
*
post_header
;
}
*
post_header
;
BYTE
*
post
=
NULL
;
DWORD
size
;
DWORD
size
;
/* set a fallback name that is just 'g<index>' */
/* set a fallback name that is just 'g<index>' */
...
@@ -697,13 +696,11 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
...
@@ -697,13 +696,11 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
NULL
,
0
);
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
NULL
,
0
);
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
return
;
return
;
post
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
post_header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
post
)
if
(
!
post_header
)
return
;
return
;
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
post_header
,
size
);
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
post
,
size
);
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
goto
cleanup
;
goto
cleanup
;
post_header
=
(
typeof
(
post_header
))(
post
);
/* note: only interested in the format for obtaining glyph names */
/* note: only interested in the format for obtaining glyph names */
post_header
->
format
=
GET_BE_DWORD
(
&
post_header
->
format
);
post_header
->
format
=
GET_BE_DWORD
(
&
post_header
->
format
);
...
@@ -717,7 +714,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
...
@@ -717,7 +714,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
}
}
else
if
(
post_header
->
format
==
MAKELONG
(
0
,
2
))
else
if
(
post_header
->
format
==
MAKELONG
(
0
,
2
))
{
{
BYTE
*
post2header
=
post
+
sizeof
(
*
post_header
)
;
void
*
post2header
=
post_header
+
1
;
int
glyphNameIndex
;
int
glyphNameIndex
;
size
-=
sizeof
(
*
post_header
);
size
-=
sizeof
(
*
post_header
);
...
@@ -739,7 +736,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
...
@@ -739,7 +736,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
HIWORD
(
post_header
->
format
),
LOWORD
(
post_header
->
format
));
HIWORD
(
post_header
->
format
),
LOWORD
(
post_header
->
format
));
cleanup:
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
post
);
HeapFree
(
GetProcessHeap
(),
0
,
post
_header
);
}
}
/****************************************************************************
/****************************************************************************
...
...
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