From 7b08dbe31828b4233cb9e8bbdaf9c527bfe3256c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Date: Sun, 17 Oct 2010 14:16:57 +0200
Subject: [PATCH] Fixed compilation warnings Automatically enable flags -Werror
 and -fno-exceptions in debug mode

---
 Rules.make.in                               |  2 +-
 configure.in                                |  4 ++--
 src/action/command.cpp                      |  2 +-
 src/ai/ai.cpp                               |  4 ++--
 src/ai/script_ai.cpp                        |  2 +-
 src/editor/editloop.cpp                     |  6 +++---
 src/game/game.cpp                           | 12 +++++++++--
 src/guichan/defaultfont.cpp                 |  2 +-
 src/guichan/include/guichan/keylistener.h   |  8 +++----
 src/guichan/include/guichan/mouselistener.h | 12 +++++------
 src/guichan/include/guichan/widget.h        |  2 +-
 src/guichan/widgets/button.cpp              |  6 +++---
 src/guichan/widgets/checkbox.cpp            |  2 +-
 src/guichan/widgets/dropdown.cpp            | 10 ++++-----
 src/guichan/widgets/listbox.cpp             |  2 +-
 src/guichan/widgets/radiobutton.cpp         |  2 +-
 src/guichan/widgets/scrollarea.cpp          |  8 +++----
 src/guichan/widgets/slider.cpp              |  2 +-
 src/guichan/widgets/textfield.cpp           |  4 ++--
 src/guichan/widgets/window.cpp              |  4 ++--
 src/include/minimap.h                       |  2 +-
 src/include/particle.h                      |  2 +-
 src/map/minimap.cpp                         |  2 +-
 src/network/netconnect.cpp                  |  4 ++--
 src/pathfinder/astar.cpp                    |  6 +++---
 src/sound/mikmod.cpp                        | 10 ++++-----
 src/sound/sound.cpp                         |  1 +
 src/sound/sound_server.cpp                  |  2 +-
 src/stratagus/iolib.cpp                     |  2 +-
 src/stratagus/player.cpp                    |  2 +-
 src/stratagus/script.cpp                    |  4 ++--
 src/stratagus/selection.cpp                 |  2 +-
 src/stratagus/spells.cpp                    | 24 ++++++++++-----------
 src/stratagus/stratagus.cpp                 |  2 +-
 src/stratagus/title.cpp                     | 12 +++++------
 src/tolua/tolua_is.cpp                      |  2 +-
 src/tolua/tolua_to.cpp                      |  2 +-
 src/ui/button_checks.cpp                    | 14 ++++++------
 src/ui/icons.cpp                            |  2 +-
 src/ui/interface.cpp                        |  8 +++----
 src/ui/mainscr.cpp                          |  6 +++---
 src/ui/mouse.cpp                            |  4 ++--
 src/ui/widgets.cpp                          | 20 ++++++++++-------
 src/unit/build.cpp                          |  6 +++---
 src/unit/depend.cpp                         |  4 ++--
 src/unit/script_unittype.cpp                |  4 ++--
 src/unit/unit_draw.cpp                      | 10 ++++-----
 src/video/linedraw.cpp                      |  8 +++----
 src/video/movie.cpp                         | 12 +++++------
 src/video/sdl.cpp                           | 16 +++++++-------
 50 files changed, 152 insertions(+), 139 deletions(-)

diff --git a/Rules.make.in b/Rules.make.in
index 0bcfa2c9a..e58e0b014 100644
--- a/Rules.make.in
+++ b/Rules.make.in
@@ -22,7 +22,7 @@ PREFIX=@PREFIX@
 PKGDATADIR=@PKGDATADIR@
 
 CPPFLAGS=@DEFS@ @CPPFLAGS@ -DUSE_ZLIB -I$(TOPDIR) -I$(TOPDIR)/src/include -I$(TOPDIR)/src/guichan/include -DSTRATAGUS_LIB_PATH="\"@PKGDATADIR@\""
-CXXFLAGS=@CXXFLAGS@ -Wextra -Wno-long-long -pedantic
+CXXFLAGS=@CXXFLAGS@
 LDFLAGS=@LDFLAGS@ -lpng -lz -lm
 
 OBJDIR=@OBJDIR@
diff --git a/configure.in b/configure.in
index abb901c53..c604795d2 100644
--- a/configure.in
+++ b/configure.in
@@ -128,9 +128,9 @@ fi
 AC_ARG_ENABLE(debug,
 	[  --enable-debug	  [Enable debug (default: no)]])
 if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then
-	CXXFLAGS="$CXXFLAGS -O2 -pipe -fsigned-char -fomit-frame-pointer -fexpensive-optimizations -ffast-math"
+	CXXFLAGS="$CXXFLAGS -O2 -pipe -pedantic -fsigned-char -fomit-frame-pointer -fexpensive-optimizations -ffast-math"
 else
-	CXXFLAGS="$CXXFLAGS -O0 -g -fsigned-char -Wsign-compare -Werror -Wall"
+	CXXFLAGS="$CXXFLAGS -O0 -g -pedantic -fsigned-char -fno-exceptions -Wsign-compare -Wall -Wextra -Werror"
 	CPPFLAGS="$CPPFLAGS -DDEBUG"
 fi
 
diff --git a/src/action/command.cpp b/src/action/command.cpp
index 8d79cf94c..c098854a8 100644
--- a/src/action/command.cpp
+++ b/src/action/command.cpp
@@ -807,7 +807,7 @@ void CommandReturnGoods(CUnit *unit, CUnit *goal, int flush)
 **  @param type   unit type to train.
 **  @param flush  if true, flush command queue.
 */
-void CommandTrainUnit(CUnit *unit, CUnitType *type, int flush)
+void CommandTrainUnit(CUnit *unit, CUnitType *type, int)
 {
 	COrderPtr order;
 
diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp
index 092591b2e..313d215bf 100644
--- a/src/ai/ai.cpp
+++ b/src/ai/ai.cpp
@@ -509,7 +509,7 @@ void AiInit(CPlayer *player)
 	ait = NULL;
 
 	DebugPrint("%d - %p - looking for class %s\n" _C_
-		player->Index _C_ player _C_ player->AiName.c_str());
+		player->Index _C_ (void *)player _C_ player->AiName.c_str());
 	//MAPTODO print the player name (player->Name) instead of the pointer
 
 	//
@@ -1101,7 +1101,7 @@ void AiCanNotMove(CUnit *unit)
 **  @param unit  Point to unit.
 **  @param what  Pointer to unit-type.
 */
