diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-04-28 15:47:46 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-04-28 15:47:46 +0000 |
commit | c3706293c92b65926b5183bf10a5c602a6318e89 (patch) | |
tree | cb1dc00702491762bce5e8478a28ff782fe7e73a /lib/libppmcolor.c | |
parent | c4210f7b1ec1c488bfed1e5c87a5981fcdb3c599 (diff) | |
download | netpbm-mirror-c3706293c92b65926b5183bf10a5c602a6318e89.tar.gz netpbm-mirror-c3706293c92b65926b5183bf10a5c602a6318e89.tar.xz netpbm-mirror-c3706293c92b65926b5183bf10a5c602a6318e89.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3220 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libppmcolor.c')
-rw-r--r-- | lib/libppmcolor.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libppmcolor.c b/lib/libppmcolor.c index cab24627..5870d2c5 100644 --- a/lib/libppmcolor.c +++ b/lib/libppmcolor.c @@ -421,24 +421,24 @@ ppm_colorname(const pixel * const colorP, f = pm_openColornameFile(NULL, !hexok); if (f != NULL) { - int best_diff, this_diff; + int bestDiff, thisDiff; bool eof; - best_diff = 32767; + bestDiff = 32767; eof = FALSE; - while (!eof && best_diff > 0 ) { + while (!eof && bestDiff > 0 ) { struct colorfile_entry const ce = pm_colorget(f); if (ce.colorname) { - this_diff = abs(r - ce.r) + abs(g - ce.g) + abs(b - ce.b); - if (this_diff < best_diff) { - best_diff = this_diff; + thisDiff = abs(r - ce.r) + abs(g - ce.g) + abs(b - ce.b); + if (thisDiff < bestDiff) { + bestDiff = thisDiff; strcpy(colorname, ce.colorname); } } else eof = TRUE; } fclose(f); - if (best_diff != 32767 && (best_diff == 0 || ! hexok)) + if (bestDiff != 32767 && (bestDiff == 0 || ! hexok)) return colorname; } |