util: silence warnings for third REALLOC argument
authorKeith Whitwell <keithw@vmware.com>
Thu, 13 Aug 2009 13:26:50 +0000 (14:26 +0100)
committerKeith Whitwell <keithw@vmware.com>
Thu, 13 Aug 2009 13:26:50 +0000 (14:26 +0100)
Our fallback realloc path requires an old_size argument, but the posix
varient doesn't need this.  Add some code to avoid gcc unused variable
warnings for this extra argument.

src/gallium/auxiliary/util/u_memory.h

index 0b18d04..c3f8c91 100644 (file)
@@ -100,8 +100,14 @@ ExFreePool(void *P);
 #define MALLOC( SIZE )  malloc( SIZE )
 #define CALLOC( COUNT, SIZE )   calloc( COUNT, SIZE )
 #define FREE( PTR )  free( PTR )
-#define REALLOC( OLDPTR, OLDSIZE, NEWSIZE )  realloc( OLDPTR, NEWSIZE )
 
+static INLINE void *
+_REALLOC( void *old_ptr, unsigned old_size, unsigned new_size )
+{
+   (void) old_size;
+   return realloc(old_ptr, new_size);
+}
+#define REALLOC( a, b, c ) _REALLOC( a, b, c )
 #endif