Fix uninitialized members
This commit is contained in:
parent
fda7611caf
commit
ec6dfd4811
@ -223,7 +223,7 @@ class basic_buffer {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Don't initialize ptr_ since it is not accessed to save a few cycles.
|
// Don't initialize ptr_ since it is not accessed to save a few cycles.
|
||||||
basic_buffer(std::size_t sz) FMT_NOEXCEPT: size_(sz), capacity_(sz) {}
|
basic_buffer(std::size_t sz) FMT_NOEXCEPT: ptr_(FMT_NULL), size_(sz), capacity_(sz) {}
|
||||||
|
|
||||||
basic_buffer(T *p = FMT_NULL, std::size_t sz = 0, std::size_t cap = 0)
|
basic_buffer(T *p = FMT_NULL, std::size_t sz = 0, std::size_t cap = 0)
|
||||||
FMT_NOEXCEPT: ptr_(p), size_(sz), capacity_(cap) {}
|
FMT_NOEXCEPT: ptr_(p), size_(sz), capacity_(cap) {}
|
||||||
@ -1328,7 +1328,9 @@ struct named_arg_base {
|
|||||||
mutable char data[
|
mutable char data[
|
||||||
sizeof(basic_format_arg<typename buffer_context<Char>::type>)];
|
sizeof(basic_format_arg<typename buffer_context<Char>::type>)];
|
||||||
|
|
||||||
named_arg_base(basic_string_view<Char> nm) : name(nm) {}
|
named_arg_base(basic_string_view<Char> nm) : name(nm) {
|
||||||
|
std::memset(data, 0, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Context>
|
template <typename Context>
|
||||||
basic_format_arg<Context> deserialize() const {
|
basic_format_arg<Context> deserialize() const {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user