mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[qfcc] Support uint and enum in expr_int
Signed or unsigned isn't that important for internal errors.
This commit is contained in:
parent
332c991064
commit
3a521ebe16
1 changed files with 5 additions and 4 deletions
|
@ -1235,10 +1235,11 @@ expr_int (const expr_t *e)
|
||||||
if (e->type == ex_value && e->value->lltype == ev_short) {
|
if (e->type == ex_value && e->value->lltype == ev_short) {
|
||||||
return e->value->short_val;
|
return e->value->short_val;
|
||||||
}
|
}
|
||||||
if (e->type == ex_symbol && e->symbol->sy_type == sy_const
|
if (e->type == ex_symbol && e->symbol->sy_type == sy_const) {
|
||||||
&& (e->symbol->type->type == ev_int
|
auto type = e->symbol->type;
|
||||||
|| is_enum (e->symbol->type))) {
|
if (!is_long (type) && !is_ulong (type) && is_integral (type)) {
|
||||||
return e->symbol->value->int_val;
|
return e->symbol->value->int_val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (e->type == ex_symbol && e->symbol->sy_type == sy_def
|
if (e->type == ex_symbol && e->symbol->sy_type == sy_def
|
||||||
&& e->symbol->def->constant
|
&& e->symbol->def->constant
|
||||||
|
|
Loading…
Reference in a new issue