From e40b8106953be7ce7af5265bbeb6a59199f234a9 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Wed, 8 Jul 2020 00:33:10 +0200 Subject: predefine: let predefine_width() take the usual interface All the helpers for type-related predefines directly take in argument the pointer to the type. All but predefine_width(). This must be an historical relic. So, let predefine_width() also take the pointer to the type as argument. Signed-off-by: Luc Van Oostenryck --- predefine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/predefine.c b/predefine.c index 7120d438..f898cdfa 100644 --- a/predefine.c +++ b/predefine.c @@ -25,12 +25,12 @@ static void predefined_sizeof(const char *name, const char *suffix, unsigned bit predefine(buf, 1, "%d", bits/8); } -static void predefined_width(const char *name, unsigned bits) +static void predefined_width(const char *name, struct symbol *type) { char buf[32]; snprintf(buf, sizeof(buf), "__%s_WIDTH__", name); - predefine(buf, 1, "%d", bits); + predefine(buf, 1, "%d", type->bit_size); } static void predefined_max(const char *name, struct symbol *type) @@ -78,7 +78,7 @@ static void predefined_ctype(const char *name, struct symbol *type, int flags) if (flags & PTYPE_TYPE) predefined_type(name, type); if (flags & PTYPE_WIDTH) - predefined_width(name, bits); + predefined_width(name, type); } void predefined_macros(void) -- cgit 1.2.3-korg