Package: enigma
Severity: normal
Tags: patch

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

if g++ -DHAVE_CONFIG_H -I. -I. -I. -I../lib-src -I/usr/include/lua40   
-I/usr/include/SDL -D_REENTRANT -I/usr/include/zipios++ -I./px/ -g -Wall -O2 
-O2 -fomit-frame-pointer -MT enigma-display-lua.o -MD -MP -MF 
".deps/enigma-display-lua.Tpo" \
  -c -o enigma-display-lua.o `test -f 'display-lua.cc' || echo 
'./'`display-lua.cc; \
then mv -f ".deps/enigma-display-lua.Tpo" ".deps/enigma-display-lua.Po"; \
else rm -f ".deps/enigma-display-lua.Tpo"; exit 1; \
fi
world.hh:182: error: explicit qualification in declaration of `bool 
world::IsInsideLevel(enigma::GridPos)'
world.hh:195: error: explicit qualification in declaration of `bool 
world::IsLevelBorder(enigma::GridPos)'
display-lua.cc: In function 'int 
toluaI_display_display_SetFollowMode00(lua_State*)':
display-lua.cc:32: error: invalid cast from type 'double' to type 
'display::FollowMode'
make[4]: *** [enigma-display-lua.o] Error 1
make[4]: Leaving directory `/enigma-0.81.1/src'

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/enigma-0.81.1/debian/patches/z_gcc4_fix.patch 
./debian/patches/z_gcc4_fix.patch
--- ../tmp-orig/enigma-0.81.1/debian/patches/z_gcc4_fix.patch   1970-01-01 
01:00:00.000000000 +0100
+++ ./debian/patches/z_gcc4_fix.patch   2005-03-17 17:18:41.000000000 +0100
@@ -0,0 +1,114 @@
+diff -urN tmp/actors.cc src/actors.cc
+--- tmp/actors.cc      2003-10-10 18:32:03.000000000 +0200
++++ src/actors.cc      2005-03-17 17:13:28.247118139 +0100
+@@ -379,7 +379,6 @@
+ 
+         display::SpriteHandle m_halosprite;
+         double                m_shield_rest_time;
+-        static const double   SHIELD_TIME = 10.0;
+         HaloState             m_halostate;
+     };
+ }
+@@ -472,6 +471,8 @@
+     }
+ 
+ 
++    static const double   SHIELD_TIME = 10.0;
++
+     // Shield can be activated in all states except DEAD
+ 
+     if (state != DEAD && m == "shield") {
+diff -urN tmp/display-lua.cc src/display-lua.cc
+--- tmp/display-lua.cc 2005-03-17 17:06:01.000000000 +0100
++++ src/display-lua.cc 2005-03-17 17:08:39.000000000 +0100
+@@ -29,7 +29,7 @@
+  goto tolua_lerror;
+  else
+  {
+-  FollowMode m = ((FollowMode)  tolua_getnumber(tolua_S,1,0));
++  FollowMode m = ((FollowMode) (long) tolua_getnumber(tolua_S,1,0));
+  {
+   SetFollowMode(m);
+  }
+diff -urN tmp/game.hh src/game.hh
+--- tmp/game.hh        2003-09-28 22:47:54.000000000 +0200
++++ src/game.hh        2005-03-17 17:09:23.592803535 +0100
+@@ -143,7 +143,7 @@
+ 
+     px::Surface *LevelPreview(LevelPack *lp, unsigned levelidx);
+ 
+-    void enigma::GameReset();
++    void GameReset();
+     unsigned     StartGame(LevelPack *lp, unsigned levelidx);
+     unsigned     NextLevel(LevelPack *lp, unsigned levelidx, unsigned 
max_available, 
+                            bool skip_solved, bool skip_todo_and_unnamed);
+diff -urN tmp/items.cc src/items.cc
+--- tmp/items.cc       2003-10-11 15:45:24.000000000 +0200
++++ src/items.cc       2005-03-17 17:15:11.326441445 +0100
+@@ -1281,6 +1281,8 @@
+ - \b signal     signal value: 1 -> "open"; 0 -> "close"
+ */
+ 
++static const double RANGE = 0.5/2;
++
+ namespace
+ {
+     class Vortex : public Item, public TimeHandler
+@@ -1295,8 +1297,6 @@
+ 
+     private:
+ 
+-        static const double RANGE = 0.5/2;
+-
+         bool actor_hit(Actor*);
+         void init_model() {
+             switch(state) {
+diff -urN tmp/stones_complex.cc src/stones_complex.cc
+--- tmp/stones_complex.cc      2003-10-11 15:45:23.000000000 +0200
++++ src/stones_complex.cc      2005-03-17 17:14:07.676591963 +0100
+@@ -37,6 +37,7 @@
+ using namespace enigma;
+ using namespace stones;
+ 
++static const double IMPULSE_DELAY = 0.1;
+ 
+ //----------------------------------------
+ // RotatorStone
+@@ -51,7 +52,6 @@
+ 
+     private:
+         static const double RATE          = 1.0;
+-        static const double IMPULSE_DELAY = 0.1;
+ 
+         bool clockwise;
+         bool movable;
+@@ -1993,7 +1993,7 @@
+         void message(const string &m, const Value &value) {
+             if (m=="trigger") {
+                 incoming = (value.get_type() == Value::DOUBLE)
+-                    ? Direction(value.get_double()+0.1)
++                    ? Direction(long(value.get_double()+0.1))
+                     : NODIR;
+ 
+                 change_state(PULSING);
+diff -urN tmp/world.hh src/world.hh
+--- tmp/world.hh       2005-03-17 17:06:01.000000000 +0100
++++ src/world.hh       2005-03-17 17:06:25.318806963 +0100
+@@ -179,7 +179,7 @@
+     bool InitWorld();
+     void BroadcastMessage(const std::string& msg, const enigma::Value& value, 
GridLayerBits grids);
+ 
+-    bool world::IsInsideLevel(GridPos p);
++    bool IsInsideLevel(GridPos p);
+     void Tick(double dtime);
+ 
+     // Destroy all objects etc.
+@@ -192,7 +192,7 @@
+     Object *GetNamedObject (const string &name);
+     Object *GetObject (const GridLoc &l);
+ 
+-    bool world::IsLevelBorder(GridPos p);
++    bool IsLevelBorder(GridPos p);
+ 
+ //----------------------------------------
+ // Force fields.


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

Reply via email to