Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jan 2018 17:45:32 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r459532 - head/games/CaribbeanStud/files
Message-ID:  <201801201745.w0KHjWJu032023@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Jan 20 17:45:32 2018
New Revision: 459532
URL: https://svnweb.freebsd.org/changeset/ports/459532

Log:
  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

Added:
  head/games/CaribbeanStud/files/patch-Bitmaps.h   (contents, props changed)
Modified:
  head/games/CaribbeanStud/files/patch-Seat.cpp   (contents, props changed)

Added: head/games/CaribbeanStud/files/patch-Bitmaps.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/CaribbeanStud/files/patch-Bitmaps.h	Sat Jan 20 17:45:32 2018	(r459532)
@@ -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,

Modified: head/games/CaribbeanStud/files/patch-Seat.cpp
==============================================================================
--- head/games/CaribbeanStud/files/patch-Seat.cpp	Sat Jan 20 17:37:32 2018	(r459531)
+++ head/games/CaribbeanStud/files/patch-Seat.cpp	Sat Jan 20 17:45:32 2018	(r459532)
@@ -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() )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801201745.w0KHjWJu032023>