[PATCH v2 4/5] png2pnm: introduce an use PNGMINUS_UNUSED()

Christian Hesse <[email protected]>
Newsgroups gmane.comp.graphics.png.devel
Message-ID <[email protected]>
From: Christian Hesse <[email protected]>

PNG_UNUSED() is defined in pngpriv.h, which we do not want to include.
Instead define a new macro PNGMINUS_UNUSED() and use that.

Signed-off-by: Christian Hesse <[email protected]>
---
 contrib/pngminus/png2pnm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c
index ae6f299cf..9414f2295 100644
--- a/contrib/pngminus/png2pnm.c
+++ b/contrib/pngminus/png2pnm.c
@@ -51,6 +51,16 @@
 #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
 #endif
 
+#ifndef PNGMINUS_UNUSED
+/* 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 PNGMINUS_UNUSED(param) (void)param;
+#endif
+
 /* function prototypes */
 
 int  main (int argc, char *argv[]);
@@ -443,7 +453,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
   if (png_pixels != (unsigned char*) NULL)
     free (png_pixels);
 
-  PNG_UNUSED(raw); /* to quiet a Coverity defect */
+  PNGMINUS_UNUSED(raw); /* to quiet a Coverity defect */
   return TRUE;
 
 } /* end of source */

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.