From 5c0c056e2caaf34d9fe57b1f181549bc3ed89e21 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 16 Mar 2020 21:07:31 +0900 Subject: [PATCH] [qfcc] Add is_entity type test helper --- tools/qfcc/include/type.h | 1 + tools/qfcc/source/type.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/tools/qfcc/include/type.h b/tools/qfcc/include/type.h index 791ea0fc9..ba3b82f1e 100644 --- a/tools/qfcc/include/type.h +++ b/tools/qfcc/include/type.h @@ -162,6 +162,7 @@ int is_quaternion (const type_t *type) __attribute__((pure)); int is_math (const type_t *type) __attribute__((pure)); int is_pointer (const type_t *type) __attribute__((pure)); int is_field (const type_t *type) __attribute__((pure)); +int is_entity (const type_t *type) __attribute__((pure)); int is_struct (const type_t *type) __attribute__((pure)); int is_array (const type_t *type) __attribute__((pure)); int is_structural (const type_t *type) __attribute__((pure)); diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index cdf7ca6df..4404f2ed0 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -811,6 +811,14 @@ is_field (const type_t *type) return 0; } +int +is_entity (const type_t *type) +{ + if (type->type == ev_entity) + return 1; + return 0; +} + int is_array (const type_t *type) {