From 0e15da5b9463e9740d82ac82bf1b24d40f05d082 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 27 Jan 2011 12:45:56 -0600 Subject: [PATCH] [devel] Simplified the PNG_UNUSED macro. --- ANNOUNCE | 2 +- CHANGES | 2 +- pngpriv.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index c8c6436e7..c122fddda 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -109,7 +109,7 @@ Version 1.5.1beta10 [January 27, 2010] argument names file_gamma, int_file_gamma, and srgb_intent consistently. Version 1.5.1beta11 [January 27, 2011] - Changed PNG_UNUSED from "param=param;" to "(void)(param ? 0 : 0));" (Cosmin) + Changed PNG_UNUSED from "param=param;" to "{(void)param;}". Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 59b3c3d2a..e9a2fed7e 100644 --- a/CHANGES +++ b/CHANGES @@ -3225,7 +3225,7 @@ Version 1.5.1beta10 [January 27, 2010] argument names file_gamma, int_file_gamma, and srgb_intent consistently. Version 1.5.1beta11 [January 27, 2011] - Changed PNG_UNUSED from "param=param;" to "(void)(param ? 0 : 0));" (Cosmin) + Changed PNG_UNUSED from "param=param;" to "{(void)param;}". Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngpriv.h b/pngpriv.h index 21c8a446b..9eef45b85 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -89,13 +89,13 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; * the terminating semicolon. */ #ifndef PNG_UNUSED -/* Different possiblities being discussed on png-mng-implement, Jan 2011 */ +# define PNG_UNUSED(param) {(void)param;} +/* Other possiblities being discussed on png-mng-implement, Jan 2011 */ /* # define PNG_UNUSED(param) param = param; */ -/* # define PNG_UNUSED(param) if(param); */ +/* # define PNG_UNUSED(param) if(param); */ /* gcc-4.2 warns about this one */ /* # define PNG_UNUSED(param) if(param){} */ /* # define PNG_UNUSED(param) {if(param){}} */ -/* # define PNG_UNUSED(param) {(void)param;} */ -# define PNG_UNUSED(param) ((void)(param ? 0 : 0)); +/* # define PNG_UNUSED(param) ((void)(param ? 0 : 0)); */ #endif /* Just a little check that someone hasn't tried to define something