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
e3ebf366
Commit
e3ebf366
authored
Sep 06, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline padding shifts
parent
894faf3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
9 deletions
+1
-9
include/fmt/format-inl.h
include/fmt/format-inl.h
+0
-3
include/fmt/format.h
include/fmt/format.h
+1
-6
No files found.
include/fmt/format-inl.h
View file @
e3ebf366
...
...
@@ -150,9 +150,6 @@ template <typename T> constexpr const char basic_data<T>::digits[][2];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
hex_digits
[];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
signs
[];
template
<
typename
T
>
constexpr
const
unsigned
basic_data
<
T
>::
prefixes
[];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
left_padding_shifts
[];
template
<
typename
T
>
constexpr
const
char
basic_data
<
T
>::
right_padding_shifts
[];
#endif
template
<
typename
T
>
struct
bits
{
...
...
include/fmt/format.h
View file @
e3ebf366
...
...
@@ -916,10 +916,6 @@ template <typename T = void> struct basic_data {
FMT_API
static
constexpr
const
char
signs
[
4
]
=
{
0
,
'-'
,
'+'
,
' '
};
FMT_API
static
constexpr
const
unsigned
prefixes
[
4
]
=
{
0
,
0
,
0x1000000u
|
'+'
,
0x1000000u
|
' '
};
FMT_API
static
constexpr
const
char
left_padding_shifts
[
5
]
=
{
31
,
31
,
0
,
1
,
0
};
FMT_API
static
constexpr
const
char
right_padding_shifts
[
5
]
=
{
0
,
31
,
0
,
1
,
0
};
};
#ifdef FMT_SHARED
...
...
@@ -1328,8 +1324,7 @@ FMT_CONSTEXPR auto write_padded(OutputIt out,
static_assert
(
align
==
align
::
left
||
align
==
align
::
right
,
""
);
unsigned
spec_width
=
to_unsigned
(
specs
.
width
);
size_t
padding
=
spec_width
>
width
?
spec_width
-
width
:
0
;
auto
*
shifts
=
align
==
align
::
left
?
data
::
left_padding_shifts
:
data
::
right_padding_shifts
;
auto
*
shifts
=
align
==
align
::
left
?
"
\x1f\x1f\x00\x01
"
:
"
\x00\x1f\x00\x01
"
;
size_t
left_padding
=
padding
>>
shifts
[
specs
.
align
];
size_t
right_padding
=
padding
-
left_padding
;
auto
it
=
reserve
(
out
,
size
+
padding
*
specs
.
fill
.
size
());
...
...
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