[PATCH 9/9] predefine: let predefine_width() take the usual interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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() to also take the pointer to the type
in argument.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 predefine.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/predefine.c b/predefine.c
index 7120d4381f16..f898cdfa39b8 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)
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux