--- Begin Message ---
Package: scorched3d
Severity: normal
Tags: patch
When building 'scorched3d' on amd64 with gcc-4.0,
I get the following error:
x86_64-linux-g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
-DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
-DPACKAGE=\"scorched3d\" -DVERSION=\"38\" -I. -I. -I../porting -I..
-I/usr/X11R6/include -I/usr/X11R6 -I/usr/lib/wx/include/gtk-2.4
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -g -O2
-I/usr/include/SDL -D_REENTRANT -I/usr/include/freetype2
-DS3D_DOCDIR=\"/usr/share/doc/scorched3d\"
-DS3D_DATADIR=\"/usr/share/games/scorched3d\" -DS3D_BINDIR=\"/usr/games\"
-DdDOUBLE -c -o GLWTankTip.o `test -f '../tankgraph/GLWTankTip.cpp' || echo
'./'`../tankgraph/GLWTankTip.cpp
../tankgraph/GLWTankTip.cpp: In member function 'virtual void
TankUndoMenu::itemSelected(GLWSelectorEntry*, int)':
../tankgraph/GLWTankTip.cpp:67: error: cast from 'void*' to 'unsigned int'
loses precision
../tankgraph/GLWTankTip.cpp: In member function 'virtual void
TankBatteryTip::itemSelected(GLWSelectorEntry*, int)':
../tankgraph/GLWTankTip.cpp:171: error: cast from 'void*' to 'int' loses
precision
make[3]: *** [GLWTankTip.o] Error 1
make[3]: Leaving directory `/scorched3d-38/src/scorched'
With the attached patch 'scorched3d' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/scorched3d-38/src/client/ServerBrowser.cpp
./src/client/ServerBrowser.cpp
--- ../tmp-orig/scorched3d-38/src/client/ServerBrowser.cpp 2003-10-21
18:58:11.000000000 +0200
+++ ./src/client/ServerBrowser.cpp 2005-01-04 14:18:35.468374288 +0100
@@ -50,7 +50,7 @@
int ServerBrowser::threadFunc(void *var)
{
- bool lan = (bool) (int(var)==1);
+ bool lan = (bool) (long(var)==1);
bool result = false;
if (lan) result = instance_->serverList_.fetchLANList();
else result = instance_->serverList_.fetchServerList();
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetInterface.h
./src/coms/NetInterface.h
--- ../tmp-orig/scorched3d-38/src/coms/NetInterface.h 2004-12-02
18:50:16.000000000 +0100
+++ ./src/coms/NetInterface.h 2005-01-04 09:27:48.000000000 +0100
@@ -35,9 +35,9 @@
virtual void setMessageHandler(NetMessageHandlerI *handler) = 0;
virtual void disconnectAllClients() = 0;
- virtual void disconnectClient(unsigned int client, bool delay = false)
= 0;
+ virtual void disconnectClient(unsigned long client, bool delay = false)
= 0;
virtual void sendMessage(NetBuffer &buffer) = 0;
- virtual void sendMessage(NetBuffer &buffer, unsigned int destination) =
0;
+ virtual void sendMessage(NetBuffer &buffer, unsigned long destination)
= 0;
static unsigned int &getBytesIn() { return bytesIn_; }
static unsigned int &getBytesOut() { return bytesOut_; }
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetLoopBack.cpp
./src/coms/NetLoopBack.cpp
--- ../tmp-orig/scorched3d-38/src/coms/NetLoopBack.cpp 2004-12-02
18:50:16.000000000 +0100
+++ ./src/coms/NetLoopBack.cpp 2005-01-04 14:16:53.576864152 +0100
@@ -57,7 +57,7 @@
Logger::log(0, "Cannot disconnect all clients, they are local!");
}
-void NetLoopBack::disconnectClient(unsigned int client, bool delay)
+void NetLoopBack::disconnectClient(unsigned long client, bool delay)
{
Logger::log(0, "Cannot disconnect client %i, they are local!", client);
}
@@ -67,7 +67,7 @@
sendMessage(buffer, ServerLoopBackID);
}
-void NetLoopBack::sendMessage(NetBuffer &buffer, unsigned int destination)
+void NetLoopBack::sendMessage(NetBuffer &buffer, unsigned long destination)
{
DIALOG_ASSERT(loopback_);
DIALOG_ASSERT(destination == ClientLoopBackID ||
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetLoopBack.h
./src/coms/NetLoopBack.h
--- ../tmp-orig/scorched3d-38/src/coms/NetLoopBack.h 2004-12-02
18:50:16.000000000 +0100
+++ ./src/coms/NetLoopBack.h 2005-01-04 14:06:03.000000000 +0100
@@ -44,9 +44,9 @@
virtual void setMessageHandler(NetMessageHandlerI *handler);
virtual void disconnectAllClients();
- virtual void disconnectClient(unsigned int client, bool delay = false);
+ virtual void disconnectClient(unsigned long client, bool delay = false);
virtual void sendMessage(NetBuffer &buffer);
- virtual void sendMessage(NetBuffer &buffer, unsigned int destination);
+ virtual void sendMessage(NetBuffer &buffer, unsigned long destination);
protected:
unsigned int currentId_;
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetServer.cpp
./src/coms/NetServer.cpp
--- ../tmp-orig/scorched3d-38/src/coms/NetServer.cpp 2004-12-02
18:50:16.000000000 +0100
+++ ./src/coms/NetServer.cpp 2005-01-03 23:06:21.000000000 +0100
@@ -77,7 +77,7 @@
return (server_ != 0 || firstDestination_ != 0);
}
-unsigned int NetServer::start(int port)
+unsigned long NetServer::start(int port)
{
if(SDLNet_Init()==-1)
{
@@ -100,10 +100,10 @@
NetBufferUtil::setBlockingIO(server_);
SDLNet_TCP_AddSocket(sockSet_, server_);
- return (unsigned int) server_;
+ return (unsigned long) server_;
}
-unsigned int NetServer::connect(const char *hostName, int portNo)
+unsigned long NetServer::connect(const char *hostName, int portNo)
{
if(SDLNet_Init()==-1)
{
@@ -124,7 +124,7 @@
NetBufferUtil::setBlockingIO(client);
addClient(client);
- return (unsigned int) client;
+ return (unsigned long) client;
}
int NetServer::threadFunc(void *param)
@@ -234,19 +234,19 @@
itor++)
{
TCPsocket sock = (*itor).first;
- disconnectClient((unsigned int) sock);
+ disconnectClient((unsigned long) sock);
}
SDL_UnlockMutex(setMutex_);
}
-void NetServer::disconnectClient(unsigned int dest, bool delayed)
+void NetServer::disconnectClient(unsigned long dest, bool delayed)
{
TCPsocket client = (TCPsocket) dest;
DIALOG_ASSERT(client);
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::DisconnectMessage,
- (unsigned int) client,
+ (unsigned long) client,
getIpAddress(client));
if (delayed)
@@ -263,10 +263,10 @@
void NetServer::sendMessage(NetBuffer &buffer)
{
- sendMessage(buffer, (unsigned int) firstDestination_);
+ sendMessage(buffer, (unsigned long) firstDestination_);
}
-void NetServer::sendMessage(NetBuffer &buffer, unsigned int dest)
+void NetServer::sendMessage(NetBuffer &buffer, unsigned long dest)
{
TCPsocket destination = (TCPsocket) dest;
@@ -275,7 +275,7 @@
// Get a new buffer from the pool
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::NoMessage,
- (unsigned int) destination,
+ (unsigned long) destination,
getIpAddress(destination));
// Add message to new buffer
@@ -304,7 +304,7 @@
{
NetMessagePool::instance()->addToPool(message);
Logger::log(0, "Unknown sendMessage destination %i",
- (int) client);
+ (long) client);
}
SDL_UnlockMutex(setMutex_);
}
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetServer.h ./src/coms/NetServer.h
--- ../tmp-orig/scorched3d-38/src/coms/NetServer.h 2004-12-02
18:50:16.000000000 +0100
+++ ./src/coms/NetServer.h 2005-01-03 23:05:07.000000000 +0100
@@ -35,16 +35,16 @@
virtual ~NetServer();
virtual bool started();
- unsigned int connect(const char *hostName, int portNo);
- unsigned int start(int portNo);
+ unsigned long connect(const char *hostName, int portNo);
+ unsigned long start(int portNo);
virtual int processMessages();
virtual void setMessageHandler(NetMessageHandlerI *handler);
virtual void disconnectAllClients();
- virtual void disconnectClient(unsigned int client, bool delayed =
false);
+ virtual void disconnectClient(unsigned long client, bool delayed =
false);
virtual void sendMessage(NetBuffer &buffer);
- virtual void sendMessage(NetBuffer &buffer, unsigned int destination);
+ virtual void sendMessage(NetBuffer &buffer, unsigned long destination);
static unsigned int getIpAddress(TCPsocket destination);
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetServerProtocol.cpp
./src/coms/NetServerProtocol.cpp
--- ../tmp-orig/scorched3d-38/src/coms/NetServerProtocol.cpp 2004-11-29
22:15:21.000000000 +0100
+++ ./src/coms/NetServerProtocol.cpp 2005-01-03 23:07:28.000000000 +0100
@@ -124,7 +124,7 @@
// allocate the buffer memory
NetMessage *buffer = NetMessagePool::instance()->
getFromPool(NetMessage::BufferMessage,
- (unsigned int) socket,
+ (unsigned long) socket,
NetServer::getIpAddress(socket));
buffer->getBuffer().allocate(len);
buffer->getBuffer().setBufferUsed(len);
@@ -160,7 +160,7 @@
// Allocate a new buffer
NetMessage *newMessage = NetMessagePool::instance()->
getFromPool(NetMessage::BufferMessage,
- (unsigned int) socket,
+ (unsigned long) socket,
NetServer::getIpAddress(socket));
NetBuffer &newBuffer = newMessage->getBuffer();
newBuffer.allocate(destLen);
@@ -290,7 +290,7 @@
// allocate the buffer memory
NetMessage *netBuffer = NetMessagePool::instance()->
getFromPool(NetMessage::BufferMessage,
- (unsigned int) socket,
+ (unsigned long) socket,
NetServer::getIpAddress(socket));
netBuffer->getBuffer().reset();
diff -urN ../tmp-orig/scorched3d-38/src/coms/NetServerRead.cpp
./src/coms/NetServerRead.cpp
--- ../tmp-orig/scorched3d-38/src/coms/NetServerRead.cpp 2004-11-29
19:09:00.000000000 +0100
+++ ./src/coms/NetServerRead.cpp 2005-01-03 23:08:27.000000000 +0100
@@ -62,7 +62,7 @@
// Send the player connected notification
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::ConnectMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(message);
@@ -94,7 +94,7 @@
sentDisconnect_ = true;
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::DisconnectMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(message);
}
@@ -189,7 +189,7 @@
Logger::log(0,
"Warning: %s net loop took %.2f seconds, client
%i",
(send?"Send":"Recv"),
- timeDiff, (unsigned int) socket_);
+ timeDiff, (unsigned long) socket_);
}
}
@@ -199,7 +199,7 @@
sentDisconnect_ = true;
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::DisconnectMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(message);
}
diff -urN ../tmp-orig/scorched3d-38/src/dialogs/HelpButtonDialog.cpp
./src/dialogs/HelpButtonDialog.cpp
--- ../tmp-orig/scorched3d-38/src/dialogs/HelpButtonDialog.cpp 2004-09-10
14:45:45.000000000 +0200
+++ ./src/dialogs/HelpButtonDialog.cpp 2005-01-03 22:49:23.000000000 +0100
@@ -158,7 +158,7 @@
void HelpButtonDialog::itemSelected(GLWSelectorEntry *entry, int position)
{
- int data = (int) entry->getUserData();
+ long data = (long) entry->getUserData();
if (data != -1)
{
int volume = int(float(data) * 12.8f);
diff -urN ../tmp-orig/scorched3d-38/src/engine/ScorchedCollisionHandler.cpp
./src/engine/ScorchedCollisionHandler.cpp
--- ../tmp-orig/scorched3d-38/src/engine/ScorchedCollisionHandler.cpp
2004-11-13 16:31:04.000000000 +0100
+++ ./src/engine/ScorchedCollisionHandler.cpp 2005-01-03 22:52:33.000000000
+0100
@@ -124,7 +124,7 @@
(float) bouncePosition[1],
(float) bouncePosition[2]);
- unsigned int id = (unsigned int) otherInfo->data;
+ unsigned long id = (unsigned long) otherInfo->data;
ParticleAction action = collisionShield(id,
bouncePositionV,
((otherInfo->id==CollisionIdShieldLarge)?
Shield::ShieldSizeLarge:Shield::ShieldSizeSmall),
@@ -207,7 +207,7 @@
otherInfo = (ScorchedCollisionInfo *) dGeomGetData(o1);
}
- unsigned int id = (unsigned int) otherInfo->data;
+ unsigned long id = (unsigned long) otherInfo->data;
ShotProjectile *shot = (ShotProjectile *) particleInfo->data;
shot->incLandedCounter();
Vector particlePositionV(
diff -urN ../tmp-orig/scorched3d-38/src/ode/config.h ./src/ode/config.h
--- ../tmp-orig/scorched3d-38/src/ode/config.h 2004-11-02 10:20:35.000000000
+0100
+++ ./src/ode/config.h 2005-01-03 23:18:19.000000000 +0100
@@ -81,7 +81,7 @@
/* an integer type that we can safely cast a pointer to and from without
* loss of bits.
*/
-typedef unsigned int intP;
+typedef unsigned long intP;
/* if we're compiling on a pentium, we may need to know the clock rate so
diff -urN ../tmp-orig/scorched3d-38/src/scorched/SettingsDialog.cpp
./src/scorched/SettingsDialog.cpp
--- ../tmp-orig/scorched3d-38/src/scorched/SettingsDialog.cpp 2004-12-02
01:52:29.000000000 +0100
+++ ./src/scorched/SettingsDialog.cpp 2005-01-04 09:31:50.000000000 +0100
@@ -708,40 +708,40 @@
// Env
{
- context_.setWindForce((OptionsGame::WindForce) (int)
+ context_.setWindForce((OptionsGame::WindForce) (long)
SettingsEnv::IDC_COMBO_FORCE_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_FORCE_CTRL->GetSelection()));
- context_.setWindType((OptionsGame::WindType) (int)
+ context_.setWindType((OptionsGame::WindType) (long)
SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->GetSelection()));
- context_.setWallType((OptionsGame::WallType) (int)
+ context_.setWallType((OptionsGame::WallType) (long)
SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->GetSelection()));
- context_.setWeapScale((OptionsGame::WeapScale) (int)
+ context_.setWeapScale((OptionsGame::WeapScale) (long)
SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->GetSelection()));
- context_.setStartArmsLevel((int)
+ context_.setStartArmsLevel((long)
SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->GetSelection()));
- context_.setEndArmsLevel((int)
+ context_.setEndArmsLevel((long)
SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->GetSelection()));
- context_.setMinFallingDistance((int)
+ context_.setMinFallingDistance((long)
SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->GetSelection()));
- context_.setMaxClimbingDistance((int)
+ context_.setMaxClimbingDistance((long)
SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->GetClientData(
SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->GetSelection()));
context_.setGiveAllWeapons(
SettingsEnv::IDC_GIVEALLWEAPONS_CTRL->GetValue());
- context_.setResignMode((OptionsGame::ResignType) (int)
+ context_.setResignMode((OptionsGame::ResignType) (long)
SettingsEnv::IDC_RESIGNENDROUND_CTRL->GetClientData(
SettingsEnv::IDC_RESIGNENDROUND_CTRL->GetSelection()));
}
@@ -762,7 +762,7 @@
int maxRoundTurns = 15;
int downloadSpeed = 0;
- context_.setTurnType((OptionsGame::TurnType) (int)
+ context_.setTurnType((OptionsGame::TurnType) (long)
SettingsMain::IDC_TYPE_CTRL->GetClientData(
SettingsMain::IDC_TYPE_CTRL->GetSelection()));
context_.setTeams((int)
SettingsMain::IDC_TEAMS_CTRL->GetSelection() + 1);
diff -urN ../tmp-orig/scorched3d-38/src/tankgraph/GLWTankTip.cpp
./src/tankgraph/GLWTankTip.cpp
--- ../tmp-orig/scorched3d-38/src/tankgraph/GLWTankTip.cpp 2004-06-18
12:17:21.000000000 +0200
+++ ./src/tankgraph/GLWTankTip.cpp 2005-01-03 22:40:51.000000000 +0100
@@ -64,7 +64,7 @@
void TankUndoMenu::itemSelected(GLWSelectorEntry *entry, int position)
{
- tank_->getPhysics().revertSettings((unsigned int) entry->getUserData());
+ tank_->getPhysics().revertSettings((unsigned long)
entry->getUserData());
}
TankFuelTip::TankFuelTip(Tank *tank) :
@@ -168,7 +168,7 @@
void TankBatteryTip::itemSelected(GLWSelectorEntry *entry, int position)
{
TankAIHuman *tankAI = (TankAIHuman *) tank_->getTankAI();
- for (int i=1; i<=(int) entry->getUserData(); i++)
+ for (int i=1; i<=(long) entry->getUserData(); i++)
{
if (tank_->getState().getLife() < 100.0f)
{
--- End Message ---