From 37045476844f1f9020fbd08cf74f1d445249046b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:44:01 +0000 Subject: [PATCH] fix complilation error: narrowing conversions in xbm files under wxX11. For discussion, please see ticket 12575 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/bdiag.xbm | 2 +- src/x11/cdiag.xbm | 2 +- src/x11/cross.xbm | 2 +- src/x11/dcclient.cpp | 18 ++++++++++++------ src/x11/fdiag.xbm | 2 +- src/x11/horiz.xbm | 2 +- src/x11/verti.xbm | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/x11/bdiag.xbm b/src/x11/bdiag.xbm index 9ff0a1822f..6b3ba001e9 100644 --- a/src/x11/bdiag.xbm +++ b/src/x11/bdiag.xbm @@ -1,6 +1,6 @@ #define bdiag_width 16 #define bdiag_height 16 -static char bdiag_bits[] = { +static unsigned char bdiag_bits[] = { 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01}; diff --git a/src/x11/cdiag.xbm b/src/x11/cdiag.xbm index 15dc7ba86d..e0502f2303 100644 --- a/src/x11/cdiag.xbm +++ b/src/x11/cdiag.xbm @@ -1,6 +1,6 @@ #define cdiag_width 16 #define cdiag_height 16 -static char cdiag_bits[] = { +static unsigned char cdiag_bits[] = { 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81}; diff --git a/src/x11/cross.xbm b/src/x11/cross.xbm index b07cbe7fcd..916ee76e3a 100644 --- a/src/x11/cross.xbm +++ b/src/x11/cross.xbm @@ -1,6 +1,6 @@ #define cross_width 15 #define cross_height 15 -static char cross_bits[] = { +static unsigned char cross_bits[] = { 0x84, 0x10, 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10}; diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 5aa69f78cc..c3c7d9a3f8 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -328,12 +328,18 @@ void wxWindowDCImpl::SetUpDC() Window xroot = RootWindow( (Display*) m_display, xscreen ); hatch_bitmap = hatches; - hatch_bitmap[0] = XCreateBitmapFromData( (Display*) m_display, xroot, bdiag_bits, bdiag_width, bdiag_height ); - hatch_bitmap[1] = XCreateBitmapFromData( (Display*) m_display, xroot, cdiag_bits, cdiag_width, cdiag_height ); - hatch_bitmap[2] = XCreateBitmapFromData( (Display*) m_display, xroot, fdiag_bits, fdiag_width, fdiag_height ); - hatch_bitmap[3] = XCreateBitmapFromData( (Display*) m_display, xroot, cross_bits, cross_width, cross_height ); - hatch_bitmap[4] = XCreateBitmapFromData( (Display*) m_display, xroot, horiz_bits, horiz_width, horiz_height ); - hatch_bitmap[5] = XCreateBitmapFromData( (Display*) m_display, xroot, verti_bits, verti_width, verti_height ); + hatch_bitmap[0] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(bdiag_bits), bdiag_width, bdiag_height ); + hatch_bitmap[1] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(cdiag_bits), cdiag_width, cdiag_height ); + hatch_bitmap[2] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(fdiag_bits), fdiag_width, fdiag_height ); + hatch_bitmap[3] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(cross_bits), cross_width, cross_height ); + hatch_bitmap[4] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(horiz_bits), horiz_width, horiz_height ); + hatch_bitmap[5] = XCreateBitmapFromData( (Display*) m_display, xroot, + reinterpret_cast(verti_bits), verti_width, verti_height ); } } diff --git a/src/x11/fdiag.xbm b/src/x11/fdiag.xbm index 67d3b4732a..76aa9f28b4 100644 --- a/src/x11/fdiag.xbm +++ b/src/x11/fdiag.xbm @@ -1,6 +1,6 @@ #define fdiag_width 16 #define fdiag_height 16 -static char fdiag_bits[] = { +static unsigned char fdiag_bits[] = { 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80}; diff --git a/src/x11/horiz.xbm b/src/x11/horiz.xbm index ff3309bcc4..f4a31c6e9d 100644 --- a/src/x11/horiz.xbm +++ b/src/x11/horiz.xbm @@ -1,6 +1,6 @@ #define horiz_width 15 #define horiz_height 15 -static char horiz_bits[] = { +static unsigned char horiz_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/x11/verti.xbm b/src/x11/verti.xbm index 2dd9dc4c05..b71941e82e 100644 --- a/src/x11/verti.xbm +++ b/src/x11/verti.xbm @@ -1,6 +1,6 @@ #define verti_width 15 #define verti_height 15 -static char verti_bits[] = { +static unsigned char verti_bits[] = { 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10};