[Libreoffice-commits] core.git: include/tools
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 8 03:58:19 UTC 2018
include/tools/helpers.hxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 3a81fcbf9de1385d65b4d7a7932543dba65618cd
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Aug 7 22:45:30 2018 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Aug 8 05:57:58 2018 +0200
CID 1438378: Allow only signed types
Change-Id: Ie342a356a599e42882f59fc823330bdfae233e5d
Reviewed-on: https://gerrit.libreoffice.org/58710
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
index bbe350d455ba..1e88e5725af4 100644
--- a/include/tools/helpers.hxx
+++ b/include/tools/helpers.hxx
@@ -77,7 +77,9 @@ inline long FRound( double fVal )
}
//valid range: (-180,180]
-template <typename T> inline SAL_WARN_UNUSED_RESULT T NormAngle180(T angle)
+template <typename T>
+inline SAL_WARN_UNUSED_RESULT typename std::enable_if<std::is_signed<T>::value, T>::type
+NormAngle180(T angle)
{
while (angle <= -180)
angle += 360;
More information about the Libreoffice-commits
mailing list