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
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
Show 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
{
USHORT
count
,
i
;
BYTE
*
strings
;
struct
struct
name_record
{
USHORT
platform_id
;
USHORT
encoding_id
;
...
...
@@ -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
);
count
=
GET_BE_WORD
(
name
+
2
);
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
++
)
{
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)
DWORD
minMemType1
;
DWORD
maxMemType1
;
}
*
post_header
;
BYTE
*
post
=
NULL
;
DWORD
size
;
/* set a fallback name that is just 'g<index>' */
...
...
@@ -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
);
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
return
;
post
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
post
)
return
;
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
post
,
size
);
post_header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
post_header
)
return
;
size
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'p'
,
'o'
,
's'
,
't'
),
0
,
post_header
,
size
);
if
(
size
<
sizeof
(
*
post_header
)
||
size
==
GDI_ERROR
)
goto
cleanup
;
post_header
=
(
typeof
(
post_header
))(
post
);
/* note: only interested in the format for obtaining glyph names */
post_header
->
format
=
GET_BE_DWORD
(
&
post_header
->
format
);
...
...
@@ -717,7 +714,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
}
else
if
(
post_header
->
format
==
MAKELONG
(
0
,
2
))
{
BYTE
*
post2header
=
post
+
sizeof
(
*
post_header
)
;
void
*
post2header
=
post_header
+
1
;
int
glyphNameIndex
;
size
-=
sizeof
(
*
post_header
);
...
...
@@ -739,7 +736,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
HIWORD
(
post_header
->
format
),
LOWORD
(
post_header
->
format
));
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