[Mesa-dev] [PATCH 03/20] intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"

Eric Anholt eric at anholt.net
Thu Sep 8 12:55:13 PDT 2011


On Mon, 29 Aug 2011 14:58:53 -0700, "Ian Romanick" <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> ---
>  src/mesa/drivers/dri/intel/intel_batchbuffer.h |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
> index fb4134d..90dc0ed 100644
> --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h
> +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
> @@ -57,9 +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)
>  {
> +   assert((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;
>  }

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

Granted, this is a debug build, but that's a lot of bloat.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110908/e00d8068/attachment.pgp>


More information about the mesa-dev mailing list