summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authordholland <dholland>2015-06-19 00:49:14 +0000
committerdholland <dholland>2015-06-19 00:49:14 +0000
commit5158a69b3a23fab481b3e20b0143b3f402335f17 (patch)
treee7e18bd309f6e6aeb3cbd8f7cbf2f07dd7082277 /games
parent1f726181fce9ba6d3ff1469587dcbfdf6b095b3d (diff)
downloadpkgsrc-5158a69b3a23fab481b3e20b0143b3f402335f17.tar.gz
fix joerg's patch to work with more fontconfig versions
Diffstat (limited to 'games')
-rw-r--r--games/openttd/distinfo4
-rw-r--r--games/openttd/patches/patch-src_fontcache.cpp12
2 files changed, 10 insertions, 6 deletions
diff --git a/games/openttd/distinfo b/games/openttd/distinfo
index a09163178c5..2adbb3baee3 100644
--- a/games/openttd/distinfo
+++ b/games/openttd/distinfo
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.21 2014/12/25 21:32:31 joerg Exp $
+$NetBSD: distinfo,v 1.22 2015/06/19 00:49:14 dholland Exp $
SHA1 (openttd-1.4.4-source.tar.xz) = c3aa122cda75162b76cd12dc4586371e841102b3
RMD160 (openttd-1.4.4-source.tar.xz) = 591ffe69e26e4820af29f8e04ec181d4c5119170
Size (openttd-1.4.4-source.tar.xz) = 6342508 bytes
SHA1 (patch-aa) = b34cc7e0adf8a91657f1426ff2d888eb7c31bcb2
-SHA1 (patch-src_fontcache.cpp) = df4101aa28ad7f0c3ccd371bc864117d928f4b93
+SHA1 (patch-src_fontcache.cpp) = 88fb873e3e487bbf5a63afd9490a83981ec8b306
diff --git a/games/openttd/patches/patch-src_fontcache.cpp b/games/openttd/patches/patch-src_fontcache.cpp
index e51a55941fe..d3280b645c4 100644
--- a/games/openttd/patches/patch-src_fontcache.cpp
+++ b/games/openttd/patches/patch-src_fontcache.cpp
@@ -1,6 +1,10 @@
-$NetBSD: patch-src_fontcache.cpp,v 1.1 2014/12/11 22:10:04 joerg Exp $
+$NetBSD: patch-src_fontcache.cpp,v 1.2 2015/06/19 00:49:14 dholland Exp $
-bitmap.width and bitmap.rows are unsigned, so std::max needs unsigned 1 too.
+bitmap.width and bitmap.rows are unsigned in some versions of freetype
+(but not others) -- because C++ requires max() to be homogeneous with
+respect to sign, if it's unsigned the constant needs to be 1U, and if
+it's not, it needs not to be. Which becomes a problem. So, since none
+of this should ever be negative, force it all to unsigned.
--- src/fontcache.cpp.orig 2014-12-11 21:17:16.000000000 +0000
+++ src/fontcache.cpp
@@ -10,8 +14,8 @@ bitmap.width and bitmap.rows are unsigned, so std::max needs unsigned 1 too.
/* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */
- int width = max(1, slot->bitmap.width + (this->fs == FS_NORMAL));
- int height = max(1, slot->bitmap.rows + (this->fs == FS_NORMAL));
-+ int width = max(1U, slot->bitmap.width + (this->fs == FS_NORMAL));
-+ int height = max(1U, slot->bitmap.rows + (this->fs == FS_NORMAL));
++ int width = max(1U, (unsigned)(slot->bitmap.width + (this->fs == FS_NORMAL)));
++ int height = max(1U, (unsigned)(slot->bitmap.rows + (this->fs == FS_NORMAL)));
/* Limit glyph size to prevent overflows later on. */
if (width > 256 || height > 256) usererror("Font glyph is too large");