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
50e54c0c
Commit
50e54c0c
authored
Jun 23, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Factor out the finding of a registered type to reduce code duplication.
parent
e8a023f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
parser.y
tools/widl/parser.y
+15
-16
No files found.
tools/widl/parser.y
View file @
50e54c0c
...
...
@@ -1900,16 +1900,22 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
return type;
}
type_t *find_type
(const char *name, int t)
static type_t *find_type_helper
(const char *name, int t)
{
struct rtype *cur = type_hash[hash_ident(name)];
while (cur && (cur->t != t || strcmp(cur->name, name)))
cur = cur->next;
if (!cur) {
return cur ? cur->type : NULL;
}
type_t *find_type(const char *name, int t)
{
type_t *type = find_type_helper(name, t);
if (!type) {
error_loc("type '%s' not found\n", name);
return NULL;
}
return
cur->
type;
return type;
}
static type_t *find_type2(char *name, int t)
...
...
@@ -1921,25 +1927,18 @@ static type_t *find_type2(char *name, int t)
int is_type(const char *name)
{
struct rtype *cur = type_hash[hash_ident(name)];
while (cur && (cur->t || strcmp(cur->name, name)))
cur = cur->next;
if (cur) return TRUE;
return FALSE;
return find_type_helper(name, 0) != NULL;
}
static type_t *get_type(unsigned char type, char *name, int t)
{
struct rtype *cur = NULL;
type_t *tp;
if (name) {
cur = type_hash[hash_ident(name)];
while (cur && (cur->t != t || strcmp(cur->name, name)))
cur = cur->next;
}
if (cur) {
free(name);
return cur->type;
tp = find_type_helper(name, t);
if (tp) {
free(name);
return tp;
}
}
tp = make_type(type, NULL);
tp->name = 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