aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/color.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-03 21:31:32 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-03 21:31:32 -0700
commit42068931c734437d6da19037721b04cf0d125c1c (patch)
tree203e6974b5863b145fa600a62ecc93a0d8f7a7fc /src/color.cpp
parente1a706bd7770e17e36de61eaf1597d39288e7f0d (diff)
eliminate "useless parentheses" lint errors
Some `oclint` errors regarding "useless parentheses" are meaningfull. But the vast majority are bogus in as much as removing the parentheses reduces readability. So fix a few of the egregious uses and otherwise suppress that error.
Diffstat (limited to 'src/color.cpp')
-rw-r--r--src/color.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/color.cpp b/src/color.cpp
index 6b920d15..7ab96779 100644
--- a/src/color.cpp
+++ b/src/color.cpp
@@ -89,8 +89,8 @@ static unsigned long squared_difference(long p1, long p2) {
static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *colors,
size_t color_count) {
long r = rgb[0], g = rgb[1], b = rgb[2];
- unsigned long best_distance = (unsigned long)(-1);
- unsigned char best_index = (unsigned char)(-1);
+ unsigned long best_distance = (unsigned long)-1;
+ unsigned char best_index = (unsigned char)-1;
for (unsigned char idx = 0; idx < color_count; idx++) {
uint32_t color = colors[idx];
long test_r = (color >> 16) & 0xFF, test_g = (color >> 8) & 0xFF,
@@ -288,7 +288,7 @@ unsigned char rgb_color_t::to_name_index() const {
} else if (type == type_rgb) {
return term8_color_for_rgb(data.color.rgb);
} else {
- return (unsigned char)(-1); // this is an error
+ return (unsigned char)-1; // this is an error
}
}