OpenTTD

Tasklist

FS#6185 - Fix build with freetype2 >= 2.5.4

Attached to Project: OpenTTD
Opened by Dmitry Marakasov (AMDmi3) - Thursday, 11 December 2014, 11:10 GMT
Last edited by Ingo von Borstel (planetmaker) - Thursday, 11 December 2014, 12:28 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version 1.4.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

openttd fails to build after update of freetype2 (2.5.3->2.5.4).

Full log:
http://beefy1.isc.freebsd.org/data/10i386-quarterly/2014-12-10_14h30m50s/logs/errors/openttd-1.4.2_1.log

Excerpt:
---
wrkdirs/usr/ports/games/openttd/work/openttd-1.4.2/src/fontcache.cpp:530:15: error: no matching function for call to 'max'
int width = max(1, slot->bitmap.width + (this->fs == FS_NORMAL));
^~~
/wrkdirs/usr/ports/games/openttd/work/openttd-1.4.2/src/core/math_func.hpp:38:17: note: candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'unsigned int')
static inline T max(const T a, const T b)
^
/wrkdirs/usr/ports/games/openttd/work/openttd-1.4.2/src/fontcache.cpp:531:15: error: no matching function for call to 'max'
int height = max(1, slot->bitmap.rows + (this->fs == FS_NORMAL));
^~~
/wrkdirs/usr/ports/games/openttd/work/openttd-1.4.2/src/core/math_func.hpp:38:17: note: candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'unsigned int')
static inline T max(const T a, const T b)
^
---

This happens because FT_Bitmap::rows, FT_Bitmap::width type has changed from int to unsigned int. So, cast both sides (to stay compatible with earlier freetype releases) and the type of resulting variable to unsigned. While here, fix 4 warnings of similar nature.
This task depends upon

Closed by  Ingo von Borstel (planetmaker)
Thursday, 11 December 2014, 12:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r27079. Thanks for the patch.
Comment by Dmitry Marakasov (AMDmi3) - Thursday, 11 December 2014, 11:16 GMT
Updated version of a patch, should not produce warnings with older freetype versions.

Loading...