[flang] Fixing Windows build (take 3)
authorpeter klausler <pklausler@nvidia.com>
Wed, 13 Oct 2021 01:57:58 +0000 (18:57 -0700)
committerpeter klausler <pklausler@nvidia.com>
Wed, 13 Oct 2021 01:59:33 +0000 (18:59 -0700)
Add explicit casts to replace implicit conversions and
recently deleted assignment operators from uint128.h
used in runtime/edit-output.cpp.

flang/runtime/edit-output.cpp

index c5d5d6c..f599cb0 100644 (file)
@@ -25,14 +25,14 @@ bool EditIntegerOutput(IoStatementState &io, const DataEdit &edit,
   case 'G':
   case 'I':
     if (isNegative) {
-      un = -n;
+      un = -un;
     }
     if (isNegative || (edit.modes.editingFlags & signPlus)) {
       signChars = 1; // '-' or '+'
     }
     while (un > 0) {
       auto quotient{un / 10u};
-      *--p = '0' + static_cast<int>(un - 10u * quotient);
+      *--p = '0' + static_cast<int>(un - Unsigned{10} * quotient);
       un = quotient;
     }
     break;
@@ -398,7 +398,8 @@ template <int KIND> bool RealOutputEditing<KIND>::Edit(const DataEdit &edit) {
   case 'O':
   case 'Z':
     return EditIntegerOutput<KIND>(io_, edit,
-        decimal::BinaryFloatingPointNumber<binaryPrecision>{x_}.raw());
+        static_cast<common::HostSignedIntType<8 * KIND>>(
+            decimal::BinaryFloatingPointNumber<binaryPrecision>{x_}.raw()));
   case 'G':
     return Edit(EditForGOutput(edit));
   default: