Package: eboard
Severity: normal
Tags: patch

When building 'eboard' on amd64 with gcc-4.0,
I get the following error:

g++ -O2 -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include 
-I/usr/X11R6/include -c board.cc -o board.o
board.cc: In member function 'void Board::dump()':
board.cc:1062: error: cast from 'Board*' to 'unsigned int' loses precision
board.cc:1063: error: cast from 'ChessGame*' to 'unsigned int' loses precision
make[1]: *** [board.o] Error 1
make[1]: Leaving directory `/eboard-0.9.5'
make: *** [build-stamp] Error 2

With the attached patch 'eboard' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/eboard-0.9.5/board.cc ./board.cc
--- ../tmp-orig/eboard-0.9.5/board.cc   2003-11-27 00:48:49.000000000 +0100
+++ ./board.cc  2005-03-01 16:43:47.461562327 +0100
@@ -1059,8 +1059,8 @@
   cerr.setf(ios::hex,ios::basefield);
   cerr.setf(ios::showbase);
 
-  cerr << "[board " << ((unsigned int)this) << "] ";
-  cerr << "game=[" << ((unsigned int)mygame) << "] ";
+  cerr << "[board " << ((unsigned long)this) << "] ";
+  cerr << "game=[" << ((unsigned long)mygame) << "] ";
 
   cerr.setf(ios::dec,ios::basefield);
   cerr << "paneid=" << getPageId() << endl;
diff -urN ../tmp-orig/eboard-0.9.5/chess.cc ./chess.cc
--- ../tmp-orig/eboard-0.9.5/chess.cc   2003-11-27 00:48:49.000000000 +0100
+++ ./chess.cc  2005-03-01 16:45:23.309061992 +0100
@@ -641,7 +641,7 @@
   cerr.setf(ios::hex,ios::basefield);
   cerr.setf(ios::showbase);
 
-  cerr << "[game " << ((unsigned int)this) << "] ";
+  cerr << "[game " << ((unsigned long)this) << "] ";
 
   cerr.setf(ios::dec,ios::basefield);
 
@@ -655,7 +655,7 @@
   cerr.setf(ios::hex,ios::basefield);
   cerr.setf(ios::showbase);
 
-  cerr << "board=[" << ((unsigned int)myboard) << "]" << endl;
+  cerr << "board=[" << ((unsigned long)myboard) << "]" << endl;
 }
 
 char * ChessGame::getPlayerString(int index) {
diff -urN ../tmp-orig/eboard-0.9.5/notebook.cc ./notebook.cc
--- ../tmp-orig/eboard-0.9.5/notebook.cc        2003-11-27 00:48:49.000000000 
+0100
+++ ./notebook.cc       2005-03-01 16:46:31.191959340 +0100
@@ -127,7 +127,7 @@
 void Page::dump() {
   cerr.setf(ios::hex,ios::basefield);
   cerr.setf(ios::showbase);
-  cerr << "[page " << ((unsigned int)this) << "] ";
+  cerr << "[page " << ((unsigned long)this) << "] ";
   cerr.setf(ios::dec,ios::basefield);
   cerr << "pageid=" << number << " ";
   cerr << "title=" << title << " ";


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to