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
72d9569c
Commit
72d9569c
authored
Dec 10, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Support the address-of operator in expressions.
parent
8ead7fe7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
0 deletions
+14
-0
header.c
tools/widl/header.c
+4
-0
parser.y
tools/widl/parser.y
+4
-0
typegen.c
tools/widl/typegen.c
+5
-0
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
tools/widl/header.c
View file @
72d9569c
...
...
@@ -483,6 +483,10 @@ void write_expr(FILE *h, const expr_t *e, int brackets)
write_expr
(
h
,
e
->
ext2
,
1
);
if
(
brackets
)
fprintf
(
h
,
")"
);
break
;
case
EXPR_ADDRESSOF
:
fprintf
(
h
,
"&"
);
write_expr
(
h
,
e
->
ref
,
1
);
break
;
}
}
...
...
tools/widl/parser.y
View file @
72d9569c
...
...
@@ -280,6 +280,7 @@ static void check_all_user_types(ifref_list_t *ifaces);
%right CAST
%right PPTR
%right NEG
%right ADDRESSOF
%%
...
...
@@ -612,6 +613,7 @@ expr: aNUM { $$ = make_exprl(EXPR_NUM, $1); }
| expr SHR expr { $$ = make_expr2(EXPR_SHR, $1, $3); }
| '~' expr { $$ = make_expr1(EXPR_NOT, $2); }
| '-' expr %prec NEG { $$ = make_expr1(EXPR_NEG, $2); }
| '&' expr %prec ADDRESSOF { $$ = make_expr1(EXPR_ADDRESSOF, $2); }
| '*' expr %prec PPTR { $$ = make_expr1(EXPR_PPTR, $2); }
| '(' type ')' expr %prec CAST { $$ = make_exprt(EXPR_CAST, $2, $4); }
| tSIZEOF '(' type ')' { $$ = make_exprt(EXPR_SIZEOF, $3, NULL); }
...
...
@@ -1138,6 +1140,8 @@ static expr_t *make_exprt(enum expr_type type, type_t *tref, expr_t *expr)
static expr_t *make_expr1(enum expr_type type, expr_t *expr)
{
expr_t *e;
if (type == EXPR_ADDRESSOF && expr->type != EXPR_IDENTIFIER)
error("address-of operator applied to invalid expression\n");
e = xmalloc(sizeof(expr_t));
e->type = type;
e->ref = expr;
...
...
tools/widl/typegen.c
View file @
72d9569c
...
...
@@ -288,6 +288,7 @@ static int compare_expr(const expr_t *a, const expr_t *b)
case
EXPR_NOT
:
case
EXPR_NEG
:
case
EXPR_PPTR
:
case
EXPR_ADDRESSOF
:
return
compare_expr
(
a
->
ref
,
b
->
ref
);
case
EXPR_SIZEOF
:
return
compare_type
(
a
->
u
.
tref
,
b
->
u
.
tref
);
...
...
@@ -3023,6 +3024,10 @@ static void write_struct_expr(FILE *h, const expr_t *e, int brackets,
write_struct_expr
(
h
,
e
->
ext2
,
1
,
fields
,
structvar
);
if
(
brackets
)
fprintf
(
h
,
")"
);
break
;
case
EXPR_ADDRESSOF
:
fprintf
(
h
,
"&"
);
write_struct_expr
(
h
,
e
->
ref
,
1
,
fields
,
structvar
);
break
;
}
}
...
...
tools/widl/widltypes.h
View file @
72d9569c
...
...
@@ -154,6 +154,7 @@ enum expr_type
EXPR_OR
,
EXPR_COND
,
EXPR_TRUEFALSE
,
EXPR_ADDRESSOF
,
};
enum
type_kind
...
...
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