Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
acd1811c
Commit
acd1811c
authored
Dec 30, 2016
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Value -> value
parent
42a31907
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
fmt/format.h
fmt/format.h
+8
-8
test/util-test.cc
test/util-test.cc
+2
-2
No files found.
fmt/format.h
View file @
acd1811c
...
...
@@ -1099,7 +1099,7 @@ struct CustomValue {
// A formatting argument value.
template
<
typename
Context
>
struct
V
alue
{
struct
v
alue
{
union
{
int
int_value
;
unsigned
uint_value
;
...
...
@@ -1177,7 +1177,7 @@ constexpr Type type() { return gettype<typename std::decay<T>::type>(); }
// Makes a format_arg object from any type.
template
<
typename
Context
>
class
MakeValue
:
public
V
alue
<
Context
>
{
class
MakeValue
:
public
v
alue
<
Context
>
{
public:
typedef
typename
Context
::
char_type
Char
;
...
...
@@ -1347,7 +1347,7 @@ class basic_format_args;
template
<
typename
Context
>
class
basic_format_arg
{
private:
internal
::
V
alue
<
Context
>
value_
;
internal
::
v
alue
<
Context
>
value_
;
internal
::
Type
type_
;
template
<
typename
ContextType
,
typename
T
>
...
...
@@ -1514,7 +1514,7 @@ constexpr uint64_t make_type<void>() { return 0; }
enum
{
MAX_PACKED_ARGS
=
16
};
template
<
bool
IS_PACKED
,
typename
Context
,
typename
T
>
inline
typename
std
::
enable_if
<
IS_PACKED
,
V
alue
<
Context
>>::
type
inline
typename
std
::
enable_if
<
IS_PACKED
,
v
alue
<
Context
>>::
type
make_arg
(
const
T
&
value
)
{
return
MakeValue
<
Context
>
(
value
);
}
...
...
@@ -1537,7 +1537,7 @@ class format_arg_store {
typedef
typename
Context
::
char_type
char_type
;
typedef
typename
std
::
conditional
<
IS_PACKED
,
internal
::
V
alue
<
Context
>
,
basic_format_arg
<
Context
>>::
type
value_type
;
internal
::
v
alue
<
Context
>
,
basic_format_arg
<
Context
>>::
type
value_type
;
// If the arguments are not packed, add one more element to mark the end.
typedef
std
::
array
<
value_type
,
NUM_ARGS
+
(
IS_PACKED
?
0
:
1
)
>
Array
;
...
...
@@ -1581,7 +1581,7 @@ class basic_format_args {
// This is done to reduce compiled code size as storing larger objects
// may require more code (at least on x86-64) even if the same amount of
// data is actually copied to stack. It saves ~10% on the bloat test.
const
internal
::
V
alue
<
Context
>
*
values_
;
const
internal
::
v
alue
<
Context
>
*
values_
;
const
format_arg
*
args_
;
};
...
...
@@ -1594,7 +1594,7 @@ class basic_format_args {
friend
class
internal
::
ArgMap
<
Context
>
;
void
set_data
(
const
internal
::
V
alue
<
Context
>
*
values
)
{
values_
=
values
;
}
void
set_data
(
const
internal
::
v
alue
<
Context
>
*
values
)
{
values_
=
values
;
}
void
set_data
(
const
format_arg
*
args
)
{
args_
=
args
;
}
format_arg
get
(
size_type
index
)
const
{
...
...
@@ -1602,7 +1602,7 @@ class basic_format_args {
bool
use_values
=
type
(
internal
::
MAX_PACKED_ARGS
-
1
)
==
internal
::
NONE
;
if
(
index
<
internal
::
MAX_PACKED_ARGS
)
{
typename
internal
::
Type
arg_type
=
type
(
index
);
internal
::
V
alue
<
Context
>
&
val
=
arg
.
value_
;
internal
::
v
alue
<
Context
>
&
val
=
arg
.
value_
;
if
(
arg_type
!=
internal
::
NONE
)
val
=
use_values
?
values_
[
index
]
:
args_
[
index
].
value_
;
arg
.
type_
=
arg_type
;
...
...
test/util-test.cc
View file @
acd1811c
...
...
@@ -57,7 +57,7 @@ using fmt::format_arg;
using
fmt
::
Buffer
;
using
fmt
::
StringRef
;
using
fmt
::
internal
::
MemoryBuffer
;
using
fmt
::
internal
::
V
alue
;
using
fmt
::
internal
::
v
alue
;
using
testing
::
_
;
using
testing
::
Return
;
...
...
@@ -423,7 +423,7 @@ void format_value(fmt::Writer &, const Test &, CustomContext &ctx) {
TEST
(
UtilTest
,
MakeValueWithCustomFormatter
)
{
::
Test
t
;
fmt
::
internal
::
V
alue
<
CustomContext
>
arg
=
fmt
::
internal
::
v
alue
<
CustomContext
>
arg
=
fmt
::
internal
::
MakeValue
<
CustomContext
>
(
t
);
CustomContext
ctx
=
{
false
};
fmt
::
MemoryWriter
w
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment