From fb524e67685d6f17063e5c16942df688d9f7a987 Mon Sep 17 00:00:00 2001 From: Nathan Reed Date: Thu, 11 May 2017 22:51:19 -0700 Subject: [PATCH] Fix warning about context parameter being unused when STBIR_MALLOC and STBIR_FREE have their default definitions. --- stb_image_resize.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stb_image_resize.h b/stb_image_resize.h index b507e04..488e67d 100644 --- a/stb_image_resize.h +++ b/stb_image_resize.h @@ -393,8 +393,9 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int #ifndef STBIR_MALLOC #include -#define STBIR_MALLOC(size,c) malloc(size) -#define STBIR_FREE(ptr,c) free(ptr) +// use comma operator to evaluate c, to avoid "unused parameter" warnings +#define STBIR_MALLOC(size,c) ((void)(c), malloc(size)) +#define STBIR_FREE(ptr,c) ((void)(c), free(ptr)) #endif #ifndef _MSC_VER