tags 664914 +patch
thanks

Sorry forgot to actually attatch it, doing so this time

ROMReader.cpp: In function 'void GZIPROMReaderDeInit(void*)':
ROMReader.cpp:143:14: error: invalid conversion from 'void*' to 'gzFile' 
[-fpermissive]
/usr/include/zlib.h:1488:24: error:   initializing argument 1 of 'int 
gzclose(gzFile)' [-fpermissive]

The issue is that zlib has changed the way gzFile is defined meaning
that we now need to explicitly cast from void * to gzFile in c++ code. I
have attatched a patch that adds the nessacery casts.

The patch contains a NMU changelog entry. If I don't get any response
from the maintainer I will ask my AM to upload this as a NMU.

diff -urN desmume-0.9.7/debian/changelog desmume-0.9.7.new/debian/changelog
--- desmume-0.9.7/debian/changelog	2012-04-04 22:29:49.000000000 +0000
+++ desmume-0.9.7.new/debian/changelog	2012-04-04 22:19:08.000000000 +0000
@@ -1,3 +1,11 @@
+desmume (0.9.7-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/02_add_gzFile_casts.patch:
+    Add some casts for compatibility with current zlib (Closes: #664914)
+
+ -- Peter Michael Green <plugw...@p10link.net>  Wed, 04 Apr 2012 22:09:07 +0000
+
 desmume (0.9.7-2) unstable; urgency=low
 
   * Add 01_fix_mode_t_on_kfreebsd.patch to fix FTBFS on kfreebsd-*.
diff -urN desmume-0.9.7/debian/patches/02_add_gzFile_casts.patch desmume-0.9.7.new/debian/patches/02_add_gzFile_casts.patch
--- desmume-0.9.7/debian/patches/02_add_gzFile_casts.patch	1970-01-01 00:00:00.000000000 +0000
+++ desmume-0.9.7.new/debian/patches/02_add_gzFile_casts.patch	2012-04-04 22:03:20.000000000 +0000
@@ -0,0 +1,49 @@
+Description: add casts to gzFile where needed
+ gzFile used to be defined as void* but is now defined as a pointer to a 
+ structure so in c++ code an explicit cast is needed to pass a void*.
+ (we can't really change the type of the parameter that is being passed because
+ it's used in a function pointer).
+Author: Peter Michael Green <plugw...@p10link.net>
+Bug-Debian: http://bugs.debian.org/664914
+
+diff -ur desmume-0.9.7/src/ROMReader.cpp desmume-0.9.7.new/src/ROMReader.cpp
+--- desmume-0.9.7/src/ROMReader.cpp	2011-01-27 10:27:00.000000000 +0000
++++ desmume-0.9.7.new/src/ROMReader.cpp	2012-04-04 21:23:22.000000000 +0000
+@@ -140,7 +140,7 @@
+ 
+ void GZIPROMReaderDeInit(void * file)
+ {
+-	gzclose(file);
++	gzclose((gzFile)file);
+ }
+ 
+ u32 GZIPROMReaderSize(void * file)
+@@ -150,22 +150,22 @@
+ 
+ 	/* FIXME this function should first save the current
+ 	 * position and restore it after size calculation */
+-	gzrewind(file);
+-	while (gzeof (file) == 0)
+-		size += gzread(file, useless, 1024);
+-	gzrewind(file);
++	gzrewind((gzFile)file);
++	while (gzeof ((gzFile)file) == 0)
++		size += gzread((gzFile)file, useless, 1024);
++	gzrewind((gzFile)file);
+ 
+ 	return size;
+ }
+ 
+ int GZIPROMReaderSeek(void * file, int offset, int whence)
+ {
+-	return gzseek(file, offset, whence);
++	return gzseek((gzFile)file, offset, whence);
+ }
+ 
+ int GZIPROMReaderRead(void * file, void * buffer, u32 size)
+ {
+-	return gzread(file, buffer, size);
++	return gzread((gzFile)file, buffer, size);
+ }
+ #endif
+ 
diff -urN desmume-0.9.7/debian/patches/series desmume-0.9.7.new/debian/patches/series
--- desmume-0.9.7/debian/patches/series	2012-04-04 22:29:49.000000000 +0000
+++ desmume-0.9.7.new/debian/patches/series	2012-04-04 21:36:45.000000000 +0000
@@ -1 +1,2 @@
 01_fix_mode_t_on_kfreebsd.patch
+02_add_gzFile_casts.patch

Reply via email to