Mesa (master): intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"

Ian Romanick idr at kemper.freedesktop.org
Fri Sep 9 12:20:28 PDT 2011


Module: Mesa
Branch: master
Commit: 2a6a1c4bc291b76674f62bd989d1487f10268ef0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a6a1c4bc291b76674f62bd989d1487f10268ef0

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Sun Aug 21 16:41:22 2011 -0700

intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"

v2: Remove the assertion in intel_batchbuffer_space:

   assert((intel->batch.state_batch_offset - intel->batch.reserved_space)
	  >= intel->batch.used*4);

After reviewing all the places where this is called, I'm (fairly)
comfortable that this assertion was redundant.  Having the assertion
adds ~20KiB to a driver build:

   text	   data	    bss	    dec	    hex	filename
 903173	  26392	   1552	 931117	  e352d	i965_dri.so
 924093	  26392	   1552	 952037	  e86e5	i965_dri.so

Based on feedback from Eric Anholt.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/intel/intel_batchbuffer.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
index fb4134d..a9e0106 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
@@ -57,10 +57,11 @@ static INLINE uint32_t float_as_int(float f)
  * be passed as structs rather than dwords, but that's a little bit of
  * work...
  */
-static INLINE GLint
+static INLINE unsigned
 intel_batchbuffer_space(struct intel_context *intel)
 {
-   return (intel->batch.state_batch_offset - intel->batch.reserved_space) - intel->batch.used*4;
+   return (intel->batch.state_batch_offset - intel->batch.reserved_space)
+      - intel->batch.used*4;
 }
 
 



More information about the mesa-commit mailing list