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
9b810cd6
Commit
9b810cd6
authored
Oct 28, 2014
by
André Hentschel
Committed by
Alexandre Julliard
Oct 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Remove duplicate code (PVS-Studio).
parent
88e81025
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
117 deletions
+61
-117
genres.c
tools/wrc/genres.c
+61
-117
No files found.
tools/wrc/genres.c
View file @
9b810cd6
...
...
@@ -960,86 +960,48 @@ static res_t *cursorgroup2res(name_id_t *name, cursor_group_t *curg)
res
=
new_res
();
restag
=
put_res_header
(
res
,
WRC_RT_GROUP_CURSOR
,
NULL
,
name
,
curg
->
memopt
,
&
(
curg
->
lvc
));
if
(
win32
)
{
put_word
(
res
,
0
);
/* Reserved */
/* FIXME: The ResType in the NEWHEADER structure should
* contain 14 according to the MS win32 doc. This is
* not the case with the BRC compiler and I really doubt
* the latter. Putting one here is compliant to win16 spec,
* but who knows the true value?
*/
put_word
(
res
,
2
);
/* ResType */
put_word
(
res
,
curg
->
ncursor
);
#if 0
for(cur = curg->cursorlist; cur; cur = cur->next)
#else
cur
=
curg
->
cursorlist
;
while
(
cur
->
next
)
cur
=
cur
->
next
;
for
(;
cur
;
cur
=
cur
->
prev
)
#endif
{
put_word
(
res
,
cur
->
width
);
/* FIXME: The height of a cursor is half the size of
* the bitmap's height. BRC puts the height from the
* BITMAPINFOHEADER here instead of the cursorfile's
* height. MS doesn't seem to care...
*/
put_word
(
res
,
cur
->
height
);
/* FIXME: The next two are reversed in BRC and I don't
* know why. Probably a bug. But, we can safely ignore
* it because win16 does not support color cursors.
* A warning should have been generated by the parser.
*/
put_word
(
res
,
cur
->
planes
);
put_word
(
res
,
cur
->
bits
);
/* FIXME: The +4 is the hotspot in the cursor resource.
* However, I could not find this in the documentation.
* The hotspot bytes must either be included or MS
* doesn't care.
*/
put_dword
(
res
,
cur
->
data
->
size
+
4
);
put_word
(
res
,
cur
->
id
);
}
}
else
/* win16 */
{
put_word
(
res
,
0
);
/* Reserved */
put_word
(
res
,
2
);
/* ResType */
put_word
(
res
,
curg
->
ncursor
);
put_word
(
res
,
0
);
/* Reserved */
/* FIXME: The ResType in the NEWHEADER structure should
* contain 14 according to the MS win32 doc. This is
* not the case with the BRC compiler and I really doubt
* the latter. Putting one here is compliant to win16 spec,
* but who knows the true value?
*/
put_word
(
res
,
2
);
/* ResType */
put_word
(
res
,
curg
->
ncursor
);
#if 0
for(cur = curg->cursorlist; cur; cur = cur->next)
for(cur = curg->cursorlist; cur; cur = cur->next)
#else
cur
=
curg
->
cursorlist
;
while
(
cur
->
next
)
cur
=
cur
->
next
;
for
(;
cur
;
cur
=
cur
->
prev
)
cur
=
curg
->
cursorlist
;
while
(
cur
->
next
)
cur
=
cur
->
next
;
for
(;
cur
;
cur
=
cur
->
prev
)
#endif
{
put_word
(
res
,
cur
->
width
);
/* FIXME: The height of a cursor is half the size of
* the bitmap's height. BRC puts the height from the
* BITMAPINFOHEADER here instead of the cursorfile's
* height. MS doesn't seem to care...
*/
put_word
(
res
,
cur
->
height
);
/* FIXME: The next two are reversed in BRC and I don't
* know why. Probably a bug. But, we can safely ignore
* it because win16 does not support color cursors.
* A warning should have been generated by the parser.
*/
put_word
(
res
,
cur
->
planes
);
put_word
(
res
,
cur
->
bits
);
/* FIXME: The +4 is the hotspot in the cursor resource.
* However, I could not find this in the documentation.
* The hotspot bytes must either be included or MS
* doesn't care.
*/
put_dword
(
res
,
cur
->
data
->
size
+
4
);
put_word
(
res
,
cur
->
id
);
}
}
{
put_word
(
res
,
cur
->
width
);
/* FIXME: The height of a cursor is half the size of
* the bitmap's height. BRC puts the height from the
* BITMAPINFOHEADER here instead of the cursorfile's
* height. MS doesn't seem to care...
*/
put_word
(
res
,
cur
->
height
);
/* FIXME: The next two are reversed in BRC and I don't
* know why. Probably a bug. But, we can safely ignore
* it because win16 does not support color cursors.
* A warning should have been generated by the parser.
*/
put_word
(
res
,
cur
->
planes
);
put_word
(
res
,
cur
->
bits
);
/* FIXME: The +4 is the hotspot in the cursor resource.
* However, I could not find this in the documentation.
* The hotspot bytes must either be included or MS
* doesn't care.
*/
put_dword
(
res
,
cur
->
data
->
size
+
4
);
put_word
(
res
,
cur
->
id
);
}
SetResSize
(
res
,
restag
);
/* Set ResourceSize */
if
(
win32
)
put_pad
(
res
);
...
...
@@ -1103,46 +1065,28 @@ static res_t *icongroup2res(name_id_t *name, icon_group_t *icog)
res
=
new_res
();
restag
=
put_res_header
(
res
,
WRC_RT_GROUP_ICON
,
NULL
,
name
,
icog
->
memopt
,
&
(
icog
->
lvc
));
if
(
win32
)
{
put_word
(
res
,
0
);
/* Reserved */
/* FIXME: The ResType in the NEWHEADER structure should
* contain 14 according to the MS win32 doc. This is
* not the case with the BRC compiler and I really doubt
* the latter. Putting one here is compliant to win16 spec,
* but who knows the true value?
*/
put_word
(
res
,
1
);
/* ResType */
put_word
(
res
,
icog
->
nicon
);
for
(
ico
=
icog
->
iconlist
;
ico
;
ico
=
ico
->
next
)
{
put_byte
(
res
,
ico
->
width
);
put_byte
(
res
,
ico
->
height
);
put_byte
(
res
,
ico
->
nclr
);
put_byte
(
res
,
0
);
/* Reserved */
put_word
(
res
,
ico
->
planes
);
put_word
(
res
,
ico
->
bits
);
put_dword
(
res
,
ico
->
data
->
size
);
put_word
(
res
,
ico
->
id
);
}
}
else
/* win16 */
{
put_word
(
res
,
0
);
/* Reserved */
put_word
(
res
,
1
);
/* ResType */
put_word
(
res
,
icog
->
nicon
);
for
(
ico
=
icog
->
iconlist
;
ico
;
ico
=
ico
->
next
)
{
put_byte
(
res
,
ico
->
width
);
put_byte
(
res
,
ico
->
height
);
put_byte
(
res
,
ico
->
nclr
);
put_byte
(
res
,
0
);
/* Reserved */
put_word
(
res
,
ico
->
planes
);
put_word
(
res
,
ico
->
bits
);
put_dword
(
res
,
ico
->
data
->
size
);
put_word
(
res
,
ico
->
id
);
}
}
put_word
(
res
,
0
);
/* Reserved */
/* FIXME: The ResType in the NEWHEADER structure should
* contain 14 according to the MS win32 doc. This is
* not the case with the BRC compiler and I really doubt
* the latter. Putting one here is compliant to win16 spec,
* but who knows the true value?
*/
put_word
(
res
,
1
);
/* ResType */
put_word
(
res
,
icog
->
nicon
);
for
(
ico
=
icog
->
iconlist
;
ico
;
ico
=
ico
->
next
)
{
put_byte
(
res
,
ico
->
width
);
put_byte
(
res
,
ico
->
height
);
put_byte
(
res
,
ico
->
nclr
);
put_byte
(
res
,
0
);
/* Reserved */
put_word
(
res
,
ico
->
planes
);
put_word
(
res
,
ico
->
bits
);
put_dword
(
res
,
ico
->
data
->
size
);
put_word
(
res
,
ico
->
id
);
}
SetResSize
(
res
,
restag
);
/* Set ResourceSize */
if
(
win32
)
put_pad
(
res
);
...
...
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