]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/SquidMath.h
Source Format Enforcement (#745)
[thirdparty/squid.git] / src / SquidMath.h
index 480d7b931bb19fd3d46e22191071c2ba71069cda..c00c61bd06827fe31172f1895109776e3670d73f 100644 (file)
@@ -40,10 +40,10 @@ using EnableIfType = typename std::enable_if<B,T>::type;
 /// reduces code duplication in Sum() declarations below
 template <typename T, typename U>
 using AllUnsigned = typename std::conditional<
-    std::is_unsigned<T>::value && std::is_unsigned<U>::value,
-    std::true_type,
-    std::false_type
-    >::type;
+                    std::is_unsigned<T>::value && std::is_unsigned<U>::value,
+                    std::true_type,
+                    std::false_type
+                    >::type;
 
 /// \returns a non-overflowing sum of the two unsigned arguments (or nothing)
 template <typename T, typename U, EnableIfType<AllUnsigned<T,U>::value, int> = 0>
@@ -72,8 +72,8 @@ Sum(const T a, const U b) {
 
     // tests below avoid undefined behavior of signed under/overflows
     return b >= 0 ?
-        ((a > std::numeric_limits<U>::max() - b) ? Optional<T>() : Optional<T>(a + b)):
-        ((a < std::numeric_limits<U>::min() - b) ? Optional<T>() : Optional<T>(a + b));
+           ((a > std::numeric_limits<U>::max() - b) ? Optional<T>() : Optional<T>(a + b)):
+           ((a < std::numeric_limits<U>::min() - b) ? Optional<T>() : Optional<T>(a + b));
 }
 
 /// \returns a non-overflowing sum of the arguments (or nothing)