From d2e134cc224e3532adff287adf189f81ff90ca4d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 25 Aug 2023 22:02:44 +0900 Subject: [PATCH] [qfcc] Support multiple parameters for attributes I have no idea why I threw away all but the *last* parameter (especially considering nothing used parameters until now). --- tools/qfcc/include/attribute.h | 2 +- tools/qfcc/source/attribute.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/qfcc/include/attribute.h b/tools/qfcc/include/attribute.h index 2f47642e6..2a0077ed3 100644 --- a/tools/qfcc/include/attribute.h +++ b/tools/qfcc/include/attribute.h @@ -34,7 +34,7 @@ typedef struct attribute_s { struct attribute_s *next; const char *name; - struct ex_value_s *value; + struct expr_s *params; } attribute_t; struct expr_s; diff --git a/tools/qfcc/source/attribute.c b/tools/qfcc/source/attribute.c index a1cbe443d..469c358fd 100644 --- a/tools/qfcc/source/attribute.c +++ b/tools/qfcc/source/attribute.c @@ -42,14 +42,16 @@ ALLOC_STATE (attribute_t, attributes); attribute_t *new_attribute(const char *name, expr_t *value) { - if (value && value->type != ex_value) { - error (value, "not a literal constant"); - return 0; + for (auto v = value; v; v = v->next) { + if (v->type != ex_value) { + error (value, "not a literal constant"); + return 0; + } } attribute_t *attr; ALLOC (16384, attribute_t, attributes, attr); attr->name = save_string (name); - attr->value = value ? value->e.value : 0; + attr->params = value ? reverse_expr_list (value) : 0; return attr; }