summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-08-07 22:45:30 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-08-08 05:57:58 +0200
commit3a81fcbf9de1385d65b4d7a7932543dba65618cd (patch)
tree58689c37580451edb566f090ecd40b8c2cac9b2c /include
parentd0425778eef7ea20ccc19834c07d0b265f58baf0 (diff)
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@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/helpers.hxx4
1 files changed, 3 insertions, 1 deletions
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;