From f8689c575165a536353506dd146afe9de5875b1c Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 11 Jan 2017 04:40:43 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2876 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/giftopnm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c index 1cdca733..f0946c9e 100644 --- a/converter/other/giftopnm.c +++ b/converter/other/giftopnm.c @@ -62,7 +62,11 @@ readFile(FILE * const ifP, unsigned char * const buffer, size_t const len, const char ** const errorP) { +/*---------------------------------------------------------------------------- + Read the next 'len' bytes from *ifP into 'buffer'. + Fail if there aren't that many bytes to read. +-----------------------------------------------------------------------------*/ size_t bytesRead; bytesRead = fread(buffer, 1, len, ifP); @@ -103,7 +107,7 @@ struct CmdlineInfo { static void -parseCommandLine(int argc, char ** argv, +parseCommandLine(int argc, const char ** argv, struct CmdlineInfo * const cmdlineP) { /*---------------------------------------------------------------------------- Note that the file spec array we return is stored in the storage that @@ -140,7 +144,7 @@ parseCommandLine(int argc, char ** argv, opt.short_allowed = false; /* We have no short (old-fashioned) options */ opt.allowNegNum = false; /* We have no parms that are negative numbers */ - pm_optParseOptions3( &argc, argv, opt, sizeof(opt), 0); + pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0); /* Uses and sets argc, argv, and some of *cmdlineP and others. */ free(option_def); @@ -1359,6 +1363,9 @@ renderRow(unsigned char * const cmapIndexRow, /*---------------------------------------------------------------------------- Convert one row of cmap indexes to PPM/PGM/PBM output. + The row is *xelrow, which is 'cols' columns wide and has pixels of format + 'format'. + Render the alpha row to *alphaFileP iff 'alphabits' is non-NULL. If 'haveTransColor' is false, render all white (i.e. the row is opaque). 'alphabits' is otherwise just a one-row buffer for us to use @@ -2141,14 +2148,14 @@ convertImages(FILE * const ifP, int -main(int argc, char **argv) { +main(int argc, const char **argv) { struct CmdlineInfo cmdline; FILE * ifP; FILE * alphaFileP; FILE * imageOutFileP; - pnm_init(&argc, argv); + pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); verbose = cmdline.verbose; -- cgit 1.4.1