mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[qfcc] Support def exprs in integral value extractors
This commit is contained in:
parent
e4a403bbb3
commit
80967e1471
1 changed files with 11 additions and 0 deletions
|
@ -1049,7 +1049,10 @@ is_integer_val (expr_t *e)
|
||||||
&& is_integral (e->e.symbol->type)) {
|
&& is_integral (e->e.symbol->type)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (e->type == ex_def && e->e.def->constant
|
||||||
|
&& is_integral (e->e.def->type)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,6 +1075,10 @@ expr_integer (expr_t *e)
|
||||||
&& is_integral (e->e.symbol->s.def->type)) {
|
&& is_integral (e->e.symbol->s.def->type)) {
|
||||||
return D_INT (e->e.symbol->s.def);
|
return D_INT (e->e.symbol->s.def);
|
||||||
}
|
}
|
||||||
|
if (e->type == ex_def && e->e.def->constant
|
||||||
|
&& is_integral (e->e.def->type)) {
|
||||||
|
return D_INT (e->e.def);
|
||||||
|
}
|
||||||
internal_error (e, "not an integer constant");
|
internal_error (e, "not an integer constant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1093,6 +1100,10 @@ expr_uinteger (expr_t *e)
|
||||||
&& is_integral (e->e.symbol->s.def->type)) {
|
&& is_integral (e->e.symbol->s.def->type)) {
|
||||||
return D_INT (e->e.symbol->s.def);
|
return D_INT (e->e.symbol->s.def);
|
||||||
}
|
}
|
||||||
|
if (e->type == ex_def && e->e.def->constant
|
||||||
|
&& is_integral (e->e.def->type)) {
|
||||||
|
return D_INT (e->e.def);
|
||||||
|
}
|
||||||
internal_error (e, "not an unsigned constant");
|
internal_error (e, "not an unsigned constant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue