Package: ire
Severity: normal
Tags: patch

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

make[1]: Entering directory `/ire-0.90.0'
gcc -c -Wall -g -O2      -I. -DPATH_FILES_DAT=\"//usr/share/games/ire/data/\" 
-DPATH_FILES_CONF=\"//etc/ire/\" -DALLEGRO -DBGUI `allegro-config --cflags` 
-DUSE_ALOGG -DUSE_ALSOUND `alogg-config --cflags` -DNO_ASM bgui2/src/bgfx.c -o 
bgui2/src/bgfx.o
bgui2/src/bgfx.c:33: error: static declaration of 'radio_unsel_data' follows 
non-static declaration
bgui2/src/binterna.h:14: error: previous declaration of 'radio_unsel_data' was 
here
bgui2/src/bgfx.c:50: error: static declaration of 'radio_sel_data' follows 
non-static declaration
bgui2/src/binterna.h:15: error: previous declaration of 'radio_sel_data' was 
here
bgui2/src/bgfx.c:67: error: static declaration of 'radio_grey_data' follows 
non-static declaration
bgui2/src/binterna.h:16: error: previous declaration of 'radio_grey_data' was 
here
make[1]: *** [bgui2/src/bgfx.o] Error 1
make[1]: Leaving directory `/ire-0.90.0'
make: *** [build-stamp] Error 2

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/ire-0.90.0/bgui2/src/binterna.h ./bgui2/src/binterna.h
--- ../tmp-orig/ire-0.90.0/bgui2/src/binterna.h 2003-01-18 21:41:17.000000000 
+0100
+++ ./bgui2/src/binterna.h      2005-02-28 16:57:51.462448673 +0100
@@ -11,10 +11,6 @@
 extern BITMAP *radio_sel;
 extern BITMAP *radio_grey;
 
-extern unsigned char radio_unsel_data[144];
-extern unsigned char radio_sel_data[144];
-extern unsigned char radio_grey_data[144];
-
 typedef struct BILLWIN_INFO_STRUCTURE
 {
  BITMAP *backbuffer;
diff -urN ../tmp-orig/ire-0.90.0/console.h ./console.h
--- ../tmp-orig/ire-0.90.0/console.h    2003-03-11 22:47:48.000000000 +0100
+++ ./console.h 2005-02-28 16:57:51.462448673 +0100
@@ -35,7 +35,7 @@
 extern void ShowSimple();
 extern void Bug(char *msg,...);
 extern void KillGFX();
-extern int console_x,console_y,console_w,console_h,ilog_break;
+extern int ilog_break;
 
 extern FONT *curfont;
 
diff -urN ../tmp-orig/ire-0.90.0/library.cpp ./library.cpp
--- ../tmp-orig/ire-0.90.0/library.cpp  2003-05-04 03:39:06.000000000 +0200
+++ ./library.cpp       2005-02-28 16:57:51.463448480 +0100
@@ -807,13 +807,13 @@
 MoveToFloor(object);
 }
 
-int in_pocket(OBJECT *obj)
+long in_pocket(OBJECT *obj)
 {
 CHECK_OBJECT(obj);
 
 // This looks like some nasty pointer trick, but we are actually returning
 // the pointer as a boolean.  If it's NULL, it's false, otherwise it's true
-return((int)obj->parent);
+return((long)obj->parent);
 }
 
 
diff -urN ../tmp-orig/ire-0.90.0/library.hpp ./library.hpp
--- ../tmp-orig/ire-0.90.0/library.hpp  2003-02-13 23:55:44.000000000 +0100
+++ ./library.hpp       2005-02-28 16:57:51.463448480 +0100
@@ -93,7 +93,7 @@
 extern int is_tile_solid(int x,int y);
 extern int is_tile_water(int x,int y);
 extern int is_solid(int x,int y);
-extern int in_pocket(OBJECT *o);
+extern long in_pocket(OBJECT *o);
 extern int move_object(OBJECT *src,int x,int y);
 extern void transfer_object(OBJECT *src,int x,int y);
 extern int line_of_sight(int xa, int ya, int xb, int yb);
Binary files ../tmp-orig/ire-0.90.0/libs/linux/libbgui.a and 
./libs/linux/libbgui.a differ
Binary files ../tmp-orig/ire-0.90.0/libs/linux/libithe.a and 
./libs/linux/libithe.a differ
diff -urN ../tmp-orig/ire-0.90.0/loadsave.cpp ./loadsave.cpp
--- ../tmp-orig/ire-0.90.0/loadsave.cpp 2003-08-29 23:17:38.000000000 +0200
+++ ./loadsave.cpp      2005-02-28 16:57:51.464448287 +0100
@@ -59,7 +59,7 @@
 
 static void fastfind_id_start();
 static void fastfind_id_stop();
-static OBJECT *fastfind_id(unsigned int id);
+static OBJECT *fastfind_id(unsigned long id);
 
 static int CMP_sort(const void *a, const void *b);
 static int CMP_search(const void *a, const void *b);
