Bug 195869 - games/openttd: fix build with new freetype2
Summary: games/openttd: fix build with new freetype2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-11 02:24 UTC by Dmitry Marakasov
Modified: 2015-01-12 19:43 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments
Fix (1.27 KB, patch)
2014-12-11 02:24 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 02:24:12 UTC
Created attachment 150453 [details]
Fix

---
/wrkdirs/usr/ports/games/openttd/work/openttd-1.4.4/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.4/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.4/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.4/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)
                ^
---

Fix attached. If you commit this yourself, don't forget to MFH.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-11 02:24:12 UTC
Auto-assigned to maintainer danfe@FreeBSD.org
Comment 2 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-12-11 07:03:18 UTC
> Fix attached.

Are you sure your patch is correct?  It does not seem to help on 10.1 at least (with Clang).  The following does, however:

-   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));

> If you commit this yourself, don't forget to MFH.

If you mean the quarterly branch, sorry, I don't consider merging (I don't run them, so I cannot validate or test any stability issues with ports there, nor do I have them checked out).

The way they are currently being done is wrong.  Stable branches should be maintained by a dedicated group of people, knowing the branch around, etc.  They (and only them) should be doing all the MFHs, not some random committers.
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 09:29:24 UTC
> Are you sure your patch is correct?  It does not seem to help on 10.1 at least (with Clang).

Yes. That fixes build in all jails in my poudriere.

>  The following does, however:

It is essentially the same. 1U does the thing which exists in both patches, my also changes variable tyoe to unsigned just for consistency (it's used as unsigned later and stored in unsigned field of other object).

> If you mean the quarterly branch, sorry, I don't consider merging (I don't run them, so I cannot validate or test any stability issues with ports there, nor do I have them checked out).

You don't need to check out quarterly branch to do an MFH. Validation may also be skipped I believe, since merges are simple small fixes.

> The way they are currently being done is wrong.  Stable branches should be maintained by a dedicated group of people, knowing the branch around, etc.  They (and only them) should be doing all the MFHs, not some random committers.

Well, there is a group, ports-secteam@. However, they only approve merges, not merge themselves. I agree it would be better to make them do actual merges, however I see that as an improvement above current situation, not a prerequisite to use stable branches. Not merging because of your opinion is not going to move the project forward.
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-12-11 09:41:12 UTC
> Yes. That fixes build in all jails in my poudriere.
> It is essentially the same. 1U does the thing which exists in both patches,

Ah, I see; sorry, I didn't notice you also had 1U when converting your patch into REINPLACE_CMD.  Since your patch seems to be more technically correct, I think it should be upstreamed.  For a quick fix in ports, sed(1) should do just fine.

> [...] Not merging because of your opinion is not going to move the project forward.

OK, I will reconsider; thank you for your input.
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-12-11 10:11:40 UTC
A commit references this bug:

Author: danfe
Date: Thu Dec 11 10:10:57 UTC 2014
New revision: 374519
URL: https://svnweb.freebsd.org/changeset/ports/374519

Log:
  Unbreak the build against new freetype2 (v2.5.4).

  This is sed(1) version of submitted patch; it is slightly less accurate,
  but functionally equivalent.

  PR:		195869
  Submitted by:	amdmi3

Changes:
  head/games/openttd/Makefile
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 10:21:23 UTC
> I think it should be upstreamed

Sure, I'm working on this right now. Thanks!
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 10:25:05 UTC
> OK, I will reconsider; thank you for your input.

JFYI you just need to add MFH:  2014Q4 header to the commit (or ask approval to merge specific revision from ports-secteam@ directly if you forgot the header). Another bonus is that you'll stop getting pkg-fallout mail. Actually, me too, since I'm monitoring fallout for games/* ports.
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 12:30:10 UTC
The fix was upstreamed.
Comment 9 Dmitry Marakasov freebsd_committer freebsd_triage 2015-01-12 19:43:25 UTC
Closing; MHF is no longer needed as we now have 2015Q1 which incorporates this fix.