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