Bug 208757

Summary: games/edge: Fix build with libc++ 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Some People CC: pi
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 208158    
Attachments:
Description Flags
Replace abs() on unsigned arguments in games/edge none

Description Dimitry Andric freebsd_committer 2016-04-12 20:12:10 UTC
Created attachment 169260 [details]
Replace abs() on unsigned arguments in games/edge

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

epi/image_hq2x.cc:178:13: error: call to 'abs' is ambiguous
                   (u32_t)abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ||
                          ^~~

This is because abs() is being called with unsigned arguments.  Fix this by calculating the unsigned difference in a more portable way.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/edge-1.35_6.log
Comment 1 Kurt Jaeger freebsd_committer 2016-04-18 05:28:50 UTC
committed, thanks.
Comment 2 commit-hook freebsd_committer 2016-04-18 05:29:39 UTC
A commit references this bug:

Author: pi
Date: Mon Apr 18 05:28:36 UTC 2016
New revision: 413549
URL: https://svnweb.freebsd.org/changeset/ports/413549

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

  - Replace abs() on unsigned arguments in games/edge

  PR:		208757
  Submitted by:	dim

Changes:
  head/games/edge/files/patch-epi__image_hq2x.cc