Skip to content

Commit

Permalink
Try to avoid compiler warning for unary minus operator inside MathLib…
Browse files Browse the repository at this point in the history
…::toLongNumber<biguint>()
  • Loading branch information
amai2012 committed Apr 13, 2014
1 parent b4b340b commit 1ef99e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <cstdlib>
#include <string>
#include <sstream>
#include <type_traits>
#include "config.h"

/// @addtogroup Core
Expand Down Expand Up @@ -69,8 +70,10 @@ class CPPCHECKLIB MathLib {
if (str[i] == '1')
ret |= 1;
}
if (str[0] == '-')
ret = -ret;
if (std::is_signed<T>()) {
if (str[0] == '-')
ret = -ret;
}
return ret;
}

Expand Down

0 comments on commit 1ef99e2

Please sign in to comment.