Skip to content

Commit 89009a2

Browse files
committed
format
1 parent aa10d5d commit 89009a2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

flang/include/flang/Common/format.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ int64_t MulOverflow(int64_t X, int64_t Y, int64_t &Result) {
6363
return __builtin_mul_overflow(X, Y, &Result);
6464
#else
6565
// Perform the unsigned multiplication on absolute values.
66-
const uint64_t UX = X < 0 ? (0 - static_cast<uint64_t>(X)) : static_cast<uint64_t>(X);
67-
const uint64_t UY = Y < 0 ? (0 - static_cast<uint64_t>(Y)) : static_cast<uint64_t>(Y);
66+
const uint64_t UX =
67+
X < 0 ? (0 - static_cast<uint64_t>(X)) : static_cast<uint64_t>(X);
68+
const uint64_t UY =
69+
Y < 0 ? (0 - static_cast<uint64_t>(Y)) : static_cast<uint64_t>(Y);
6870
const uint64_t UResult = UX * UY;
6971

7072
// Convert to signed.
@@ -79,7 +81,9 @@ int64_t MulOverflow(int64_t X, int64_t Y, int64_t &Result) {
7981
// Check how the max allowed absolute value (2^n for negative, 2^(n-1) for
8082
// positive) divided by an argument compares to the other.
8183
if (IsNegative)
82-
return UX > (static_cast<uint64_t>(std::numeric_limits<T>::max()) + uint64_t(1)) / UY;
84+
return UX >
85+
(static_cast<uint64_t>(std::numeric_limits<T>::max()) + uint64_t(1)) /
86+
UY;
8387
else
8488
return UX > (static_cast<uint64_t>(std::numeric_limits<T>::max())) / UY;
8589
#endif

0 commit comments

Comments
 (0)