mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Add a function to check for error expressions
I haven't gone through and replaced all the existing tests, but hiding the details makes sense and fits with many of the other check functions.
This commit is contained in:
parent
f7bf77c2b7
commit
fed1bce12a
2 changed files with 8 additions and 0 deletions
|
@ -740,6 +740,8 @@ unsigned short expr_ushort (const expr_t *e) __attribute__((pure));
|
|||
|
||||
int expr_integral (const expr_t *e) __attribute__((pure));
|
||||
|
||||
bool is_error (const expr_t *e) __attribute__((pure));
|
||||
|
||||
/** Check if the expression refers to a constant value.
|
||||
|
||||
\param e The expression to check.
|
||||
|
|
|
@ -861,6 +861,12 @@ new_short_expr (short short_val)
|
|||
return new_value_expr (new_short_val (short_val), false);
|
||||
}
|
||||
|
||||
bool
|
||||
is_error (const expr_t *e)
|
||||
{
|
||||
return e->type == ex_error;
|
||||
}
|
||||
|
||||
int
|
||||
is_constant (const expr_t *e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue