Use std::abs instead of abs()

This suppresses a couple of warnings with the latest version of clang shipped with Xcode 6.3.
This commit is contained in:
Ronald Wampler
2015-04-22 22:16:23 -04:00
committed by Allan Odgaard
parent 172ce9d428
commit 4aff7098a5
3 changed files with 3 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ NSUInteger const OakMoveNoActionReturn = 3;
NSInteger row = [_tableView selectedRow] + anOffset;
NSInteger numberOfRows = [_tableView numberOfRows];
if(abs(anOffset) == 1 && numberOfRows && [[NSUserDefaults standardUserDefaults] boolForKey:kUserDefaultsEnableLoopFilterList])
if(std::abs(anOffset) == 1 && numberOfRows && [[NSUserDefaults standardUserDefaults] boolForKey:kUserDefaultsEnableLoopFilterList])
row = (row + numberOfRows) % numberOfRows;
else row = oak::cap((NSInteger)0, row, numberOfRows - 1);

View File

@@ -4,7 +4,7 @@ void test_date_value ()
{
oak::date_t now = oak::date_t::now();
oak::date_t stillNow(now.time_value());
OAK_ASSERT_LT(abs(now.value() - stillNow.value()), 0.5);
OAK_ASSERT_LT(std::abs(now.value() - stillNow.value()), 0.5);
}
void test_date_time_value ()

View File

@@ -7,6 +7,7 @@
#include "prelude-mac.h"
#include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iterator>