Author: baby-guest
Date: 2007-08-05 10:46:33 +0000 (Sun, 05 Aug 2007)
New Revision: 3561

Added:
   packages/trunk/hex-a-hop/debian/patches/endianess.patch
Modified:
   packages/trunk/hex-a-hop/debian/patches/series
Log:
Added patch to take endianess and word size into account when reading the size 
of the dat file.




Added: packages/trunk/hex-a-hop/debian/patches/endianess.patch
===================================================================
--- packages/trunk/hex-a-hop/debian/patches/endianess.patch                     
        (rev 0)
+++ packages/trunk/hex-a-hop/debian/patches/endianess.patch     2007-08-05 
10:46:33 UTC (rev 3561)
@@ -0,0 +1,30 @@
+# Copyright (C) 2007  Miriam Ruiz <[EMAIL PROTECTED]>
+# Licensed under the GPL, see /usr/share/common-licenses/GPL
+
+--- hex-a-hop-0.0.20070315.orig/packfile.h
++++ hex-a-hop-0.0.20070315/packfile.h
+@@ -16,6 +16,9 @@
+     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+ 
++#include <stdint.h>
++#include <endian.h>
++#include <byteswap.h>
+ 
+ struct PackFile1
+ {
+@@ -73,10 +76,13 @@
+               if (numfiles || e || data)
+                       FATAL("Calling Packfile1::Read when already 
initialised.");
+ 
+-              int size;
++              int32_t size;
+               fseek(f, -(int)sizeof(size), SEEK_END);
+               int end_offset = ftell(f);
+               fread(&size, sizeof(size), 1, f);
++#if __BYTE_ORDER == __BIG_ENDIAN
++              size = bswap_32(size);
++#endif
+               fseek(f, end_offset - size, SEEK_SET);
+ 
+               data = malloc(size);

Modified: packages/trunk/hex-a-hop/debian/patches/series
===================================================================
--- packages/trunk/hex-a-hop/debian/patches/series      2007-08-05 10:09:51 UTC 
(rev 3560)
+++ packages/trunk/hex-a-hop/debian/patches/series      2007-08-05 10:46:33 UTC 
(rev 3561)
@@ -1,3 +1,4 @@
+endianess.patch
 proper_directories.patch
 gettext_i18n.patch
 patch-hex-a-hop-better-than-par.diff


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to