diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2010-04-10 16:07:24 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2010-04-10 16:07:24 +0000 |
commit | 7d714381d1af9f51ae0094df79e1fe8d28c46b84 (patch) | |
tree | cf576cb526aa84b025b3bb599062e1849a55a3b0 /converter/pbm | |
parent | 73225706f044df73549d0982e782b41ff94e117f (diff) | |
download | netpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.tar.gz netpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.tar.xz netpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.zip |
Fix compiler warnings
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1185 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm')
-rw-r--r-- | converter/pbm/pbmto10x.c | 4 | ||||
-rw-r--r-- | converter/pbm/pbmtonokia.c | 8 | ||||
-rw-r--r-- | converter/pbm/pbmtoxbm.c | 2 | ||||
-rw-r--r-- | converter/pbm/thinkjettopbm.l | 3 | ||||
-rw-r--r-- | converter/pbm/xbmtopbm.c | 2 |
5 files changed, 11 insertions, 8 deletions
diff --git a/converter/pbm/pbmto10x.c b/converter/pbm/pbmto10x.c index f8a38b5d..8a3edb36 100644 --- a/converter/pbm/pbmto10x.c +++ b/converter/pbm/pbmto10x.c @@ -60,7 +60,7 @@ res_60x72(void) { MALLOCARRAY(stripe, cols); if (stripe == NULL) pm_error("Unable to allocate %u bytes for a stripe buffer.", - cols * sizeof(stripe[0])); + (unsigned)(cols * sizeof(stripe[0]))); for (i = 0; i < LOW_RES_ROWS; ++i) bitrows[i] = pbm_allocrow(cols); printf("\033A\010"); /* '\n' = 8/72 */ @@ -95,7 +95,7 @@ res_120x144(void) { MALLOCARRAY(stripe, cols); if (stripe == NULL) pm_error("Unable to allocate %u bytes for a stripe buffer.", - cols * sizeof(stripe[0])); + (unsigned)(cols * sizeof(stripe[0]))); for (i = 0; i < HIGH_RES_ROWS; ++i) bitrows[i] = pbm_allocrow(cols); printf("\0333\001"); /* \n = 1/144" */ diff --git a/converter/pbm/pbmtonokia.c b/converter/pbm/pbmtonokia.c index b8057393..dd64fc20 100644 --- a/converter/pbm/pbmtonokia.c +++ b/converter/pbm/pbmtonokia.c @@ -45,7 +45,7 @@ uppercase(const char * const subject) { if (buffer == NULL) pm_error("Out of memory allocating buffer for uppercasing a " - "%u-character string", strlen(subject)); + "%u-character string", (unsigned)strlen(subject)); else { unsigned int i; @@ -117,7 +117,7 @@ parseCommandLine(int argc, char ** argv, if (netSpec) { if (strlen(netOpt) != 6) pm_error("-net option must be 6 hex digits long. " - "You specified %u characters", strlen(netOpt)); + "You specified %u characters", (unsigned)strlen(netOpt)); else if (!strishex(netOpt)) pm_error("-net option must be hexadecimal. You specified '%s'", netOpt); @@ -131,7 +131,7 @@ parseCommandLine(int argc, char ** argv, else if (strlen(cmdlineP->txt) > 120) pm_error("Text message is longer (%u characters) than " "the 120 characters allowed by the format.", - strlen(cmdlineP->txt)); + (unsigned)strlen(cmdlineP->txt)); if (argc-1 == 0) cmdlineP->inputFileName = "-"; @@ -253,7 +253,7 @@ convertToHexNpm(bit ** const image, unsigned int it; - fprintf(ofP, "00%04X", len); + fprintf(ofP, "00%04X", (unsigned)len); for (it = 0; it < len; ++it) fprintf(ofP, "%02X", text[it]); diff --git a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c index 937e56c5..dd3dcc3b 100644 --- a/converter/pbm/pbmtoxbm.c +++ b/converter/pbm/pbmtoxbm.c @@ -83,7 +83,7 @@ parseCommandLine(int argc, cmdlineP->name = NULL; else if (strlen(cmdlineP->name) > 56) pm_error("Image name too long: %d chars. (max 56)", - strlen(cmdlineP->name)); + (unsigned)strlen(cmdlineP->name)); else if (!ISALPHA(cmdlineP->name[0]) && cmdlineP->name[0] !='_') pm_error("Image name '%s' starts with non-alphabet character.", cmdlineP->name); diff --git a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l index 71501596..e9b44f23 100644 --- a/converter/pbm/thinkjettopbm.l +++ b/converter/pbm/thinkjettopbm.l @@ -49,6 +49,7 @@ uses a macro he failed to define). */ #define YY_NO_UNPUT +#define YY_NO_INPUT 1 #define YY_STACK_USED 0 #define YY_ALWAYS_INTERACTIVE 0 #define YY_NEVER_INTERACTIVE 0 @@ -200,6 +201,8 @@ main (int argc, char **argv) } debugFlag = cmdline.debug; yylex (); + if (0) + yyunput(0, NULL); /* defeat compiler warning about unused fn */ return 0; } diff --git a/converter/pbm/xbmtopbm.c b/converter/pbm/xbmtopbm.c index 135b79f1..2ac61ccf 100644 --- a/converter/pbm/xbmtopbm.c +++ b/converter/pbm/xbmtopbm.c @@ -170,7 +170,7 @@ getXbmHeader(FILE * const ifP, if (strlen(line) == MAX_LINE - 1) pm_error("A line in the input file is %u characters long. " "%u is the maximum we can handle", - strlen(line), MAX_LINE-1); + (unsigned)strlen(line), MAX_LINE-1); parseWidthHeightLine(line, &gotWidth, widthP, &gotHeight, heightP); |