@@ -1032,7 +1032,7 @@
 while(temp)
        {
        next = temp->next;
-       parent = fastfind_id((int)temp->parent);
+       parent = fastfind_id((long)temp->parent);
        if(parent)
                {
                MoveToPocketEnd(temp,parent);
@@ -1052,18 +1052,18 @@
        if(ptr->ptr)
                {
                if(ptr->ptr->target)
-                       ptr->ptr->target = fastfind_id((int)ptr->ptr->target);
+                       ptr->ptr->target = fastfind_id((long)ptr->ptr->target);
                if(ptr->ptr->enemy)
-                       ptr->ptr->enemy = fastfind_id((int)ptr->ptr->enemy);
+                       ptr->ptr->enemy = fastfind_id((long)ptr->ptr->enemy);
                if(ptr->ptr->stats->owner)
-                       ptr->ptr->stats->owner = 
fastfind_id((int)ptr->ptr->stats->owner);
+                       ptr->ptr->stats->owner = 
fastfind_id((long)ptr->ptr->stats->owner);
 
                // Convert any targets
                if(ptr->ptr->schedule)
                        {
                        for(ctr2=0;ctr2<24;ctr2++)
                                if(ptr->ptr->schedule[ctr2].hour != -1)
-                                       ptr->ptr->schedule[ctr2].target = 
fastfind_id((int)ptr->ptr->schedule[ctr2].target);
+                                       ptr->ptr->schedule[ctr2].target = 
fastfind_id((long)ptr->ptr->schedule[ctr2].target);
                        }
 
 
@@ -2522,7 +2522,7 @@
 }
 
 
-static OBJECT *fastfind_id(unsigned int id)
+static OBJECT *fastfind_id(unsigned long id)
 {
 OBJECT **xx;
 
@@ -2545,7 +2545,7 @@
 
 static int CMP_search(const void *a, const void *b)
 {
-return (int)a - (*(OBJECT **)b)->save_id;
+return (long)a - (*(OBJECT **)b)->save_id;
 }
 
 /*
diff -urN ../tmp-orig/ire-0.90.0/map.cpp ./map.cpp
--- ../tmp-orig/ire-0.90.0/map.cpp      2002-12-08 10:18:58.000000000 +0100
+++ ./map.cpp   2005-02-28 16:58:19.871965113 +0100
@@ -23,7 +23,7 @@
     if(x>=mapx && y>=mapy)                      // Check for a big object
        if(x<mapx+VSW)                           // If onscreen
           if(y<mapy+VSH)
-              return (int)solidmap[VIEWDIST+x-mapx][VIEWDIST+y-mapy];
+              return (long)solidmap[VIEWDIST+x-mapx][VIEWDIST+y-mapy];
 
     temp = curmap->objmap[ytab[y]+x];            // Now look at object map
     for(;temp;temp=temp->next)
diff -urN ../tmp-orig/ire-0.90.0/pe/pe_sys.cpp ./pe/pe_sys.cpp
--- ../tmp-orig/ire-0.90.0/pe/pe_sys.cpp        2003-07-13 02:04:52.000000000 
+0200
+++ ./pe/pe_sys.cpp     2005-02-28 16:59:05.084238310 +0100
@@ -1019,7 +1019,7 @@
 // Look for a constant
 k = find_keyword(number,'n',curfunc);
 if(k)
-       return((unsigned int)k->value);
+       return((unsigned long)k->value);
 
 // Is it hexadecimal?
 if(number[0] == '0')
@@ -1423,7 +1423,7 @@
        return NULL;
 
 for(k=klist[kl];k;k=k->next)
-       if(type == k->type || type == '?' || k->type == '?')
+       if(type == k->type || type == '?' || k->type == '?')
                {
                // Check locals first..
                if(k->local == func)
@@ -1434,18 +1434,18 @@
 
                // Then look for a global that's local to this file
 
-               if(k->local == NULL)
+               if(k->local == NULL)
                        {
                        if(k->localfile == compilename)
                                if(!stricmp(k->name,name))
-                                       return k; // Found it!
+                                       return k; // Found it!
 
                        // Now search everywhere
-
+
                        if(k->localfile == NULL)
                                if(!stricmp(k->name,name))
                                        return k; // Found it!
-                       }
+                       }
                }
 // Oh well
 
diff -urN ../tmp-orig/ire-0.90.0/pe/pe_vm.cpp ./pe/pe_vm.cpp
--- ../tmp-orig/ire-0.90.0/pe/pe_vm.cpp 2003-07-22 01:29:14.000000000 +0200
+++ ./pe/pe_vm.cpp      2005-02-28 17:00:33.121245543 +0100
@@ -1583,14 +1583,14 @@
        return;
 
 ilog_quiet("(%s)\n",curvm->name);
-ilog_quiet("(%x-%x)\n",(unsigned int)curvm->code,(unsigned 
int)curvm->code+(unsigned int)curvm->size);
+ilog_quiet("(%lx-%lx)\n",(unsigned long)curvm->code,(unsigned 
long)curvm->code+(unsigned int)curvm->size);
 
 oldip = curvm->ip;
 curvm->ip = curvm->code;
-proglen = (unsigned int)curvm->codelen + (unsigned int)curvm->ip;
+proglen = (unsigned long)curvm->codelen + (unsigned long)curvm->ip;
 //proglen = curvm->codelen + curvm->ip;
 
-for(;(unsigned int)curvm->ip<proglen;)
+for(;(unsigned long)curvm->ip<proglen;)
        {
        if(curvm->ip == lastip)
                ilog_quiet("-> ");
@@ -5933,16 +5933,16 @@
 
 void CheckRange(PEVM *vm, void *ptr, int ident)
 {
-unsigned int a,b,c,d;
+unsigned long a,b,c,d;
 
-a=(unsigned int)vm->code;
-b=(unsigned int)vm->size;
+a=(unsigned long)vm->code;
+b=(unsigned long)vm->size;
 c=a+b;
-d=(unsigned int)ptr;
+d=(unsigned long)ptr;
 
 if(d<a || d>c)
        {
-       printf("%s: POINTER 0x%p OUT OF RANGE (0x%x-0x%x), ident 
%d\n",vm->name,ptr,a,c,ident);
+       printf("%s: POINTER 0x%p OUT OF RANGE (0x%lx-0x%lx), ident 
%d\n",vm->name,ptr,a,c,ident);
 //     CRASH();
        }
 }
diff -urN ../tmp-orig/ire-0.90.0/script.cpp ./script.cpp
--- ../tmp-orig/ire-0.90.0/script.cpp   2003-07-21 02:12:00.000000000 +0200
+++ ./script.cpp        2005-02-28 17:00:47.731425509 +0100
@@ -127,7 +127,7 @@
 
 Section("sprites");
 Section("sequences");
-Section("tiles");
+Section("tiles");
 Section("characters");
 Section("tables");
 Section("tilelink");
@@ -424,9 +424,9 @@
 //      Most of the grunt-work has already been done, we just need to
 //      load in the sprite data for each entry.
 //
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 ilog_printf("    Load sprites..");
 
@@ -532,10 +532,10 @@
 long ctr,pos,spos,tmp,list;
 char *line,*Rptr;
 long liststart=0,listend=0;
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
-
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
+
 ilog_printf("    Animation sequences");
 
 Plot(SQtot);
@@ -854,7 +854,7 @@
 for(ctr=0;ctr<pos;ctr++)
     if(SQlist[ctr].flags&SEQFLAG_JUMPTO)
         {
-        
strcpy(Rbuffer,strfirst(strrest(script.line[(int)SQlist[ctr].jumpto])));
+        
strcpy(Rbuffer,strfirst(strrest(script.line[(long)SQlist[ctr].jumpto])));
         tmp=getnum4sequence(Rbuffer);
             if(tmp==-1)
                 Dump((long)SQlist[ctr].jumpto,"SQJT: Could not find 
sequence:",Rbuffer);
@@ -930,8 +930,8 @@
 int hour,minute;
 // Values for SETSOLID
 
-if(bookview[0]) // Not needed for the book viewer
-       return;
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 ilog_printf("    Setting up characters");
 
@@ -1896,9 +1896,9 @@
 {
 int ctr,tmp,pos,seqno,altcode;
 char *line,*Rptr,*p;
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 TItot = 0;
 
@@ -2030,7 +2030,7 @@
                        if(!strisnumber(Rbuffer))
                                Dump(ctr,"The movement cost must be a 
number.",NULL);
                        tmp=strgetnumber(Rbuffer);
-                       TIlist[pos].cost=tmp;
+                       TIlist[pos].cost=tmp;
                        continue;
                        }
 
@@ -2146,19 +2146,19 @@
 char *line;
 OBJCODE *pe;
 char msg[1024];
-
+
 // Temporary structures for the PEscript compiler
 int numfiles,func;
 int *filefuncs;
 
 // The PE list is just a straight list of files.
 // We just get the first term and store it.
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 if(editarea[0]) // Not needed for the area editor
-       return;
+       return;
 
 
 // First, see how many PE files we have.  This != functions
@@ -2456,9 +2456,9 @@
 long ctr,pos,imagedata;
 char *Rptr;
 char *line;
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 // The rooftiles list is just a single list of sprite files:
 //
@@ -2895,9 +2895,9 @@
 char *line,*Rptr,*p;
 
 // Tables are optional
-
-if(bookview[0]) // Not needed for the book viewer
-       return;
+
+if(bookview[0]) // Not needed for the book viewer
+       return;
 
 if(TLtot<1)
        return;


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

Reply via email to