tag 417061 +patch
thanks

Hi,

I'm attaching a fixed version of a patch (05_jlib.patch) that is already in
your package that fixes this problem.  Please take into account that the gcc
4.3 issues are now release critical bugs as gcc is the default compiler in some
architectures, so if you don't upload a fix soon, it will probably be NMUed.

Please notice that there is a new upstream release available (1.3.10) [1], it
might be worth the extra effort and upload that one.

[1]: 
http://www.mainreactor.net/holotzcastle/download/holotz-castle-1.3.10-src.tar.gz

Thanks,
-- 
" Documentation is like sex: when it is good, it is very, very good; and when
it is bad, it is better than nothing. " -- (Dick Brandon)
Saludos /\/\ /\ >< `/
diff -ruN holotz-castle-1.3.8.orig/JLib/JLib/Util/JFS.cpp holotz-castle-1.3.8.new/JLib/JLib/Util/JFS.cpp
--- holotz-castle-1.3.8.orig/JLib/JLib/Util/JFS.cpp	2006-01-20 13:59:37.000000000 +0100
+++ holotz-castle-1.3.8.new/JLib/JLib/Util/JFS.cpp	2006-09-23 15:58:26.000000000 +0200
@@ -1112,7 +1112,7 @@
 				// Lee los datos desde el formato adecuado
 				if (JFS_COMPRESSED(index[id]->res))
 				{
-					if (0 == (size = resFile.ZRead((void **)&buff)))
+					if (0 == (size = resFile.ZRead(&buff)))
 					{
 						fprintf(stderr, "JFS::Export - Error reading compressed resource\n");
 						delete[] buff;
diff -ruN holotz-castle-1.3.8.orig/JLib/JLib/Util/JRW.cpp holotz-castle-1.3.8.new/JLib/JLib/Util/JRW.cpp
--- holotz-castle-1.3.8.orig/JLib/JLib/Util/JRW.cpp	2006-01-20 13:59:37.000000000 +0100
+++ holotz-castle-1.3.8.new/JLib/JLib/Util/JRW.cpp	2006-09-23 15:58:26.000000000 +0200
@@ -7,7 +7,7 @@
 
 #include <JLib/Util/JRW.h>
 
-u32 JRW::ZRead(void **buff)
+u32 JRW::ZRead(u8 **buff)
 {
 	u32 len, lenUncomp;
 	
@@ -112,12 +112,9 @@
 		return 0;
 	}
 
-  // For compatibility with zlib
-  unsigned long sizeCompUL, sizeUL;
-  sizeCompUL = sizeComp;
-  sizeUL = size;
+	unsigned long sizeCompUL = sizeComp;
 
-	if (Z_OK != compress2((Bytef*)buffComp, (uLongf*)&sizeComp, (Bytef*)buff, size, level))
+	if (Z_OK != compress2(buffComp, &sizeCompUL, static_cast<const Byte *>(buff), size, level))
 	{
 		delete[] buffComp;
 		return 0;
diff -ruN holotz-castle-1.3.8.orig/JLib/JLib/Util/JRW.h holotz-castle-1.3.8.new/JLib/JLib/Util/JRW.h
--- holotz-castle-1.3.8.orig/JLib/JLib/Util/JRW.h	2006-01-20 13:59:37.000000000 +0100
+++ holotz-castle-1.3.8.new/JLib/JLib/Util/JRW.h	2006-09-23 15:58:26.000000000 +0200
@@ -30,6 +30,8 @@
 #ifndef _JRW_INCLUDED
 #define _JRW_INCLUDED
 
+#include <string.h>
+
 #include <JLib/Util/JTypes.h>
 #include <JLib/Util/JObject.h>
 #include <zlib.h>
@@ -139,7 +141,7 @@
    * @param  buff Buffer to fill with the read data uncompressed.
    * @return Uncompressed size of the data. 
    */
-	u32 ZRead(void **buff);
+	u32 ZRead(u8 **buff);
 
   /** Reads a bool data. The bool is stored as a single byte.
    * @param  buff Variable with the result.
@@ -195,6 +197,22 @@
    */
   u32 ReadLE32(s32 *buff) {if (0 < SDL_RWread(rwops, buff, 4, 1)) {*buff = SDL_SwapLE32(*buff); return 4;} return 0;}
 
+  /** Reads 32-bit IEEE-754 float data in little- endian format.
+   * @param  buff Variable with the result in the machine weight.
+   * @return Number of bytes read or 0 (zero) if an error occured. 
+   */
+  u32 ReadLE32(float *fbuff)
+	{
+		typedef char pre_cxx0x_static_assert[sizeof(u32) == sizeof(float) ? 1 : -1 ];
+		u32 ibuff;
+		if (ReadLE32(&ibuff) == 4)
+		{
+			memcpy(fbuff, &ibuff, sizeof(float));
+			return 4;
+		}
+		return 0;
+	}
+
   /** Reads a 32-bit unsigned data in big-endian format.
    * @param  buff Variable with the result in the machine weight.
    * @return Number of bytes read or 0 (zero) if an error occured. 
@@ -284,6 +302,18 @@
    */
   u32 WriteLE32(s32 *buff) {s32 v = SDL_SwapLE32(*buff); return SDL_RWwrite(rwops, &v, 4, 1);}
 
+  /** Writes a 32-bit IEEE-754 float data in little-endian format.
+   * @param  buff Variable with the data in the machine weight.
+   * @return Number of bytes written or 0 (zero) if an error occured. 
+   */
+  u32 WriteLE32(const float *fbuff)
+	{
+		typedef char pre_cxx0x_static_assert[sizeof(u32) == sizeof(float) ? 1 : -1 ];
+		u32 ibuff;
+		memcpy(&ibuff, fbuff, sizeof(u32));
+		return WriteLE32(&ibuff);
+	}
+
   /** Writes a 32-bit unsigned data in big-endian format.
    * @param  buff Variable with the data in the machine weight.
    * @return Number of bytes written or 0 (zero) if an error occured. 
diff -ruN holotz-castle-1.3.8.orig/JLib/JLib/Util/JTypes.h holotz-castle-1.3.8.new/JLib/JLib/Util/JTypes.h
--- holotz-castle-1.3.8.orig/JLib/JLib/Util/JTypes.h	2006-01-20 13:59:37.000000000 +0100
+++ holotz-castle-1.3.8.new/JLib/JLib/Util/JTypes.h	2006-09-23 15:58:26.000000000 +0200
@@ -85,10 +85,10 @@
 // use the 8bit and 16bit macros listed here, and using any of the 32-bit macros in this case could
 // translate in a segmentation fault during execution. Notice that he 'double' and 'long' types are normally 
 // twice the size of the architecture
-#define JCAST_8_TO_VOIDPTR(val)  ((void *)size_t(*((u8 *)&(val))))
-#define JCAST_16_TO_VOIDPTR(val) ((void *)size_t(*((u16 *)&(val))))
-#define JCAST_32_TO_VOIDPTR(val) ((void *)size_t(*((u32 *)&(val))))
-#define JCAST_64_TO_VOIDPTR(val) ((void *)size_t(*((u64 *)&(val))))
+#define JCAST_8_TO_VOIDPTR(val)  ((void *)(size_t)(val))
+#define JCAST_16_TO_VOIDPTR(val) ((void *)(size_t)(val))
+#define JCAST_32_TO_VOIDPTR(val) ((void *)(size_t)(val))
+#define JCAST_64_TO_VOIDPTR(val) ((void *)(size_t)(val))
 
 #define JCAST_S8_TO_VOIDPTR(val) JCAST_8_TO_VOIDPTR((val))
 #define JCAST_U8_TO_VOIDPTR(val) JCAST_8_TO_VOIDPTR((val))
@@ -101,7 +101,7 @@
 #define JCAST_U64_TO_VOIDPTR(val) JCAST_64_TO_VOIDPTR((val))
 #define JCAST_DOUBLE_TO_VOIDPTR(val) JCAST_64_TO_VOIDPTR((val))
 
-#define JCAST_VOIDPTR_TO_TYPE(p, type) (*((type *)&(p)))
+#define JCAST_VOIDPTR_TO_TYPE(p, type) ((type)(size_t)(p))
 #define JCAST_VOIDPTR_TO_S8(p) JCAST_VOIDPTR_TO_TYPE(p, s8)
 #define JCAST_VOIDPTR_TO_U8(p) JCAST_VOIDPTR_TO_TYPE(p, u8)
 #define JCAST_VOIDPTR_TO_S16(p) JCAST_VOIDPTR_TO_TYPE(p, s16)
diff -ruN holotz-castle-1.3.8.orig/JLib/JLib/Util/JUtil.cpp holotz-castle-1.3.8.new/JLib/JLib/Util/JUtil.cpp
--- holotz-castle-1.3.8.orig/JLib/JLib/Util/JUtil.cpp	2006-01-20 13:59:37.000000000 +0100
+++ holotz-castle-1.3.8.new/JLib/JLib/Util/JUtil.cpp	2006-09-23 15:58:26.000000000 +0200
@@ -209,7 +209,6 @@
 					s->w, s->h, fmt->BitsPerPixel, fmt->colorkey, fmt->alpha, 
 					s->flags & SDL_SRCALPHA ? "yes" : "no", 
 					s->flags & SDL_SRCCOLORKEY ? "yes" : "no",
-					s->flags & SDL_RLEACCEL ? "yes" : "no",
 					s->flags & SDL_RLEACCEL ? "yes" : "no");
 	fprintf(stderr, 
 					"RGBAmask: R: 0x%08x G: 0x%08x B: 0x%08x A: 0x%08x\n", 
_______________________________________________
Pkg-games-devel mailing list
Pkg-games-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-devel

Reply via email to