Skip to content

Commit e76aacc

Browse files
committed
LIBC_INLINE for modular fn definitions
1 parent ae1ac4e commit e76aacc

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

libc/src/stdio/printf_core/float_dec_converter.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,8 @@ convert_float_dec_auto(Writer<write_mode> *writer,
11371137
// TODO: unify the float converters to remove the duplicated checks for inf/nan.
11381138

11391139
template <WriteMode write_mode>
1140-
int convert_float_decimal(Writer<write_mode> *writer,
1141-
const FormatSection &to_conv) {
1140+
LIBC_INLINE int convert_float_decimal(Writer<write_mode> *writer,
1141+
const FormatSection &to_conv) {
11421142
if (to_conv.length_modifier == LengthModifier::L) {
11431143
fputil::FPBits<long double>::StorageType float_raw = to_conv.conv_val_raw;
11441144
fputil::FPBits<long double> float_bits(float_raw);
@@ -1159,8 +1159,8 @@ int convert_float_decimal(Writer<write_mode> *writer,
11591159
}
11601160

11611161
template <WriteMode write_mode>
1162-
int convert_float_dec_exp(Writer<write_mode> *writer,
1163-
const FormatSection &to_conv) {
1162+
LIBC_INLINE int convert_float_dec_exp(Writer<write_mode> *writer,
1163+
const FormatSection &to_conv) {
11641164
if (to_conv.length_modifier == LengthModifier::L) {
11651165
fputil::FPBits<long double>::StorageType float_raw = to_conv.conv_val_raw;
11661166
fputil::FPBits<long double> float_bits(float_raw);
@@ -1181,8 +1181,8 @@ int convert_float_dec_exp(Writer<write_mode> *writer,
11811181
}
11821182

11831183
template <WriteMode write_mode>
1184-
int convert_float_dec_auto(Writer<write_mode> *writer,
1185-
const FormatSection &to_conv) {
1184+
LIBC_INLINE int convert_float_dec_auto(Writer<write_mode> *writer,
1185+
const FormatSection &to_conv) {
11861186
if (to_conv.length_modifier == LengthModifier::L) {
11871187
fputil::FPBits<long double>::StorageType float_raw = to_conv.conv_val_raw;
11881188
fputil::FPBits<long double> float_bits(float_raw);

libc/src/stdio/printf_core/float_dec_converter_limited.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,20 +687,20 @@ LIBC_PRINTF_MODULAR_DECL int convert_float_dec_auto(Writer<write_mode> *writer,
687687

688688
#ifdef LIBC_PRINTF_DEFINE_MODULAR
689689
template <WriteMode write_mode>
690-
int convert_float_decimal(Writer<write_mode> *writer,
691-
const FormatSection &to_conv) {
690+
LIBC_INLINE int convert_float_decimal(Writer<write_mode> *writer,
691+
const FormatSection &to_conv) {
692692
return convert_float_outer(writer, to_conv, ConversionType::F);
693693
}
694694

695695
template <WriteMode write_mode>
696-
int convert_float_dec_exp(Writer<write_mode> *writer,
697-
const FormatSection &to_conv) {
696+
LIBC_INLINE int convert_float_dec_exp(Writer<write_mode> *writer,
697+
const FormatSection &to_conv) {
698698
return convert_float_outer(writer, to_conv, ConversionType::E);
699699
}
700700

701701
template <WriteMode write_mode>
702-
int convert_float_dec_auto(Writer<write_mode> *writer,
703-
const FormatSection &to_conv) {
702+
LIBC_INLINE int convert_float_dec_auto(Writer<write_mode> *writer,
703+
const FormatSection &to_conv) {
704704
return convert_float_outer(writer, to_conv, ConversionType::G);
705705
}
706706
#endif

libc/src/stdio/printf_core/float_hex_converter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ LIBC_PRINTF_MODULAR_DECL int convert_float_hex_exp(Writer<write_mode> *writer,
3131

3232
#ifdef LIBC_PRINTF_DEFINE_MODULAR
3333
template <WriteMode write_mode>
34-
int convert_float_hex_exp(Writer<write_mode> *writer,
35-
const FormatSection &to_conv) {
34+
LIBC_INLINE int convert_float_hex_exp(Writer<write_mode> *writer,
35+
const FormatSection &to_conv) {
3636
using LDBits = fputil::FPBits<long double>;
3737
using StorageType = LDBits::StorageType;
3838

libc/src/stdio/printf_core/parser.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,9 @@ template <typename ArgProvider> class Parser {
682682

683683
#ifdef LIBC_PRINTF_DEFINE_MODULAR
684684
template <typename ArgParser>
685-
void Parser<ArgParser>::write_float_arg_val(FormatSection &section,
686-
LengthModifier lm,
687-
size_t conv_index) {
685+
LIBC_INLINE void Parser<ArgParser>::write_float_arg_val(FormatSection &section,
686+
LengthModifier lm,
687+
size_t conv_index) {
688688
if (lm != LengthModifier::L) {
689689
WRITE_ARG_VAL_SIMPLEST(section.conv_val_raw, double, conv_index);
690690
} else {
@@ -693,15 +693,16 @@ void Parser<ArgParser>::write_float_arg_val(FormatSection &section,
693693
}
694694

695695
template <typename ArgParser>
696-
TypeDesc Parser<ArgParser>::float_type_desc(LengthModifier lm) {
696+
LIBC_INLINE TypeDesc Parser<ArgParser>::float_type_desc(LengthModifier lm) {
697697
if (lm != LengthModifier::L)
698698
return type_desc_from_type<double>();
699699
else
700700
return type_desc_from_type<long double>();
701701
}
702702

703703
template <typename ArgParser>
704-
bool Parser<ArgParser>::advance_arg_if_float(TypeDesc cur_type_desc) {
704+
LIBC_INLINE bool
705+
Parser<ArgParser>::advance_arg_if_float(TypeDesc cur_type_desc) {
705706
if (cur_type_desc == type_desc_from_type<double>())
706707
args_cur.template next_var<double>();
707708
else if (cur_type_desc == type_desc_from_type<long double>())

0 commit comments

Comments
 (0)