From 1964d560e96c6d14af59a3e8a80299a09a875148 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Tue, 10 Sep 2024 19:15:13 +0300 Subject: [PATCH] Deprecate PNGARG and remove all of its remaining uses --- png.h | 2 +- pngconf.h | 6 +++--- pngerror.c | 9 +++++---- pngtest.c | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/png.h b/png.h index b71bd7064..6ac0171d9 100644 --- a/png.h +++ b/png.h @@ -824,7 +824,7 @@ typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, * your compiler. This may be very difficult - try using a different compiler * to build the library! */ -PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); +PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef); #endif /* Transform masks for the high-level interface */ diff --git a/pngconf.h b/pngconf.h index 175a36c6f..41785a3ca 100644 --- a/pngconf.h +++ b/pngconf.h @@ -88,7 +88,7 @@ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function - * prototypes. It is not required for modern C compilers. + * prototypes. [Deprecated.] */ #ifndef PNGARG # define PNGARG(arglist) arglist @@ -298,7 +298,7 @@ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes) \ - PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \ + PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \ PNG_LINKAGE_API attributes) #endif @@ -316,7 +316,7 @@ #endif #ifndef PNG_CALLBACK -# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) +# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args #endif /* Support for compiler specific function attributes. These are used diff --git a/pngerror.c b/pngerror.c index 29ebda794..1babf9f8d 100644 --- a/pngerror.c +++ b/pngerror.c @@ -20,13 +20,14 @@ #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr, - png_const_charp error_message)),PNG_NORETURN); +static PNG_FUNCTION(void /* PRIVATE */, +png_default_error,(png_const_structrp png_ptr, png_const_charp error_message), + PNG_NORETURN); #ifdef PNG_WARNINGS_SUPPORTED static void /* PRIVATE */ -png_default_warning PNGARG((png_const_structrp png_ptr, - png_const_charp warning_message)); +png_default_warning(png_const_structrp png_ptr, + png_const_charp warning_message); #endif /* WARNINGS */ /* This function is called whenever there is a fatal error. This function diff --git a/pngtest.c b/pngtest.c index ba2b7463e..a4621a60f 100644 --- a/pngtest.c +++ b/pngtest.c @@ -518,9 +518,9 @@ static int maximum_allocation = 0; static int total_allocation = 0; static int num_allocations = 0; -png_voidp PNGCBAPI png_debug_malloc PNGARG((png_structp png_ptr, - png_alloc_size_t size)); -void PNGCBAPI png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); +png_voidp PNGCBAPI png_debug_malloc(png_structp png_ptr, + png_alloc_size_t size); +void PNGCBAPI png_debug_free(png_structp png_ptr, png_voidp ptr); png_voidp PNGCBAPI png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)