mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 04:48:36 +00:00
widl: Respect u and l modifiers in expressions.
This commit is contained in:
parent
e261f187ad
commit
53c70aec87
|
@ -512,7 +512,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
|
|||
case EXPR_NUM:
|
||||
case EXPR_TRUEFALSE:
|
||||
result.is_temporary = FALSE;
|
||||
result.type = type_new_int(TYPE_BASIC_INT, 0);
|
||||
result.type = type_new_int(e->u.integer.is_long ? TYPE_BASIC_LONG : TYPE_BASIC_INT, e->u.integer.is_unsigned);
|
||||
break;
|
||||
case EXPR_STRLIT:
|
||||
result.is_temporary = TRUE;
|
||||
|
@ -690,6 +690,10 @@ void write_expr(FILE *h, const expr_t *e, int brackets,
|
|||
fprintf(h, "0x%x", e->u.integer.value);
|
||||
else
|
||||
fprintf(h, "%u", e->u.integer.value);
|
||||
if (e->u.integer.is_unsigned)
|
||||
fprintf(h, "u");
|
||||
if (e->u.integer.is_long)
|
||||
fprintf(h, "l");
|
||||
break;
|
||||
case EXPR_DOUBLE:
|
||||
fprintf(h, "%#.15g", e->u.dval);
|
||||
|
|
|
@ -158,6 +158,8 @@ static int token_num( const char *yytext, YYSTYPE *yylval, int is_hex )
|
|||
{
|
||||
yylval->integer.value = xstrtoul( yytext, NULL, 0 );
|
||||
yylval->integer.is_hex = is_hex;
|
||||
yylval->integer.is_long = !!strchr(yytext, 'l');
|
||||
yylval->integer.is_unsigned = !!strchr(yytext, 'u');
|
||||
return is_hex ? aHEXNUM : aNUM;
|
||||
}
|
||||
|
||||
|
|
|
@ -351,6 +351,8 @@ struct _attr_t {
|
|||
struct integer
|
||||
{
|
||||
int value;
|
||||
int is_unsigned;
|
||||
int is_long;
|
||||
int is_hex;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue