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
942ec30a
Commit
942ec30a
authored
Oct 16, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Use write_pointer_description_offsets() to output no_repeat descriptors for consistency.
parent
916461d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
81 deletions
+52
-81
typegen.c
tools/widl/typegen.c
+52
-81
No files found.
tools/widl/typegen.c
View file @
942ec30a
...
...
@@ -1614,87 +1614,6 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff)
}
}
static
int
write_no_repeat_pointer_descriptions
(
FILE
*
file
,
const
attr_list_t
*
attrs
,
type_t
*
type
,
unsigned
int
*
offset_in_memory
,
unsigned
int
*
offset_in_buffer
,
unsigned
int
*
typestring_offset
)
{
int
written
=
0
;
unsigned
int
align
;
if
(
is_ptr
(
type
)
||
(
is_conformant_array
(
type
)
&&
type_array_is_decl_as_ptr
(
type
)))
{
unsigned
int
memsize
;
print_file
(
file
,
2
,
"0x%02x, /* FC_NO_REPEAT */
\n
"
,
RPC_FC_NO_REPEAT
);
print_file
(
file
,
2
,
"0x%02x, /* FC_PAD */
\n
"
,
RPC_FC_PAD
);
/* pointer instance */
print_file
(
file
,
2
,
"NdrFcShort(0x%hx),
\t
/* Memory offset = %d */
\n
"
,
*
offset_in_memory
,
*
offset_in_memory
);
print_file
(
file
,
2
,
"NdrFcShort(0x%hx),
\t
/* Buffer offset = %d */
\n
"
,
*
offset_in_buffer
,
*
offset_in_buffer
);
*
typestring_offset
+=
6
;
if
(
is_ptr
(
type
))
{
if
(
is_string_type
(
attrs
,
type
))
write_string_tfs
(
file
,
attrs
,
type
,
FALSE
,
NULL
,
typestring_offset
);
else
write_pointer_tfs
(
file
,
attrs
,
type
,
FALSE
,
typestring_offset
);
}
else
{
unsigned
int
offset
=
type
->
typestring_offset
;
/* skip over the pointer that is written for strings, since a
* pointer has to be written in-place here */
if
(
is_string_type
(
attrs
,
type
))
offset
+=
4
;
write_nonsimple_pointer
(
file
,
attrs
,
type
,
FALSE
,
offset
,
typestring_offset
);
}
align
=
0
;
memsize
=
type_memsize
(
type
,
&
align
);
*
offset_in_memory
+=
memsize
;
/* increment these separately as in the case of conformant (varying)
* structures these start at different values */
*
offset_in_buffer
+=
memsize
;
return
1
;
}
if
(
is_non_complex_struct
(
type
))
{
const
var_t
*
v
;
LIST_FOR_EACH_ENTRY
(
v
,
type_struct_get_fields
(
type
),
const
var_t
,
entry
)
{
if
(
offset_in_memory
&&
offset_in_buffer
)
{
unsigned
int
padding
;
align
=
0
;
type_memsize
(
v
->
type
,
&
align
);
padding
=
ROUNDING
(
*
offset_in_memory
,
align
);
*
offset_in_memory
+=
padding
;
*
offset_in_buffer
+=
padding
;
}
written
+=
write_no_repeat_pointer_descriptions
(
file
,
v
->
attrs
,
v
->
type
,
offset_in_memory
,
offset_in_buffer
,
typestring_offset
);
}
}
else
{
unsigned
int
memsize
;
align
=
0
;
memsize
=
type_memsize
(
type
,
&
align
);
*
offset_in_memory
+=
memsize
;
/* increment these separately as in the case of conformant (varying)
* structures these start at different values */
*
offset_in_buffer
+=
memsize
;
}
return
written
;
}
static
int
write_pointer_description_offsets
(
FILE
*
file
,
const
attr_list_t
*
attrs
,
type_t
*
type
,
unsigned
int
*
offset_in_memory
,
unsigned
int
*
offset_in_buffer
,
...
...
@@ -1793,6 +1712,58 @@ static int write_pointer_description_offsets(
return
written
;
}
static
int
write_no_repeat_pointer_descriptions
(
FILE
*
file
,
const
attr_list_t
*
attrs
,
type_t
*
type
,
unsigned
int
*
offset_in_memory
,
unsigned
int
*
offset_in_buffer
,
unsigned
int
*
typestring_offset
)
{
int
written
=
0
;
unsigned
int
align
;
if
(
is_ptr
(
type
)
||
(
is_conformant_array
(
type
)
&&
type_array_is_decl_as_ptr
(
type
)))
{
print_file
(
file
,
2
,
"0x%02x, /* FC_NO_REPEAT */
\n
"
,
RPC_FC_NO_REPEAT
);
print_file
(
file
,
2
,
"0x%02x, /* FC_PAD */
\n
"
,
RPC_FC_PAD
);
*
typestring_offset
+=
2
;
return
write_pointer_description_offsets
(
file
,
attrs
,
type
,
offset_in_memory
,
offset_in_buffer
,
typestring_offset
);
}
if
(
is_non_complex_struct
(
type
))
{
const
var_t
*
v
;
LIST_FOR_EACH_ENTRY
(
v
,
type_struct_get_fields
(
type
),
const
var_t
,
entry
)
{
if
(
offset_in_memory
&&
offset_in_buffer
)
{
unsigned
int
padding
;
align
=
0
;
type_memsize
(
v
->
type
,
&
align
);
padding
=
ROUNDING
(
*
offset_in_memory
,
align
);
*
offset_in_memory
+=
padding
;
*
offset_in_buffer
+=
padding
;
}
written
+=
write_no_repeat_pointer_descriptions
(
file
,
v
->
attrs
,
v
->
type
,
offset_in_memory
,
offset_in_buffer
,
typestring_offset
);
}
}
else
{
unsigned
int
memsize
;
align
=
0
;
memsize
=
type_memsize
(
type
,
&
align
);
*
offset_in_memory
+=
memsize
;
/* increment these separately as in the case of conformant (varying)
* structures these start at different values */
*
offset_in_buffer
+=
memsize
;
}
return
written
;
}
/* Note: if file is NULL return value is number of pointers to write, else
* it is the number of type format characters written */
static
int
write_fixed_array_pointer_descriptions
(
...
...
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