diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
commit | 23ce26f64c34e30951ad9ade2151552ed77e7357 (patch) | |
tree | d73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /other/pamdepth.c | |
parent | 1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff) | |
download | netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip |
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pamdepth.c')
-rw-r--r-- | other/pamdepth.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/other/pamdepth.c b/other/pamdepth.c index 96613d07..46601864 100644 --- a/other/pamdepth.c +++ b/other/pamdepth.c @@ -17,7 +17,7 @@ #include "shhopt.h" #include "pam.h" -struct cmdlineInfo { +struct CmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ @@ -30,7 +30,7 @@ struct cmdlineInfo { static void parseCommandLine(int argc, const char ** argv, - struct cmdlineInfo *cmdlineP) { + struct CmdlineInfo * const cmdlineP) { /*---------------------------------------------------------------------------- Note that the file spec strings we return are stored in the storage that was passed to us as the argv array. @@ -45,7 +45,7 @@ parseCommandLine(int argc, const char ** argv, MALLOCARRAY_NOFAIL(option_def, 100); option_def_index = 0; /* incremented by OPTENTRY */ - OPTENT3(0, "verbose", OPT_STRING, NULL, + OPTENT3(0, "verbose", OPT_STRING, NULL, &cmdlineP->verbose, 0); opt.opt_table = option_def; @@ -64,8 +64,8 @@ parseCommandLine(int argc, const char ** argv, pm_error("New maxval must be at least 1. You specified %d", intval); else if (intval > PNM_OVERALLMAXVAL) - pm_error("newmaxval (%d) is too large.\n" - "The maximum allowed by the PNM formats is %d.", + pm_error("newmaxval (%d) is too large. " + "The maximum allowed by the PNM formats is %u.", intval, PNM_OVERALLMAXVAL); else cmdlineP->newMaxval = intval; @@ -101,7 +101,7 @@ createSampleMap(sample const oldMaxval, static void transformRaster(struct pam * const inpamP, struct pam * const outpamP) { - + tuple * tuplerow; unsigned int row; sample * sampleMap; /* malloc'ed */ @@ -136,7 +136,7 @@ transformRaster(struct pam * const inpamP, int main(int argc, const char * argv[]) { - struct cmdlineInfo cmdline; + struct CmdlineInfo cmdline; FILE * ifP; struct pam inpam; struct pam outpam; @@ -153,15 +153,15 @@ main(int argc, const char * argv[]) { pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); outpam = inpam; /* initial value */ - + outpam.file = stdout; outpam.maxval = cmdline.newMaxval; - + if (PNM_FORMAT_TYPE(inpam.format) == PBM_TYPE) { outpam.format = PGM_TYPE; } else outpam.format = inpam.format; - + if (streq(inpam.tuple_type, PAM_PBM_TUPLETYPE)) { pm_message("promoting from black and white to grayscale"); strcpy(outpam.tuple_type, PAM_PGM_TUPLETYPE); @@ -182,3 +182,6 @@ main(int argc, const char * argv[]) { return 0; } + + + |