[devel] Fixed comments around PNG_UNUSED macro definition in pngpriv.h

This commit is contained in:
Glenn Randers-Pehrson 2011-01-28 15:14:43 -06:00
parent 4e7c47fb73
commit bf3293a3cb

View File

@ -86,26 +86,28 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
/* Unused formal parameter errors are removed using the following macro /* Unused formal parameter errors are removed using the following macro
* which is expected to have no bad effects on performance. Note that * which is expected to have no bad effects on performance. Note that
* if you replace it with something other than whitespace, you must include * if you replace it with something other than whitespace, you must include
* the terminating semicolon. * 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.
*/ */
#ifndef PNG_UNUSED #define PNG_UNUSED(param) {if(param){}}
# define PNG_UNUSED(param) {if(param){}}
/* Other possiblities being discussed on png-mng-implement, Jan 2011 */ #if 0 /* Possibilities discussed on png-mng-implement, starting 27 Jan 2011 */
/* #define PNG_UNUSED(param) param = param; */ /* What we used before */ #ifndef PNG_UNUSED /* "best" but complex */
/* #define PNG_UNUSED(param) {(void)param;} */ /* Visual C complains */ #if defined(__GNUC__) || defined(_MSC_VER)
/* #define PNG_UNUSED(param) if(param); */ /* gcc-4.2 complains */ # define PNG_UNUSED(param) (void)param;
/* #define PNG_UNUSED(param) if(param){} */ #else
/* #define PNG_UNUSED(param) ((void)(param ? 0 : 0)); */ /* 0:0 might be seen */ # define PNG_UNUSED(param)
/* #define PNG_UNUSED(param) {if(&param){}} */ /* gcc-4 complains */ #endif
/* #define PNG_UNUSED(param) {if(&param-&param){}} */ /* No comment. */ #define PNG_UNUSED(param) param = param; /* What we used before */
/* #define PNG_UNUSED(param) {(void)param;} /* Visual C complains */
* #if defined(__GNUC__) || defined(_MSC_VER) #define PNG_UNUSED(param) if(param); /* gcc-4.2 complains */
* # define UNUSED(param) (void)param; #define PNG_UNUSED(param) if(param){} /* more brackets nicer */
* #else #define PNG_UNUSED(param) ((void)(param ? 0 : 0)); /* 0:0 might be seen */
* # define UNUSED(param) #define PNG_UNUSED(param) {if(&param){}} /* gcc-4 complains */
* #endif #define PNG_UNUSED(param) {if(&param-&param){}} /* No comment. */
*/ #define PNG_UNUSED(param) /* generates smallest (no) code but emits warning */
#endif #endif /* 0 */
#endif /* PNG_UNUSED */
/* Just a little check that someone hasn't tried to define something /* Just a little check that someone hasn't tried to define something
* contradictory. * contradictory.