diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
commit | 43939e66b1d4eeb2f3799c124f3598756755005a (patch) | |
tree | 15733092de55d52421a6ea02f5a43d5f8ff24393 /other/pnmcolormap.c | |
parent | 49f4336c9bba33650573ba780b70bc501b38643e (diff) | |
download | netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.gz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.xz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.zip |
Rebase Stable series to current Advanced: 10.47.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@995 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pnmcolormap.c')
-rw-r--r-- | other/pnmcolormap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c index 1be54ef8..42b03063 100644 --- a/other/pnmcolormap.c +++ b/other/pnmcolormap.c @@ -26,11 +26,12 @@ #include <math.h> #include "pm_config.h" -#include "pam.h" -#include "pammap.h" -#include "shhopt.h" +#include "pm_c_util.h" #include "mallocvar.h" #include "nstring.h" +#include "shhopt.h" +#include "pam.h" +#include "pammap.h" enum methodForLargest {LARGE_NORM, LARGE_LUM}; @@ -380,7 +381,7 @@ averageColors(int const boxStart, for (i = 0; i < boxSize; ++i) sum += colorfreqtable.table[boxStart+i]->tuple[plane]; - newTuple[plane] = sum / boxSize; + newTuple[plane] = ROUNDDIV(sum, boxSize); } } @@ -414,7 +415,7 @@ averagePixels(int const boxStart, sum += colorfreqtable.table[boxStart+i]->tuple[plane] * colorfreqtable.table[boxStart+i]->value; - newTuple[plane] = sum / n; + newTuple[plane] = ROUNDDIV(sum, n); } } @@ -631,7 +632,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); } |