From 3d5aff0f3011d372d15dd25eed034d4af81b4ef4 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 29 Aug 2016 14:48:07 +1000 Subject: [PATCH] maths: use mult rather than negation in constexpr util::digits was triggering signed overflow warnings under gcc. By using negative multiplication rather than explicit negation we get the same behaviour, sans warning. --- maths.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths.hpp b/maths.hpp index 6513242c..543ceed1 100644 --- a/maths.hpp +++ b/maths.hpp @@ -312,7 +312,7 @@ namespace util { digits (ValueT value, BaseT base) noexcept { if (value < 0) - return digits (-value, base); + value *= -1; unsigned tally = 1; while (value /= base)