mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
STYLE: Use default member initialization
Converts a default constructor’s member initializers into the new default member initializers in C++11. Other member initializers that match the default member initializer are removed. This can reduce repeated code or allow use of ‘= default’. SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/ run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-default-member-init -header-filter=.* -fix
This commit is contained in:

committed by
Hans Johnson

parent
b5093e8122
commit
e817e4fc25
@@ -630,7 +630,7 @@ private:
|
||||
|
||||
void setComment(const char* text, size_t len);
|
||||
|
||||
char* comment_;
|
||||
char* comment_{nullptr};
|
||||
};
|
||||
|
||||
// struct MemberNamesTransform
|
||||
@@ -678,8 +678,8 @@ public:
|
||||
private:
|
||||
enum Kind { kindNone = 0, kindIndex, kindKey };
|
||||
JSONCPP_STRING key_;
|
||||
ArrayIndex index_;
|
||||
Kind kind_;
|
||||
ArrayIndex index_{};
|
||||
Kind kind_{kindNone};
|
||||
};
|
||||
|
||||
/** \brief Experimental and untested: represents a "path" to access a node.
|
||||
@@ -780,7 +780,7 @@ protected:
|
||||
private:
|
||||
Value::ObjectValues::iterator current_;
|
||||
// Indicates that iterator is for a null value.
|
||||
bool isNull_;
|
||||
bool isNull_{true};
|
||||
|
||||
public:
|
||||
// For some reason, BORLAND needs these at the end, rather
|
||||
|
Reference in New Issue
Block a user