repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: ad40ce1766761e8dec8b192ba7b41a3d6c0cb615:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit ad40ce1766761e8dec8b192ba7b41a3d6c0cb615
Author: Emanuele Giaquinta 
Date:   Fri Nov 7 13:45:55 2014 +0000

    Remove narrowing conversions in aggregate initializations, as they are invalid in C++11.

diff --git a/src/rxvtfont.C b/src/rxvtfont.C
index cd8bd89021b41a5ee46e9b4de6774dcd13268684..
index ..255ead91908e24b787537b34e1c53dba52dcb7c0 100644
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -936,7 +936,8 @@ rxvt_font_x11::load (const rxvt_fontprop &prop, bool force_prop)
       if (!has_char (*t, &prop, careful))
         continue;

-      XChar2b ch = { *t >> 8, *t };
+      // the casts are needed in C++11 (see 8.5.1)
+      XChar2b ch = { (unsigned char)(*t >> 8), (unsigned char)*t };

       XCharStruct g;
       int dir_ret, asc_ret, des_ret;
diff --git a/src/rxvtimg.C b/src/rxvtimg.C
index f5182fb16fd070f4b4fdc84675425e06cf3ac4aa..
index ..d701fea29e85abf79744e40d54a1cd207085cd02 100644
--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -190,11 +190,12 @@ namespace
     // CreateSolidFill creates a very very very weird picture
     void mask (const rgba &c)
     {
+      // the casts are needed in C++11 (see 8.5.1)
       XRenderColor rc = {
-        c.r * c.a / 65535,
-        c.g * c.a / 65535,
-        c.b * c.a / 65535,
-              c.a
+        (unsigned short)(c.r * c.a / 65535),
+        (unsigned short)(c.g * c.a / 65535),
+        (unsigned short)(c.b * c.a / 65535),
+        c.a
       };
       msk = XRenderCreateSolidFill (dpy, &rc);
       ecb_assume (msk);
@@ -203,10 +204,10 @@ namespace
     void fill (const rgba &c)
     {
       XRenderColor rc = {
-        c.r * c.a / 65535,
-        c.g * c.a / 65535,
-        c.b * c.a / 65535,
-              c.a
+        (unsigned short)(c.r * c.a / 65535),
+        (unsigned short)(c.g * c.a / 65535),
+        (unsigned short)(c.b * c.a / 65535),
+        c.a
       };

       XRenderFillRectangle (dpy, PictOpSrc, msk, &rc, 0, 0, 1, 1);

-----END OF PAGE-----