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
064775c9
Commit
064775c9
authored
Jul 03, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Struct alignment should be the largest alignment of all the struct members.
parent
fc7681a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
typegen.c
tools/widl/typegen.c
+5
-12
No files found.
tools/widl/typegen.c
View file @
064775c9
...
@@ -1083,7 +1083,6 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *structure,
...
@@ -1083,7 +1083,6 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *structure,
static
unsigned
int
fields_memsize
(
const
var_list_t
*
fields
,
unsigned
int
*
align
)
static
unsigned
int
fields_memsize
(
const
var_list_t
*
fields
,
unsigned
int
*
align
)
{
{
int
have_align
=
FALSE
;
unsigned
int
size
=
0
;
unsigned
int
size
=
0
;
const
var_t
*
v
;
const
var_t
*
v
;
...
@@ -1092,11 +1091,7 @@ static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align
...
@@ -1092,11 +1091,7 @@ static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align
{
{
unsigned
int
falign
=
0
;
unsigned
int
falign
=
0
;
unsigned
int
fsize
=
type_memsize
(
v
->
type
,
&
falign
);
unsigned
int
fsize
=
type_memsize
(
v
->
type
,
&
falign
);
if
(
!
have_align
)
if
(
*
align
<
falign
)
*
align
=
falign
;
{
*
align
=
falign
;
have_align
=
TRUE
;
}
size
=
ROUND_SIZE
(
size
,
falign
);
size
=
ROUND_SIZE
(
size
,
falign
);
size
+=
fsize
;
size
+=
fsize
;
}
}
...
@@ -1128,7 +1123,7 @@ static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
...
@@ -1128,7 +1123,7 @@ static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
int
get_padding
(
const
var_list_t
*
fields
)
int
get_padding
(
const
var_list_t
*
fields
)
{
{
unsigned
short
offset
=
0
;
unsigned
short
offset
=
0
;
int
salign
=
-
1
;
unsigned
int
salign
=
1
;
const
var_t
*
f
;
const
var_t
*
f
;
if
(
!
fields
)
if
(
!
fields
)
...
@@ -1139,8 +1134,7 @@ int get_padding(const var_list_t *fields)
...
@@ -1139,8 +1134,7 @@ int get_padding(const var_list_t *fields)
type_t
*
ft
=
f
->
type
;
type_t
*
ft
=
f
->
type
;
unsigned
int
align
=
0
;
unsigned
int
align
=
0
;
unsigned
int
size
=
type_memsize
(
ft
,
&
align
);
unsigned
int
size
=
type_memsize
(
ft
,
&
align
);
if
(
salign
==
-
1
)
if
(
align
>
salign
)
salign
=
align
;
salign
=
align
;
offset
=
ROUND_SIZE
(
offset
,
align
);
offset
=
ROUND_SIZE
(
offset
,
align
);
offset
+=
size
;
offset
+=
size
;
}
}
...
@@ -2202,7 +2196,7 @@ static void write_struct_members(FILE *file, const type_t *type,
...
@@ -2202,7 +2196,7 @@ static void write_struct_members(FILE *file, const type_t *type,
{
{
const
var_t
*
field
;
const
var_t
*
field
;
unsigned
short
offset
=
0
;
unsigned
short
offset
=
0
;
int
salign
=
-
1
;
unsigned
int
salign
=
1
;
int
padding
;
int
padding
;
var_list_t
*
fields
=
type_struct_get_fields
(
type
);
var_list_t
*
fields
=
type_struct_get_fields
(
type
);
...
@@ -2213,8 +2207,7 @@ static void write_struct_members(FILE *file, const type_t *type,
...
@@ -2213,8 +2207,7 @@ static void write_struct_members(FILE *file, const type_t *type,
{
{
unsigned
int
align
=
0
;
unsigned
int
align
=
0
;
unsigned
int
size
=
type_memsize
(
ft
,
&
align
);
unsigned
int
size
=
type_memsize
(
ft
,
&
align
);
if
(
salign
==
-
1
)
if
(
salign
<
align
)
salign
=
align
;
salign
=
align
;
if
((
align
-
1
)
&
offset
)
if
((
align
-
1
)
&
offset
)
{
{
unsigned
char
fc
=
0
;
unsigned
char
fc
=
0
;
...
...
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