r4204 - in packages/trunk/hex-a-hop/debian: . patches

Jens Seidel jseidel-guest at alioth.debian.org
Sat Sep 15 16:20:25 UTC 2007


Author: jseidel-guest
Date: 2007-09-15 16:20:24 +0000 (Sat, 15 Sep 2007)
New Revision: 4204

Modified:
   packages/trunk/hex-a-hop/debian/changelog
   packages/trunk/hex-a-hop/debian/patches/endianess.patch
Log:
Fixed another big endian error for "par" value. Closes: #442183


Modified: packages/trunk/hex-a-hop/debian/changelog
===================================================================
--- packages/trunk/hex-a-hop/debian/changelog	2007-09-15 15:49:26 UTC (rev 4203)
+++ packages/trunk/hex-a-hop/debian/changelog	2007-09-15 16:20:24 UTC (rev 4204)
@@ -3,8 +3,9 @@
   [Jens Seidel]
   * Minor update of Polish translation. Thanks to Piotr Engelking
     <inkerman42 at gmail.com>.
+  * Fixed another big endian error for "par" value. Closes: #442183
 
- -- Jens Seidel <jensseidel at users.sf.net>  Wed, 12 Sep 2007 19:30:00 +0200
+ -- Jens Seidel <jensseidel at users.sf.net>  Sat, 15 Sep 2007 19:30:00 +0200
 
 hex-a-hop (0.0.20070315-5) unstable; urgency=low
 

Modified: packages/trunk/hex-a-hop/debian/patches/endianess.patch
===================================================================
--- packages/trunk/hex-a-hop/debian/patches/endianess.patch	2007-09-15 15:49:26 UTC (rev 4203)
+++ packages/trunk/hex-a-hop/debian/patches/endianess.patch	2007-09-15 16:20:24 UTC (rev 4204)
@@ -121,7 +121,31 @@
  
  			int highval=0;
  
-@@ -1902,13 +1910,18 @@
+@@ -1821,8 +1829,8 @@ struct HexPuzzle : public State
+ 		typedef unsigned int _fn(void*, unsigned int, unsigned int, FILE*);
+ 		_fn * fn = (loadPtr ? (_fn*)fread_replace : (_fn*)fread);
+ 
+-		int par = 99999, diff = 0;
+-		int version;
++		int32_t par = 99999, diff = 0;
++		int16_t version;
+ 		
+ 		if (!f && !loadPtr)
+ 			return getdiff ? diff : par;
+@@ -1831,7 +1839,11 @@ struct HexPuzzle : public State
+ 
+ 		if (fn(&par, sizeof(par), 1, f) != 1)
+ 			par = 99999;
+-		if (fn(&diff, sizeof(diff), 1, f) != 1 || diff<0 || diff>10)
++		else
++			par = SWAP32(par);
++		size_t ret = fn(&diff, sizeof(diff), 1, f);
++		diff = SWAP32(diff);
++		if (ret != 1 || diff<0 || diff>10)
+ 			diff = 0;
+ 
+ 		#ifdef USE_LEVEL_PACKFILE
+@@ -1902,13 +1914,18 @@ struct HexPuzzle : public State
  		return false;
  	}
  
@@ -141,7 +165,7 @@
  		if (save)
  			fprintf(f, "%d\n", version);
  		else
-@@ -1935,13 +1948,26 @@
+@@ -1935,13 +1952,26 @@
  		if (version==1)
  		{
  			for (int i=0; i<MAP_SIZE; i++)
@@ -169,7 +193,7 @@
  		}
  		else if (version>=2 && version<=4)
  		{
-@@ -1966,18 +1992,28 @@
+@@ -1966,18 +1996,28 @@
  				memset(map_item, 0, sizeof(map_item));
  			}
  
@@ -200,7 +224,7 @@
  
  			int offsetx=0, offsety=0;
  
-@@ -2016,24 +2052,27 @@
+@@ -2016,24 +2056,27 @@
  					for (int j=bounds[2]; j<=bounds[3]; j++)
  						if (special[i][j])
  						{
@@ -230,7 +254,7 @@
  					if (len<0) break;
  					char* tmp = new char[len+1];
  					tmp[len] = 0;
-@@ -2398,10 +2437,12 @@
+@@ -2398,10 +2441,12 @@
  		FILE* f = file_open(bmp, "rb");
  		if (!f) FATAL("Unable to open file", bmp);
  
@@ -245,7 +269,7 @@
  
  		tmp = new uint32[(int)w*h];
  		
-@@ -2414,9 +2455,12 @@
+@@ -2414,9 +2459,12 @@
  			else
  			{
  				fread(&c, sizeof(c), 1, f);




More information about the Pkg-games-commits mailing list