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
16d4e712
Commit
16d4e712
authored
Aug 15, 2006
by
Dan Hipschman
Committed by
Alexandre Julliard
Aug 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Calculate method indices in parser instead of during header generation.
parent
e86828a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
header.c
tools/widl/header.c
+3
-9
parser.y
tools/widl/parser.y
+28
-0
No files found.
tools/widl/header.c
View file @
16d4e712
...
...
@@ -572,15 +572,13 @@ const var_t *is_callas(const attr_t *a)
return
get_attrp
(
a
,
ATTR_CALLAS
);
}
static
int
write_method_macro
(
const
type_t
*
iface
,
const
char
*
name
)
static
void
write_method_macro
(
const
type_t
*
iface
,
const
char
*
name
)
{
int
idx
;
func_t
*
cur
=
iface
->
funcs
;
if
(
iface
->
ref
)
idx
=
write_method_macro
(
iface
->
ref
,
name
);
else
idx
=
0
;
if
(
iface
->
ref
)
write_method_macro
(
iface
->
ref
,
name
);
if
(
!
cur
)
return
idx
;
if
(
!
cur
)
return
;
while
(
NEXT_LINK
(
cur
))
cur
=
NEXT_LINK
(
cur
);
fprintf
(
header
,
"/*** %s methods ***/
\n
"
,
iface
->
name
);
...
...
@@ -608,13 +606,9 @@ static int write_method_macro(const type_t *iface, const char *name)
for
(
c
=
0
;
c
<
argc
;
c
++
)
fprintf
(
header
,
",%c"
,
c
+
'a'
);
fprintf
(
header
,
")
\n
"
);
if
(
cur
->
idx
==
-
1
)
cur
->
idx
=
idx
;
else
if
(
cur
->
idx
!=
idx
)
yyerror
(
"BUG: method index mismatch in write_method_macro"
);
idx
++
;
}
cur
=
PREV_LINK
(
cur
);
}
return
idx
;
}
void
write_args
(
FILE
*
h
,
var_t
*
arg
,
const
char
*
name
,
int
method
,
int
do_indent
)
...
...
tools/widl/parser.y
View file @
16d4e712
...
...
@@ -101,6 +101,8 @@ static void write_clsid(type_t *cls);
static void write_diid(type_t *iface);
static void write_iid(type_t *iface);
static int compute_method_indexes(type_t *iface);
#define tsENUM 1
#define tsSTRUCT 2
#define tsUNION 3
...
...
@@ -711,6 +713,7 @@ dispinterfacedef: dispinterfacehdr '{'
}
/* FIXME: not sure how to handle this yet
| dispinterfacehdr '{' interface '}' { $$ = $1;
compute_method_indexes($$);
if (!parse_only && do_header) write_interface($$);
if (!parse_only && do_idfile) write_iid($$);
}
...
...
@@ -737,6 +740,7 @@ interfacedef: interfacehdr inherit
'{' int_statements '}' { $$ = $1;
$$->ref = $2;
$$->funcs = $4;
compute_method_indexes($$);
if (!parse_only && do_header) write_interface($$);
if (!parse_only && do_idfile) write_iid($$);
}
...
...
@@ -747,6 +751,7 @@ interfacedef: interfacehdr inherit
$$->ref = find_type2($3, 0);
if (!$$->ref) yyerror("base class '%s' not found in import", $3);
$$->funcs = $6;
compute_method_indexes($$);
if (!parse_only && do_header) write_interface($$);
if (!parse_only && do_idfile) write_iid($$);
}
...
...
@@ -1539,3 +1544,26 @@ static void write_iid(type_t *iface)
const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
write_guid(idfile, "IID", iface->name, uuid);
}
static int compute_method_indexes(type_t *iface)
{
int idx;
func_t *f = iface->funcs;
if (iface->ref)
idx = compute_method_indexes(iface->ref);
else
idx = 0;
if (! f)
return idx;
while (NEXT_LINK(f))
f = NEXT_LINK(f);
for ( ; f ; f = PREV_LINK(f))
if (! is_callas(f->def->attrs))
f->idx = idx++;
return idx;
}
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