mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Cleanup
- Removed unnecessary definitions of max() and min(), replaced existent calls with std::max(). Precursor to Bugfix #887. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
parent
69fecbb2c0
commit
30a97f5f52
3 changed files with 3 additions and 11 deletions
|
@ -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 <std::string, std::string> 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 <std::string, std::string> annos;
|
||||
|
|
|
@ -40,14 +40,6 @@
|
|||
#include <uuid/uuid.h>
|
||||
#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&);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue