diff options
Diffstat (limited to 'editor/ppmchange.c')
-rw-r--r-- | editor/ppmchange.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/editor/ppmchange.c b/editor/ppmchange.c index 6d3839bd..f0d2cc38 100644 --- a/editor/ppmchange.c +++ b/editor/ppmchange.c @@ -13,6 +13,7 @@ ** 28 Jan 94 - Added multiple color substitution function. */ +#include "pm_c_util.h" #include "ppm.h" #include "shhopt.h" #include "mallocvar.h" @@ -144,22 +145,22 @@ changeRow(const pixel * const inrow, The input row is 'inrow'. The output is returned as 'outrow', in storage which must be already allocated. Both are 'cols' columns wide. -----------------------------------------------------------------------------*/ - int col; + unsigned int col; for (col = 0; col < cols; ++col) { - int i; - int have_match; /* logical: It's a color user said to change */ + unsigned int i; + bool haveMatch; /* logical: It's a color user said to change */ pixel newcolor; /* Color to which we must change current pixel. Undefined unless - 'have_match' is true. + 'haveMatch' is true. */ - have_match = FALSE; /* haven't found a match yet */ - for (i = 0; i < ncolors && !have_match; ++i) { - have_match = colormatch(inrow[col], colorfrom[i], closeness); + haveMatch = FALSE; /* haven't found a match yet */ + for (i = 0; i < ncolors && !haveMatch; ++i) { + haveMatch = colormatch(inrow[col], colorfrom[i], closeness); newcolor = colorto[i]; } - if (have_match) + if (haveMatch) outrow[col] = newcolor; else if (remainder_specified) outrow[col] = remainder_color; |