diff --git a/include/jsoncons/json_encoder.hpp b/include/jsoncons/json_encoder.hpp index da688041c..f83a7d04d 100644 --- a/include/jsoncons/json_encoder.hpp +++ b/include/jsoncons/json_encoder.hpp @@ -329,7 +329,6 @@ namespace detail { Sink sink_; basic_json_encode_options options_; - char_type indent_char_{' '}; jsoncons::write_double fp_; std::vector stack_; @@ -359,7 +358,6 @@ namespace detail { const Allocator& alloc = Allocator()) : sink_(std::forward(sink)), options_(options), - indent_char_(options.indent_char()), fp_(options.float_format(), options.precision()), stack_(alloc) { @@ -1084,14 +1082,7 @@ namespace detail { sink_.append(options_.new_line_chars().data(),options_.new_line_chars().length()); for (int i = 0; i < indent_amount_; ++i) { - if (options_.indent_chars().empty()) - { - sink_.push_back(indent_char_); - } - else - { - sink_.append(options_.indent_chars().data(), options_.indent_chars().length()); - } + sink_.append(options_.indent_chars().data(), options_.indent_chars().length()); } column_ = indent_amount_ * options_.new_line_chars().length(); } @@ -1101,14 +1092,7 @@ namespace detail { sink_.append(options_.new_line_chars().data(),options_.new_line_chars().length()); for (std::size_t i = 0; i < len; ++i) { - if (options_.indent_chars().empty()) - { - sink_.push_back(indent_char_); - } - else - { - sink_.append(options_.indent_chars().data(), options_.indent_chars().length()); - } + sink_.append(options_.indent_chars().data(), options_.indent_chars().length()); } column_ = len; } diff --git a/include/jsoncons/json_options.hpp b/include/jsoncons/json_options.hpp index 523514a3d..44d70f9d9 100644 --- a/include/jsoncons/json_options.hpp +++ b/include/jsoncons/json_options.hpp @@ -339,7 +339,6 @@ class basic_json_encode_options : public virtual basic_json_options_common, basic_json_options& indent_char(char_type value) { - this->indent_char_ = value; + this->indent_chars_ = value; return *this; } diff --git a/include/jsoncons/utility/bigint.hpp b/include/jsoncons/utility/bigint.hpp index d670712b2..9ff8bb09a 100644 --- a/include/jsoncons/utility/bigint.hpp +++ b/include/jsoncons/utility/bigint.hpp @@ -287,6 +287,11 @@ class bigint_storage : private std::allocator_traits:: template rebin ::new (&inlined_) inlined_storage(); } +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + bigint_storage(const bigint_storage& other) : word_allocator_type(other.get_allocator()) { @@ -300,6 +305,10 @@ class bigint_storage : private std::allocator_traits:: template rebin } } +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + bigint_storage(const bigint_storage& other, const Allocator& alloc) : word_allocator_type(alloc) {