Package: widelands
Version: build9-2
Severity: normal
Tags: patch

Hello alpha people,

this bug report is just to tell you that I (the maintainer) have a patch to
port the game to your beloved arch, but I'm currently waiting for the game
to enter into testing.

Please be patient,
Mt.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages widelands depends on:
ii  libc6       2.3.2.ds1-20                 GNU C Library: Shared libraries an
ii  libgcc1     1:3.4.3-6                    GCC support library
ii  libsdl-imag 1.2.3-6                      image loading library for Simple D
ii  libsdl-net1 1.2.5-3                      network library for Simple DirectM
ii  libsdl-ttf2 2.0.6-5                      ttf library for Simple DirectMedia
ii  libsdl1.2de 1.2.7+1.2.8cvs20041007-3.0.1 Simple DirectMedia Layer
ii  libstdc++5  1:3.3.5-5                    The GNU Standard C++ Library v3
ii  widelands-d build9-2                     fantasy real-time strategy game (d

-- no debconf information
Patch to compile on alpha architecture without warning. It solves three
types of problems:
 - declare the alpha arch in machdep.h
 - vector.size() seems to return long int on this arch, inducing issues in
   printf().
   => casted back to int 
 - void* and int are not the same size here, casting one to the other
   produces a warning.
   => (void*) ((long int) i)

My fixes are not the most beautiful ones, and one may for example want to
change all int which are meant to be stored as a void* to long int. But I
wanted my patch as little intrusive as possible.

Only the first change (to machdep.h) is mandatory to get the game running.
The others are cosmetics to get it compiling without a warning.

 building_statistics_menu.cc               |    6 +++---
 fieldaction.cc                            |    2 +-
 game_debug_ui.cc                          |    2 +-
 immovable.cc                              |    2 +-
 machdep.h                                 |    2 +-
 militarysite.cc                           |    4 ++--
 network.cc                                |    2 +-
 productionsite.cc                         |    2 +-
 widelands_map_buildingdata_data_packet.cc |    2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

Index: widelands-build9/src/machdep.h
===================================================================
--- widelands-build9.orig/src/machdep.h
+++ widelands-build9/src/machdep.h
@@ -32,7 +32,7 @@
 #undef P_LITTLE_ENDIAN
 #define P_BIG_ENDIAN
 #define P_ALIGNMENT
-#elif defined (__i386__) || defined(__x86_64__)
+#elif defined (__i386__) || defined(__x86_64__) || defined(__alpha__)
 #undef P_BIG_ENDIAN
 #define P_LITTLE_ENDIAN
 #undef P_ALIGNMENT
Index: widelands-build9/src/militarysite.cc
===================================================================
--- widelands-build9.orig/src/militarysite.cc
+++ widelands-build9/src/militarysite.cc
@@ -134,9 +134,9 @@ std::string MilitarySite::get_statistics
 {
    char str[255];
    if (m_soldier_requests.size())
-      sprintf (str, "%d soldiers (+%d)", m_soldiers.size(), 
m_soldier_requests.size());
+      sprintf (str, "%d soldiers (+%d)", (int)m_soldiers.size(), 
(int)m_soldier_requests.size());
    else
-      sprintf (str, "%d soldiers", m_soldiers.size());
+      sprintf (str, "%d soldiers", (int)m_soldiers.size());
    
    return str;
 }
Index: widelands-build9/src/building_statistics_menu.cc
===================================================================
--- widelands-build9.orig/src/building_statistics_menu.cc
+++ widelands-build9/src/building_statistics_menu.cc
@@ -316,7 +316,7 @@ void Building_Statistics_Menu::update( v
       UITable_Entry* te = 0; 
       for( int l = 0; l< m_table->get_nr_entries(); l++) {
          UITable_Entry* entr = m_table->get_entry(l);
-         if( (int)entr->get_user_data() == i) {
+         if( (long int)entr->get_user_data() == i) {
             te = entr; 
             break;
          }
@@ -326,7 +326,7 @@ void Building_Statistics_Menu::update( v
       // enabled
       if(!te) {
          if(! m_parent->get_player()->is_building_allowed(i) ) continue;
-         te = new UITable_Entry(m_table, (void*)i, 
tribe->get_building_descr(i)->get_buildicon());
+         te = new UITable_Entry(m_table, (void*) ((long int) i), 
tribe->get_building_descr(i)->get_buildicon());
       }
       
        int nr_owned=0;
@@ -347,7 +347,7 @@ void Building_Statistics_Menu::update( v
           }
 
           // Is this entry selected?
-          bool is_selected = (m_table->get_selection_index() != -1 &&  
(int)m_table->get_selection() == i);
+          bool is_selected = (m_table->get_selection_index() != -1 &&  (long 
int)m_table->get_selection() == i);
 
           if(is_selected) {
              m_anim = tribe->get_building_descr(i)->get_ui_anim();
Index: widelands-build9/src/productionsite.cc
===================================================================
--- widelands-build9.orig/src/productionsite.cc
+++ widelands-build9/src/productionsite.cc
@@ -258,7 +258,7 @@ std::string ProductionSite::get_statisti
                return "(not occupied)";
    else if(m_worker_requests.size()) {
       char buf[1000];
-      sprintf(buf, "Waiting for %i workers!", m_worker_requests.size());
+      sprintf(buf, "Waiting for %i workers!", (int)m_worker_requests.size());
       return buf;
    }
        
Index: widelands-build9/src/network.cc
===================================================================
--- widelands-build9.orig/src/network.cc
+++ widelands-build9/src/network.cc
@@ -380,7 +380,7 @@ void NetHost::handle_network ()
 
                // send any outstanding player commands
                while (!cmds.empty()) {
-                       log ("%d player commands queued\n", cmds.size());
+                       log ("%d player commands queued\n", (int)cmds.size());
 
                        PlayerCommand* cmd=cmds.front();
                        cmds.pop ();
Index: widelands-build9/src/fieldaction.cc
===================================================================
--- widelands-build9.orig/src/fieldaction.cc
+++ widelands-build9/src/fieldaction.cc
@@ -95,7 +95,7 @@ void BuildGrid::add(int id)
        Building_Descr* descr = m_tribe->get_building_descr(id);
        uint picid = descr->get_buildicon();
 
-       UIIcon_Grid::add(picid, (void*)id, descr->get_descname());
+       UIIcon_Grid::add(picid, (void*) ((long int)id), descr->get_descname());
 }
 
 
Index: widelands-build9/src/immovable.cc
===================================================================
--- widelands-build9.orig/src/immovable.cc
+++ widelands-build9/src/immovable.cc
@@ -794,7 +794,7 @@ Cleanup
 PlayerImmovable::~PlayerImmovable()
 {
        if (m_workers.size())
-               log("Building::~Building: %i workers left!\n", 
m_workers.size());
+               log("Building::~Building: %i workers left!\n", (int) 
m_workers.size());
 }
 
 /*
Index: widelands-build9/src/game_debug_ui.cc
===================================================================
--- widelands-build9.orig/src/game_debug_ui.cc
+++ widelands-build9/src/game_debug_ui.cc
@@ -341,7 +341,7 @@ void FieldDebugWindow::think()
        m_map->find_bobs(m_coords, 0, &bobs);
        for(std::vector<Bob*>::iterator it = bobs.begin(); it != bobs.end(); 
++it) {
                snprintf(buf, sizeof(buf), "%s (%u)", 
(*it)->get_name().c_str(), (*it)->get_serial());
-               m_ui_bobs->add_entry(buf, (void*)(*it)->get_serial());
+               m_ui_bobs->add_entry(buf, (void*) ((long int) 
(*it)->get_serial()));
        }
 }
 
Index: widelands-build9/src/widelands_map_buildingdata_data_packet.cc
===================================================================
--- widelands-build9.orig/src/widelands_map_buildingdata_data_packet.cc
+++ widelands-build9/src/widelands_map_buildingdata_data_packet.cc
@@ -176,7 +176,7 @@ void Widelands_Map_Buildingdata_Data_Pac
       }
       cs->m_wares.resize(size);
       for(uint i=0; i<cs->m_wares.size(); i++) {
-         log("Reading waresqueue %i,%i\n", i+1, cs->m_wares.size());
+         log("Reading waresqueue %i,%i\n", i+1, (int)cs->m_wares.size());
          cs->m_wares[i]->Read(fr,egbase,ol);
       }
      

Reply via email to