From 75aaab85f92320ceac421182154f91503388e86e Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 10 May 2007 02:49:13 +0000 Subject: Replace STREQ() with streq() git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@295 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pamundice.c | 2 +- editor/pgmmedian.c | 4 ++-- editor/ppmdraw.c | 30 +++++++++++++++--------------- lib/libppmfuzzy.c | 2 +- other/pamx/pamx.c | 2 +- other/pnmcolormap.c | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/editor/pamundice.c b/editor/pamundice.c index 1fe37d3d..90bac9f6 100644 --- a/editor/pamundice.c +++ b/editor/pamundice.c @@ -608,7 +608,7 @@ verifyRankFileAttributes(struct pam * const inpam, pm_error("Rank %u, File %u image has format 0x%x, " "which differs from others (0x%x)", rank, file, inpamP->format, outpamP->format); - else if (!STREQ(inpamP->tuple_type, outpamP->tuple_type)) + else if (!streq(inpamP->tuple_type, outpamP->tuple_type)) pm_error("Rank %u, File %u image has tuple type '%s', " "which differs from others ('%s')", rank, file, inpamP->tuple_type, outpamP->tuple_type); diff --git a/editor/pgmmedian.c b/editor/pgmmedian.c index 5878b1e7..9ca2bbb1 100644 --- a/editor/pgmmedian.c +++ b/editor/pgmmedian.c @@ -102,9 +102,9 @@ parseCommandLine(int argc, char ** argv, cmdlineP->cutoff = 250; if (typeSpec) { - if (STREQ(type, "histogram_sort")) + if (streq(type, "histogram_sort")) cmdlineP->type = HISTOGRAM_SORT_MEDIAN; - else if (STREQ(type, "select")) + else if (streq(type, "select")) cmdlineP->type = SELECT_MEDIAN; else pm_error("Invalid value '%s' for -type. Valid values are " diff --git a/editor/ppmdraw.c b/editor/ppmdraw.c index 0dd03bc9..3bd271a6 100644 --- a/editor/ppmdraw.c +++ b/editor/ppmdraw.c @@ -515,7 +515,7 @@ parseDrawCommand(struct tokenSet const commandTokens, if (drawCommandP == NULL) pm_error("Out of memory to parse '%s' command", verb); - if (STREQ(verb, "setpos")) { + if (streq(verb, "setpos")) { drawCommandP->verb = VERB_SETPOS; if (commandTokens.count < 3) pm_error("Not enough tokens for a 'setpos' command. " @@ -524,22 +524,22 @@ parseDrawCommand(struct tokenSet const commandTokens, drawCommandP->u.setposArg.x = atoi(commandTokens.token[1]); drawCommandP->u.setposArg.y = atoi(commandTokens.token[2]); } - } else if (STREQ(verb, "setlinetype")) { + } else if (streq(verb, "setlinetype")) { drawCommandP->verb = VERB_SETLINETYPE; if (commandTokens.count < 2) pm_error("Not enough tokens for a 'setlinetype' command. " "Need %u. Got %u", 2, commandTokens.count); else { const char * const typeArg = commandTokens.token[1]; - if (STREQ(typeArg, "normal")) + if (streq(typeArg, "normal")) drawCommandP->u.setlinetypeArg.type = PPMD_LINETYPE_NORMAL; - else if (STREQ(typeArg, "normal")) + else if (streq(typeArg, "normal")) drawCommandP->u.setlinetypeArg.type = PPMD_LINETYPE_NODIAGS; else pm_error("Invalid type"); } - } else if (STREQ(verb, "setlineclip")) { + } else if (streq(verb, "setlineclip")) { drawCommandP->verb = VERB_SETLINECLIP; if (commandTokens.count < 2) pm_error("Not enough tokens for a 'setlineclip' command. " @@ -547,7 +547,7 @@ parseDrawCommand(struct tokenSet const commandTokens, else drawCommandP->u.setlineclipArg.clip = atoi(commandTokens.token[1]); - } else if (STREQ(verb, "setcolor")) { + } else if (streq(verb, "setcolor")) { drawCommandP->verb = VERB_SETCOLOR; if (commandTokens.count < 2) pm_error("Not enough tokens for a 'setcolor' command. " @@ -555,7 +555,7 @@ parseDrawCommand(struct tokenSet const commandTokens, else drawCommandP->u.setcolorArg.colorName = strdup(commandTokens.token[1]); - } else if (STREQ(verb, "setfont")) { + } else if (streq(verb, "setfont")) { drawCommandP->verb = VERB_SETFONT; if (commandTokens.count < 2) pm_error("Not enough tokens for a 'setfont' command. " @@ -563,7 +563,7 @@ parseDrawCommand(struct tokenSet const commandTokens, else drawCommandP->u.setfontArg.fontFileName = strdup(commandTokens.token[1]); - } else if (STREQ(verb, "line")) { + } else if (streq(verb, "line")) { drawCommandP->verb = VERB_LINE; if (commandTokens.count < 5) pm_error("Not enough tokens for a 'line' command. " @@ -574,7 +574,7 @@ parseDrawCommand(struct tokenSet const commandTokens, drawCommandP->u.lineArg.x1 = atoi(commandTokens.token[3]); drawCommandP->u.lineArg.y1 = atoi(commandTokens.token[4]); } - } else if (STREQ(verb, "line_here")) { + } else if (streq(verb, "line_here")) { drawCommandP->verb = VERB_LINE_HERE; if (commandTokens.count < 3) pm_error("Not enough tokens for a 'line_here' command. " @@ -585,7 +585,7 @@ parseDrawCommand(struct tokenSet const commandTokens, argP->right = atoi(commandTokens.token[1]); argP->down = atoi(commandTokens.token[2]); } - } else if (STREQ(verb, "spline3")) { + } else if (streq(verb, "spline3")) { drawCommandP->verb = VERB_SPLINE3; if (commandTokens.count < 7) pm_error("Not enough tokens for a 'spline3' command. " @@ -600,7 +600,7 @@ parseDrawCommand(struct tokenSet const commandTokens, argP->x2 = atoi(commandTokens.token[5]); argP->y2 = atoi(commandTokens.token[6]); } - } else if (STREQ(verb, "circle")) { + } else if (streq(verb, "circle")) { drawCommandP->verb = VERB_CIRCLE; if (commandTokens.count < 4) pm_error("Not enough tokens for a 'circle' command. " @@ -611,7 +611,7 @@ parseDrawCommand(struct tokenSet const commandTokens, argP->cy = atoi(commandTokens.token[2]); argP->radius = atoi(commandTokens.token[3]); } - } else if (STREQ(verb, "filledrectangle")) { + } else if (streq(verb, "filledrectangle")) { drawCommandP->verb = VERB_FILLEDRECTANGLE; if (commandTokens.count < 5) pm_error("Not enough tokens for a 'filledrectangle' command. " @@ -624,7 +624,7 @@ parseDrawCommand(struct tokenSet const commandTokens, argP->width = atoi(commandTokens.token[3]); argP->height = atoi(commandTokens.token[4]); } - } else if (STREQ(verb, "text")) { + } else if (streq(verb, "text")) { drawCommandP->verb = VERB_TEXT; if (commandTokens.count < 6) pm_error("Not enough tokens for a 'text' command. " @@ -638,7 +638,7 @@ parseDrawCommand(struct tokenSet const commandTokens, if (drawCommandP->u.textArg.text == NULL) pm_error("Out of storage parsing 'text' command"); } - } else if (STREQ(verb, "text_here")) { + } else if (streq(verb, "text_here")) { drawCommandP->verb = VERB_TEXT_HERE; if (commandTokens.count < 4) pm_error("Not enough tokens for a 'text_here' command. " @@ -705,7 +705,7 @@ processToken(const char * const scriptText, memcpy(token, &scriptText[tokenStart], tokenLength); token[tokenLength] = '\0'; - if (STREQ(token, ";")) { + if (streq(token, ";")) { disposeOfCommandTokens(tokenSetP, scriptP); free(token); } else { diff --git a/lib/libppmfuzzy.c b/lib/libppmfuzzy.c index e149b42a..2a54e896 100644 --- a/lib/libppmfuzzy.c +++ b/lib/libppmfuzzy.c @@ -425,7 +425,7 @@ ppm_bk_color_from_name(const char * const name) { bk_color i; for (i = 0; i < BKCOLOR_COUNT; ++i) { - if (STREQ(name, bkColorNameMap[i])) + if (streq(name, bkColorNameMap[i])) return i; } pm_error("Invalid Berlin-Kay color name: '%s'", name); diff --git a/other/pamx/pamx.c b/other/pamx/pamx.c index c6503d5e..49aa07c9 100644 --- a/other/pamx/pamx.c +++ b/other/pamx/pamx.c @@ -298,7 +298,7 @@ determineTitle(struct cmdlineInfo const cmdline, if (cmdline.title) title = strdup(cmdline.title); else { - if (STREQ(cmdline.inputFileName, "-")) + if (streq(cmdline.inputFileName, "-")) title = NULL; else { title = pm_basename(cmdline.inputFileName); diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c index 1be54ef8..4faf5ab6 100644 --- a/other/pnmcolormap.c +++ b/other/pnmcolormap.c @@ -631,7 +631,7 @@ validateCompatibleImage(struct pam * const inpamP, if (inpamP->format != firstPamP->format) pm_error("Image %u format (%d) is not the same as Image 0 (%d)", imageSeq, inpamP->format, firstPamP->format); - if (!STREQ(inpamP->tuple_type, firstPamP->tuple_type)) + if (!streq(inpamP->tuple_type, firstPamP->tuple_type)) pm_error("Image %u tuple type (%s) is not the same as Image 0 (%s)", imageSeq, inpamP->tuple_type, firstPamP->tuple_type); } -- cgit 1.4.1