1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

games/CaribbeanStud: unbreak build with Clang 6 (C++14 by default)

In file included from Seat.cpp:37:
./Bitmaps.h:47:46: error: constant expression evaluates to 128 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
                                             ^~~~
./Bitmaps.h:47:46: note: insert an explicit cast to silence this issue
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
                                             ^~~~
                                             static_cast<char>( )
Seat.cpp:256:18: error: no matching function for call to 'XCreateBitmapFromData'
      s_map[i] = XCreateBitmapFromData(_dpy,
                 ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/X11/Xlib.h:1604:15: note: candidate function not viable: no known conversion from
      'const unsigned char [2018]' to 'const char *' for 3rd argument
extern Pixmap XCreateBitmapFromData(
              ^

Reported by:	pkg-fallout
This commit is contained in:
Jan Beich 2018-01-20 17:45:32 +00:00
parent 2f92266b54
commit a567135c93
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=459532
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,47 @@
--- Bitmaps.h.orig 1997-01-31 22:47:58 UTC
+++ Bitmaps.h
@@ -32,7 +32,7 @@
*/
-const char c_bits[][2018] = { // bitmaps for Clubs
+const unsigned char c_bits[][2018] = { // bitmaps for Clubs
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -1647,7 +1647,7 @@ const char c_bits[][2018] = { // bitmaps for Clubs
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }
};
-const char d_bits[][2018] = { // Bitmaps for Dimands
+const unsigned char d_bits[][2018] = { // Bitmaps for Dimands
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -3263,7 +3263,7 @@ const char d_bits[][2018] = { // Bitmaps for Dimands
};
-const char h_bits[][2018] = { // Bitmaps for Hearts
+const unsigned char h_bits[][2018] = { // Bitmaps for Hearts
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -4879,7 +4879,7 @@ const char h_bits[][2018] = { // Bitmaps for Hearts
};
-const char s_bits[][2018] = { // Bitmaps for Spades
+const unsigned char s_bits[][2018] = { // Bitmaps for Spades
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -6494,7 +6494,7 @@ const char s_bits[][2018] = { // Bitmaps for Spades
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
-const char back_bits[] = { // Bitmap for CardBack
+const unsigned char back_bits[] = { // Bitmap for CardBack
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x01, 0x80, 0x00, 0xa0,
0x00, 0x00, 0x04, 0x20, 0x10, 0x02, 0x08, 0x01, 0x40, 0x00, 0x04, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,

View File

@ -13,6 +13,37 @@
i = 0;
XtSetArg(args[i], XmNbackground, color.pixel); i++;
XtSetArg(args[i], XmNforeground, whitepixel); i++;
@@ -255,25 +255,25 @@ void Seat::MakeCardMaps()
for (int i = 0; i< 13; i++) {
s_map[i] = XCreateBitmapFromData(_dpy,
RootWindow(_dpy, _screen),
- s_bits[i], CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
+ reinterpret_cast<const char *>(s_bits[i]), CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
h_map[i] = XCreateBitmapFromData(_dpy,
RootWindow(_dpy, _screen),
- h_bits[i], CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
+ reinterpret_cast<const char *>(h_bits[i]), CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
c_map[i] = XCreateBitmapFromData(_dpy,
RootWindow(_dpy, _screen),
- c_bits[i], CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
+ reinterpret_cast<const char *>(c_bits[i]), CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
d_map[i] = XCreateBitmapFromData(_dpy,
RootWindow(_dpy, _screen),
- d_bits[i], CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
+ reinterpret_cast<const char *>(d_bits[i]), CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
}
back_map = XCreateBitmapFromData(_dpy,
RootWindow(_dpy, _screen),
- back_bits, CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
+ reinterpret_cast<const char *>(back_bits), CARD_MAP_WIDTH, CARD_MAP_HEIGHT);
}
@@ -342,7 +342,8 @@
Card ** cards = hands->Cards();
if( hands->NumOfCards() )