From 6a70ecda9d2e8b3d41b800f363e91e58d5e98f87 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 21 Aug 2024 08:30:15 +0900 Subject: [PATCH] [qfcc] Make default_type take const symbol_t It doesn't need to modify sym, and being const makes it more clear that it doesn't (despite some of the other type functions breaking that rule, ugh). --- tools/qfcc/include/type.h | 2 +- tools/qfcc/source/type.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/include/type.h b/tools/qfcc/include/type.h index 0546a7633..ba5ade9f4 100644 --- a/tools/qfcc/include/type.h +++ b/tools/qfcc/include/type.h @@ -147,7 +147,7 @@ void chain_type (type_t *type); */ const type_t *append_type (const type_t *type, const type_t *new); void set_func_type_attrs (const type_t *func, specifier_t spec); -specifier_t default_type (specifier_t spec, struct symbol_s *sym); +specifier_t default_type (specifier_t spec, const struct symbol_s *sym); const type_t *find_type (const type_t *new); void new_typedef (const char *name, type_t *type); const type_t *field_type (const type_t *aux); diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 5f01c634f..4a13e7ecc 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -459,7 +459,7 @@ set_func_type_attrs (const type_t *func, specifier_t spec) } specifier_t -default_type (specifier_t spec, symbol_t *sym) +default_type (specifier_t spec, const symbol_t *sym) { if (spec.type) { if (is_float (spec.type) && !spec.multi_type) {