Fix "Unit overflow in pow()" error

During tests on Debian/Ubuntu :
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836983 a problem was
found when raising a unit to a negative power on some architectures.
By default some architectures have "char" being
unsigned such as the ones listed here and others (
https://wiki.debian.org/ArchitectureSpecificsMemo ).
I just forced the sign-ness of pow()'s argument which fixes the issue.
This commit is contained in:
Frederic Bonnard
2017-12-08 15:42:50 +01:00
committed by wmayer
parent 3627cf2b1a
commit 651d2fd751
2 changed files with 2 additions and 2 deletions

View File

@@ -127,7 +127,7 @@ Unit::Unit(const QString& expr)
}
}
Unit Unit::pow(char exp) const
Unit Unit::pow(signed char exp) const
{
checkRange("pow()",
(int32_t)Sig.Length * (int32_t)exp,