25
25
namespace LIBC_NAMESPACE {
26
26
namespace printf_core {
27
27
28
- using MantissaInt = fputil::FPBits<long double >::UIntType;
29
-
30
28
LIBC_INLINE int convert_float_hex_exp (Writer *writer,
31
29
const FormatSection &to_conv) {
30
+ using LDBits = fputil::FPBits<long double >;
31
+ using MantissaInt = LDBits::UIntType;
32
32
// All of the letters will be defined relative to variable a, which will be
33
33
// the appropriate case based on the name of the conversion. This converts any
34
34
// conversion name into the letter 'a' with the appropriate case.
@@ -40,18 +40,19 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
40
40
bool is_inf_or_nan;
41
41
uint32_t mantissa_width;
42
42
if (to_conv.length_modifier == LengthModifier::L) {
43
- mantissa_width = fputil::MantissaWidth< long double >::VALUE ;
44
- fputil::FPBits< long double > ::UIntType float_raw = to_conv.conv_val_raw ;
45
- fputil::FPBits< long double > float_bits (float_raw);
43
+ mantissa_width = LDBits::MANTISSA_WIDTH ;
44
+ LDBits ::UIntType float_raw = to_conv.conv_val_raw ;
45
+ LDBits float_bits (float_raw);
46
46
is_negative = float_bits.get_sign ();
47
47
exponent = float_bits.get_explicit_exponent ();
48
48
mantissa = float_bits.get_explicit_mantissa ();
49
49
is_inf_or_nan = float_bits.is_inf_or_nan ();
50
50
} else {
51
- mantissa_width = fputil::MantissaWidth<double >::VALUE;
52
- fputil::FPBits<double >::UIntType float_raw =
53
- static_cast <fputil::FPBits<double >::UIntType>(to_conv.conv_val_raw );
54
- fputil::FPBits<double > float_bits (float_raw);
51
+ using LBits = fputil::FPBits<double >;
52
+ mantissa_width = LBits::MANTISSA_WIDTH;
53
+ LBits::UIntType float_raw =
54
+ static_cast <LBits::UIntType>(to_conv.conv_val_raw );
55
+ LBits float_bits (float_raw);
55
56
is_negative = float_bits.get_sign ();
56
57
exponent = float_bits.get_explicit_exponent ();
57
58
mantissa = float_bits.get_explicit_mantissa ();
@@ -157,8 +158,7 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
157
158
// 15 -> 5
158
159
// 11 -> 4
159
160
// 8 -> 3
160
- constexpr size_t EXP_LEN =
161
- (((fputil::ExponentWidth<long double >::VALUE * 5 ) + 15 ) / 16 ) + 1 ;
161
+ constexpr size_t EXP_LEN = (((LDBits::EXPONENT_WIDTH * 5 ) + 15 ) / 16 ) + 1 ;
162
162
char exp_buffer[EXP_LEN];
163
163
164
164
bool exp_is_negative = false ;
0 commit comments