commented casts

This commit is contained in:
Charlie Gordon 2015-06-19 21:39:07 +00:00
commit 0efc7d9c56

5
tty.c
View file

@ -830,9 +830,8 @@ int tty_bg_colors_count = 16;
unsigned int const *tty_fg_colors = tty_putty_colors;
int tty_fg_colors_count = 16;
static inline int color_dist(unsigned int c1, unsigned int c2)
{
static inline int color_dist(unsigned int c1, unsigned int c2) {
/* using casts because c1 and c2 are unsigned */
return abs((int)((c1 >> 0) & 0xff) - (int)((c2 >> 0) & 0xff)) +
2 * abs((int)((c1 >> 8) & 0xff) - (int)((c2 >> 8) & 0xff)) +
abs((int)((c1 >> 16) & 0xff) - (int)((c2 >> 16) & 0xff));