From 3a521ebe16406a6dab4d9001d66f5a714208494f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 20 Jan 2025 11:24:01 +0900 Subject: [PATCH] [qfcc] Support uint and enum in expr_int Signed or unsigned isn't that important for internal errors. --- tools/qfcc/source/expr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 6a3c9cba8..efdc189d7 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -1235,10 +1235,11 @@ expr_int (const expr_t *e) if (e->type == ex_value && e->value->lltype == ev_short) { return e->value->short_val; } - if (e->type == ex_symbol && e->symbol->sy_type == sy_const - && (e->symbol->type->type == ev_int - || is_enum (e->symbol->type))) { - return e->symbol->value->int_val; + if (e->type == ex_symbol && e->symbol->sy_type == sy_const) { + auto type = e->symbol->type; + if (!is_long (type) && !is_ulong (type) && is_integral (type)) { + return e->symbol->value->int_val; + } } if (e->type == ex_symbol && e->symbol->sy_type == sy_def && e->symbol->def->constant