mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 11:17:35 +02:00
pointer_value -> pointer
This commit is contained in:
@@ -831,7 +831,7 @@ void fmt::internal::PrintfFormatter<Char>::format(
|
|||||||
internal::report_unknown_type(spec.type_, "pointer");
|
internal::report_unknown_type(spec.type_, "pointer");
|
||||||
spec.flags_= HASH_FLAG;
|
spec.flags_= HASH_FLAG;
|
||||||
spec.type_ = 'x';
|
spec.type_ = 'x';
|
||||||
writer.write_int(reinterpret_cast<uintptr_t>(arg.pointer_value), spec);
|
writer.write_int(reinterpret_cast<uintptr_t>(arg.pointer), spec);
|
||||||
break;
|
break;
|
||||||
case Arg::CUSTOM: {
|
case Arg::CUSTOM: {
|
||||||
if (spec.type_)
|
if (spec.type_)
|
||||||
|
8
format.h
8
format.h
@@ -631,7 +631,7 @@ struct Value {
|
|||||||
ULongLong ulong_long_value;
|
ULongLong ulong_long_value;
|
||||||
double double_value;
|
double double_value;
|
||||||
long double long_double_value;
|
long double long_double_value;
|
||||||
const void *pointer_value;
|
const void *pointer;
|
||||||
StringValue<char> string;
|
StringValue<char> string;
|
||||||
StringValue<wchar_t> wstring;
|
StringValue<wchar_t> wstring;
|
||||||
CustomValue custom;
|
CustomValue custom;
|
||||||
@@ -803,8 +803,8 @@ public:
|
|||||||
MakeArg(const std::wstring &value) { set_string(value); }
|
MakeArg(const std::wstring &value) { set_string(value); }
|
||||||
MakeArg(WStringRef value) { set_string(value); }
|
MakeArg(WStringRef value) { set_string(value); }
|
||||||
|
|
||||||
MakeArg(void *value) { pointer_value = value; }
|
MakeArg(void *value) { pointer = value; }
|
||||||
MakeArg(const void *value) { pointer_value = value; }
|
MakeArg(const void *value) { pointer = value; }
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
MakeArg(const T &value) {
|
MakeArg(const T &value) {
|
||||||
@@ -908,7 +908,7 @@ class ArgVisitor {
|
|||||||
case Arg::WSTRING:
|
case Arg::WSTRING:
|
||||||
return FMT_DISPATCH(visit_wstring(arg.wstring));
|
return FMT_DISPATCH(visit_wstring(arg.wstring));
|
||||||
case Arg::POINTER:
|
case Arg::POINTER:
|
||||||
return FMT_DISPATCH(visit_pointer(arg.pointer_value));
|
return FMT_DISPATCH(visit_pointer(arg.pointer));
|
||||||
case Arg::CUSTOM:
|
case Arg::CUSTOM:
|
||||||
return FMT_DISPATCH(visit_custom(arg.custom));
|
return FMT_DISPATCH(visit_custom(arg.custom));
|
||||||
}
|
}
|
||||||
|
@@ -96,7 +96,7 @@ ARG_INFO(LONG_DOUBLE, long double, long_double_value);
|
|||||||
ARG_INFO(CHAR, int, int_value);
|
ARG_INFO(CHAR, int, int_value);
|
||||||
ARG_INFO(STRING, const char *, string.value);
|
ARG_INFO(STRING, const char *, string.value);
|
||||||
ARG_INFO(WSTRING, const wchar_t *, wstring.value);
|
ARG_INFO(WSTRING, const wchar_t *, wstring.value);
|
||||||
ARG_INFO(POINTER, const void *, pointer_value);
|
ARG_INFO(POINTER, const void *, pointer);
|
||||||
ARG_INFO(CUSTOM, Arg::CustomValue, custom);
|
ARG_INFO(CUSTOM, Arg::CustomValue, custom);
|
||||||
|
|
||||||
#define CHECK_ARG_INFO(Type, field, value) { \
|
#define CHECK_ARG_INFO(Type, field, value) { \
|
||||||
@@ -118,7 +118,7 @@ TEST(ArgTest, ArgInfo) {
|
|||||||
const wchar_t WSTR[] = L"abc";
|
const wchar_t WSTR[] = L"abc";
|
||||||
CHECK_ARG_INFO(WSTRING, wstring.value, WSTR);
|
CHECK_ARG_INFO(WSTRING, wstring.value, WSTR);
|
||||||
int p = 0;
|
int p = 0;
|
||||||
CHECK_ARG_INFO(POINTER, pointer_value, &p);
|
CHECK_ARG_INFO(POINTER, pointer, &p);
|
||||||
Value value = {};
|
Value value = {};
|
||||||
value.custom.value = &p;
|
value.custom.value = &p;
|
||||||
EXPECT_EQ(&p, ArgInfo<Arg::CUSTOM>::get(value).value);
|
EXPECT_EQ(&p, ArgInfo<Arg::CUSTOM>::get(value).value);
|
||||||
|
Reference in New Issue
Block a user