heffer pushed to openttd (f20). "fix build"

notifications at fedoraproject.org notifications at fedoraproject.org
Mon May 18 20:28:01 UTC 2015


From 8b77580f20816656a8d67482e7d4a495c27969b4 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon at redhat.com>
Date: Tue, 27 Jan 2015 21:31:13 +0100
Subject: fix build


diff --git a/0001-fix-build.patch b/0001-fix-build.patch
new file mode 100644
index 0000000..6881644
--- /dev/null
+++ b/0001-fix-build.patch
@@ -0,0 +1,27 @@
+From a8cea91036540981f2ef1da4a08f52b3a008643a Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon at redhat.com>
+Date: Tue, 27 Jan 2015 21:30:30 +0100
+Subject: [PATCH] fix build
+
+---
+ src/fontcache.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/fontcache.cpp b/src/fontcache.cpp
+index 8b76c0d..b2bda0e 100644
+--- a/src/fontcache.cpp
++++ b/src/fontcache.cpp
+@@ -527,8 +527,8 @@ const Sprite *FreeTypeFontCache::GetGlyph(GlyphID key)
+ 	aa = (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
+ 
+ 	/* 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));
+ 
+ 	/* Limit glyph size to prevent overflows later on. */
+ 	if (width > 256 || height > 256) usererror("Font glyph is too large");
+-- 
+2.1.0
+
diff --git a/openttd.spec b/openttd.spec
index 7b123a8..3af03ae 100644
--- a/openttd.spec
+++ b/openttd.spec
@@ -17,6 +17,8 @@ BuildRequires:  freetype-devel, xz-devel, ccache, doxygen
 Requires:       hicolor-icon-theme
 Requires:       openttd-opengfx => 0.5.0
 
+Patch0:         0001-fix-build.patch
+
 %description
 OpenTTD is modeled after a popular transportation business simulation game
 by Chris Sawyer and enhances the game experience dramatically. Many features
@@ -37,6 +39,8 @@ the AI.
 %prep
 %setup -q -n %{name}-%{version}%{?prever:-%{prever}}
 
+%patch0 -p1
+
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS"
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/openttd.git/commit/?h=f20&id=8b77580f20816656a8d67482e7d4a495c27969b4


More information about the scm-commits mailing list