mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-26 20:20:04 +00:00
ReportUnknownType -> report_unknown_type (https://github.com/cppformat/cppformat/issues/50)
This commit is contained in:
parent
b498ba0bc5
commit
f634ccb344
12
format.cc
12
format.cc
@ -278,7 +278,7 @@ const uint64_t fmt::internal::POWERS_OF_10_64[] = {
|
||||
ULongLong(1000000000) * ULongLong(1000000000) * 10
|
||||
};
|
||||
|
||||
void fmt::internal::ReportUnknownType(char code, const char *type) {
|
||||
void fmt::internal::report_unknown_type(char code, const char *type) {
|
||||
if (std::isprint(static_cast<unsigned char>(code))) {
|
||||
throw fmt::FormatError(
|
||||
fmt::format("unknown format code '{}' for {}", code, type));
|
||||
@ -466,7 +466,7 @@ class fmt::internal::ArgFormatter :
|
||||
|
||||
void visit_pointer(const void *value) {
|
||||
if (spec_.type_ && spec_.type_ != 'p')
|
||||
fmt::internal::ReportUnknownType(spec_.type_, "pointer");
|
||||
fmt::internal::report_unknown_type(spec_.type_, "pointer");
|
||||
spec_.flags_ = fmt::HASH_FLAG;
|
||||
spec_.type_ = 'x';
|
||||
writer_.write_int(reinterpret_cast<uintptr_t>(value), spec_);
|
||||
@ -522,7 +522,7 @@ void fmt::BasicWriter<Char>::write_double(T value, const FormatSpec &spec) {
|
||||
upper = true;
|
||||
break;
|
||||
default:
|
||||
internal::ReportUnknownType(type, "double");
|
||||
internal::report_unknown_type(type, "double");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -657,7 +657,7 @@ void fmt::BasicWriter<Char>::write_str(
|
||||
// Check if StringChar is convertible to Char.
|
||||
internal::CharTraits<Char>::convert(StringChar());
|
||||
if (spec.type_ && spec.type_ != 's')
|
||||
internal::ReportUnknownType(spec.type_, "string");
|
||||
internal::report_unknown_type(spec.type_, "string");
|
||||
const StringChar *s = str.value;
|
||||
std::size_t size = str.size;
|
||||
if (size == 0) {
|
||||
@ -932,14 +932,14 @@ void fmt::internal::PrintfFormatter<Char>::Format(
|
||||
break;
|
||||
case Arg::POINTER:
|
||||
if (spec.type_ && spec.type_ != 'p')
|
||||
internal::ReportUnknownType(spec.type_, "pointer");
|
||||
internal::report_unknown_type(spec.type_, "pointer");
|
||||
spec.flags_= HASH_FLAG;
|
||||
spec.type_ = 'x';
|
||||
writer.write_int(reinterpret_cast<uintptr_t>(arg.pointer_value), spec);
|
||||
break;
|
||||
case Arg::CUSTOM:
|
||||
if (spec.type_)
|
||||
internal::ReportUnknownType(spec.type_, "object");
|
||||
internal::report_unknown_type(spec.type_, "object");
|
||||
arg.custom.format(&writer, arg.custom.value, "s");
|
||||
break;
|
||||
default:
|
||||
|
4
format.h
4
format.h
@ -426,7 +426,7 @@ struct IsLongDouble { enum {VALUE = 0}; };
|
||||
template <>
|
||||
struct IsLongDouble<long double> { enum {VALUE = 1}; };
|
||||
|
||||
void ReportUnknownType(char code, const char *type);
|
||||
void report_unknown_type(char code, const char *type);
|
||||
|
||||
extern const uint32_t POWERS_OF_10_32[];
|
||||
extern const uint64_t POWERS_OF_10_64[];
|
||||
@ -1675,7 +1675,7 @@ void BasicWriter<Char>::write_int(T value, const Spec &spec) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
internal::ReportUnknownType(
|
||||
internal::report_unknown_type(
|
||||
spec.type(), spec.flag(CHAR_FLAG) ? "char" : "integer");
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user