From cd55cb529c43d0772fb0daf64af0bac465910260 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 14 Nov 2020 19:52:57 +0000 Subject: Mark equal and mean as dyadic, since they are not associative git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3986 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- other/pamarith.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/other/pamarith.c b/other/pamarith.c index 4220169d..a4cb3502 100644 --- a/other/pamarith.c +++ b/other/pamarith.c @@ -29,8 +29,6 @@ isDyadic(enum Function const function) { case FN_MULTIPLY: case FN_MINIMUM: case FN_MAXIMUM: - case FN_MEAN: - case FN_EQUAL: case FN_AND: case FN_NAND: case FN_OR: @@ -42,8 +40,10 @@ isDyadic(enum Function const function) { case FN_DIFFERENCE: case FN_COMPARE: case FN_DIVIDE: + case FN_MEAN: case FN_SHIFTLEFT: case FN_SHIFTRIGHT: + case FN_EQUAL: retval = TRUE; break; } @@ -176,9 +176,11 @@ parseCommandLine(int argc, const char ** const argv, argc-1); else { if (isDyadic(cmdlineP->function) && argc-1 > 2) - pm_error("You specified %u arguments, but a dyadic function. " - "For a dyadic function, you must specify 2 arguments: " - "the operands of the function", argc-1); + pm_error("You specified %u arguments, but a function " + "which is not associative and commutative. " + "Unless a function is associative and commutative " + "(like -add), you must specify exactly two arguments. ", + argc-1); else { cmdlineP->operandCt = argc-1; cmdlineP->operandFileNames = &argv[1]; -- cgit 1.4.1