diff --git a/tools/qfcc/include/type.h b/tools/qfcc/include/type.h index dd0d7a430..f4eaf755d 100644 --- a/tools/qfcc/include/type.h +++ b/tools/qfcc/include/type.h @@ -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); diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index b4a4a72af..0c0eeac0a 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -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) {