From 25d2d47f86b0164ad9d136463f80855027edeaf7 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 31 Jan 2011 10:25:10 -0600 Subject: [PATCH] [devel] updated the commentary in pngpriv.h about PNG_UNUSED(). --- ANNOUNCE | 8 ++++---- CHANGES | 6 +++--- pngpriv.h | 29 +++++------------------------ 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 9be49af9f..4069e20f0 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.1rc02 - January 30, 2011 +Libpng 1.5.1rc02 - January 31, 2011 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -115,13 +115,13 @@ Version 1.5.1beta11 [January 28, 2011] architectures. Added transform tests to pngvalid and simplified the arguments. -Version 1.5.1rc01 [January 30, 2011] +Version 1.5.1rc01 [January 31, 2011] No changes. -Version 1.5.1rc02 [January 30, 2011] +Version 1.5.1rc02 [January 31, 2011] Added a request in the manual that applications do not use "png_" or "PNG_" to begin any of their own symbols. - Changed PNG_UNUSED to "(void)param;" + Changed PNG_UNUSED to "(void)param;" and updated the commentary in pngpriv.h Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 10e99ac8f..121e517f4 100644 --- a/CHANGES +++ b/CHANGES @@ -3231,13 +3231,13 @@ Version 1.5.1beta11 [January 28, 2011] architectures. Added transform tests to pngvalid and simplified the arguments. -Version 1.5.1rc01 [January 30, 2011] +Version 1.5.1rc01 [January 31, 2011] No changes. -Version 1.5.1rc02 [January 30, 2011] +Version 1.5.1rc02 [January 31, 2011] Added a request in the manual that applications do not use "png_" or "PNG_" to begin any of their own symbols. - Changed PNG_UNUSED to "(void)param;" + Changed PNG_UNUSED to "(void)param;" and updated the commentary in pngpriv.h Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngpriv.h b/pngpriv.h index d3903a960..30ac00473 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -83,33 +83,14 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; # define PNG_MAX_MALLOC_64K #endif -/* Unused formal parameter errors are removed using the following macro - * which is expected to have no bad effects on performance. Note that - * if you replace it with something other than whitespace, you must include - * the terminating semicolon. Also note that some of these might not - * work when "param" is a structure, but that is never the case in libpng. +/* Unused formal parameter warnings are silenced using the following macro + * which is expected to have no bad effects on performance (optimizing + * compilers will probably remove it entirely). Note that if you replace + * it with something other than whitespace, you must include the terminating + * semicolon. */ #define PNG_UNUSED(param) (void)param; -#if 0 /* Possibilities discussed on png-mng-implement, starting 27 Jan 2011 */ -#ifndef PNG_UNUSED /* "best" but complex */ - #if defined(__GNUC__) || defined(_MSC_VER) - # define PNG_UNUSED(param) (void)param; - #else - # define PNG_UNUSED(param) - #endif -#define PNG_UNUSED(param) {if(param){}} -#define PNG_UNUSED(param) param = param; /* What we used before */ -#define PNG_UNUSED(param) {(void)param;} /* Visual C complains */ -#define PNG_UNUSED(param) if(param); /* gcc-4.2 complains */ -#define PNG_UNUSED(param) if(param){} /* more brackets nicer */ -#define PNG_UNUSED(param) ((void)(param ? 0 : 0)); /* 0:0 might be seen */ -#define PNG_UNUSED(param) {if(¶m){}} /* gcc-4 complains */ -#define PNG_UNUSED(param) {if(¶m-¶m){}} /* No comment. */ -#define PNG_UNUSED(param) /* generates smallest (no) code but emits warning */ -#endif /* 0 */ -#endif /* PNG_UNUSED */ - /* Just a little check that someone hasn't tried to define something * contradictory. */