Bug 208842 - games/kuklomenos: Fix build with libc++ 3.8.0
Summary: games/kuklomenos: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-04-16 20:27 UTC by Dimitry Andric
Modified: 2016-04-18 16:52 UTC (History)
1 user (show)

See Also:


Attachments
Fix argument type for max() in games/kuklomenos (963 bytes, patch)
2016-04-16 20:27 UTC, Dimitry Andric
no flags Details | Diff
Fix argument type for max() in games/kuklomenos (964 bytes, patch)
2016-04-18 16:42 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-04-16 20:27:36 UTC
Created attachment 169379 [details]
Fix argument type for max() in games/kuklomenos

During the exp-run in bug 208158, it was found that games/kuklomenos gives errors with libc++ 3.8.0 [1]:

node.cc:178:7: error: no matching function for call to 'max'
                    std::max(0.0, 1 - ( fabs(angleDiff(spin*3, 0)) * 2 )) );
                    ^~~~~~~~

This is because max() is being called with two arguments of different type (double and float).  Fix this by using 0.0f instead.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/kuklomenos-0.4.5_4.log
Comment 1 Kurt Jaeger freebsd_committer freebsd_triage 2016-04-18 05:44:41 UTC
Testbuilds on 11a, 10.3a+i, 9.3a all fail because std::max is not known ?

Did I miss something ?
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2016-04-18 16:42:02 UTC
Created attachment 169442 [details]
Fix argument type for max() in games/kuklomenos

Right, I didn't realize that for earlier versions of libc++, the fabs() prototype is such that it always returns double.  In that case, the std::max invocation will still be with differently typed arguments, causing complaints.

I now replaced the fabs() call with fabsf(), so now both arguments to std::max are *really* floats.
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2016-04-18 16:52:42 UTC
Committed, thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-04-18 16:52:52 UTC
A commit references this bug:

Author: pi
Date: Mon Apr 18 16:52:26 UTC 2016
New revision: 413588
URL: https://svnweb.freebsd.org/changeset/ports/413588

Log:
  games/kuklomenos: Fix build with libc++ 3.8.0

  PR:		208842
  Submitted by:	dim

Changes:
  head/games/kuklomenos/files/
  head/games/kuklomenos/files/patch-node.cc