From 30a97f5f52ca5c4d2e87f1526292c3903df3af5b Mon Sep 17 00:00:00 2001 From: Wilhelm Schuermann Date: Sun, 18 Dec 2011 10:13:21 -0500 Subject: [PATCH] Cleanup - Removed unnecessary definitions of max() and min(), replaced existent calls with std::max(). Precursor to Bugfix #887. Signed-off-by: Paul Beckingham --- src/columns/ColDescription.cpp | 4 ++-- src/util.h | 8 -------- test/test.cpp | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/columns/ColDescription.cpp b/src/columns/ColDescription.cpp index 846029d12..9fa262e07 100644 --- a/src/columns/ColDescription.cpp +++ b/src/columns/ColDescription.cpp @@ -106,7 +106,7 @@ void ColumnDescription::measure (Task& task, int& minimum, int& maximum) int min_desc = longestWord (description); int min_anno = indent + Date::length (format); - minimum = max (min_desc, min_anno); + minimum = std::max (min_desc, min_anno); maximum = description.length (); std::map annos; @@ -136,7 +136,7 @@ void ColumnDescription::measure (Task& task, int& minimum, int& maximum) int min_desc = longestWord (description); int min_anno = Date::length (format); - minimum = max (min_desc, min_anno); + minimum = std::max (min_desc, min_anno); maximum = description.length (); std::map annos; diff --git a/src/util.h b/src/util.h index 397aebec9..dc97155b5 100644 --- a/src/util.h +++ b/src/util.h @@ -40,14 +40,6 @@ #include #endif -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif - // util.cpp bool confirm (const std::string&); int confirm3 (const std::string&); diff --git a/test/test.cpp b/test/test.cpp index 73cbdf2d8..77ff73522 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -60,7 +60,7 @@ UnitTest::~UnitTest () { float percentPassed = 0.0; if (mPlanned > 0) - percentPassed = (100.0 * mPassed) / max (mPlanned, mPassed + mFailed + mSkipped); + percentPassed = (100.0 * mPassed) / std::max (mPlanned, mPassed + mFailed + mSkipped); if (mCounter < mPlanned) {