From 3e2b8ea9ccf6c9068f54c8ba5523abd8a62cb760 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Sat, 3 Mar 2018 12:51:17 -0600 Subject: [PATCH] Minor changes for static analysis (#749) re: #747 --- src/lib_json/json_value.cpp | 2 +- src/lib_json/json_writer.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index a3e6550..1633f49 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -931,7 +931,7 @@ void Value::resize(ArrayIndex newSize) { if (newSize == 0) clear(); else if (newSize > oldSize) - (*this)[newSize - 1]; + this->operator[](newSize - 1); else { for (ArrayIndex index = newSize; index < oldSize; ++index) { value_.map_->erase(index); diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 456424d..5167c31 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -623,7 +623,8 @@ bool StyledWriter::hasCommentForValue(const Value& value) { StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation) : document_(NULL), rightMargin_(74), indentation_(indentation), - addChildValues_() {} + addChildValues_(), indented_(false) +{} void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) { document_ = &out;