--- rxvt-unicode/src/rxvtfont.C 2012/01/26 13:08:51 1.188 +++ rxvt-unicode/src/rxvtfont.C 2014/11/07 13:45:55 1.193 @@ -6,7 +6,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -242,7 +242,7 @@ Picture dst; # ifdef HAVE_BG_PIXMAP - if (term->bg_pixmap + if (term->bg_img && !term->pix_colors[color].is_opaque () && ((dst = XftDrawPicture (d)))) { @@ -936,7 +936,8 @@ 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; @@ -1413,7 +1414,7 @@ #ifdef HAVE_BG_PIXMAP Picture dst = 0; // the only assignment is done conditionally in the following if condition - if (term->bg_pixmap + if (term->bg_img && (bg == Color_transparent || bg == Color_bg || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) { @@ -1425,10 +1426,10 @@ src_y += term->window_vt_y; } - if (term->bg_pmap_width >= src_x + w - && term->bg_pmap_height >= src_y + h) + if (term->bg_img->w >= src_x + w + && term->bg_img->h >= src_y + h) { - XCopyArea (disp, term->bg_pixmap, d2, gc, + XCopyArea (disp, term->bg_img->pm, d2, gc, src_x, src_y, w, h, 0, 0); } else @@ -1436,7 +1437,7 @@ XGCValues gcv; gcv.fill_style = FillTiled; - gcv.tile = term->bg_pixmap; + gcv.tile = term->bg_img->pm; gcv.ts_x_origin = -src_x; gcv.ts_y_origin = -src_y; @@ -1501,7 +1502,7 @@ (*i)->unref (); for (pagemap **p = fmap.begin (); p != fmap.end (); p++) - delete [] *p; + delete *p; free (fontdesc); fontdesc = 0; @@ -1787,14 +1788,7 @@ if (!fmap[hi]) { - // we use [1] here because C++ has no separate new and new [] forms, - // and pagemap is char[256], so new incorrectly assumes we want to - // allocate an array of chars instead of a single pagemap. - // we can either cast the resulting pointer to (pagemap *) or - // allocate an array of pagemaps, returning a pointer to the first member - // this is no extra overhead, as new even allocates an array for - // "new pagemap" - fmap[hi] = new pagemap[1]; + fmap[hi] = new pagemap; memset (fmap[hi], 0xff, sizeof (pagemap)); }