[Mesa-dev] [PATCH] gen_matypes: eliminate printf warnings
nobled
nobled at dreamwidth.org
Fri Dec 9 06:00:57 PST 2011
The VERT_BIT_* defines are 64-bit values since commit
f364ac1da10ff67eba5196c1074aff579864f741, but the printf
was still expecting a simple int. This worked on little-endian
hosts because the values were still less than INT_MAX, but
probably would've gone bad and printed zero on big-endian ones.
---
src/mesa/x86/gen_matypes.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
index 648bf87..18baa29 100644
--- a/src/mesa/x86/gen_matypes.c
+++ b/src/mesa/x86/gen_matypes.c
@@ -32,6 +32,11 @@
* Mesa, including lighting, clipping, texture image conversion etc.
*/
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
+
#include "main/glheader.h"
#include "main/mtypes.h"
#include "tnl/t_context.h"
@@ -68,7 +73,7 @@ do { \
printf( "#define %s\t%lu\n", s, (unsigned long) sizeof(t) );
#define DEFINE( s, d ) \
- printf( "#define %s\t0x%x\n", s, d );
+ printf( "#define %s\t0x%"PRIx64"\n", s, (uint64_t) d );
--
1.7.4.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002b-gen_matypes-eliminate-printf-warnings.patch
Type: text/x-patch
Size: 1289 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111209/952b34f8/attachment-0001.bin>
More information about the mesa-dev
mailing list