From b6f2e9ba0e3be84aef0db018af32b43f344ff795 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 1 Apr 2007 17:44:32 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@269 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pamdice.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/editor/pamdice.c b/editor/pamdice.c index 062e05e3..4afb5f29 100644 --- a/editor/pamdice.c +++ b/editor/pamdice.c @@ -23,8 +23,8 @@ struct cmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ - const char * inputFilespec; /* '-' if stdin */ - char * outstem; + const char * inputFileName; /* '-' if stdin */ + const char * outstem; /* null-terminated string, max MAXFILENAMELEN-10 characters */ unsigned int sliceVertically; /* boolean */ unsigned int sliceHorizontally; /* boolean */ @@ -39,8 +39,8 @@ struct cmdlineInfo { static void -parseCommandLine ( int argc, char ** argv, - struct cmdlineInfo * const cmdlineP ) { +parseCommandLine(int argc, char ** argv, + struct cmdlineInfo * const cmdlineP ) { /*---------------------------------------------------------------------------- parse program command line described in Unix standard form by argc and argv. Return the information in the options as *cmdlineP. @@ -63,17 +63,17 @@ parseCommandLine ( int argc, char ** argv, option_def_index = 0; /* incremented by OPTENT3 */ OPTENT3(0, "width", OPT_UINT, &cmdlineP->width, - &cmdlineP->sliceVertically, 0 ); + &cmdlineP->sliceVertically, 0); OPTENT3(0, "height", OPT_UINT, &cmdlineP->height, - &cmdlineP->sliceHorizontally, 0 ); + &cmdlineP->sliceHorizontally, 0); OPTENT3(0, "hoverlap", OPT_UINT, &cmdlineP->hoverlap, - &hoverlapSpec, 0 ); + &hoverlapSpec, 0); OPTENT3(0, "voverlap", OPT_UINT, &cmdlineP->voverlap, - &voverlapSpec, 0 ); + &voverlapSpec, 0); OPTENT3(0, "outstem", OPT_STRING, &cmdlineP->outstem, - &outstemSpec, 0 ); + &outstemSpec, 0); OPTENT3(0, "verbose", OPT_FLAG, NULL, - &cmdlineP->verbose, 0 ); + &cmdlineP->verbose, 0); opt.opt_table = option_def; opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */ @@ -104,13 +104,14 @@ parseCommandLine ( int argc, char ** argv, if (!outstemSpec) pm_error("You must specify the -outstem option to indicate where to " "put the output images."); + if (argc-1 < 1) - cmdlineP->inputFilespec = "-"; + cmdlineP->inputFileName = "-"; else if (argc-1 == 1) - cmdlineP->inputFilespec = argv[1]; + cmdlineP->inputFileName = argv[1]; else pm_error("Progam takes at most 1 parameter: the file specification. " - "You specified %d", argc-1); + "You specified %u", argc-1); } @@ -451,7 +452,7 @@ main(int argc, char ** argv) { parseCommandLine(argc, argv, &cmdline); - ifP = pm_openr(cmdline.inputFilespec); + ifP = pm_openr(cmdline.inputFileName); pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); -- cgit 1.4.1