Skip to content

Commit

Permalink
Compilation fix for narrowing conversions in XBM files in wxMotif
Browse files Browse the repository at this point in the history
The same fix as in commit 3704547 for ticket wxWidgets#12575.
  • Loading branch information
lanurmi authored and vadz committed Apr 15, 2017
1 parent 2e9e3f5 commit 4cdc1f5
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/motif/bdiag.xbm
Original file line number Diff line number Diff line change
@@ -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};
6 changes: 4 additions & 2 deletions src/motif/bmpmotif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Pixmap
XCreateInsensitivePixmap( Display *display, Pixmap pixmap )

{
static char stipple_data[] =
static unsigned char stipple_data[] =
{
0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
Expand All @@ -259,7 +259,9 @@ XCreateInsensitivePixmap( Display *display, Pixmap pixmap )

/* Get the stipple pixmap to be used to 'gray-out' the argument pixmap.
*/
stipple = XCreateBitmapFromData( display, pixmap, stipple_data, 16, 16 );
stipple = XCreateBitmapFromData( display, pixmap,
reinterpret_cast<const char*>(stipple_data),
16, 16 );
if ( 0 != stipple )
{
gc = XCreateGC( display, pixmap, (XtGCMask)0, NULL );
Expand Down
2 changes: 1 addition & 1 deletion src/motif/cdiag.xbm
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion src/motif/cross.xbm
Original file line number Diff line number Diff line change
@@ -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};
24 changes: 12 additions & 12 deletions src/motif/dcclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,43 +1653,43 @@ void wxWindowDCImpl::SetPen( const wxPen &pen )
if (bdiag == (Pixmap) 0)
bdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
bdiag_bits, bdiag_width, bdiag_height);
reinterpret_cast<const char*>(bdiag_bits), bdiag_width, bdiag_height);
myStipple = bdiag;
break;
case wxFDIAGONAL_HATCH:
if (fdiag == (Pixmap) 0)
fdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
fdiag_bits, fdiag_width, fdiag_height);
reinterpret_cast<const char*>(fdiag_bits), fdiag_width, fdiag_height);
myStipple = fdiag;
break;
case wxCROSS_HATCH:
if (cross == (Pixmap) 0)
cross = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
cross_bits, cross_width, cross_height);
reinterpret_cast<const char*>(cross_bits), cross_width, cross_height);
myStipple = cross;
break;
case wxHORIZONTAL_HATCH:
if (horiz == (Pixmap) 0)
horiz = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
horiz_bits, horiz_width, horiz_height);
reinterpret_cast<const char*>(horiz_bits), horiz_width, horiz_height);
myStipple = horiz;
break;
case wxVERTICAL_HATCH:
if (verti == (Pixmap) 0)
verti = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
verti_bits, verti_width, verti_height);
reinterpret_cast<const char*>(verti_bits), verti_width, verti_height);
myStipple = verti;
break;
case wxCROSSDIAG_HATCH:
default:
if (cdiag == (Pixmap) 0)
cdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
cdiag_bits, cdiag_width, cdiag_height);
reinterpret_cast<const char*>(cdiag_bits), cdiag_width, cdiag_height);
myStipple = cdiag;
break;
}
Expand Down Expand Up @@ -1824,43 +1824,43 @@ void wxWindowDCImpl::SetBrush( const wxBrush &brush )
if (bdiag == (Pixmap) 0)
bdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
bdiag_bits, bdiag_width, bdiag_height);
reinterpret_cast<const char*>(bdiag_bits), bdiag_width, bdiag_height);
myStipple = bdiag;
break;
case wxFDIAGONAL_HATCH:
if (fdiag == (Pixmap) 0)
fdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
fdiag_bits, fdiag_width, fdiag_height);
reinterpret_cast<const char*>(fdiag_bits), fdiag_width, fdiag_height);
myStipple = fdiag;
break;
case wxCROSS_HATCH:
if (cross == (Pixmap) 0)
cross = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
cross_bits, cross_width, cross_height);
reinterpret_cast<const char*>(cross_bits), cross_width, cross_height);
myStipple = cross;
break;
case wxHORIZONTAL_HATCH:
if (horiz == (Pixmap) 0)
horiz = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
horiz_bits, horiz_width, horiz_height);
reinterpret_cast<const char*>(horiz_bits), horiz_width, horiz_height);
myStipple = horiz;
break;
case wxVERTICAL_HATCH:
if (verti == (Pixmap) 0)
verti = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
verti_bits, verti_width, verti_height);
reinterpret_cast<const char*>(verti_bits), verti_width, verti_height);
myStipple = verti;
break;
case wxCROSSDIAG_HATCH:
default:
if (cdiag == (Pixmap) 0)
cdiag = XCreateBitmapFromData ((Display*) m_display,
RootWindow ((Display*) m_display, DefaultScreen ((Display*) m_display)),
cdiag_bits, cdiag_width, cdiag_height);
reinterpret_cast<const char*>(cdiag_bits), cdiag_width, cdiag_height);
myStipple = cdiag;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/motif/fdiag.xbm
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion src/motif/horiz.xbm
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion src/motif/verti.xbm
Original file line number Diff line number Diff line change
@@ -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};

0 comments on commit 4cdc1f5

Please sign in to comment.