From 1ef99e26628fe0ef0b8fea4fc48d4e309cddd067 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Sun, 13 Apr 2014 19:20:44 +0200 Subject: [PATCH] Try to avoid compiler warning for unary minus operator inside MathLib::toLongNumber() --- lib/mathlib.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mathlib.h b/lib/mathlib.h index 233d601ba..bd4aacbd5 100644 --- a/lib/mathlib.h +++ b/lib/mathlib.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "config.h" /// @addtogroup Core @@ -69,8 +70,10 @@ public: if (str[i] == '1') ret |= 1; } - if (str[0] == '-') - ret = -ret; + if (std::is_signed()) { + if (str[0] == '-') + ret = -ret; + } return ret; }