qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs tty.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs tty.c
Date: Sun, 03 May 2015 10:16:15 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        15/05/03 10:16:15

Modified files:
        .              : tty.c 

Log message:
        fixed signed/unsigned inconsistency

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.62&r2=1.63

Patches:
Index: tty.c
===================================================================
RCS file: /sources/qemacs/qemacs/tty.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- tty.c       27 May 2014 22:59:49 -0000      1.62
+++ tty.c       3 May 2015 10:16:15 -0000       1.63
@@ -830,12 +830,12 @@
 unsigned int const *tty_fg_colors = tty_putty_colors;
 int tty_fg_colors_count = 16;
 
-static inline int color_dist(unsigned int c1, unsigned c2)
+static inline int color_dist(unsigned int c1, unsigned int c2)
 {
 
-    return (abs( (c1 & 0xff) - (c2 & 0xff)) +
-            2 * abs( ((c1 >> 8) & 0xff) - ((c2 >> 8) & 0xff)) +
-            abs( ((c1 >> 16) & 0xff) - ((c2 >> 16) & 0xff)));
+    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));
 }
 
 int get_tty_color(QEColor color, unsigned int const *colors, int count)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]