mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Add is_integral() to check for integral types (integer, short, enum).
This commit is contained in:
parent
17a9dff769
commit
85bffbcad0
2 changed files with 9 additions and 2 deletions
|
@ -146,6 +146,7 @@ void print_type (type_t *type);
|
|||
const char *encode_params (type_t *type);
|
||||
void encode_type (struct dstring_s *encoding, type_t *type);
|
||||
int is_enum (type_t *type);
|
||||
int is_integral (type_t *type);
|
||||
int is_scalar (type_t *type);
|
||||
int is_math (type_t *type);
|
||||
int is_struct (type_t *type);
|
||||
|
|
|
@ -637,15 +637,21 @@ is_enum (type_t *type)
|
|||
}
|
||||
|
||||
int
|
||||
is_scalar (type_t *type)
|
||||
is_integral (type_t *type)
|
||||
{
|
||||
etype_t t = type->type;
|
||||
|
||||
if (t == ev_float || t == ev_integer || t == ev_short)
|
||||
if (t == ev_integer || t == ev_short)
|
||||
return 1;
|
||||
return is_enum (type);
|
||||
}
|
||||
|
||||
int
|
||||
is_scalar (type_t *type)
|
||||
{
|
||||
return type->type == ev_float || is_integral (type);
|
||||
}
|
||||
|
||||
int
|
||||
is_math (type_t *type)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue