diff options
Diffstat (limited to 'games')
-rw-r--r-- | games/openttd/distinfo | 4 | ||||
-rw-r--r-- | games/openttd/patches/patch-src_fontcache.cpp | 12 |
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"); |