aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-26 19:15:38 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-27 21:40:34 +0100
commit9f6fb41fb056ee5dd63b7968eab0280dc02af1cc (patch)
tree8caa926cfc01c63f8216e69e17702494572088e0 /include
parent0ba99b2a18bd423f8aa6ca0315051de76c20ef9c (diff)
downloadgnumach-9f6fb41fb056ee5dd63b7968eab0280dc02af1cc.tar.gz
gnumach-9f6fb41fb056ee5dd63b7968eab0280dc02af1cc.tar.bz2
gnumach-9f6fb41fb056ee5dd63b7968eab0280dc02af1cc.zip
Fix inttypes.h format constants for uintptr_t and intptr_t.
The format constants are not correct for 32 bits and there was duplication for PRIx* constants (replaced with octal constants). Fixed a few format warnings too. Message-Id: <Y6o5KsvtPavCYe8f@mars>
Diffstat (limited to 'include')
-rw-r--r--include/inttypes.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/inttypes.h b/include/inttypes.h
index ebafb67a..353984a0 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -25,38 +25,40 @@
#ifdef __x86_64__
#define __64PREFIX "l"
+#define __PTRPREFIX "l"
#else
#define __64PREFIX "ll"
+#define __PTRPREFIX
#endif
#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "d"
#define PRId64 __64PREFIX"d"
-#define PRIdPTR __64PREFIX"d"
+#define PRIdPTR __PTRPREFIX"d"
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "i"
#define PRIi64 __64PREFIX"i"
-#define PRIiPTR __64PREFIX"i"
+#define PRIiPTR __PTRPREFIX"i"
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "u"
#define PRIu64 __64PREFIX"u"
-#define PRIuPTR __64PREFIX"u"
+#define PRIuPTR __PTRPREFIX"u"
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "x"
#define PRIx64 __64PREFIX"x"
-#define PRIxPTR __64PREFIX"x"
+#define PRIxPTR __PTRPREFIX"x"
-#define PRIx8 "x"
-#define PRIx16 "x"
-#define PRIx32 "x"
-#define PRIx64 __64PREFIX"x"
-#define PRIxPTR __64PREFIX"x"
+#define PRIo8 "o"
+#define PRIo16 "o"
+#define PRIo32 "o"
+#define PRIo64 __64PREFIX"o"
+#define PRIoPTR __PTRPREFIX"o"
#endif /* _INTTYPES_H_ */