Skip to content

Commit

Permalink
Work around Windows min/max mess.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 30, 2018
1 parent 1c0cd2c commit d44ef68
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pdal/util/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ namespace Utils
* \return the value to clamped to the given bounds.
*/
template <class T>
PDAL_DLL const T& clamp(const T& t, const T& min, const T& max)
PDAL_DLL const T& clamp(const T& t, const T& minimum, const T& maximum)
{
return ((t < min) ? min : ((t > max) ? max : t));
return ((t < minimum) ? minimum : ((t > maximum) ? maximum : t));
}

/**
Expand Down Expand Up @@ -687,7 +687,7 @@ namespace Utils

return std::is_same<double, T_OUT>::value ||
(in >= static_cast<double>(std::numeric_limits<T_OUT>::lowest()) &&
in <= static_cast<double>(std::numeric_limits<T_OUT>::max()));
in <= static_cast<double>(std::numeric_limits<T_OUT>::(max)()));
}

/**
Expand Down Expand Up @@ -727,7 +727,7 @@ namespace Utils
if (std::is_integral<T_OUT>::value)
in = static_cast<T_IN>(sround((double)in));
if ((std::is_same<T_OUT, double>::value) ||
(in <= static_cast<double>(std::numeric_limits<T_OUT>::max()) &&
(in <= static_cast<double>(std::numeric_limits<T_OUT>::(max)()) &&
in >= static_cast<double>(std::numeric_limits<T_OUT>::lowest())))
{
out = static_cast<T_OUT>(in);
Expand Down Expand Up @@ -935,7 +935,7 @@ namespace Utils
{
int i = std::stoi(s);
if (i >= std::numeric_limits<char>::lowest() &&
i <= std::numeric_limits<char>::max())
i <= std::numeric_limits<char>::(max)())
{
to = static_cast<char>(i);
return true;
Expand Down Expand Up @@ -967,7 +967,7 @@ namespace Utils
{
int i = std::stoi(s);
if (i >= std::numeric_limits<unsigned char>::lowest() &&
i <= std::numeric_limits<unsigned char>::max())
i <= std::numeric_limits<unsigned char>::(max)())
{
to = static_cast<unsigned char>(i);
return true;
Expand Down Expand Up @@ -999,7 +999,7 @@ namespace Utils
{
int i = std::stoi(s);
if (i >= std::numeric_limits<signed char>::lowest() &&
i <= std::numeric_limits<signed char>::max())
i <= std::numeric_limits<signed char>::(max)())
{
to = static_cast<signed char>(i);
return true;
Expand Down

0 comments on commit d44ef68

Please sign in to comment.