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
2226ddca
Commit
2226ddca
authored
Oct 08, 2007
by
Dan Hipschman
Committed by
Alexandre Julliard
Oct 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Keep track of every allocated type_t to simplify set_all_tfswrite.
parent
24ce74e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
49 deletions
+27
-49
parser.y
tools/widl/parser.y
+22
-1
typegen.c
tools/widl/typegen.c
+2
-47
typelib.c
tools/widl/typelib.c
+1
-1
widltypes.h
tools/widl/widltypes.h
+2
-0
No files found.
tools/widl/parser.y
View file @
2226ddca
...
...
@@ -1249,9 +1249,30 @@ static array_dims_t *append_array(array_dims_t *list, expr_t *expr)
return list;
}
static struct list type_pool = LIST_INIT(type_pool);
typedef struct
{
type_t data;
struct list link;
} type_pool_node_t;
type_t *alloc_type(void)
{
type_pool_node_t *node = xmalloc(sizeof *node);
list_add_tail(&type_pool, &node->link);
return &node->data;
}
void set_all_tfswrite(int val)
{
type_pool_node_t *node;
LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link)
node->data.tfswrite = val;
}
static type_t *make_type(unsigned char type, type_t *ref)
{
type_t *t =
xmalloc(sizeof(type_t)
);
type_t *t =
alloc_type(
);
t->name = NULL;
t->kind = TKIND_PRIMITIVE;
t->type = type;
...
...
tools/widl/typegen.c
View file @
2226ddca
...
...
@@ -2095,36 +2095,6 @@ static size_t write_typeformatstring_var(FILE *file, int indent, const func_t *f
offset
,
typeformat_offset
);
}
static
void
set_tfswrite
(
type_t
*
type
,
int
val
)
{
while
(
type
->
tfswrite
!=
val
)
{
type_t
*
utype
=
get_user_type
(
type
,
NULL
);
type
->
tfswrite
=
val
;
if
(
utype
)
set_tfswrite
(
utype
,
val
);
if
(
type
->
kind
==
TKIND_ALIAS
)
type
=
type
->
orig
;
else
if
(
is_ptr
(
type
)
||
is_array
(
type
))
type
=
type
->
ref
;
else
{
if
(
type
->
fields
)
{
var_t
*
v
;
LIST_FOR_EACH_ENTRY
(
v
,
type
->
fields
,
var_t
,
entry
)
if
(
v
->
type
)
set_tfswrite
(
v
->
type
,
val
);
}
return
;
}
}
}
static
int
write_embedded_types
(
FILE
*
file
,
const
attr_list_t
*
attrs
,
type_t
*
type
,
const
char
*
name
,
int
write_ptr
,
unsigned
int
*
tfsoff
)
{
...
...
@@ -2180,21 +2150,6 @@ static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *ty
return
retmask
;
}
static
void
set_all_tfswrite
(
const
ifref_list_t
*
ifaces
,
int
val
)
{
const
ifref_t
*
iface
;
const
func_t
*
func
;
const
var_t
*
var
;
if
(
ifaces
)
LIST_FOR_EACH_ENTRY
(
iface
,
ifaces
,
const
ifref_t
,
entry
)
if
(
iface
->
iface
->
funcs
)
LIST_FOR_EACH_ENTRY
(
func
,
iface
->
iface
->
funcs
,
const
func_t
,
entry
)
if
(
func
->
args
)
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
set_tfswrite
(
var
->
type
,
val
);
}
static
size_t
process_tfs
(
FILE
*
file
,
const
ifref_list_t
*
ifaces
,
int
for_objects
)
{
const
var_t
*
var
;
...
...
@@ -2242,7 +2197,7 @@ void write_typeformatstring(FILE *file, const ifref_list_t *ifaces, int for_obje
indent
++
;
print_file
(
file
,
indent
,
"NdrFcShort(0x0),
\n
"
);
set_all_tfswrite
(
ifaces
,
TRUE
);
set_all_tfswrite
(
TRUE
);
process_tfs
(
file
,
ifaces
,
for_objects
);
print_file
(
file
,
indent
,
"0x0
\n
"
);
...
...
@@ -2859,7 +2814,7 @@ size_t get_size_procformatstring(const ifref_list_t *ifaces, int for_objects)
size_t
get_size_typeformatstring
(
const
ifref_list_t
*
ifaces
,
int
for_objects
)
{
set_all_tfswrite
(
ifaces
,
FALSE
);
set_all_tfswrite
(
FALSE
);
return
process_tfs
(
NULL
,
ifaces
,
for_objects
);
}
...
...
tools/widl/typelib.c
View file @
2226ddca
...
...
@@ -52,7 +52,7 @@ static typelib_t *typelib;
type_t
*
duptype
(
type_t
*
t
,
int
dupname
)
{
type_t
*
d
=
xmalloc
(
sizeof
*
d
);
type_t
*
d
=
alloc_type
(
);
*
d
=
*
t
;
if
(
dupname
&&
t
->
name
)
...
...
tools/widl/widltypes.h
View file @
2226ddca
...
...
@@ -313,6 +313,8 @@ extern user_type_list_t user_type_list;
void
check_for_user_types_and_context_handles
(
const
var_list_t
*
list
);
void
init_types
(
void
);
type_t
*
alloc_type
(
void
);
void
set_all_tfswrite
(
int
val
);
type_t
*
duptype
(
type_t
*
t
,
int
dupname
);
type_t
*
alias
(
type_t
*
t
,
const
char
*
name
);
...
...
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