[libc-commits] [PATCH] D156812: [libc][NFC] Fix str_to_float and uint warnings

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 1 11:08:21 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG15994529e064: [libc][NFC] Fix str_to_float and uint warnings (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156812/new/

https://reviews.llvm.org/D156812

Files:
  libc/src/__support/UInt.h
  libc/src/__support/str_to_float.h


Index: libc/src/__support/str_to_float.h
===================================================================
--- libc/src/__support/str_to_float.h
+++ libc/src/__support/str_to_float.h
@@ -1196,7 +1196,7 @@
             if (strtoint_result.has_error()) {
               error = strtoint_result.error;
             }
-            nan_mantissa = strtoint_result.value;
+            nan_mantissa = static_cast<BitsType>(strtoint_result.value);
             if (src[left_paren + 1 + strtoint_result.parsed_len] != ')')
               nan_mantissa = 0;
           }
Index: libc/src/__support/UInt.h
===================================================================
--- libc/src/__support/UInt.h
+++ libc/src/__support/UInt.h
@@ -381,7 +381,7 @@
 
     BigInt<Bits, Signed> quotient(0);
     BigInt<Bits, Signed> subtractor = other;
-    int cur_bit = subtractor.clz() - this->clz();
+    int cur_bit = static_cast<int>(subtractor.clz() - this->clz());
     subtractor.shift_left(cur_bit);
 
     for (; cur_bit >= 0 && *this > 0; --cur_bit, subtractor.shift_right(1)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156812.546155.patch
Type: text/x-patch
Size: 1067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230801/dca9e1ca/attachment.bin>


More information about the libc-commits mailing list