diff options
Diffstat (limited to 'generator/pamgauss.c')
-rw-r--r-- | generator/pamgauss.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/generator/pamgauss.c b/generator/pamgauss.c index 13fe8ea1..82c340fa 100644 --- a/generator/pamgauss.c +++ b/generator/pamgauss.c @@ -11,7 +11,7 @@ -struct cmdlineInfo { +struct CmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ @@ -25,8 +25,8 @@ struct cmdlineInfo { static void -parseCommandLine(int argc, char ** argv, - struct cmdlineInfo * const cmdlineP) { +parseCommandLine(int argc, const char ** argv, + struct CmdlineInfo * const cmdlineP) { /*---------------------------------------------------------------------------- Convert program invocation arguments (argc,argv) into a format the program can use easily, struct cmdlineInfo. Validate arguments along @@ -57,7 +57,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. */ if (!tupletypeSpec) @@ -101,6 +101,7 @@ parseCommandLine(int argc, char ** argv, pm_error("height argument must be a positive number. You " "specified '%s'", argv[2]); } + free(option_def); } @@ -159,15 +160,15 @@ imageNormalizer(struct pam * const pamP, int -main(int argc, char **argv) { +main(int argc, const char **argv) { - struct cmdlineInfo cmdline; + struct CmdlineInfo cmdline; struct pam pam; int row; double normalizer; tuplen * tuplerown; - pnm_init(&argc, argv); + pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); |