about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-07 19:25:44 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-07 19:25:44 +0000
commitb1528e437e46d978c8e5721197ac0d41536c5403 (patch)
tree3afdf15fb98e0280bb41c41fe7d19ca5f72f16c5
parentc84db6d5899ca01a32e4506eb730151c3e03cce3 (diff)
downloadnetpbm-mirror-b1528e437e46d978c8e5721197ac0d41536c5403.tar.gz
netpbm-mirror-b1528e437e46d978c8e5721197ac0d41536c5403.tar.xz
netpbm-mirror-b1528e437e46d978c8e5721197ac0d41536c5403.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4859 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--other/pamarith.c2
-rw-r--r--other/pambayer.c4
-rw-r--r--other/pamchannel.c4
-rw-r--r--other/pamdepth.c4
-rw-r--r--other/pamexec.c6
-rw-r--r--other/pamlookup.c2
-rw-r--r--other/pampick.c6
-rw-r--r--other/pamsplit.c6
-rw-r--r--other/pamstack.c4
-rw-r--r--other/pamsummcol.c2
-rw-r--r--other/pamunlookup.c2
-rw-r--r--other/pnmcolormap.c6
-rw-r--r--other/ppmsvgalib.c7
13 files changed, 20 insertions, 35 deletions
diff --git a/other/pamarith.c b/other/pamarith.c
index 31f52a59..05ba5327 100644
--- a/other/pamarith.c
+++ b/other/pamarith.c
@@ -112,7 +112,7 @@ parseCommandLine(int argc, const char ** const 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, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (addSpec + subtractSpec + multiplySpec + divideSpec + differenceSpec +
diff --git a/other/pambayer.c b/other/pambayer.c
index 599dc11e..1d5522f9 100644
--- a/other/pambayer.c
+++ b/other/pambayer.c
@@ -55,8 +55,6 @@ parseCommandLine(int argc, const char ** argv,
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
     optEntry * option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -75,7 +73,7 @@ parseCommandLine(int argc, const char ** argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We may have parms that are negative numbers */
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     free(option_def);
diff --git a/other/pamchannel.c b/other/pamchannel.c
index 0b9c3947..95fdc088 100644
--- a/other/pamchannel.c
+++ b/other/pamchannel.c
@@ -43,8 +43,6 @@ parseCommandLine(int argc, const char ** argv,
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
     optEntry *option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
     optStruct3 opt;
     extern struct pam pam;  /* Just so we can look at field sizes */
 
@@ -63,7 +61,7 @@ parseCommandLine(int argc, const 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, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (!infileSpec)
diff --git a/other/pamdepth.c b/other/pamdepth.c
index 4349f5ea..4425fcf2 100644
--- a/other/pamdepth.c
+++ b/other/pamdepth.c
@@ -36,8 +36,6 @@ parseCommandLine(int argc, const char ** argv,
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
     optEntry * option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -52,7 +50,7 @@ parseCommandLine(int argc, const char ** argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We may have parms that are negative numbers */
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (argc-1 < 1)
diff --git a/other/pamexec.c b/other/pamexec.c
index cbde81ac..b615790c 100644
--- a/other/pamexec.c
+++ b/other/pamexec.c
@@ -68,9 +68,7 @@ parseCommandLine(int argc, const char ** argv,
    Note that the pointers we place into *cmdlineP are sometimes to storage
    in the argv array.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def;
-        /* Instructions to OptParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -85,7 +83,7 @@ parseCommandLine(int argc, const 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, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (argc-1 < 1)
diff --git a/other/pamlookup.c b/other/pamlookup.c
index 23a113c3..9682a65e 100644
--- a/other/pamlookup.c
+++ b/other/pamlookup.c
@@ -67,7 +67,7 @@ parseCommandLine(int argc, const char ** const argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We may have parms that are negative numbers */
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc,argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (!lookupfileSpec)
diff --git a/other/pampick.c b/other/pampick.c
index 67d42fc5..d831fcbb 100644
--- a/other/pampick.c
+++ b/other/pampick.c
@@ -98,9 +98,7 @@ parseCommandLine(int argc, const char ** argv,
    Note that the pointers we place into *cmdlineP are sometimes to storage
    in the argv array.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def;
-        /* Instructions to OptParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -119,7 +117,7 @@ parseCommandLine(int argc, const 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, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     initUintSet(&cmdlineP->imageSeqList, argc-1);
diff --git a/other/pamsplit.c b/other/pamsplit.c
index 8c7aff11..1c1ab3d4 100644
--- a/other/pamsplit.c
+++ b/other/pamsplit.c
@@ -41,9 +41,7 @@ parseCommandLine(int argc, const char ** argv,
    Note that the pointers we place into *cmdlineP are sometimes to storage
    in the argv array.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def;
-        /* Instructions to OptParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
 
     unsigned int padnameSpec;
@@ -60,7 +58,7 @@ parseCommandLine(int argc, const 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, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (!padnameSpec)
diff --git a/other/pamstack.c b/other/pamstack.c
index 533795ca..1c005f4c 100644
--- a/other/pamstack.c
+++ b/other/pamstack.c
@@ -53,8 +53,6 @@ parseCommandLine(int argc, const char ** argv,
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
     optEntry * option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
     optStruct3 opt;
     extern struct pam pam;  /* Just so we can look at field sizes */
 
@@ -73,7 +71,7 @@ parseCommandLine(int argc, const char ** argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We may have parms that are negative numbers */
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (!tupletypeSpec)
diff --git a/other/pamsummcol.c b/other/pamsummcol.c
index 673eaf57..ec0d2085 100644
--- a/other/pamsummcol.c
+++ b/other/pamsummcol.c
@@ -21,7 +21,7 @@ struct cmdlineInfo {
     /* All the information the user supplied in the command line,
        in a form easy for the program to use.
     */
-    const char *inputFilespec;  /* Filespec of input file */
+    const char * inputFilespec;  /* Filespec of input file */
     enum function function;
     unsigned int verbose;
 };
diff --git a/other/pamunlookup.c b/other/pamunlookup.c
index defa7b1f..a835ebd8 100644
--- a/other/pamunlookup.c
+++ b/other/pamunlookup.c
@@ -61,7 +61,7 @@ parseCommandLine(int argc, const char ** const argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We may have parms that are negative numbers */
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (!lookupfileSpec)
diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c
index 97e56654..f59a1a0d 100644
--- a/other/pnmcolormap.c
+++ b/other/pnmcolormap.c
@@ -111,9 +111,7 @@ parseCommandLine (int argc, const char ** argv,
    Note that the strings we return are stored in the storage that
    was passed to us as the argv array.  We also trash *argv.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -154,7 +152,7 @@ parseCommandLine (int argc, const 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, (char **)argv, opt, sizeof(opt), 0 );
+    pm_optParseOptions4( &argc, argv, opt, sizeof(opt), 0 );
         /* Uses and sets argc, argv, and some of *cmdline_p and others. */
 
 
diff --git a/other/ppmsvgalib.c b/other/ppmsvgalib.c
index 97cef286..e106280b 100644
--- a/other/ppmsvgalib.c
+++ b/other/ppmsvgalib.c
@@ -20,6 +20,7 @@
 #include "pm_c_util.h"
 #include "ppm.h"
 #include "shhopt.h"
+#include "mallocvar.h"
 
 struct cmdlineInfo {
     /* All the information the user supplied in the command line,
@@ -45,15 +46,15 @@ parseCommandLine (int argc, char ** argv,
    Note that the strings we return are stored in the storage that
    was passed to us as the argv array.  We also trash *argv.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def = malloc( 100*sizeof( optEntry ) );
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
 
     unsigned int option_def_index;
 
     unsigned int modeSpec;
 
+    MALLOCARRAY(option_def, 100);
+
     option_def_index = 0;   /* incremented by OPTENT3 */
     OPTENT3(0,   "mode",         OPT_UINT,
             &cmdlineP->mode,   &modeSpec, 0);