public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 1/3] Define uintptr_t as long int to simplify printf() format strings
@ 2011-11-04 16:42 Simon Glass
  2011-11-04 16:42 ` [U-Boot] [PATCH v3 2/3] Fix warnings in cmd_nvedit.c Simon Glass
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Glass @ 2011-11-04 16:42 UTC (permalink / raw)
  To: u-boot

If uintptr_t can be either an unsigned int or an unsigned long int, it is
tricky to use it in a printf() format string. This changes it to
unsigned long int consistently. This should do the right thing on both
32-bit and 64-bit architectures.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- Remove the #if logic since it doesn't really do anything

 include/compiler.h |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/include/compiler.h b/include/compiler.h
index 54999a7..0734ed4 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -123,16 +123,10 @@ typedef unsigned int uint;
 #define __WORDSIZE	32
 #endif
 
-/* Types for `void *' pointers. */
-#if __WORDSIZE == 64
-typedef unsigned long int       uintptr_t;
-#elif __WORDSIZE == 32
-typedef unsigned int            uintptr_t;
-#else
-#error "__WORDSIZE has unexpected value"
-#endif
+/* Type for `void *' pointers. */
+typedef unsigned long int uintptr_t;
 
-#endif
+#endif /* USE_HOSTCC */
 
 /* compiler options */
 #define uninitialized_var(x)		x = x
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-22  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 16:42 [U-Boot] [PATCH v3 1/3] Define uintptr_t as long int to simplify printf() format strings Simon Glass
2011-11-04 16:42 ` [U-Boot] [PATCH v3 2/3] Fix warnings in cmd_nvedit.c Simon Glass
2011-11-22  8:50   ` Stefano Babic
2011-11-04 16:42 ` [U-Boot] [PATCH v3 3/3] sandbox: Fix warnings in hashtable.c Simon Glass
2011-11-04 20:07 ` [U-Boot] [PATCH v3 1/3] Define uintptr_t as long int to simplify printf() format strings Mike Frysinger
2011-11-22  8:49 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox