From a0c19101ff9d0653f7942da9df73440908723864 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 1 Nov 2007 03:13:31 +0000 Subject: Get rid of ARGS git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@442 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libpbm1.c | 4 +++- lib/pbm.h | 5 ++++- lib/pbmfont.h | 2 +- lib/pm.h | 24 ------------------------ lib/pnm.h | 4 +++- lib/ppmcmap.h | 40 +++++++++++++++++++++++++++++++++------- 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/lib/libpbm1.c b/lib/libpbm1.c index 6c43587e..9085846e 100644 --- a/lib/libpbm1.c +++ b/lib/libpbm1.c @@ -21,7 +21,9 @@ #include "shhopt.h" void -pbm_init(int *argcP, char *argv[]) { +pbm_init(int * const argcP, + const char ** const argv) { + pm_proginit(argcP, argv); } diff --git a/lib/pbm.h b/lib/pbm.h index dbe50216..b378dca6 100644 --- a/lib/pbm.h +++ b/lib/pbm.h @@ -33,7 +33,10 @@ typedef unsigned char bit; /* Declarations of routines. */ -void pbm_init ARGS(( int* argcP, char* argv[] )); +void +pbm_init(int * const argcP, + const char ** const argv); + void pbm_nextimage(FILE *file, int * const eofP); diff --git a/lib/pbmfont.h b/lib/pbmfont.h index 8a81c37a..d287bc6c 100644 --- a/lib/pbmfont.h +++ b/lib/pbmfont.h @@ -68,7 +68,7 @@ pbm_dissectfont(const bit ** const font, struct font* pbm_loadfont(const char * const filename); struct font* pbm_loadpbmfont(const char * const filename); struct font* pbm_loadbdffont(const char * const filename); -void pbm_dumpfont ARGS(( struct font* fn )); +void pbm_dumpfont(struct font * const fnP); #ifdef __cplusplus } diff --git a/lib/pm.h b/lib/pm.h index 28dfbb43..9fa061b8 100644 --- a/lib/pm.h +++ b/lib/pm.h @@ -34,30 +34,6 @@ extern "C" { #endif -/* Definitions to make Netpbm programs work with either ANSI C or C - Classic. - - This is obsolete, as all compilers recognize the ANSI syntax now. - - We are slowly removing all the ARGS invocations from the programs - (and replacing them with explicit ANSI syntax), but we have a lot - of programs where we have removed ARGS from the definition but not - the prototype, and we have discovered that the Sun compiler - considers the resulting mismatch between definition and prototype - to be an error. So we make ARGS create the ANSI syntax - unconditionally to avoid having to fix all those mismatches. */ - -#if 0 -#if __STDC__ -#define ARGS(alist) alist -#else /*__STDC__*/ -#define ARGS(alist) () -#define const -#endif /*__STDC__*/ -#endif -#define ARGS(alist) alist - - /* PM_GNU_PRINTF_ATTR lets the GNU compiler check pm_message() and pm_error() calls to be sure the arguments match the format string, thus preventing runtime segmentation faults and incorrect messages. diff --git a/lib/pnm.h b/lib/pnm.h index 636c1336..fc5e6c9e 100644 --- a/lib/pnm.h +++ b/lib/pnm.h @@ -29,7 +29,9 @@ typedef pixval xelval; /* Declarations of routines. */ -void pnm_init ARGS(( int* argcP, char* argv[] )); +void +pnm_init(int * const argcP, + const char ** const argv); void pnm_nextimage(FILE *file, int * const eofP); diff --git a/lib/ppmcmap.h b/lib/ppmcmap.h index b44dcbea..af33b178 100644 --- a/lib/ppmcmap.h +++ b/lib/ppmcmap.h @@ -89,13 +89,39 @@ void ppm_freecolorhash(colorhash_table const cht); -colorhash_table ppm_colorrowtocolorhash ARGS((pixel *colorrow, int ncolors)); -pixel * ppm_computecolorrow ARGS((pixel **pixels, int cols, int rows, int maxcolors, int *ncolorsP)); -pixel * ppm_mapfiletocolorrow ARGS((FILE *file, int maxcolors, int *ncolorsP, pixval *maxvalP)); -void ppm_colorrowtomapfile ARGS((FILE *ofp, pixel *colormap, int ncolors, pixval maxval)); -void ppm_sortcolorrow (pixel * const colorrow, const int ncolors, - int (*cmpfunc)(pixel *, pixel *) ); -int ppm_addtocolorrow ARGS((pixel *colorrow, int *ncolorsP, int maxcolors, pixel *pixelP)); +colorhash_table +ppm_colorrowtocolorhash(pixel * const colorrow, + int const ncolors); + +pixel * +ppm_computecolorrow(pixel ** const pixels, + int const cols, + int const rows, + int const maxcolors, + int * const ncolorsP); + +pixel * +ppm_mapfiletocolorrow(FILE * const fileP, + int const maxcolors, + int * const ncolorsP, + pixval * const maxvalP); + +void +ppm_colorrowtomapfile(FILE * const ofP, + pixel * const colormap, + int const ncolors, + pixval const maxval); + +void +ppm_sortcolorrow(pixel * const colorrow, + int const ncolors, + int (*cmpfunc)(pixel *, pixel *)); + +int +ppm_addtocolorrow(pixel * const colorrow, + int * const ncolorsP, + int const maxcolors, + pixel * const pixelP)x; int ppm_findclosestcolor(const pixel * const colormap, -- cgit 1.4.1