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
From f88d54fde18f4109b5af5d90e513ef761e4021bd Mon Sep 17 00:00:00 2001
From: nobled <[email protected]>
Date: Thu, 8 Dec 2011 20:53:25 +0000
Subject: [PATCH 2/4] gen_matypes: eliminate printf warnings
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
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev