[Mesa-dev] [PATCH] intel: fix a few printf argument mismatches in the Intel driver.

Sam Hocevar sam at hocevar.net
Wed Feb 16 14:33:45 PST 2011


Error and debug messages in the intel driver were using %d in format
strings with long int arguments.

Signed-off-by: Sam Hocevar <sam at hocevar.net>
---
 src/mesa/drivers/dri/intel/intel_batchbuffer.c |    6 ++++--
 src/mesa/drivers/dri/intel/intel_regions.c     |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 67ce8a4..0af862b 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -206,7 +206,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
 
    if (batch->ptr - batch->map > batch->buf->size)
     printf ("bad relocation ptr %p map %p offset %d size %lu\n",
-	    batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size);
+	    batch->ptr, batch->map, (int)(batch->ptr - batch->map),
+	    batch->buf->size);
    ret = drm_intel_bo_emit_reloc(batch->buf, batch->ptr - batch->map,
 				 buffer, delta,
 				 read_domains, write_domain);
@@ -233,7 +234,8 @@ intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch,
 
    if (batch->ptr - batch->map > batch->buf->size)
     printf ("bad relocation ptr %p map %p offset %d size %lu\n",
-	    batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size);
+	    batch->ptr, batch->map, (int)(batch->ptr - batch->map),
+	    batch->buf->size);
    ret = drm_intel_bo_emit_reloc_fence(batch->buf, batch->ptr - batch->map,
 				       buffer, delta,
 				       read_domains, write_domain);
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index e87e294..0857fa8 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -491,7 +491,7 @@ intel_region_cow(struct intel_context *intel, struct intel_region *region)
 
    assert(region->cpp * region->pitch * region->height == pbo->Base.Size);
 
-   _DBG("%s %p (%d bytes)\n", __FUNCTION__, region, pbo->Base.Size);
+   _DBG("%s %p (%d bytes)\n", __FUNCTION__, region, (int)pbo->Base.Size);
 
    /* Now blit from the texture buffer to the new buffer: 
     */
-- 
1.7.2.3


More information about the mesa-dev mailing list