Andreas, thanks for posting your patch. Based on the information in your
bugreport I was able to make a new patch for 39.1+cvs20050929-1.
With the attached patch, scorched3d compiles with gcc 4.0.2-4 on
Debian-amd64 sid. I haven't tested it heavily, but a few bots are now
craters. :)
-Corey
diff -aur scorched3d-39.1+cvs20050929.orig/src/client/ServerBrowser.cpp
scorched3d-39.1+cvs20050929/src/client/ServerBrowser.cpp
--- scorched3d-39.1+cvs20050929.orig/src/client/ServerBrowser.cpp
2003-10-21 09:58:11.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/client/ServerBrowser.cpp 2005-11-19
00:08:45.000000000 -0800
@@ -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 -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetInterface.h
scorched3d-39.1+cvs20050929/src/coms/NetInterface.h
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetInterface.h 2004-12-09
12:56:33.000000000 -0800
+++ scorched3d-39.1+cvs20050929/src/coms/NetInterface.h 2005-11-19
00:08:45.000000000 -0800
@@ -37,9 +37,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 -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetLoopBack.cpp
scorched3d-39.1+cvs20050929/src/coms/NetLoopBack.cpp
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetLoopBack.cpp 2005-04-04
15:35:25.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/coms/NetLoopBack.cpp 2005-11-19
00:08:45.000000000 -0800
@@ -57,7 +57,7 @@
Logger::log( "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( "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 -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetLoopBack.h
scorched3d-39.1+cvs20050929/src/coms/NetLoopBack.h
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetLoopBack.h 2004-12-09
12:56:33.000000000 -0800
+++ scorched3d-39.1+cvs20050929/src/coms/NetLoopBack.h 2005-11-19
00:08:45.000000000 -0800
@@ -46,9 +46,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 -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetServer.cpp
scorched3d-39.1+cvs20050929/src/coms/NetServer.cpp
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetServer.cpp 2005-06-10
16:24:31.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/coms/NetServer.cpp 2005-11-19
00:08:45.000000000 -0800
@@ -235,19 +235,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)
@@ -264,10 +264,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;
@@ -276,7 +276,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
@@ -305,7 +305,7 @@
{
NetMessagePool::instance()->addToPool(message);
Logger::log( "Unknown sendMessage destination %i",
- (int) client);
+ (long) client);
}
SDL_UnlockMutex(setMutex_);
}
diff -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetServer.h
scorched3d-39.1+cvs20050929/src/coms/NetServer.h
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetServer.h 2005-06-10
16:24:31.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/coms/NetServer.h 2005-11-19
00:06:03.000000000 -0800
@@ -42,9 +42,9 @@
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);
void setSentNotification() { sentNotification_ = true; }
static unsigned int getIpAddress(TCPsocket destination);
diff -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetServerProtocol.cpp
scorched3d-39.1+cvs20050929/src/coms/NetServerProtocol.cpp
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetServerProtocol.cpp
2005-06-13 10:31:06.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/coms/NetServerProtocol.cpp 2005-11-19
00:12:43.000000000 -0800
@@ -125,7 +125,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);
@@ -161,7 +161,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);
@@ -291,7 +291,7 @@
// allocate the buffer memory
NetMessage *netBuffer = NetMessagePool::instance()->
getFromPool(NetMessage::BufferMessage,
- (unsigned int) socket,
+ (unsigned long) socket,
NetServer::getIpAddress(socket));
netBuffer->getBuffer().reset();
@@ -354,7 +354,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 -aur scorched3d-39.1+cvs20050929.orig/src/coms/NetServerRead.cpp
scorched3d-39.1+cvs20050929/src/coms/NetServerRead.cpp
--- scorched3d-39.1+cvs20050929.orig/src/coms/NetServerRead.cpp 2005-06-10
16:24:31.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/coms/NetServerRead.cpp 2005-11-19
00:15:58.000000000 -0800
@@ -64,7 +64,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);
@@ -96,7 +96,7 @@
sentDisconnect_ = true;
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::DisconnectMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(message);
}
@@ -191,7 +191,7 @@
Logger::log(
"Warning: %s net loop took %.2f seconds, client
%i",
(send?"Send":"Recv"),
- timeDiff, (unsigned int) socket_);
+ timeDiff, (unsigned long) socket_);
}
}
@@ -201,7 +201,7 @@
sentDisconnect_ = true;
NetMessage *message = NetMessagePool::instance()->
getFromPool(NetMessage::DisconnectMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(message);
}
@@ -276,7 +276,7 @@
{
NetMessage *notification = NetMessagePool::instance()->
getFromPool(NetMessage::SentMessage,
- (unsigned int) socket_,
+ (unsigned long) socket_,
NetServer::getIpAddress(socket_));
messageHandler_->addMessage(notification);
}
diff -aur scorched3d-39.1+cvs20050929.orig/src/dialogs/HelpButtonDialog.cpp
scorched3d-39.1+cvs20050929/src/dialogs/HelpButtonDialog.cpp
--- scorched3d-39.1+cvs20050929.orig/src/dialogs/HelpButtonDialog.cpp
2005-09-18 02:59:33.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/dialogs/HelpButtonDialog.cpp
2005-11-19 00:08:45.000000000 -0800
@@ -160,7 +160,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 -aur
scorched3d-39.1+cvs20050929.orig/src/engine/ScorchedCollisionHandler.cpp
scorched3d-39.1+cvs20050929/src/engine/ScorchedCollisionHandler.cpp
--- scorched3d-39.1+cvs20050929.orig/src/engine/ScorchedCollisionHandler.cpp
2005-06-08 10:29:38.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/engine/ScorchedCollisionHandler.cpp
2005-11-19 00:08:45.000000000 -0800
@@ -93,7 +93,7 @@
}
ShotBounce *particle = (ShotBounce *) bounceInfo->data;
- unsigned int id = (unsigned int) otherInfo->data;
+ unsigned long id = (unsigned long) otherInfo->data;
// only collide with the ground, walls or landscape,
// or iteself
@@ -217,7 +217,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 -aur scorched3d-39.1+cvs20050929.orig/src/ode/config.h
scorched3d-39.1+cvs20050929/src/ode/config.h
--- scorched3d-39.1+cvs20050929.orig/src/ode/config.h 2004-11-02
01:20:35.000000000 -0800
+++ scorched3d-39.1+cvs20050929/src/ode/config.h 2005-11-19
00:08:45.000000000 -0800
@@ -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 -aur scorched3d-39.1+cvs20050929.orig/src/scorched/SettingsDialog.cpp
scorched3d-39.1+cvs20050929/src/scorched/SettingsDialog.cpp
--- scorched3d-39.1+cvs20050929.orig/src/scorched/SettingsDialog.cpp
2005-09-22 08:14:28.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/scorched/SettingsDialog.cpp 2005-11-19
00:21:23.000000000 -0800
@@ -748,44 +748,44 @@
// 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()));
-
context_.setMovementRestriction((OptionsGame::MovementRestrictionType) (int)
+
context_.setMovementRestriction((OptionsGame::MovementRestrictionType) (long)
SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->GetClientData(
SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->GetSelection()));
}
@@ -809,10 +809,10 @@
int downloadSpeed = 0;
int keepAliveTime = 0;
- context_.setTurnType((OptionsGame::TurnType) (int)
+ context_.setTurnType((OptionsGame::TurnType) (long)
SettingsMain::IDC_TYPE_CTRL->GetClientData(
SettingsMain::IDC_TYPE_CTRL->GetSelection()));
- context_.setTeamBallance((OptionsGame::TeamBallanceType) (int)
+ context_.setTeamBallance((OptionsGame::TeamBallanceType) (long)
SettingsMain::IDC_TEAMBALLANCE_CTRL->GetClientData(
SettingsMain::IDC_TEAMBALLANCE_CTRL->GetSelection()));
context_.setTeams((int)
SettingsMain::IDC_TEAMS_CTRL->GetSelection() + 1);
diff -aur scorched3d-39.1+cvs20050929.orig/src/tankgraph/GLWTankTip.cpp
scorched3d-39.1+cvs20050929/src/tankgraph/GLWTankTip.cpp
--- scorched3d-39.1+cvs20050929.orig/src/tankgraph/GLWTankTip.cpp
2005-06-11 09:53:41.000000000 -0700
+++ scorched3d-39.1+cvs20050929/src/tankgraph/GLWTankTip.cpp 2005-11-19
00:08:45.000000000 -0800
@@ -66,7 +66,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) :
@@ -170,7 +170,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)
{