Mesa (master): gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Brian Paul
brianp at kemper.freedesktop.org
Fri Oct 26 16:59:47 UTC 2012
Module: Mesa
Branch: master
Commit: 369b5a311ca5e03bc4cccc3052800b94e316087d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=369b5a311ca5e03bc4cccc3052800b94e316087d
Author: Brian Paul <brianp at vmware.com>
Date: Tue Oct 23 15:54:11 2012 -0600
gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h. We made a
similar change in prog_print.c in df2d81ea59993a77bd1f1ef96c5cf19ac692d5f7.
---
src/gallium/auxiliary/gallivm/lp_bld_swizzle.c | 7 +++----
src/gallium/drivers/llvmpipe/lp_rast_debug.c | 11 +++++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
index 641c960..201a348 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
@@ -32,7 +32,7 @@
* @author Jose Fonseca <jfonseca at vmware.com>
*/
-
+#include <inttypes.h> /* for PRIx64 macro */
#include "util/u_debug.h"
#include "lp_bld_type.h"
@@ -386,7 +386,7 @@ lp_build_swizzle_aos(struct lp_build_context *bld,
* same shift as possible
*/
for (shift = -3; shift <= 3; ++shift) {
- unsigned long long mask = 0;
+ uint64_t mask = 0;
assert(type4.width <= sizeof(mask)*8);
@@ -401,9 +401,8 @@ lp_build_swizzle_aos(struct lp_build_context *bld,
if (mask) {
LLVMValueRef masked;
LLVMValueRef shifted;
-
if (0)
- debug_printf("shift = %i, mask = 0x%08llx\n", shift, mask);
+ debug_printf("shift = %i, mask = %" PRIx64 "\n", shift, mask);
masked = LLVMBuildAnd(builder, a,
lp_build_const_int_vec(bld->gallivm, type4, mask), "");
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_debug.c b/src/gallium/drivers/llvmpipe/lp_rast_debug.c
index 86f5f64..4008251 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_debug.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_debug.c
@@ -1,3 +1,4 @@
+#include <inttypes.h> /* for PRIu64 macro */
#include "util/u_math.h"
#include "lp_rast_priv.h"
#include "lp_state_fs.h"
@@ -334,8 +335,8 @@ lp_debug_draw_bins_by_coverage( struct lp_scene *scene )
unsigned x, y;
unsigned total = 0;
unsigned possible = 0;
- static unsigned long long _total;
- static unsigned long long _possible;
+ static uint64_t _total = 0;
+ static uint64_t _possible = 0;
for (x = 0; x < scene->tiles_x; x++)
debug_printf("-");
@@ -383,10 +384,12 @@ lp_debug_draw_bins_by_coverage( struct lp_scene *scene )
_total += total;
_possible += possible;
- debug_printf("overall total: %llu possible %llu: percentage: %f\n",
+
+ debug_printf("overall total: %" PRIu64
+ " possible %" PRIu64 ": percentage: %f\n",
_total,
_possible,
- _total * 100.0 / (double)_possible);
+ (double) _total * 100.0 / (double)_possible);
}
More information about the mesa-commit
mailing list