[SCM] DarkPlaces, a Quake engine branch, master, updated. debian/0_20110628+svn11231-2-2-g2d07598
Simon McVittie
smcv at debian.org
Tue Jul 19 10:42:55 UTC 2011
The following commit has been merged in the master branch:
commit 2d075989db2f62c342186595f1a5137f608d2c05
Author: Simon McVittie <smcv at debian.org>
Date: Tue Jul 19 11:42:52 2011 +0100
Improve the description of the two type-safety-related patches to explain why they're applied
diff --git a/debian/changelog b/debian/changelog
index 5965790..8595b4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
darkplaces (0~20110628+svn11231-3) UNRELEASED; urgency=low
* Remove a duplicate patch which is not actually applied
+ * Improve the description of the two type-safety-related patches to explain
+ why they're applied
-- Simon McVittie <smcv at debian.org> Tue, 19 Jul 2011 11:26:36 +0100
diff --git a/debian/patches/0015-Be-more-type-safe-when-calling-setjmp-call-the-same-.patch b/debian/patches/0015-Be-more-type-safe-when-calling-setjmp-call-the-same-.patch
index 7135086..3de8f62 100644
--- a/debian/patches/0015-Be-more-type-safe-when-calling-setjmp-call-the-same-.patch
+++ b/debian/patches/0015-Be-more-type-safe-when-calling-setjmp-call-the-same-.patch
@@ -4,6 +4,27 @@ Date: Thu, 7 Jul 2011 18:11:42 +0100
Subject: [PATCH 15/17] Be more type-safe when calling setjmp(); call the same
one that libpng would
+Depending whether _BSD_SOURCE is preferred, glibc will provide one of two
+implementations of setjmp()/longjmp() (it either does or doesn't save the
+signal mask), acting on different definitions of the jmp_buf struct.
+
+libpng calls longjmp() internally, and expects its callers to call the
+version of setjmp() corresponding to the longjmp() call that libpng would
+make.
+
+In an attempt to ensure that consistent versions of setjmp() and longjmp()
+are used, pngconf.h insists that on Linux, setjmp.h has not already been
+included. However, quakedef.h includes that header, leading to some
+interesting contortions when using the system libpng.
+
+(IMO the right thing for libpng to do would be for it to provide an exported
+function png_setjmp (or something) which calls the version of setjmp() that
+libpng expects on the jmp_buf included in the png structure, like qpng_setjmp
+in this patch.)
+
+When using the system libpng headers, this patch also avoids the assumption
+that jmp_buf is the first thing in the png structure.
+
---
image_png.c | 48 ++++++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/debian/patches/0016-Be-a-bit-more-type-safe-about-using-libpng.patch b/debian/patches/0016-Be-a-bit-more-type-safe-about-using-libpng.patch
index a032202..7be3c2c 100644
--- a/debian/patches/0016-Be-a-bit-more-type-safe-about-using-libpng.patch
+++ b/debian/patches/0016-Be-a-bit-more-type-safe-about-using-libpng.patch
@@ -3,6 +3,18 @@ From: Simon McVittie <smcv at debian.org>
Date: Thu, 7 Jul 2011 18:12:50 +0100
Subject: [PATCH 16/17] Be a bit more type-safe about using libpng
+The simplified libpng declarations in DarkPlaces just use "void **" for
+various pointer-to-pointer arguments. However, this conflicts with the system
+libpng headers (if used), which expect something like "png_struct **" (which
+is not considered to be a compatible type by ISO C), causing compiler
+warnings. This patch reduces the simplification a bit by distinguishing
+between the various pointers-to-struct enough that system libpng headers
+do not provoke warnings.
+
+Similarly, assigning a function pointer provokes warnings if the arguments'
+types are not exactly as expected. Avoiding those warnings potentially makes
+genuine bugs easier to spot, so it seems worth being a bit more precis.
+
---
image_png.c | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
--
DarkPlaces, a Quake engine
More information about the Pkg-games-commits
mailing list