[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).
This commit is contained in:
Bill Currie 2024-08-21 08:30:15 +09:00
parent 43f83fc0eb
commit 6a70ecda9d
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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) {