[gcc r15-7670] libstdc++: Remove redundant cast in floating_from_chars.cc

Jonathan Wakely redi@gcc.gnu.org
Sat Feb 22 21:20:40 GMT 2025


https://gcc.gnu.org/g:a742b27bd2da33640222b1f85a4576d6d0aa2759

commit r15-7670-ga742b27bd2da33640222b1f85a4576d6d0aa2759
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 20 15:16:11 2025 +0000

    libstdc++: Remove redundant cast in floating_from_chars.cc
    
    In r15-7647-g32457bc25fea80 I added a cast and also changed the type of
    the variable, making the cast redundant. This removes the cast.
    
    libstdc++-v3/ChangeLog:
    
            * src/c++17/floating_from_chars.cc (__floating_from_chars_hex):
            Remove redundant cast.

Diff:
---
 libstdc++-v3/src/c++17/floating_from_chars.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc
index d48f1c0d4545..9bad12c7f69e 100644
--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
@@ -1103,8 +1103,7 @@ namespace
 	// If the leading hexit is not '1', shift MANTISSA to make it so.
 	// This normalizes input like "4.08p0" into "1.02p2".
 	const unsigned leading_hexit = mantissa >> mantissa_bits;
-	const int leading_hexit_width
-	  = __bit_width((unsigned)leading_hexit); // FIXME: optimize?
+	const int leading_hexit_width = __bit_width(leading_hexit); // FIXME: optimize?
 	__glibcxx_assert(leading_hexit_width >= 1 && leading_hexit_width <= 4);
 	shift_mantissa(leading_hexit_width - 1);
 	// After this adjustment, we can assume the leading hexit is '1'.


More information about the Libstdc++-cvs mailing list