[vte/wip/sixels: 19/111] sixels: Be explicit about bitwise operator precedence




commit 35682aab708a28fd16ca8046e51ed66cc2dcd280
Author: Hans Petter Jansson <hpj cl no>
Date:   Sat Aug 8 20:42:48 2020 +0200

    sixels: Be explicit about bitwise operator precedence

 src/vteseq.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/vteseq.cc b/src/vteseq.cc
index cd4e96a8..390f1035 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -3081,8 +3081,8 @@ Terminal::seq_load_sixel(char const* dcs)
        unsigned char *pixels = NULL;
        auto fg = get_color(VTE_DEFAULT_FG);
        auto bg = get_color(VTE_DEFAULT_BG);
-       int nfg = fg->red >> 8 | fg->green >> 8 << 8 | fg->blue >> 8 << 16;
-       int nbg = bg->red >> 8 | bg->green >> 8 << 8 | bg->blue >> 8 << 16;
+       int nfg = (fg->red >> 8) | ((fg->green >> 8) << 8) | ((fg->blue >> 8) << 16);
+       int nbg = (bg->red >> 8) | ((bg->green >> 8) << 8) | ((bg->blue >> 8) << 16);
        glong left, top, width, height;
        glong pixelwidth, pixelheight;
        glong i;


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