tnintemann / rpms / boost

Forked from rpms/boost 3 years ago
Clone
Blob Blame History Raw
--- boost_1_66_0/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp~	2018-02-23 16:59:53.785141676 +0000
+++ boost_1_66_0/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp	2018-02-23 17:00:16.838092946 +0000
@@ -68,7 +68,11 @@
             typedef unsignedtype type;                                        \
             static type call(signedtype n)                                    \
             {                                                                 \
-                return static_cast<unsignedtype>((n >= 0) ? n : -n);          \
+                if (n >= 0)                                                   \
+                    return n;                                                 \
+                if (n == std::numeric_limits<signedtype>::min())              \
+                    return (unsignedtype)n;                                   \
+                return (unsignedtype)(-n);                                    \
             }                                                                 \
         }                                                                     \
     /**/