Bug 208844 - graphics/gource: Fix build with libc++ 3.8.0
Summary: graphics/gource: 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: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-04-16 20:47 UTC by Dimitry Andric
Modified: 2016-04-17 13:35 UTC (History)
0 users

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


Attachments
Fix argument type for max() in graphics/gource (1.10 KB, patch)
2016-04-16 20:49 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:47:44 UTC

    
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2016-04-16 20:49:37 UTC
Created attachment 169381 [details]
Fix argument type for max() in graphics/gource

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

src/dirnode.cpp:585:27: error: no matching function for call to 'max'
    this->parent_radius = std::max(1.0, sqrt(total_file_area) * gGourceDirPadding);
                          ^~~~~~~~

This is because max() is being called with two arguments of different type (double and float).  Fix this by using 0.0f instead (and casting the result of sqrt to float like two lines above, though this should strictly not be necessary).

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/gource-0.43_1.log
Comment 2 Dmitry Sivachenko freebsd_committer freebsd_triage 2016-04-16 20:51:09 UTC
Please commit this.

(you may fix clang-3.8 errors for my ports without my approval in the future).

Thanks for your work!
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-04-16 21:31:19 UTC
A commit references this bug:

Author: dim
Date: Sat Apr 16 21:30:23 UTC 2016
New revision: 413481
URL: https://svnweb.freebsd.org/changeset/ports/413481

Log:
  During the exp-run in bug 208158, it was found that graphics/gource
  gives errors with libc++ 3.8.0:

  src/dirnode.cpp:585:27: error: no matching function for call to 'max'
      this->parent_radius = std::max(1.0, sqrt(total_file_area) * gGourceDirPadding);
                            ^~~~~~~~

  This is because max() is being called with two arguments of different
  type (double and float).  Fix this by using 0.0f instead (and casting
  the result of sqrt to float like two lines above, though this should
  strictly not be necessary).

  Approved by:	demon (maintainer)
  PR:		208844
  MFH:		2016Q2

Changes:
  head/graphics/gource/files/
  head/graphics/gource/files/patch-src_dirnode.cpp
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-04-17 13:34:31 UTC
A commit references this bug:

Author: dim
Date: Sun Apr 17 13:33:39 UTC 2016
New revision: 413509
URL: https://svnweb.freebsd.org/changeset/ports/413509

Log:
  MFH: r413481

  During the exp-run in bug 208158, it was found that graphics/gource
  gives errors with libc++ 3.8.0:

  src/dirnode.cpp:585:27: error: no matching function for call to 'max'
      this->parent_radius = std::max(1.0, sqrt(total_file_area) * gGourceDirPadding);
                            ^~~~~~~~

  This is because max() is being called with two arguments of different
  type (double and float).  Fix this by using 0.0f instead (and casting
  the result of sqrt to float like two lines above, though this should
  strictly not be necessary).

  Approved by:	portmgr (junovitch)
  PR:		208844

Changes:
_U  branches/2016Q2/
  branches/2016Q2/graphics/gource/files/