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
785908ee
Commit
785908ee
authored
Jun 29, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings
parent
fbb70eec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
include/fmt/core.h
include/fmt/core.h
+2
-2
include/fmt/format.h
include/fmt/format.h
+5
-3
No files found.
include/fmt/core.h
View file @
785908ee
...
@@ -2427,7 +2427,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
...
@@ -2427,7 +2427,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
if
(
pbegin
==
pend
)
return
;
if
(
pbegin
==
pend
)
return
;
for
(;;)
{
for
(;;)
{
const
Char
*
p
=
nullptr
;
const
Char
*
p
=
nullptr
;
if
(
!
find
<
IS_CONSTEXPR
>
(
pbegin
,
pend
,
'}'
,
p
))
if
(
!
find
<
IS_CONSTEXPR
>
(
pbegin
,
pend
,
Char
(
'}'
)
,
p
))
return
handler_
.
on_text
(
pbegin
,
pend
);
return
handler_
.
on_text
(
pbegin
,
pend
);
++
p
;
++
p
;
if
(
p
==
pend
||
*
p
!=
'}'
)
if
(
p
==
pend
||
*
p
!=
'}'
)
...
@@ -2442,7 +2442,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
...
@@ -2442,7 +2442,7 @@ FMT_CONSTEXPR FMT_INLINE void parse_format_string(
// Doing two passes with memchr (one for '{' and another for '}') is up to
// Doing two passes with memchr (one for '{' and another for '}') is up to
// 2.5x faster than the naive one-pass implementation on big format strings.
// 2.5x faster than the naive one-pass implementation on big format strings.
const
Char
*
p
=
begin
;
const
Char
*
p
=
begin
;
if
(
*
begin
!=
'{'
&&
!
find
<
IS_CONSTEXPR
>
(
begin
+
1
,
end
,
'{'
,
p
))
if
(
*
begin
!=
'{'
&&
!
find
<
IS_CONSTEXPR
>
(
begin
+
1
,
end
,
Char
(
'{'
)
,
p
))
return
write
(
begin
,
end
);
return
write
(
begin
,
end
);
write
(
begin
,
p
);
write
(
begin
,
p
);
begin
=
parse_replacement_field
(
p
,
end
,
handler
);
begin
=
parse_replacement_field
(
p
,
end
,
handler
);
...
...
include/fmt/format.h
View file @
785908ee
...
@@ -882,8 +882,10 @@ template <typename T = void> struct basic_data {
...
@@ -882,8 +882,10 @@ template <typename T = void> struct basic_data {
FMT_API
static
constexpr
const
char
signs
[
4
]
=
{
0
,
'-'
,
'+'
,
' '
};
FMT_API
static
constexpr
const
char
signs
[
4
]
=
{
0
,
'-'
,
'+'
,
' '
};
FMT_API
static
constexpr
const
unsigned
prefixes
[
4
]
=
{
0
,
0
,
0x1000000u
|
'+'
,
FMT_API
static
constexpr
const
unsigned
prefixes
[
4
]
=
{
0
,
0
,
0x1000000u
|
'+'
,
0x1000000u
|
' '
};
0x1000000u
|
' '
};
FMT_API
static
constexpr
const
char
left_padding_shifts
[
5
]
=
{
31
,
31
,
0
,
1
,
0
};
FMT_API
static
constexpr
const
char
left_padding_shifts
[
5
]
=
{
31
,
31
,
0
,
1
,
FMT_API
static
constexpr
const
char
right_padding_shifts
[
5
]
=
{
0
,
31
,
0
,
1
,
0
};
0
};
FMT_API
static
constexpr
const
char
right_padding_shifts
[
5
]
=
{
0
,
31
,
0
,
1
,
0
};
};
};
#ifdef FMT_SHARED
#ifdef FMT_SHARED
...
@@ -1023,7 +1025,7 @@ template <> inline auto decimal_point(locale_ref loc) -> wchar_t {
...
@@ -1023,7 +1025,7 @@ template <> inline auto decimal_point(locale_ref loc) -> wchar_t {
// Compares two characters for equality.
// Compares two characters for equality.
template
<
typename
Char
>
auto
equal2
(
const
Char
*
lhs
,
const
char
*
rhs
)
->
bool
{
template
<
typename
Char
>
auto
equal2
(
const
Char
*
lhs
,
const
char
*
rhs
)
->
bool
{
return
lhs
[
0
]
==
rhs
[
0
]
&&
lhs
[
1
]
==
rhs
[
1
]
;
return
lhs
[
0
]
==
Char
(
rhs
[
0
])
&&
lhs
[
1
]
==
Char
(
rhs
[
1
])
;
}
}
inline
auto
equal2
(
const
char
*
lhs
,
const
char
*
rhs
)
->
bool
{
inline
auto
equal2
(
const
char
*
lhs
,
const
char
*
rhs
)
->
bool
{
return
memcmp
(
lhs
,
rhs
,
2
)
==
0
;
return
memcmp
(
lhs
,
rhs
,
2
)
==
0
;
...
...
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