summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2006-05-27 11:17:52 +0000
committerAlfredo Tupone <tupone@gentoo.org>2006-05-27 11:17:52 +0000
commit5438cab07725e389c7a2273b0f0eec8917deba6f (patch)
treefed6d226799f62c6fd5c5ccaaf359b31d6c6fd03 /games-strategy/freecraft/files
parent2.1_rc3 release candidate (diff)
downloadgentoo-2-5438cab07725e389c7a2273b0f0eec8917deba6f.tar.gz
gentoo-2-5438cab07725e389c7a2273b0f0eec8917deba6f.tar.bz2
gentoo-2-5438cab07725e389c7a2273b0f0eec8917deba6f.zip
Fix for gcc-4.1
(Portage version: 2.1_rc2-r3)
Diffstat (limited to 'games-strategy/freecraft/files')
-rw-r--r--games-strategy/freecraft/files/freecraft-1.18-gcc41.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/games-strategy/freecraft/files/freecraft-1.18-gcc41.patch b/games-strategy/freecraft/files/freecraft-1.18-gcc41.patch
new file mode 100644
index 000000000000..b7cb4a7eaf0a
--- /dev/null
+++ b/games-strategy/freecraft/files/freecraft-1.18-gcc41.patch
@@ -0,0 +1,94 @@
+--- src/clone/mpq.c.old 2006-05-27 12:13:54.000000000 +0200
++++ src/clone/mpq.c 2006-05-27 12:16:51.000000000 +0200
+@@ -106,9 +106,9 @@
+ extern const unsigned char dcl_table[];
+ local UInt8 *explode_buffer;
+
+-extern const UInt8 wav_table[2512];
+-extern const UInt32 small_tbl1[90];
+-extern const UInt32 small_tbl2[32];
++local const UInt8 wav_table[2512];
++local const UInt32 small_tbl1[90];
++local const UInt32 small_tbl2[32];
+
+ local UInt32 offset_mpq; /// Offset to MPQ file data
+ local UInt32 offset_htbl; /// Offset to hash_table of MPQ
+--- src/clone/scm.c.old 2006-05-27 12:17:38.000000000 +0200
++++ src/clone/scm.c 2006-05-27 12:37:29.000000000 +0200
+@@ -165,7 +165,9 @@
+ */
+ local inline int ChkReadByte(void)
+ {
+- return *((unsigned char*)chk_ptr)++;
++ int r = *(unsigned char *)chk_ptr;
++ chk_ptr = ((unsigned char *)chk_ptr) + 1;
++ return r;
+ }
+
+ /**
+--- src/unit/unittype.c.old 2006-05-27 12:28:11.000000000 +0200
++++ src/unit/unittype.c 2006-05-27 12:46:31.000000000 +0200
+@@ -266,7 +266,7 @@
+ }
+
+ /// Macro to fetch an 8bit value, to have some looking 8/16/32 bit funcs.
+-#define Fetch8(p) (*((unsigned char*)(p))++)
++#define Fetch8(p) (*((unsigned char*)(p))); p = ((unsigned char*)(p)) + 1
+
+ /**
+ ** Parse UDTA area from puds.
+--- src/video/linedraw.c.old 2006-05-27 12:46:57.000000000 +0200
++++ src/video/linedraw.c 2006-05-27 12:47:56.000000000 +0200
+@@ -1432,7 +1432,8 @@
+ f=((unsigned long)Pixels16[color]<<16)|Pixels16[color];
+
+ while( p<e ) { // draw 2 pixels
+- *((unsigned long*)p)++=f;
++ *((unsigned long*)p)=f;
++ p=((unsigned long*)p)+1;
+ }
+
+ if( p<=e ) {
+--- src/include/myendian.h.old 2006-05-27 12:29:53.000000000 +0200
++++ src/include/myendian.h 2006-05-27 12:45:29.000000000 +0200
+@@ -85,8 +85,6 @@
+ ** Fetch a 16 bit value in little endian with incrementing pointer
+ ** and return it in native format.
+ */
+-#ifdef __ULTRA_SPARC__
+-
+ extern unsigned short inline _FetchLE16(unsigned char **pp) {
+ unsigned char *p = *pp;
+ unsigned short i = p[0] + (p[1] << 8);
+@@ -95,18 +93,10 @@
+ }
+ #define FetchLE16(p) _FetchLE16(&p)
+
+-#else
+-
+-#define FetchLE16(p) SDL_SwapLE16(*((unsigned short*)(p))++)
+-
+-#endif
+-
+ /**
+ ** Fetch a 32 bit value in little endian with incrementing pointer
+ ** and return it in native format.
+ */
+-#ifdef __ULTRA_SPARC__
+-
+ extern unsigned inline _FetchLE32(unsigned char **pp) {
+ unsigned char *p = *pp;
+ unsigned int i = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] <<24);
+@@ -115,12 +105,6 @@
+ }
+ #define FetchLE32(p) _FetchLE32(&p)
+
+-#else
+-
+-#define FetchLE32(p) SDL_SwapLE32(*((unsigned int*)(p))++)
+-
+-#endif
+-
+ // ============================================================================
+ #else // }{ SDL
+ // ============================================================================