Skip to content

Commit

Permalink
Merge pull request #292 from jwillemsen/master
Browse files Browse the repository at this point in the history
Use std::abs instead of abs
  • Loading branch information
jwillemsen committed Sep 11, 2016
2 parents 4b78b50 + e240612 commit 37ce198
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ACE/ace/Time_Value.cpp
Expand Up @@ -18,6 +18,8 @@
# include <iomanip>
#endif /* ACE_HAS_CPP98_IOSTREAMS */

#include <cstdlib>

#ifdef ACE_HAS_CPP11
# include <cmath>
#endif /* ACE_HAS_CPP11 */
Expand Down Expand Up @@ -178,7 +180,7 @@ ACE_Time_Value::normalize (bool saturate)
if (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS ||
this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS)
{
time_t sec = abs(this->tv_.tv_usec) / ACE_ONE_SECOND_IN_USECS * (this->tv_.tv_usec > 0 ? 1 : -1);
time_t sec = std::abs(this->tv_.tv_usec) / ACE_ONE_SECOND_IN_USECS * (this->tv_.tv_usec > 0 ? 1 : -1);
suseconds_t usec = this->tv_.tv_usec - sec * ACE_ONE_SECOND_IN_USECS;

if (saturate && this->tv_.tv_sec > 0 && sec > 0 &&
Expand Down

0 comments on commit 37ce198

Please sign in to comment.