From 41bac7b295aab8a09a1add8ca02db472fcd31184 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 31 May 2008 23:57:51 -0500 Subject: [PATCH] Types: make SilcUInt32 an unsigned int in most cases. On typical 32-bit systems, both unsigned int and unsigned long are 32 bits wide. However, they have different format specifiers, so they cannot be used interchangeably. On typical 64-bit systems, unsigned int is 32 bits and unsigned long is 64 bits. To allow for a more consistent format string, reorder the type size checks so that SilcUInt32 is an unsigned int on both 32 bit and 64 bit systems. --- lib/silcutil/silctypes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/silcutil/silctypes.h b/lib/silcutil/silctypes.h index b22c7e77..d7f97976 100644 --- a/lib/silcutil/silctypes.h +++ b/lib/silcutil/silctypes.h @@ -177,14 +177,14 @@ typedef signed short SilcInt16; * * SOURCE */ -#if SILC_SIZEOF_LONG == 4 -typedef unsigned long SilcUInt32; -typedef signed long SilcInt32; -#else #if SILC_SIZEOF_INT == 4 typedef unsigned int SilcUInt32; typedef signed int SilcInt32; #else +#if SILC_SIZEOF_LONG == 4 +typedef unsigned long SilcUInt32; +typedef signed long SilcInt32; +#else #if SILC_SIZEOF_LONG_LONG >= 4 #ifndef WIN32 typedef unsigned long long SilcUInt32; -- 2.24.0