-void AiNeedMoreSupply(const CUnit *unit, const CUnitType *what)
+void AiNeedMoreSupply(const CUnit *unit, const CUnitType *)
 {
 	Assert(unit->Player->Type != PlayerPerson);
 	unit->Player->Ai->NeedSupply = true;
diff --git a/src/ai/script_ai.cpp b/src/ai/script_ai.cpp
index b4ea6cf4f..c37e57c43 100644
--- a/src/ai/script_ai.cpp
+++ b/src/ai/script_ai.cpp
@@ -1297,7 +1297,7 @@ static int CclDefineAiPlayer(lua_State *l)
 	++j;
 
 	Assert(i >= 0 && i <= PlayerMax);
-	DebugPrint("%p %d\n" _C_ Players[i].Ai _C_ Players[i].AiEnabled );
+	DebugPrint("%p %d\n" _C_ (void *)Players[i].Ai _C_ Players[i].AiEnabled );
 	// FIXME: lose this:
 	// Assert(!Players[i].Ai && Players[i].AiEnabled);
 
diff --git a/src/editor/editloop.cpp b/src/editor/editloop.cpp
index bb8a0028d..59d54cff8 100644
--- a/src/editor/editloop.cpp
+++ b/src/editor/editloop.cpp
@@ -135,7 +135,7 @@ static gcn::Slider *editorSlider;
 class EditorUnitSliderListener : public gcn::ActionListener
 {
 public:
-	virtual void action(const std::string &eventId) {
+	virtual void action(const std::string &) {
 		int iconsPerStep = VisibleUnitIcons;
 		int steps = (Editor.ShownUnitTypes.size() + iconsPerStep - 1) / iconsPerStep;
 		double value = editorUnitSlider->getValue();
@@ -153,7 +153,7 @@ static EditorUnitSliderListener *editorUnitSliderListener;
 class EditorSliderListener : public gcn::ActionListener
 {
 public:
-	virtual void action(const std::string &eventId) {
+	virtual void action(const std::string &) {
 		int iconsPerStep = VisibleTileIcons;
 		int steps = (Editor.ShownTileTypes.size() + iconsPerStep - 1) / iconsPerStep;
 		double value = editorSlider->getValue();
@@ -1577,7 +1577,7 @@ static void EditorCallbackKeyUp(unsigned key, unsigned keychar)
 /**
 **  Callback for input.
 */
-static void EditorCallbackKeyRepeated(unsigned key, unsigned keychar)
+static void EditorCallbackKeyRepeated(unsigned key, unsigned)
 {
 	switch (key) {
 		case 'z':
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 3959fe9fc..0aeaaefd6 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -90,7 +90,7 @@ GameResults GameResult;                      /// Outcome of the game
 **  @param mapname  map filename
 **  @param map      map loaded
 */
-static void LoadStratagusMap(const std::string &smpname, const std::string &mapname, CMap *map)
+static void LoadStratagusMap(const std::string &smpname, const std::string &mapname, CMap *)
 {
 	char mapfull[PATH_MAX];
 	CFile file;
@@ -163,7 +163,7 @@ static void LoadStratagusMap(const std::string &smpname, const std::string &mapn
 
 
 // Write the map presentation file
-static int WriteMapPresentation(const std::string &mapname, CMap *map, char *mapsetup)
+static int WriteMapPresentation(const std::string &mapname, CMap *map, char *)
 {
 	FileWriter *f = NULL;
 	int i;
@@ -176,7 +176,9 @@ static int WriteMapPresentation(const std::string &mapname, CMap *map, char *map
 	numplayers = 0;
 	topplayer = PlayerMax - 2;
 
+#ifndef DEBUG
 	try {
+#endif
 		f = CreateFileWriter(mapname);
 		f->printf("-- Stratagus Map Presentation\n");
 		f->printf("-- File generated by the stratagus builtin editor.\n");
@@ -204,11 +206,13 @@ static int WriteMapPresentation(const std::string &mapname, CMap *map, char *map
 //			mapsetupname = mapsetup;
 //		}
 //		f->printf("DefineMapSetup(GetCurrentLuaPath()..\"%s\")\n", mapsetupname);
+#ifndef DEBUG
 	} catch (const FileException &) {
 		fprintf(stderr, "ERROR: cannot write the map presentation\n");
 		delete f;
 		return -1;
 	}
+#endif
 	delete f;
 
 	return 1;
@@ -227,7 +231,9 @@ int WriteMapSetup(const char *mapSetup, CMap *map, int writeTerrain)
 	FileWriter *f = NULL;
 	int i, j;
 
+#ifndef DEBUG
 	try {
+#endif
 		f = CreateFileWriter(mapSetup);
 
 		f->printf("-- Stratagus Map Setup\n");
@@ -287,11 +293,13 @@ int WriteMapSetup(const char *mapSetup, CMap *map, int writeTerrain)
 			}
 		}
 		f->printf("\n\n");
+#ifndef DEBUG
 	} catch (const FileException &) {
 		fprintf(stderr,"Can't save map setup : `%s' \n", mapSetup);
 		delete f;
 		return -1;
 	}
+#endif
 	delete f;
 
 	return 1;
diff --git a/src/guichan/defaultfont.cpp b/src/guichan/defaultfont.cpp
index 4d8e793a9..bead6c4da 100644
--- a/src/guichan/defaultfont.cpp
+++ b/src/guichan/defaultfont.cpp
@@ -71,7 +71,7 @@ namespace gcn
         return 8*text.size();
     }
 
-    int DefaultFont::drawGlyph(Graphics* graphics, unsigned char glyph, int x, int y)
+    int DefaultFont::drawGlyph(Graphics* graphics, unsigned char, int x, int y)
     {
         graphics->drawRectangle( Rectangle(x, y, 8, 8));
      
diff --git a/src/guichan/include/guichan/keylistener.h b/src/guichan/include/guichan/keylistener.h
index 43e9c75d5..673937861 100644
--- a/src/guichan/include/guichan/keylistener.h
+++ b/src/guichan/include/guichan/keylistener.h
@@ -87,17 +87,17 @@ namespace gcn
          *
          * @param key the key pressed.
          */
-        virtual bool keyPress(const Key& key) { return false; }
+        virtual bool keyPress(const Key&) { return false; }
 
         /**
          * Called if a key is released when the widget has keyboard focus.
          *
          * @param key the key released.
          */
-        virtual bool keyRelease(const Key& key) { return false; }
+        virtual bool keyRelease(const Key&) { return false; }
 
-		virtual void hotKeyPress(const Key& key) { }
-		virtual void hotKeyRelease(const Key& key) { }
+		virtual void hotKeyPress(const Key&) { }
+		virtual void hotKeyRelease(const Key&) { }
 
     protected:
         /**
diff --git a/src/guichan/include/guichan/mouselistener.h b/src/guichan/include/guichan/mouselistener.h
index 370d6edd1..9b3054b2f 100644
--- a/src/guichan/include/guichan/mouselistener.h
+++ b/src/guichan/include/guichan/mouselistener.h
@@ -101,7 +101,7 @@ namespace gcn
          *          itself.
          * @param button the button pressed.
          */
-        virtual void mousePress(int x, int y, int button) { }
+        virtual void mousePress(int, int, int) { }
 
         /**
          * Called when a mouse button is released when the mouse is in the
@@ -114,7 +114,7 @@ namespace gcn
          *          itself.
          * @param button the button released.
          */
-        virtual void mouseRelease(int x, int y, int button) { }
+        virtual void mouseRelease(int, int, int) { }
 
 
         /**
@@ -129,7 +129,7 @@ namespace gcn
          * @param button the button clicked.
          * @param count the number of clicks.
          */
-        virtual void mouseClick(int x, int y, int button, int count) { }
+        virtual void mouseClick(int, int, int, int) { }
     
         /**
          * Called on a mouse wheel up when the mouse is in the Widget
@@ -140,7 +140,7 @@ namespace gcn
          * @param y the y coordinate of the mouse relative to the Widget
          *          itself.
          */
-        virtual void mouseWheelUp(int x, int y) { }
+        virtual void mouseWheelUp(int, int) { }
 
         /**
          * Called on a mouse wheel down when the mouse is in the Widget
@@ -151,7 +151,7 @@ namespace gcn
          * @param y the y coordinate of the mouse relative to the Widget
          *          itself.
          */
-        virtual void mouseWheelDown(int x, int y) { }
+        virtual void mouseWheelDown(int, int) { }
 
         /**
          * Called when the mouse moves and the mouse is in the Widget
@@ -162,7 +162,7 @@ namespace gcn
          * @param y the y coordinate of the mouse relative to the Widget
          *          itself.
          */
-        virtual void mouseMotion(int x, int y) { }
+        virtual void mouseMotion(int, int) { }
 
     protected:
         /**
diff --git a/src/guichan/include/guichan/widget.h b/src/guichan/include/guichan/widget.h
index b7f1fd5cb..e50bdfef6 100644
--- a/src/guichan/include/guichan/widget.h
+++ b/src/guichan/include/guichan/widget.h
@@ -124,7 +124,7 @@ namespace gcn
          *
          * @param graphics a Graphics object to draw with.
          */
-        virtual void drawBorder(Graphics* graphics) { }
+        virtual void drawBorder(Graphics*) { }
         
         /**
          * Called for all Widgets in the gui each time Gui::logic is called.
diff --git a/src/guichan/widgets/button.cpp b/src/guichan/widgets/button.cpp
index 42a926689..d13ecb939 100644
--- a/src/guichan/widgets/button.cpp
+++ b/src/guichan/widgets/button.cpp
@@ -228,7 +228,7 @@ namespace gcn
         return (hasMouse() && mMouseDown) || mKeyDown || mHotKeyDown;
     }
     
-    void Button::mouseClick(int x, int y, int button, int count)
+    void Button::mouseClick(int, int, int button, int)
     {
         if (button == MouseInput::LEFT)
         {
@@ -236,7 +236,7 @@ namespace gcn
         }
     }
 
-    void Button::mousePress(int x, int y, int button)
+    void Button::mousePress(int, int, int button)
     {
         if (button == MouseInput::LEFT && hasMouse())
         {      
@@ -244,7 +244,7 @@ namespace gcn
         }
     }
 
-    void Button::mouseRelease(int x, int y, int button)
+    void Button::mouseRelease(int, int, int button)
     {
         if (button == MouseInput::LEFT)
         {      
diff --git a/src/guichan/widgets/checkbox.cpp b/src/guichan/widgets/checkbox.cpp
index ad04c27a2..725a2e186 100644
--- a/src/guichan/widgets/checkbox.cpp
+++ b/src/guichan/widgets/checkbox.cpp
@@ -190,7 +190,7 @@ namespace gcn
         return false;
     }
   
-    void CheckBox::mouseClick(int x, int y, int button, int count)
+    void CheckBox::mouseClick(int, int, int button, int)
     {
         if (button == MouseInput::LEFT)
         {
diff --git a/src/guichan/widgets/dropdown.cpp b/src/guichan/widgets/dropdown.cpp
index a72573276..d9cb4ce4b 100644
--- a/src/guichan/widgets/dropdown.cpp
+++ b/src/guichan/widgets/dropdown.cpp
@@ -381,7 +381,7 @@ namespace gcn
 		return false;
     }
   
-    void DropDown::mousePress(int x, int y, int button)
+    void DropDown::mousePress(int, int y, int button)
     {
         if (button == MouseInput::LEFT && hasMouse() && !mDroppedDown)
         {
@@ -400,7 +400,7 @@ namespace gcn
         }        
     }
 
-    void DropDown::mouseRelease(int x, int y, int button)
+    void DropDown::mouseRelease(int, int, int button)
     {
         if (button == MouseInput::LEFT)
         {      
@@ -599,7 +599,7 @@ namespace gcn
         foldUp();        
     }
 
-    void DropDown::moveToTop(Widget* widget)
+    void DropDown::moveToTop(Widget*)
     {
         if (getParent())
         {
@@ -607,7 +607,7 @@ namespace gcn
         }        
     }
 
-    void DropDown::moveToBottom(Widget* widget)
+    void DropDown::moveToBottom(Widget*)
     {
         if (getParent())
         {
@@ -628,7 +628,7 @@ namespace gcn
         }        
     }
 
-    void DropDown::action(const std::string& eventId)
+    void DropDown::action(const std::string&)
     {
         foldUp();
         generateAction();        
diff --git a/src/guichan/widgets/listbox.cpp b/src/guichan/widgets/listbox.cpp
index 14583e24f..e669c8918 100644
--- a/src/guichan/widgets/listbox.cpp
+++ b/src/guichan/widgets/listbox.cpp
@@ -219,7 +219,7 @@ namespace gcn
         return ret;
     }
 
-    void ListBox::mousePress(int x, int y, int button)
+    void ListBox::mousePress(int, int y, int button)
     {
         if (button == MouseInput::LEFT && hasMouse())
         {
diff --git a/src/guichan/widgets/radiobutton.cpp b/src/guichan/widgets/radiobutton.cpp
index 33c5c6402..365fe7fd4 100644
--- a/src/guichan/widgets/radiobutton.cpp
+++ b/src/guichan/widgets/radiobutton.cpp
@@ -249,7 +249,7 @@ namespace gcn
         return false;
     }
 
-    void RadioButton::mouseClick(int x, int y, int button, int count)
+    void RadioButton::mouseClick(int, int, int button, int)
     {
         if (button == MouseInput::LEFT)
         {
diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp
index e6a0822c7..01745684c 100644
--- a/src/guichan/widgets/scrollarea.cpp
+++ b/src/guichan/widgets/scrollarea.cpp
@@ -335,7 +335,7 @@ namespace gcn
         BasicContainer::_mouseOutMessage();
     }
   
-    void ScrollArea::mousePress(int x, int y, int button)
+    void ScrollArea::mousePress(int x, int y, int)
     {
         if (getUpButtonDimension().isPointInRect(x, y))
         {
@@ -369,7 +369,7 @@ namespace gcn
         } 
     }
 
-    void ScrollArea::mouseRelease(int x, int y, int button)
+    void ScrollArea::mouseRelease(int, int, int)
     {
         mUpButtonPressed = false;
         mDownButtonPressed = false;
@@ -1278,7 +1278,7 @@ namespace gcn
         }
     }
 
-    void ScrollArea::mouseWheelUp(int x, int y)
+    void ScrollArea::mouseWheelUp(int, int)
     {    
         if (hasMouse())
         {
@@ -1286,7 +1286,7 @@ namespace gcn
         }    
     }
 
-    void ScrollArea::mouseWheelDown(int x, int y)
+    void ScrollArea::mouseWheelDown(int, int)
     {    
         if (hasMouse())
         {
diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp
index 2c6331700..474ee6c6c 100644
--- a/src/guichan/widgets/slider.cpp
+++ b/src/guichan/widgets/slider.cpp
@@ -232,7 +232,7 @@ namespace gcn
         }
     }
     
-    void Slider::mouseRelease(int x, int y, int button)
+    void Slider::mouseRelease(int, int, int)
     {
         mMouseDrag = false;
     }
diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp
index c01b5d453..4acc6642d 100644
--- a/src/guichan/widgets/textfield.cpp
+++ b/src/guichan/widgets/textfield.cpp
@@ -179,7 +179,7 @@ namespace gcn
         graphics->drawLine(x, getHeight() - 2, x, 1);    
     }
   
-    void TextField::mousePress(int x, int y, int button)
+    void TextField::mousePress(int x, int, int button)
     {
         if (hasMouse() && button == MouseInput::LEFT)
         {
@@ -199,7 +199,7 @@ namespace gcn
         }
     }
 
-	void TextField::mouseMotion(int x, int y)
+	void TextField::mouseMotion(int x, int)
 	{
 		if (isDragged() && mClickButton == MouseInput::LEFT)
 		{
diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp
index a77d3e640..bb4f00137 100644
--- a/src/guichan/widgets/window.cpp
+++ b/src/guichan/widgets/window.cpp
@@ -131,7 +131,7 @@ namespace gcn
         return mTitleBarHeight;
     }
 
-    void Window:: _announceDeath(Widget *widget)
+    void Window:: _announceDeath(Widget *)
     {
         mContent = NULL;
     }
@@ -326,7 +326,7 @@ namespace gcn
         }
     }
   
-    void Window::mouseRelease(int x, int y, int button)
+    void Window::mouseRelease(int, int, int button)
     {
         if (button == 1)
         {
diff --git a/src/include/minimap.h b/src/include/minimap.h
index 804967924..5f0a9f9b2 100644
--- a/src/include/minimap.h
+++ b/src/include/minimap.h
@@ -54,7 +54,7 @@ public:
 		Transparent(false), UpdateCache(false) {}
 
 	void UpdateXY(int tx, int ty);
-	void UpdateSeenXY(int tx, int ty) {}
+	void UpdateSeenXY(int, int) {}
 	void Update(void);
 	void Create(void);
 	void FreeOpenGL(void);
diff --git a/src/include/particle.h b/src/include/particle.h
index ee19037d3..78f0cdb5d 100644
--- a/src/include/particle.h
+++ b/src/include/particle.h
@@ -94,7 +94,7 @@ public:
 	virtual ~CParticle() {}
 
 	virtual void draw() {}
-	virtual void update(int ticks) {}
+	virtual void update(int) {}
 
 	inline void destroy() { destroyed = true; }
 	inline bool isDestroyed() { return destroyed; }
diff --git a/src/map/minimap.cpp b/src/map/minimap.cpp
index 2b4b23429..1b86a0c79 100644
--- a/src/map/minimap.cpp
+++ b/src/map/minimap.cpp
@@ -622,7 +622,7 @@ static void DrawEvents(void)
 /**
 **  Draw the minimap on the screen
 */
-void CMinimap::Draw(int vx, int vy)
+void CMinimap::Draw(int, int)
 {
 	if (!UseOpenGL) {
 		SDL_Rect drect = {X, Y, 0, 0};
diff --git a/src/network/netconnect.cpp b/src/network/netconnect.cpp
index 8d0098dd9..87c3841f5 100644
--- a/src/network/netconnect.cpp
+++ b/src/network/netconnect.cpp
@@ -1500,7 +1500,7 @@ static void ClientParseStarted(const CInitMessage *msg)
 **
 ** @param msg message received
 */
-static void ClientParseAreYouThere(const CInitMessage *msg)
+static void ClientParseAreYouThere(const CInitMessage *)
 {
 	CInitMessage message;
 
@@ -1514,7 +1514,7 @@ static void ClientParseAreYouThere(const CInitMessage *msg)
 **
 ** @param msg message received
 */
-static void ClientParseBadMap(const CInitMessage *msg)
+static void ClientParseBadMap(const CInitMessage *)
 {
 	int i;
 	CInitMessage message;
diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp
index bc330f163..bda82a9e4 100644
--- a/src/pathfinder/astar.cpp
+++ b/src/pathfinder/astar.cpp
@@ -567,7 +567,7 @@ static inline int AStarAddNode(int x, int y, int o, int costs)
 **  Can be further optimised knowing that the new cost MUST BE LOWER
 **  than the old one.
 */
-static void AStarReplaceNode(int pos, int costs)
+static void AStarReplaceNode(int pos, int)
 {
 	ProfileBegin("AStarReplaceNode");
 
@@ -955,8 +955,8 @@ static int AStarSavePath(int startX, int startY, int endX, int endY, char *path,
 **  Check if we're at the goal or if it's 1 tile away
 */
 static int AStarFindSimplePath(int sx, int sy, int gx, int gy, int gw, int gh,
-	int tilesizex, int tilesizey, int minrange, int maxrange,
-	 char *path, int pathlen, void *data)
+	int, int, int minrange, int maxrange,
+	 char *path, int, void *data)
 {
 	ProfileBegin("AStarFindSimplePath");
 	// At exact destination point already
diff --git a/src/sound/mikmod.cpp b/src/sound/mikmod.cpp
index efad53dc5..c4edb752f 100644
--- a/src/sound/mikmod.cpp
+++ b/src/sound/mikmod.cpp
@@ -80,29 +80,29 @@ public:
 --  Functions
 ----------------------------------------------------------------------------*/
 
-static BOOL Seek(struct MREADER *mreader, long off, int whence)
+static BOOL Seek(struct MREADER *, long off, int whence)
 {
 	return CurrentFile->seek(off, whence);
 }
 
-static long Tell(struct MREADER *mreader)
+static long Tell(struct MREADER *)
 {
 	return CurrentFile->tell();
 }
 
-static BOOL Read(struct MREADER *mreader, void *buf, size_t len)
+static BOOL Read(struct MREADER *, void *buf, size_t len)
 {
 	return CurrentFile->read(buf, len);
 }
 
-static int Get(struct MREADER *mreader)
+static int Get(struct MREADER *)
 {
 	char c;
 	CurrentFile->read(&c, 1);
 	return c;
 }
 
-static BOOL Eof(struct MREADER *mreader)
+static BOOL Eof(struct MREADER *)
 {
 	return 0;
 }
diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp
index b6a163bfc..980cb815c 100644
--- a/src/sound/sound.cpp
+++ b/src/sound/sound.cpp
@@ -81,6 +81,7 @@ GameSound GameSounds
 	{ SoundConfig("rescue (human) UNUSED"),
 		SoundConfig("rescue (orc) UNUSED"),
 	},
+	SoundConfig("click"),
 }
 #endif
 	;
diff --git a/src/sound/sound_server.cpp b/src/sound/sound_server.cpp
index 2ca894457..a767b7692 100644
--- a/src/sound/sound_server.cpp
+++ b/src/sound/sound_server.cpp
@@ -336,7 +336,7 @@ static void MixIntoBuffer(void *buffer, int samples)
 **  @param stream  pointer to buffer you want to fill with information.
 **  @param len     is length of audio buffer in bytes.
 */
-static void FillAudio(void *udata, Uint8 *stream, int len)
+static void FillAudio(void *, Uint8 *stream, int len)
 {
 	len >>= 1;
 	MixIntoBuffer(stream, len);
diff --git a/src/stratagus/iolib.cpp b/src/stratagus/iolib.cpp
index a168c6fd1..fc1992739 100644
--- a/src/stratagus/iolib.cpp
+++ b/src/stratagus/iolib.cpp
@@ -113,7 +113,7 @@ static int gzseek(CFile *file, unsigned offset, int whence)
 **  @param offset  Seek position
 **  @param whence  How to seek
 */
-static void bzseek(BZFILE *file, unsigned offset, int whence)
+static void bzseek(BZFILE *file, unsigned offset, int)
 {
 	char buf[32];
 
diff --git a/src/stratagus/player.cpp b/src/stratagus/player.cpp
index 74d2e93ea..3f6bcb8c9 100644
--- a/src/stratagus/player.cpp
+++ b/src/stratagus/player.cpp
@@ -908,7 +908,7 @@ void DebugPlayers(void)
 **  @note The parameter type, isn't yet used.
 **  @todo FIXME: We must also notfiy allied players.
 */
-void CPlayer::Notify(int type, int x, int y, const char *fmt, ...) const
+void CPlayer::Notify(int, int x, int y, const char *fmt, ...) const
 {
 	char temp[128];
 	va_list va;
diff --git a/src/stratagus/script.cpp b/src/stratagus/script.cpp
index 50761a173..51daa471e 100644
--- a/src/stratagus/script.cpp
+++ b/src/stratagus/script.cpp
@@ -509,7 +509,7 @@ bool LuaToBoolean(lua_State *l, int narg)
 **
 **  @param fast  set this flag to disable slow GC (during game)
 */
-void CclGarbageCollect(int fast)
+void CclGarbageCollect(int)
 {
 #if LUA_VERSION_NUM >= 501
 	DebugPrint("Garbage collect (before): %d\n" _C_
@@ -1187,7 +1187,7 @@ std::string EvalString(const StringDesc *s)
 **
 **  @param unitdesc  struct to free
 */
-void FreeUnitDesc(UnitDesc *unitdesc)
+void FreeUnitDesc(UnitDesc *)
 {
 #if 0 // Nothing to free mow.
 	if (!unitdesc) {
diff --git a/src/stratagus/selection.cpp b/src/stratagus/selection.cpp
index 520b45d31..68d98d25e 100644
--- a/src/stratagus/selection.cpp
+++ b/src/stratagus/selection.cpp
@@ -930,7 +930,7 @@ int SelectGroundUnitsInRectangle(int sx0, int sy0, int sx1, int sy1)
 }
 
 int DoSelectAirUnitsInRectangle(int sx0, int sy0, int sx1, int sy1,
-CUnit**table, int num_units = UnitMax)
+CUnit**table)
 {
 	CUnit *unit;
 	int r;
diff --git a/src/stratagus/spells.cpp b/src/stratagus/spells.cpp
index dbe7b357d..57edee176 100644
--- a/src/stratagus/spells.cpp
+++ b/src/stratagus/spells.cpp
@@ -91,8 +91,8 @@ std::vector<SpellType*> SpellTypeTable;
 **
 **  @return             =!0 if spell should be repeated, 0 if not
 */
-int Demolish::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+int Demolish::Cast(CUnit *caster, const SpellType *,
+	CUnit *, int x, int y)
 {
 	int xmin;
 	int ymin;
@@ -162,8 +162,8 @@ int Demolish::Cast(CUnit *caster, const SpellType *spell,
 **
 **  @return             =!0 if spell should be repeated, 0 if not
 */
-int SpawnPortal::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+int SpawnPortal::Cast(CUnit *caster, const SpellType *,
+	CUnit *, int x, int y)
 {
 	// FIXME: vladi: cop should be placed only on explored land
 	CUnit *portal;
@@ -252,8 +252,8 @@ int AreaAdjustVitals::Cast(CUnit *caster, const SpellType *spell,
 **  @internal: vladi: blizzard differs than original in this way:
 **   original: launches 50 shards at 5 random spots x 10 for 25 mana.
 */
-int AreaBombardment::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+int AreaBombardment::Cast(CUnit *caster, const SpellType *,
+	CUnit *, int x, int y)
 {
 	int fields;
 	int shards;
@@ -351,7 +351,7 @@ static void EvaluateMissileLocation(const SpellActionMissileLocation *location,
 **
 **  @return             =!0 if spell should be repeated, 0 if not
 */
-int SpawnMissile::Cast(CUnit *caster, const SpellType *spell,
+int SpawnMissile::Cast(CUnit *caster, const SpellType *,
 	CUnit *target, int x, int y)
 {
 	::Missile *missile;
@@ -390,8 +390,8 @@ int SpawnMissile::Cast(CUnit *caster, const SpellType *spell,
 **
 **  @return        =!0 if spell should be repeated, 0 if not
 */
-int AdjustVariable::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+int AdjustVariable::Cast(CUnit *caster, const SpellType *,
+	CUnit *target, int, int)
 {
 	for (unsigned int i = 0; i < UnitTypeVar.GetNumberVariable(); ++i) {
 		CUnit *unit = (this->Var[i].TargetIsCaster) ? caster : target;
@@ -447,7 +447,7 @@ int AdjustVariable::Cast(CUnit *caster, const SpellType *spell,
 **  @return             =!0 if spell should be repeated, 0 if not
 */
 int AdjustVitals::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+	CUnit *target, int, int)
 {
 	int castcount;
 	int diffHP;
@@ -603,7 +603,7 @@ int Polymorph::Cast(CUnit *caster, const SpellType *spell,
 **  @return             =!0 if spell should be repeated, 0 if not
 */
 int Capture::Cast(CUnit *caster, const SpellType *spell,
-	CUnit *target, int x, int y)
+	CUnit *target, int, int)
 {
 	if (!target || caster->Player == target->Player) {
 		return 0;
@@ -772,7 +772,7 @@ static Target *NewTargetPosition(int x, int y)
 **  @return            true if passed, false otherwise.
 */
 static bool PassCondition(const CUnit *caster, const SpellType *spell, const CUnit *target,
-	int x, int y, const ConditionInfo *condition)
+	int, int, const ConditionInfo *condition)
 {
 	if (caster->Variable[MANA_INDEX].Value < spell->ManaCost) { // Check caster mana.
 		return false;
diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp
index 84f25b510..6b3ca154e 100644
--- a/src/stratagus/stratagus.cpp
+++ b/src/stratagus/stratagus.cpp
@@ -558,7 +558,7 @@ static void PrintHeader(void)
 **  @param argc  Number of arguments.
 **  @param argv  Vector of arguments.
 */
-static int main1(int argc, char **argv)
+static int main1(int, char **)
 {
 	PrintHeader();
 	printf(
diff --git a/src/stratagus/title.cpp b/src/stratagus/title.cpp
index 0ef0fbea1..77ec6675a 100644
--- a/src/stratagus/title.cpp
+++ b/src/stratagus/title.cpp
@@ -43,7 +43,7 @@ static bool WaitNoEvent;             /// Flag got an event
 /**
 **  Callback for input.
 */
-static void WaitCallbackButtonPressed(unsigned dummy)
+static void WaitCallbackButtonPressed(unsigned)
 {
 	WaitNoEvent = false;
 }
@@ -51,14 +51,14 @@ static void WaitCallbackButtonPressed(unsigned dummy)
 /**
 **  Callback for input.
 */
-static void WaitCallbackButtonReleased(unsigned dummy)
+static void WaitCallbackButtonReleased(unsigned)
 {
 }
 
 /**
 **  Callback for input.
 */
-static void WaitCallbackKeyPressed(unsigned dummy1, unsigned dummy2)
+static void WaitCallbackKeyPressed(unsigned, unsigned)
 {
 	WaitNoEvent = false;
 }
@@ -66,21 +66,21 @@ static void WaitCallbackKeyPressed(unsigned dummy1, unsigned dummy2)
 /**
 **  Callback for input.
 */
-static void WaitCallbackKeyReleased(unsigned dummy1, unsigned dummy2)
+static void WaitCallbackKeyReleased(unsigned, unsigned)
 {
 }
 
 /**
 **  Callback for input.
 */
-static void WaitCallbackKeyRepeated(unsigned dummy1, unsigned dummy2)
+static void WaitCallbackKeyRepeated(unsigned, unsigned)
 {
 }
 
 /**
 **  Callback for input.
 */
-static void WaitCallbackMouse(int x, int y)
+static void WaitCallbackMouse(int, int)
 {
 }
 
diff --git a/src/tolua/tolua_is.cpp b/src/tolua/tolua_is.cpp
index f8710adc4..c7056491d 100644
--- a/src/tolua/tolua_is.cpp
+++ b/src/tolua/tolua_is.cpp
@@ -308,7 +308,7 @@ TOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def,
 }
 
 TOLUA_API int tolua_isvaluearray
- (lua_State* L, int lo, int dim, int def, tolua_Error* err)
+ (lua_State* L, int lo, int, int def, tolua_Error* err)
 {
 	if (!tolua_istable(L,lo,def,err))
 		return 0;
diff --git a/src/tolua/tolua_to.cpp b/src/tolua/tolua_to.cpp
index 1bd99213b..c7aa75a00 100644
--- a/src/tolua/tolua_to.cpp
+++ b/src/tolua/tolua_to.cpp
@@ -122,7 +122,7 @@ TOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def)
  return v;
 }
 
-TOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int def)
+TOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int)
 {
  int v;
  lua_pushnumber(L,index);
diff --git a/src/ui/button_checks.cpp b/src/ui/button_checks.cpp
index f259ca1e5..34ab8bca2 100644
--- a/src/ui/button_checks.cpp
+++ b/src/ui/button_checks.cpp
@@ -59,7 +59,7 @@
 **
 **  @return        True if enabled.
 */
-bool ButtonCheckTrue(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckTrue(const CUnit *, const ButtonAction *)
 {
 	return true;
 }
@@ -73,7 +73,7 @@ bool ButtonCheckTrue(const CUnit *unit, const ButtonAction *button)
 **
 **  @return        True if enabled.
 */
-bool ButtonCheckFalse(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckFalse(const CUnit *, const ButtonAction *)
 {
 	return false;
 }
@@ -151,7 +151,7 @@ bool ButtonCheckUnitsAnd(const CUnit *unit, const ButtonAction *button)
 **
 **  @note: this check could also be moved into intialisation.
 */
-bool ButtonCheckNetwork(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckNetwork(const CUnit *, const ButtonAction *)
 {
 	return IsNetworkGame();
 }
@@ -166,7 +166,7 @@ bool ButtonCheckNetwork(const CUnit *unit, const ButtonAction *button)
 **
 **  @note: this check could also be moved into intialisation.
 */
-bool ButtonCheckNoNetwork(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckNoNetwork(const CUnit *, const ButtonAction *)
 {
 	return !IsNetworkGame();
 }
@@ -180,7 +180,7 @@ bool ButtonCheckNoNetwork(const CUnit *unit, const ButtonAction *button)
 **
 **  @return        True if enabled.
 */
-bool ButtonCheckNoWork(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckNoWork(const CUnit *unit, const ButtonAction *)
 {
 	int action = unit->CurrentAction(); 
 	return action != UnitActionTrain &&
@@ -196,7 +196,7 @@ bool ButtonCheckNoWork(const CUnit *unit, const ButtonAction *button)
 **
 **  @return        True if enabled.
 */
-bool ButtonCheckNoResearch(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckNoResearch(const CUnit *unit, const ButtonAction *)
 {
 	int action = unit->CurrentAction();
 	return action != UnitActionUpgradeTo &&
@@ -228,7 +228,7 @@ bool ButtonCheckUpgradeTo(const CUnit *unit, const ButtonAction *button)
 **
 **  @return        True if enabled.
 */
-bool ButtonCheckAttack(const CUnit *unit, const ButtonAction *button)
+bool ButtonCheckAttack(const CUnit *unit, const ButtonAction *)
 {
 	return unit->Type->CanAttack;
 }
diff --git a/src/ui/icons.cpp b/src/ui/icons.cpp
index 793be702e..f1c66aac5 100644
--- a/src/ui/icons.cpp
+++ b/src/ui/icons.cpp
@@ -198,7 +198,7 @@ void CIcon::DrawIcon(const CPlayer *player, int x, int y) const
 **  @param y       Y display pixel position
 **  @param text    Optional text to display
 */
-void CIcon::DrawUnitIcon(const CPlayer *player, ButtonStyle *style,
+void CIcon::DrawUnitIcon(const CPlayer *, ButtonStyle *style,
 	unsigned flags, int x, int y, const std::string &text) const
 {
 	ButtonStyle s(*style);
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 1cc552a85..c56085e52 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -966,7 +966,7 @@ static void Screenshot(void)
 **
 **  @return         1 if modifier found, 0 otherwise
 */
-int HandleKeyModifiersDown(unsigned key, unsigned keychar)
+int HandleKeyModifiersDown(unsigned key, unsigned)
 {
 	switch (key) {
 		case SDLK_LSHIFT:
@@ -1012,7 +1012,7 @@ int HandleKeyModifiersDown(unsigned key, unsigned keychar)
 **
 **  @return         1 if modifier found, 0 otherwise
 */
-int HandleKeyModifiersUp(unsigned key, unsigned keychar)
+int HandleKeyModifiersUp(unsigned key, unsigned)
 {
 	switch (key) {
 		case SDLK_LSHIFT:
@@ -1141,7 +1141,7 @@ void HandleKeyUp(unsigned key, unsigned keychar)
 **  @param key      Key scancode.
 **  @param keychar  Character code.
 */
-void HandleKeyRepeat(unsigned key, unsigned keychar)
+void HandleKeyRepeat(unsigned, unsigned keychar)
 {
 	if (KeyState == KeyStateInput && keychar) {
 		InputKey(keychar);
@@ -1401,7 +1401,7 @@ void InputMouseMove(const EventCallback *callbacks,
 **  @param ticks      Denotes time-stamp of video-system
 **
 */
-void InputMouseExit(const EventCallback *callbacks, unsigned ticks)
+void InputMouseExit(const EventCallback *callbacks, unsigned)
 {
 	// FIXME: should we do anything here with ticks? don't know, but conform others
 	// JOHNS: called by callback HandleMouseExit();
diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp
index fd0ca6c12..1f154509c 100644
--- a/src/ui/mainscr.cpp
+++ b/src/ui/mainscr.cpp
@@ -468,7 +468,7 @@ void CContentTypeFormattedText2::Draw(const CUnit *unit, CFont *defaultfont) con
 **  @param unit         unit with icon to show.
 **  @param defaultfont  unused.
 */
-void CContentTypeIcon::Draw(const CUnit *unit, CFont *defaultfont) const
+void CContentTypeIcon::Draw(const CUnit *unit, CFont *) const
 {
 	Assert(unit);
 	unit = GetUnitRef(unit, this->UnitRef);
@@ -486,7 +486,7 @@ void CContentTypeIcon::Draw(const CUnit *unit, CFont *defaultfont) const
 **
 **  @todo Color and percent value Parametrisation.
 */
-void CContentTypeLifeBar::Draw(const CUnit *unit, CFont *defaultfont) const
+void CContentTypeLifeBar::Draw(const CUnit *unit, CFont *) const
 {
 	Assert(unit);
 	Assert((unsigned int) this->Index < UnitTypeVar.GetNumberVariable());
@@ -524,7 +524,7 @@ void CContentTypeLifeBar::Draw(const CUnit *unit, CFont *defaultfont) const
 **
 **  @todo Color and percent value Parametrisation.
 */
-void CContentTypeCompleteBar::Draw(const CUnit *unit, CFont *defaultfont) const
+void CContentTypeCompleteBar::Draw(const CUnit *unit, CFont *) const
 {
 	Assert(unit);
 	Assert((unsigned int) this->Index < UnitTypeVar.GetNumberVariable());
diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp
index 17baa321a..aa1282c60 100644
--- a/src/ui/mouse.cpp
+++ b/src/ui/mouse.cpp
@@ -1263,7 +1263,7 @@ static void SendCommand(int sx, int sy)
 **  @param num     Button number.
 **  @param button  Mouse Button pressed.
 */
-static void DoSelectionButtons(int num, unsigned button)
+static void DoSelectionButtons(int num, unsigned)
 {
 	if (GameObserve || GamePaused) {
 		return;
@@ -1309,7 +1309,7 @@ static void DoSelectionButtons(int num, unsigned button)
 **
 **  @param button  Button pressed down.
 */
-static void UISelectStateButtonDown(unsigned button)
+static void UISelectStateButtonDown(unsigned)
 {
 	if (GameObserve || GamePaused) {
 		return;
diff --git a/src/ui/widgets.cpp b/src/ui/widgets.cpp
index fbae8046a..b23f79a00 100644
--- a/src/ui/widgets.cpp
+++ b/src/ui/widgets.cpp
@@ -62,10 +62,10 @@ static std::stack<MenuScreen *> MenuStack;
 ----------------------------------------------------------------------------*/
 
 
-static void MenuHandleButtonDown(unsigned buttons)
+static void MenuHandleButtonDown(unsigned)
 {
 }
-static void MenuHandleButtonUp(unsigned buttons)
+static void MenuHandleButtonUp(unsigned)
 {
 }
 static void MenuHandleMouseMove(int x, int y)
@@ -149,11 +149,15 @@ void handleInput(const SDL_Event *event)
 {
 	if (event) {
 		if (Input) {
+#ifndef DEBUG
 			try {
+#endif
 				Input->pushInput(*event);
+#ifndef DEBUG
 			} catch (const gcn::Exception &) {
 				// ignore unhandled buttons
 			}
+#endif
 		}
 	} else {
 		if (Gui) {
@@ -493,7 +497,7 @@ void ImageRadioButton::draw(gcn::Graphics *graphics)
 /**
 **  Mouse button pressed callback
 */
-void ImageRadioButton::mousePress(int x, int y, int button)
+void ImageRadioButton::mousePress(int, int, int button)
 {
 	if (button == gcn::MouseInput::LEFT && hasMouse()) {
 		mMouseDown = true;
@@ -503,7 +507,7 @@ void ImageRadioButton::mousePress(int x, int y, int button)
 /**
 **  Mouse button released callback
 */
-void ImageRadioButton::mouseRelease(int x, int y, int button)
+void ImageRadioButton::mouseRelease(int, int, int button)
 {
 	if (button == gcn::MouseInput::LEFT) {
 		mMouseDown = false;
@@ -513,7 +517,7 @@ void ImageRadioButton::mouseRelease(int x, int y, int button)
 /**
 **  Mouse clicked callback
 */
-void ImageRadioButton::mouseClick(int x, int y, int button, int count)
+void ImageRadioButton::mouseClick(int, int, int button, int)
 {
 	if (button == gcn::MouseInput::LEFT) {
         setMarked(true);
@@ -629,7 +633,7 @@ void ImageCheckBox::drawBox(gcn::Graphics *graphics)
 /**
 **  Mouse button pressed callback
 */
-void ImageCheckBox::mousePress(int x, int y, int button)
+void ImageCheckBox::mousePress(int, int, int button)
 {
 	if (button == gcn::MouseInput::LEFT && hasMouse()) {
 		mMouseDown = true;
@@ -639,7 +643,7 @@ void ImageCheckBox::mousePress(int x, int y, int button)
 /**
 **  Mouse button released callback
 */
-void ImageCheckBox::mouseRelease(int x, int y, int button)
+void ImageCheckBox::mouseRelease(int, int, int button)
 {
 	if (button == gcn::MouseInput::LEFT) {
 		mMouseDown = false;
@@ -649,7 +653,7 @@ void ImageCheckBox::mouseRelease(int x, int y, int button)
 /**
 **  Mouse clicked callback
 */
-void ImageCheckBox::mouseClick(int x, int y, int button, int count)
+void ImageCheckBox::mouseClick(int, int, int button, int)
 {
 	if (button == gcn::MouseInput::LEFT) {
 		toggle();
diff --git a/src/unit/build.cpp b/src/unit/build.cpp
index e5cdcae68..394c443a3 100644
--- a/src/unit/build.cpp
+++ b/src/unit/build.cpp
@@ -102,7 +102,7 @@ bool CBuildRestrictionAnd::Check(const CUnitType *type, int x, int y, CUnit *&on
 /**
 **  Check Distance Restriction
 */
-bool CBuildRestrictionDistance::Check(const CUnitType *type, int x, int y, CUnit *&ontoptarget) const
+bool CBuildRestrictionDistance::Check(const CUnitType *type, int x, int y, CUnit *&) const
 {
 	CUnit *table[UnitMax];
 	int n;
@@ -180,7 +180,7 @@ inline bool CBuildRestrictionAddOn::functor::operator() (const CUnit *const unit
 /**
 **  Check AddOn Restriction
 */
-bool CBuildRestrictionAddOn::Check(const CUnitType *type, int x, int y, CUnit *&ontoptarget) const
+bool CBuildRestrictionAddOn::Check(const CUnitType *, int x, int y, CUnit *&) const
 {
 	int x1;
 	int y1;
@@ -216,7 +216,7 @@ inline bool CBuildRestrictionOnTop::functor::operator() (CUnit *const unit)
 	return true;
 }
 
-bool CBuildRestrictionOnTop::Check(const CUnitType *type, int x, int y, CUnit *&ontoptarget) const
+bool CBuildRestrictionOnTop::Check(const CUnitType *, int x, int y, CUnit *&ontoptarget) const
 {
 #if 0
 	CUnit *table[UnitMax];
diff --git a/src/unit/depend.cpp b/src/unit/depend.cpp
index 3471e2b01..207998ccd 100644
--- a/src/unit/depend.cpp
+++ b/src/unit/depend.cpp
@@ -440,7 +440,7 @@ static int CclDefineDependency(lua_State *l)
 */
 static int CclGetDependency(lua_State *l)
 {
-	DebugPrint("FIXME: write this %p\n" _C_ l);
+	DebugPrint("FIXME: write this %p\n" _C_ (void*)l);
 
 	return 0;
 }
@@ -454,7 +454,7 @@ static int CclGetDependency(lua_State *l)
 */
 static int CclCheckDependency(lua_State *l)
 {
-	DebugPrint("FIXME: write this %p\n" _C_ l);
+	DebugPrint("FIXME: write this %p\n" _C_ (void *)l);
 
 	return 0;
 }
diff --git a/src/unit/script_unittype.cpp b/src/unit/script_unittype.cpp
index fa28fc9e6..745c3203e 100644
--- a/src/unit/script_unittype.cpp
+++ b/src/unit/script_unittype.cpp
@@ -1266,7 +1266,7 @@ static int CclSetUnitTypeName(lua_State *l)
 /**
 **  Add a label
 */
-static void AddLabel(lua_State *l, CAnimation *anim, const std::string &name)
+static void AddLabel(lua_State *, CAnimation *anim, const std::string &name)
 {
 	LabelsStruct label;
 	label.Anim = anim;
@@ -1291,7 +1291,7 @@ static CAnimation *FindLabel(lua_State *l, const std::string &name)
 /**
 **  Find a label later
 */
-static void FindLabelLater(lua_State *l, CAnimation **anim, const std::string &name)
+static void FindLabelLater(lua_State *, CAnimation **anim, const std::string &name)
 {
 	LabelsLaterStruct label;
 	label.Anim = anim;
diff --git a/src/unit/unit_draw.cpp b/src/unit/unit_draw.cpp
index 4ecbcc6cf..42a920ffb 100644
--- a/src/unit/unit_draw.cpp
+++ b/src/unit/unit_draw.cpp
@@ -190,8 +190,8 @@ void DrawUnitSelection(const CViewport *vp, const CUnit *unit)
 **  @param x1,y1  Coordinates of the top left corner.
 **  @param x2,y2  Coordinates of the bottom right corner.
 */
-void DrawSelectionNone(Uint32 color, int x1, int y1,
-	int x2, int y2)
+void DrawSelectionNone(Uint32, int, int,
+	int, int)
 {
 }
 
@@ -483,7 +483,7 @@ void CDecoVarBar::Draw(int x, int y,
 **  @todo fix font/color configuration.
 */
 void CDecoVarText::Draw(int x, int y, 
-	const CUnitType *Type, const CVariable &Variable) const
+	const CUnitType *, const CVariable &Variable) const
 {
 	if (this->IsCenteredInX) {
 		x -= 2; // GameFont->Width(buf) / 2, with buf = str(Value)
@@ -503,7 +503,7 @@ void CDecoVarText::Draw(int x, int y,
 **  @todo fix sprite configuration.
 */
 void CDecoVarSpriteBar::Draw(int x, int y, 
-	const CUnitType *Type, const CVariable &Variable) const
+	const CUnitType *, const CVariable &Variable) const
 {
 	int n;                   // frame of the sprite to show.
 	CGraphic *sprite;        // the sprite to show.
@@ -539,7 +539,7 @@ void CDecoVarSpriteBar::Draw(int x, int y,
 **  @todo fix sprite configuration configuration.
 */
 void CDecoVarStaticSprite::Draw(int x, int y, 
-	const CUnitType *Type, const CVariable &Variable) const
+	const CUnitType *, const CVariable &) const
 {
 	CGraphic *sprite;         // the sprite to show.
 	Decoration *decosprite;  // Info on the sprite.
diff --git a/src/video/linedraw.cpp b/src/video/linedraw.cpp
index 79cb339a6..602abbe2f 100644
--- a/src/video/linedraw.cpp
+++ b/src/video/linedraw.cpp
@@ -529,7 +529,7 @@ void DrawLineClip(Uint32 color, int sx, int sy, int dx, int dy)
 **  Draw a transparent line
 */
 void DrawTransLine(Uint32 color, int sx, int sy,
-	int dx, int dy, unsigned char alpha)
+	int dx, int dy, unsigned char)
 {
 	// FIXME: trans
 	DrawLine(color, sx, sy, dx, dy);
@@ -539,7 +539,7 @@ void DrawTransLine(Uint32 color, int sx, int sy,
 **  Draw a transparent line clipped
 */
 void DrawTransLineClip(Uint32 color, int sx, int sy,
-	int dx, int dy, unsigned char alpha)
+	int dx, int dy, unsigned char)
 {
 	// FIXME: trans
 	DrawLineClip(color, sx, sy, dx, dy);
@@ -1437,7 +1437,7 @@ void DrawLineClip(Uint32 color, int x1, int y1, int x2, int y2)
 **  Draw a transparent line
 */
 void DrawTransLine(Uint32 color, int sx, int sy,
-	int dx, int dy, unsigned char alpha)
+	int dx, int dy, unsigned char)
 {
 	// FIXME: trans
 	DrawLine(color, sx, sy, dx, dy);
@@ -1447,7 +1447,7 @@ void DrawTransLine(Uint32 color, int sx, int sy,
 **  Draw a transparent line clipped
 */
 void DrawTransLineClip(Uint32 color, int sx, int sy,
-	int dx, int dy, unsigned char alpha)
+	int dx, int dy, unsigned char)
 {
 	// FIXME: trans
 	DrawLineClip(color, sx, sy, dx, dy);
diff --git a/src/video/movie.cpp b/src/video/movie.cpp
index 229fbca9b..c4cffdde2 100644
--- a/src/video/movie.cpp
+++ b/src/video/movie.cpp
@@ -71,30 +71,30 @@ static int MovieStop;
 **  Callbacks for movie input.
 */
 
-static void MovieCallbackButtonPressed(unsigned dummy)
+static void MovieCallbackButtonPressed(unsigned)
 {
 	MovieStop = 1;
 }
 
-static void MovieCallbackButtonReleased(unsigned dummy)
+static void MovieCallbackButtonReleased(unsigned)
 {
 }
 
-static void MovieCallbackKeyPressed(unsigned dummya, unsigned dummyb)
+static void MovieCallbackKeyPressed(unsigned, unsigned)
 {
 	MovieStop = 1;
 }
 
 
-static void MovieCallbackKeyReleased(unsigned dummya, unsigned dummyb)
+static void MovieCallbackKeyReleased(unsigned, unsigned)
 {
 }
 
-static void MovieCallbackKeyRepeated(unsigned dummya, unsigned dummyb)
+static void MovieCallbackKeyRepeated(unsigned, unsigned)
 {
 }
 
-static void MovieCallbackMouseMove(int dummya, int dummyb)
+static void MovieCallbackMouseMove(int, int)
 {
 }
 
diff --git a/src/video/sdl.cpp b/src/video/sdl.cpp
index 6f1507af7..5e72c376e 100644
--- a/src/video/sdl.cpp
+++ b/src/video/sdl.cpp
@@ -212,19 +212,19 @@ static void InitOpenGLExtensions()
 	if (IsExtensionSupported("GL_ARB_texture_compression"))
 	{
 		glCompressedTexImage3DARB =
-			(PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)SDL_GL_GetProcAddress("glCompressedTexImage3DARB");
+			(PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexImage3DARB");
 		glCompressedTexImage2DARB =
-			(PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)SDL_GL_GetProcAddress("glCompressedTexImage2DARB");
+			(PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexImage2DARB");
 		glCompressedTexImage1DARB =
-			(PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)SDL_GL_GetProcAddress("glCompressedTexImage1DARB");
+			(PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexImage1DARB");
 		glCompressedTexSubImage3DARB =
-			(PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)SDL_GL_GetProcAddress("glCompressedTexSubImage3DARB");
+			(PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexSubImage3DARB");
 		glCompressedTexSubImage2DARB =
-			(PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)SDL_GL_GetProcAddress("glCompressedTexSubImage2DARB");
+			(PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexSubImage2DARB");
 		glCompressedTexSubImage1DARB =
-			(PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)SDL_GL_GetProcAddress("glCompressedTexSubImage1DARB");
+			(PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompressedTexSubImage1DARB");
 		glGetCompressedTexImageARB =
-			(PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)SDL_GL_GetProcAddress("glGetCompressedTexImageARB");
+			(PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(uintptr_t)SDL_GL_GetProcAddress("glGetCompressedTexImageARB");
 
 		if (glCompressedTexImage3DARB && glCompressedTexImage2DARB &&
 			glCompressedTexImage1DARB && glCompressedTexSubImage3DARB &&
@@ -319,7 +319,7 @@ void ReloadOpenGL()
 }
 
 #if defined(DEBUG) && !defined(USE_WIN32)
-static void CleanExit(int signum)
+static void CleanExit(int)
 {
 	// Clean SDL
 	SDL_Quit();