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
24d66c5d
Commit
24d66c5d
authored
Feb 14, 2018
by
Alex Alabuzhev
Committed by
Victor Zverovich
Feb 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compilation fix & warnings
parent
229887bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
include/fmt/core.h
include/fmt/core.h
+6
-9
include/fmt/format.h
include/fmt/format.h
+13
-7
No files found.
include/fmt/core.h
View file @
24d66c5d
...
@@ -346,7 +346,7 @@ class container_buffer : public basic_buffer<typename Container::value_type> {
...
@@ -346,7 +346,7 @@ class container_buffer : public basic_buffer<typename Container::value_type> {
Container
&
container_
;
Container
&
container_
;
protected:
protected:
v
irtual
void
grow
(
std
::
size_t
capacity
)
{
v
oid
grow
(
std
::
size_t
capacity
)
FMT_OVERRIDE
{
container_
.
resize
(
capacity
);
container_
.
resize
(
capacity
);
this
->
set
(
&
container_
[
0
],
capacity
);
this
->
set
(
&
container_
[
0
],
capacity
);
}
}
...
@@ -801,10 +801,10 @@ class context_base {
...
@@ -801,10 +801,10 @@ class context_base {
// Extracts a reference to the container from back_insert_iterator.
// Extracts a reference to the container from back_insert_iterator.
template
<
typename
Container
>
template
<
typename
Container
>
inline
Container
&
get_container
(
std
::
back_insert_iterator
<
Container
>
it
)
{
inline
Container
&
get_container
(
std
::
back_insert_iterator
<
Container
>
it
)
{
typedef
std
::
back_insert_iterator
<
Container
>
iterator
;
typedef
std
::
back_insert_iterator
<
Container
>
bi_
iterator
;
struct
accessor
:
iterator
{
struct
accessor
:
bi_
iterator
{
accessor
(
iterator
it
)
:
iterator
(
it
)
{}
accessor
(
bi_iterator
it
)
:
bi_
iterator
(
it
)
{}
using
iterator
::
container
;
using
bi_
iterator
::
container
;
};
};
return
*
accessor
(
it
).
container
;
return
*
accessor
(
it
).
container
;
}
}
...
@@ -865,11 +865,8 @@ typedef buffer_context<wchar_t>::type wcontext;
...
@@ -865,11 +865,8 @@ typedef buffer_context<wchar_t>::type wcontext;
namespace
internal
{
namespace
internal
{
template
<
typename
Context
,
typename
T
>
template
<
typename
Context
,
typename
T
>
class
get_type
{
class
get_type
{
private:
static
const
T
&
val
();
public:
public:
typedef
decltype
(
make_value
<
Context
>
(
val
()))
value_type
;
typedef
decltype
(
make_value
<
Context
>
(
std
::
declval
<
typename
std
::
decay
<
T
>::
type
&>
()))
value_type
;
static
const
type
value
=
value_type
::
type_tag
;
static
const
type
value
=
value_type
::
type_tag
;
};
};
...
...
include/fmt/format.h
View file @
24d66c5d
...
@@ -382,7 +382,7 @@ class basic_memory_buffer: private Allocator, public internal::basic_buffer<T> {
...
@@ -382,7 +382,7 @@ class basic_memory_buffer: private Allocator, public internal::basic_buffer<T> {
}
}
protected:
protected:
void
grow
(
std
::
size_t
size
);
void
grow
(
std
::
size_t
size
)
FMT_OVERRIDE
;
public:
public:
explicit
basic_memory_buffer
(
const
Allocator
&
alloc
=
Allocator
())
explicit
basic_memory_buffer
(
const
Allocator
&
alloc
=
Allocator
())
...
@@ -494,7 +494,7 @@ class basic_fixed_buffer : public internal::basic_buffer<Char> {
...
@@ -494,7 +494,7 @@ class basic_fixed_buffer : public internal::basic_buffer<Char> {
}
}
protected:
protected:
FMT_API
void
grow
(
std
::
size_t
size
);
FMT_API
void
grow
(
std
::
size_t
size
)
FMT_OVERRIDE
;
};
};
namespace
internal
{
namespace
internal
{
...
@@ -567,7 +567,7 @@ template <typename Char>
...
@@ -567,7 +567,7 @@ template <typename Char>
class
null_terminating_iterator
;
class
null_terminating_iterator
;
template
<
typename
Char
>
template
<
typename
Char
>
FMT_CONSTEXPR
const
Char
*
pointer_from
(
null_terminating_iterator
<
Char
>
it
);
FMT_CONSTEXPR
_DECL
const
Char
*
pointer_from
(
null_terminating_iterator
<
Char
>
it
);
// An iterator that produces a null terminator on *end. This simplifies parsing
// An iterator that produces a null terminator on *end. This simplifies parsing
// and allows comparing the performance of processing a null-terminated string
// and allows comparing the performance of processing a null-terminated string
...
@@ -642,7 +642,13 @@ class null_terminating_iterator {
...
@@ -642,7 +642,13 @@ class null_terminating_iterator {
return
ptr_
>=
other
.
ptr_
;
return
ptr_
>=
other
.
ptr_
;
}
}
// 'fmt::internal::pointer_from': the inline specifier cannot be used
// when a friend declaration refers to a specialization of a function
// pointer_from is defined with the inline specifier, but declared without,
// so this looks like a bug in the compiler.
friend
FMT_CONSTEXPR_DECL
const
Char
*
pointer_from
<
Char
>
(
friend
FMT_CONSTEXPR_DECL
const
Char
*
pointer_from
<
Char
>
(
# pragma warning(suppress: 4396)
null_terminating_iterator
it
);
null_terminating_iterator
it
);
private:
private:
...
@@ -1360,7 +1366,7 @@ class arg_formatter_base {
...
@@ -1360,7 +1366,7 @@ class arg_formatter_base {
}
}
void
write
(
const
char_type
*
value
)
{
void
write
(
const
char_type
*
value
)
{
auto
length
=
value
!=
0
?
std
::
char_traits
<
char_type
>::
length
(
value
)
:
0
;
auto
length
=
value
!=
FMT_NULL
?
std
::
char_traits
<
char_type
>::
length
(
value
)
:
0
;
writer_
.
write_str
(
basic_string_view
<
char_type
>
(
value
,
length
),
specs_
);
writer_
.
write_str
(
basic_string_view
<
char_type
>
(
value
,
length
),
specs_
);
}
}
...
@@ -2220,7 +2226,7 @@ class basic_writer {
...
@@ -2220,7 +2226,7 @@ class basic_writer {
struct
padded_int_writer
{
struct
padded_int_writer
{
string_view
prefix
;
string_view
prefix
;
wchar_t
fill
;
wchar_t
fill
;
unsigned
padding
;
std
::
size_t
padding
;
F
f
;
F
f
;
template
<
typename
It
>
template
<
typename
It
>
...
@@ -2238,9 +2244,9 @@ class basic_writer {
...
@@ -2238,9 +2244,9 @@ class basic_writer {
template
<
typename
Spec
,
typename
F
>
template
<
typename
Spec
,
typename
F
>
void
write_int
(
unsigned
num_digits
,
string_view
prefix
,
void
write_int
(
unsigned
num_digits
,
string_view
prefix
,
const
Spec
&
spec
,
F
f
)
{
const
Spec
&
spec
,
F
f
)
{
unsigned
size
=
prefix
.
size
()
+
num_digits
;
std
::
size_t
size
=
prefix
.
size
()
+
num_digits
;
auto
fill
=
spec
.
fill
();
auto
fill
=
spec
.
fill
();
unsigned
padding
=
0
;
std
::
size_t
padding
=
0
;
if
(
spec
.
align
()
==
ALIGN_NUMERIC
)
{
if
(
spec
.
align
()
==
ALIGN_NUMERIC
)
{
if
(
spec
.
width
()
>
size
)
{
if
(
spec
.
width
()
>
size
)
{
padding
=
spec
.
width
()
-
size
;
padding
=
spec
.
width
()
-
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