[vte/wip/sixels: 9/82] sixels: Be explicit about bitwise operator precedence



commit 560f5d47fb863a69e5e5ac4ca3e5061683fb265f
Author: Hans Petter Jansson <hpj cl no>
Date:   Wed May 27 01:54:54 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]