From 756d33ddae316c71b1241e7c8684c07cd82b9e05 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 23 Nov 2012 17:39:55 +0100 Subject: [PATCH] widl: Print large enum constants in hex. --- tools/widl/parser.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 616a538ae9d..9c2281f9970 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -620,7 +620,10 @@ enum_list: enum { if (!$1->eval) | enum_list ',' enum { if (!$3->eval) { var_t *last = LIST_ENTRY( list_tail($$), var_t, entry ); - $3->eval = make_exprl(EXPR_NUM, last->eval->cval + 1); + enum expr_type type = EXPR_NUM; + if (last->eval->type == EXPR_HEXNUM) type = EXPR_HEXNUM; + if (last->eval->cval + 1 < 0) type = EXPR_HEXNUM; + $3->eval = make_exprl(type, last->eval->cval + 1); } $$ = append_var( $1, $3 ); }