summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-27 09:03:13 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-27 09:03:13 +0000
commitee15a808a1e0d36167f80d9f96147103ba5583de (patch)
tree0756c69cfb8c8d09b0abc29aa302aeea81a59af5
parent4d546730d97828bfed5586c1d50527c7ff5e5c79 (diff)
downloadmana-ee15a808a1e0d36167f80d9f96147103ba5583de.tar.gz
mana-ee15a808a1e0d36167f80d9f96147103ba5583de.tar.bz2
mana-ee15a808a1e0d36167f80d9f96147103ba5583de.tar.xz
mana-ee15a808a1e0d36167f80d9f96147103ba5583de.zip
Made it compile with GCC 4.3
-rw-r--r--ChangeLog17
-rw-r--r--src/beingmanager.cpp1
-rw-r--r--src/channel.cpp7
-rw-r--r--src/channel.h4
-rw-r--r--src/channelmanager.cpp1
-rw-r--r--src/flooritemmanager.cpp2
-rw-r--r--src/game.cpp16
-rw-r--r--src/gui/button.cpp4
-rw-r--r--src/gui/chat.cpp5
-rw-r--r--src/gui/chat.h2
-rw-r--r--src/gui/playerbox.cpp2
-rw-r--r--src/gui/scrollarea.cpp2
-rw-r--r--src/gui/serverdialog.cpp5
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/skill.cpp4
-rw-r--r--src/gui/tabbedcontainer.cpp2
-rw-r--r--src/gui/textfield.cpp4
-rw-r--r--src/gui/widgets/dropdown.cpp2
-rw-r--r--src/gui/window.cpp5
-rw-r--r--src/gui/windowcontainer.cpp2
-rw-r--r--src/localplayer.h2
-rw-r--r--src/log.cpp9
-rw-r--r--src/main.cpp2
-rw-r--r--src/net/messageout.cpp5
-rw-r--r--src/particle.cpp5
-rw-r--r--src/properties.h3
-rw-r--r--src/resources/buddylist.cpp8
-rw-r--r--src/resources/imageset.cpp2
-rw-r--r--src/resources/itemdb.cpp4
-rw-r--r--src/resources/iteminfo.h2
-rw-r--r--src/resources/monsterdb.cpp2
-rw-r--r--src/resources/monsterinfo.cpp2
-rw-r--r--src/resources/monsterinfo.h2
33 files changed, 95 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d3dae7b..d382dd8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-10-27 Guillaume Melquiond <guillaume.melquiond@gmail.com>
+
+ * src/properties.h, src/game.cpp, src/channel.h, src/log.cpp,
+ src/gui/window.cpp, src/gui/setup.cpp, src/gui/button.cpp,
+ src/gui/chat.h, src/gui/widgets/dropdown.cpp, src/gui/chat.cpp,
+ src/gui/tabbedcontainer.cpp, src/gui/windowcontainer.cpp,
+ src/gui/skill.cpp, src/gui/serverdialog.cpp, src/gui/textfield.cpp,
+ src/gui/playerbox.cpp, src/gui/scrollarea.cpp, src/beingmanager.cpp,
+ src/flooritemmanager.cpp, src/channelmanager.cpp, src/main.cpp,
+ src/particle.cpp, src/net/messageout.cpp, src/channel.cpp,
+ src/localplayer.h, src/resources/imageset.cpp,
+ src/resources/buddylist.cpp, src/resources/monsterinfo.h,
+ src/resources/iteminfo.h, src/resources/monsterdb.cpp,
+ src/resources/monsterinfo.cpp, src/resources/itemdb.cpp: Fixed missing
+ dependencies, spurious const qualifiers, and weak brackets, so that it
+ compiles with GCC 4.3.
+
2007-10-24 Bjørn Lindeijer <bjorn@lindeijer.nl>
* po/nl.po: Completed Dutch translation.
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 56865841..8ef3de1e 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -21,6 +21,7 @@
* $Id$
*/
+#include <algorithm>
#include <cassert>
#include "beingmanager.h"
diff --git a/src/channel.cpp b/src/channel.cpp
index 170dbf5e..3204b3b2 100644
--- a/src/channel.cpp
+++ b/src/channel.cpp
@@ -40,12 +40,7 @@ void Channel::setName(const std::string &channelName)
mName = channelName;
}
-const short Channel::getId() const
-{
- return mID;
-}
-
-const int Channel::getUserListSize() const
+int Channel::getUserListSize() const
{
return userList.size();
}
diff --git a/src/channel.h b/src/channel.h
index 0a62e073..ea6789ee 100644
--- a/src/channel.h
+++ b/src/channel.h
@@ -30,8 +30,8 @@ class Channel
Channel(short id);
std::string getName() const;
void setName(const std::string &channelName);
- const short getId() const;
- const int getUserListSize() const;
+ int getId() const { return mID; }
+ int getUserListSize() const;
std::string getUser(unsigned int i) const;
private:
typedef std::vector<std::string> Users;
diff --git a/src/channelmanager.cpp b/src/channelmanager.cpp
index 082581a1..91c20e98 100644
--- a/src/channelmanager.cpp
+++ b/src/channelmanager.cpp
@@ -21,6 +21,7 @@
* $Id$
*/
+#include <algorithm>
#include <list>
#include "channelmanager.h"
diff --git a/src/flooritemmanager.cpp b/src/flooritemmanager.cpp
index 680616a8..8a00cc51 100644
--- a/src/flooritemmanager.cpp
+++ b/src/flooritemmanager.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "flooritemmanager.h"
#include "floor_item.h"
diff --git a/src/game.cpp b/src/game.cpp
index 53874f4d..b4887f5b 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -684,24 +684,24 @@ void Game::handleInput()
unsigned char direction = 0;
// Translate pressed keys to movement and direction
- if ( keyboard.isKeyActive(keyboard.KEY_MOVE_UP) ||
- joystick && joystick->isUp())
+ if (keyboard.isKeyActive(keyboard.KEY_MOVE_UP) ||
+ (joystick && joystick->isUp()))
{
direction |= Being::UP;
}
- else if ( keyboard.isKeyActive(keyboard.KEY_MOVE_DOWN) ||
- joystick && joystick->isDown())
+ else if (keyboard.isKeyActive(keyboard.KEY_MOVE_DOWN) ||
+ (joystick && joystick->isDown()))
{
direction |= Being::DOWN;
}
- if ( keyboard.isKeyActive(keyboard.KEY_MOVE_LEFT) ||
- joystick && joystick->isLeft())
+ if (keyboard.isKeyActive(keyboard.KEY_MOVE_LEFT) ||
+ (joystick && joystick->isLeft()))
{
direction |= Being::LEFT;
}
- else if ( keyboard.isKeyActive(keyboard.KEY_MOVE_RIGHT) ||
- joystick && joystick->isRight())
+ else if (keyboard.isKeyActive(keyboard.KEY_MOVE_RIGHT) ||
+ (joystick && joystick->isRight()))
{
direction |= Being::RIGHT;
}
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index 0379ebc0..e47f90f8 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -21,12 +21,14 @@
* $Id$
*/
-#include "button.h"
+#include <algorithm>
#include <guichan/exception.hpp>
#include <guichan/graphics.hpp>
#include <guichan/imagefont.hpp>
+#include "button.h"
+
#include "../graphics.h"
#include "../resources/image.h"
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index da60ef42..de47c8a9 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -21,13 +21,14 @@
* $Id$
*/
-#include "chat.h"
-
+#include <algorithm>
#include <sstream>
#include <guichan/focushandler.hpp>
#include <guichan/key.hpp>
+#include "chat.h"
+
#include "browserbox.h"
#include "../channelmanager.h"
#include "../channel.h"
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 2227e87d..ee699cf2 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -218,7 +218,7 @@ class ChatWindow : public Window, public gcn::ActionListener,
int mItems;
int mItemsKeep;
- typedef struct CHATLOG
+ struct CHATLOG
{
std::string nick;
std::string text;
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index e3f5b540..8e5f1827 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "playerbox.h"
#include "../player.h"
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 816f94a8..cf555ef4 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "scrollarea.h"
#include "../graphics.h"
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index c05e7aa9..70ed7fe8 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -21,13 +21,14 @@
* $Id$
*/
-#include "serverdialog.h"
-
+#include <cstdlib>
#include <iostream>
#include <string>
#include <guichan/widgets/label.hpp>
+#include "serverdialog.h"
+
#include "button.h"
#include "listbox.h"
#include "ok_dialog.h"
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 6a13232a..821e9da6 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "setup.h"
#include "button.h"
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index d5cfe76a..c553863f 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -21,10 +21,12 @@
* $Id$
*/
-#include "skill.h"
+#include <algorithm>
#include <guichan/widgets/label.hpp>
+#include "skill.h"
+
#include "button.h"
#include "listbox.h"
#include "scrollarea.h"
diff --git a/src/gui/tabbedcontainer.cpp b/src/gui/tabbedcontainer.cpp
index 5d6d21d1..8fb2f598 100644
--- a/src/gui/tabbedcontainer.cpp
+++ b/src/gui/tabbedcontainer.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "tabbedcontainer.h"
#include "button.h"
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp
index 88d8fff9..81b1a0ab 100644
--- a/src/gui/textfield.cpp
+++ b/src/gui/textfield.cpp
@@ -21,10 +21,12 @@
* $Id$
*/
-#include "textfield.h"
+#include <algorithm>
#include <guichan/font.hpp>
+#include "textfield.h"
+
#include "sdlinput.h"
#include "../graphics.h"
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 1176ef2a..6863aa01 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "dropdown.h"
#include "../../graphics.h"
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 1509ac92..68b79367 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -21,11 +21,14 @@
* $Id$
*/
-#include "window.h"
+#include <algorithm>
+#include <climits>
#include <guichan/exception.hpp>
#include <guichan/widgets/icon.hpp>
+#include "window.h"
+
#include "gui.h"
#include "gccontainer.h"
#include "windowcontainer.h"
diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp
index 14aaaf68..d10c519c 100644
--- a/src/gui/windowcontainer.cpp
+++ b/src/gui/windowcontainer.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "windowcontainer.h"
#include "../utils/dtor.h"
diff --git a/src/localplayer.h b/src/localplayer.h
index 6349f7ed..d6cb11ba 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -24,7 +24,7 @@
#ifndef _TMW_LOCALPLAYER_H
#define _TMW_LOCALPLAYER_H
-#include <memory.h>
+#include <memory>
#include "player.h"
diff --git a/src/log.cpp b/src/log.cpp
index 224736bd..6f69c671 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -19,7 +19,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "log.h"
+#include <cstdarg>
+#include <cstdlib>
+#include <iostream>
+#include <sstream>
#ifdef WIN32
#include "utils/wingettimeofday.h"
@@ -31,9 +34,7 @@
#include <Carbon/Carbon.h>
#endif
-#include <cstdarg>
-#include <iostream>
-#include <sstream>
+#include "log.h"
Logger::Logger():
mLogToStandardOut(false)
diff --git a/src/main.cpp b/src/main.cpp
index e8fe26cb..74a2fe13 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -770,6 +770,7 @@ int main(int argc, char *argv[])
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE)
+ {
if (!quitDialog)
{
quitDialog = new QuitDialog(NULL, &quitDialog);
@@ -778,6 +779,7 @@ int main(int argc, char *argv[])
{
quitDialog->requestMoveToTop();
}
+ }
break;
}
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 4d68c14f..208196e2 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -21,12 +21,13 @@
* $Id$
*/
-#include "messageout.h"
-
+#include <cstring>
#include <string>
#include <enet/enet.h>
+#include "messageout.h"
+
MessageOut::MessageOut(short id):
mData(0),
mDataSize(0),
diff --git a/src/particle.cpp b/src/particle.cpp
index 0f116b15..93fc7893 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -21,10 +21,11 @@
* $Id$
*/
-#include "particle.h"
-
+#include <algorithm>
#include <cmath>
+#include "particle.h"
+
#include "animationparticle.h"
#include "configuration.h"
#include "imageparticle.h"
diff --git a/src/properties.h b/src/properties.h
index bcd114c1..69950d56 100644
--- a/src/properties.h
+++ b/src/properties.h
@@ -63,8 +63,7 @@ class Properties
* @return the value of the given property, or 0.0f when it doesn't
* exist.
*/
- const float
- getFloatProperty(const std::string &name, float def = 0.0f)
+ float getFloatProperty(std::string const &name, float def = 0.0f)
{
PropertyMap::const_iterator i = mProperties.find(name);
float ret = def;
diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp
index 9327ef60..2f85825a 100644
--- a/src/resources/buddylist.cpp
+++ b/src/resources/buddylist.cpp
@@ -21,11 +21,15 @@
* $Id$
*/
+#include <algorithm>
+#include <cstring>
+#include <iostream>
+#include <fstream>
+
#include "buddylist.h"
+
#include "../main.h"
#include "../configuration.h"
-#include <iostream>
-#include <fstream>
BuddyList::BuddyList()
{
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
index 565e8860..08a6a110 100644
--- a/src/resources/imageset.cpp
+++ b/src/resources/imageset.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "imageset.h"
#include "../log.h"
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 49632279..a83da342 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -21,12 +21,12 @@
* $Id$
*/
+#include <algorithm>
#include <cassert>
+#include <libxml/tree.h>
#include "itemdb.h"
-#include <libxml/tree.h>
-
#include "iteminfo.h"
#include "resourcemanager.h"
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index b6fc922c..2726a012 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -107,7 +107,7 @@ class ItemInfo
void setWeaponType(int);
- const SpriteAction getAttackType() const
+ SpriteAction getAttackType() const
{ return mAttackType; }
void addSound(EquipmentSoundEvent event, const std::string &filename);
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index 7bdafdc2..84e3a219 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "monsterdb.h"
#include "resourcemanager.h"
diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp
index 2e896237..0a7e18dc 100644
--- a/src/resources/monsterinfo.cpp
+++ b/src/resources/monsterinfo.cpp
@@ -21,6 +21,8 @@
* $Id$
*/
+#include <algorithm>
+
#include "monsterinfo.h"
#include "../utils/dtor.h"
diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h
index b068056d..3034f10e 100644
--- a/src/resources/monsterinfo.h
+++ b/src/resources/monsterinfo.h
@@ -77,7 +77,7 @@ class MonsterInfo
const std::string&
getSprite() const { return mSprite; }
- const Being::TargetCursorSize
+ Being::TargetCursorSize
getTargetCursorSize() const { return mTargetCursorSize; }
std::string