From 620ecbee2ed1cb478e0289722d86dd72717f1cb8 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 28 Jun 2015 15:34:21 +0000 Subject: Release 10.71.00 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2588 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/pbm/pbmtomatrixorbital.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'converter/pbm/pbmtomatrixorbital.c') diff --git a/converter/pbm/pbmtomatrixorbital.c b/converter/pbm/pbmtomatrixorbital.c index 96e1406a..41f8e260 100644 --- a/converter/pbm/pbmtomatrixorbital.c +++ b/converter/pbm/pbmtomatrixorbital.c @@ -1,3 +1,5 @@ +#include + #include "pbm.h" /* By Bryan Henderson, San Jose CA 2003.09.06. @@ -12,10 +14,10 @@ static void -generateMo(FILE * const ofP, - bit ** const bits, - int const cols, - int const rows) { +generateMo(FILE * const ofP, + bit ** const bits, + unsigned int const cols, + unsigned int const rows) { unsigned int col; @@ -51,37 +53,40 @@ generateMo(FILE * const ofP, int -main(int argc, char * argv[]) { +main(int argc, const char ** argv) { - FILE* ifp; - bit** bits; + FILE * ifP; + bit ** bits; int rows, cols; const char * inputFilename; - pbm_init(&argc, argv); + pm_proginit(&argc, argv); if (argc-1 > 1) - pm_error("Too many arguments (%d). The only valid argument is an " + pm_error("Too many arguments (%u). The only valid argument is an " "input file name.", argc-1); else if (argc-1 == 1) inputFilename = argv[1]; else inputFilename = "-"; - ifp = pm_openr(inputFilename); + ifP = pm_openr(inputFilename); - bits = pbm_readpbm(ifp, &cols, &rows); + bits = pbm_readpbm(ifP, &cols, &rows); if (rows > 255) - pm_error("Image is too high: %d rows. Max height: 255 rows", rows); + pm_error("Image is too high: %u rows. Max height: 255 rows", rows); if (cols > 255) - pm_error("Image is too wide: %d cols. Max width: 255 cols", cols); + pm_error("Image is too wide: %u cols. Max width: 255 cols", cols); generateMo(stdout, bits, cols, rows); - pm_close(ifp); + pm_close(ifP); pbm_freearray(bits, rows); - exit(0); + return 0; } + + + -- cgit 1.4.1