Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with freetype2 >= 2.5.4 #6185

Closed
DorpsGek opened this issue Dec 11, 2014 · 2 comments
Closed

Fix build with freetype2 >= 2.5.4 #6185

DorpsGek opened this issue Dec 11, 2014 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

AMDmi3 opened the ticket and wrote:

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.

Attachments

Reported version: 1.4.4
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6185
@DorpsGek
Copy link
Member Author

AMDmi3 wrote:

Updated version of a patch, should not produce warnings with older freetype versions.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6185#comment13655

@DorpsGek
Copy link
Member Author

planetmaker closed the ticket.

Reason for closing: Fixed

In r27079. Thanks for the patch.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6185

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant