repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: ad40ce1766761e8dec8b192ba7b41a3d6c0cb615: path_to: revision_to:
commit ad40ce1766761e8dec8b192ba7b41a3d6c0cb615 Author: Emanuele GiaquintaDate: 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
--- 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
--- 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-----