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
513996fd
Commit
513996fd
authored
Jan 31, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Do constant folding for the sizeof operator on simple types.
parent
0a2c5b73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
parser.y
tools/widl/parser.y
+29
-0
No files found.
tools/widl/parser.y
View file @
513996fd
...
...
@@ -877,6 +877,35 @@ static expr_t *make_exprt(enum expr_type type, typeref_t *tref, expr_t *expr)
e->is_const = FALSE;
INIT_LINK(e);
/* check for cast of constant expression */
if (type == EXPR_SIZEOF) {
switch (tref->ref->type) {
case RPC_FC_BYTE:
case RPC_FC_CHAR:
case RPC_FC_SMALL:
case RPC_FC_USMALL:
e->is_const = TRUE;
e->cval = 1;
break;
case RPC_FC_WCHAR:
case RPC_FC_USHORT:
case RPC_FC_SHORT:
e->is_const = TRUE;
e->cval = 2;
break;
case RPC_FC_LONG:
case RPC_FC_ULONG:
case RPC_FC_FLOAT:
case RPC_FC_ERROR_STATUS_T:
e->is_const = TRUE;
e->cval = 4;
break;
case RPC_FC_HYPER:
case RPC_FC_DOUBLE:
e->is_const = TRUE;
e->cval = 8;
break;
}
}
if (type == EXPR_CAST && expr->is_const) {
e->is_const = TRUE;
e->cval = expr->cval;
...
...
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