diff options
Diffstat (limited to 'converter/other/jpeg2000/jpeg2ktopam.c')
-rw-r--r-- | converter/other/jpeg2000/jpeg2ktopam.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c index faf8e4cc..8bb760c1 100644 --- a/converter/other/jpeg2000/jpeg2ktopam.c +++ b/converter/other/jpeg2000/jpeg2ktopam.c @@ -29,11 +29,9 @@ #include "libjasper_compat.h" -enum compmode {COMPMODE_INTEGER, COMPMODE_REAL}; -enum progression {PROG_LRCP, PROG_RLCP, PROG_RPCL, PROG_PCRL, PROG_CPRL}; -struct cmdlineInfo { +struct CmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ @@ -44,15 +42,15 @@ struct cmdlineInfo { static void -parseCommandLine(int argc, char ** argv, - struct cmdlineInfo * const cmdlineP) { +parseCommandLine(int argc, const char ** argv, + struct CmdlineInfo * const cmdlineP) { /*---------------------------------------------------------------------------- Note that many of the strings that this function returns in the *cmdlineP structure are actually in the supplied argv array. And sometimes, one of these strings is actually just a suffix of an entry in argv! -----------------------------------------------------------------------------*/ - optEntry *option_def; + optEntry * option_def; optStruct3 opt; unsigned int debuglevelSpec; @@ -71,7 +69,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); if (!debuglevelSpec) cmdlineP->debuglevel = 0; @@ -84,6 +82,7 @@ parseCommandLine(int argc, char ** argv, pm_error("Too many arguments. The only argument accepted\n" "is the input file specification"); + free(option_def); } @@ -482,9 +481,9 @@ convertToPamPnm(struct pam * const outpamP, int -main(int argc, char **argv) +main(int argc, const char **argv) { - struct cmdlineInfo cmdline; + struct CmdlineInfo cmdline; struct pam outpam; int * jasperCmpt; /* malloc'ed */ /* jaspercmpt[P] is the component number for use with the @@ -492,7 +491,7 @@ main(int argc, char **argv) */ jas_image_t * jasperP; - pnm_init(&argc, argv); + pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); |