Fix different names for parameters in declaration and definition

This commit is contained in:
Marian Klymov
2018-06-02 20:15:26 +03:00
parent 091e03979d
commit fc20134c92
5 changed files with 57 additions and 57 deletions

View File

@@ -241,15 +241,15 @@ void Value::CommentInfo::setComment(const char* text, size_t len) {
// Notes: policy_ indicates if the string was allocated when
// a string is stored.
Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}
Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}
Value::CZString::CZString(char const* str,
unsigned ulength,
unsigned length,
DuplicationPolicy allocate)
: cstr_(str) {
// allocate != duplicate
storage_.policy_ = allocate & 0x3;
storage_.length_ = ulength & 0x3FFFFFFF;
storage_.length_ = length & 0x3FFFFFFF;
}
Value::CZString::CZString(const CZString& other) {
@@ -357,10 +357,10 @@ bool Value::CZString::isStaticString() const {
* memset( this, 0, sizeof(Value) )
* This optimization is used in ValueInternalMap fast allocator.
*/
Value::Value(ValueType vtype) {
Value::Value(ValueType type) {
static char const emptyString[] = "";
initBasic(vtype);
switch (vtype) {
initBasic(type);
switch (type) {
case nullValue:
break;
case intValue:
@@ -418,10 +418,10 @@ Value::Value(const char* value) {
value, static_cast<unsigned>(strlen(value)));
}
Value::Value(const char* beginValue, const char* endValue) {
Value::Value(const char* begin, const char* end) {
initBasic(stringValue, true);
value_.string_ = duplicateAndPrefixStringValue(
beginValue, static_cast<unsigned>(endValue - beginValue));
begin, static_cast<unsigned>(end - begin));
}
Value::Value(const JSONCPP_STRING& value) {
@@ -645,14 +645,14 @@ unsigned Value::getCStringLength() const {
}
#endif
bool Value::getString(char const** str, char const** cend) const {
bool Value::getString(char const** begin, char const** end) const {
if (type_ != stringValue)
return false;
if (value_.string_ == 0)
return false;
unsigned length;
decodePrefixedString(this->allocated_, this->value_.string_, &length, str);
*cend = *str + length;
decodePrefixedString(this->allocated_, this->value_.string_, &length, begin);
*end = *begin + length;
return true;
}
@@ -1003,8 +1003,8 @@ const Value& Value::operator[](int index) const {
return (*this)[ArrayIndex(index)];
}
void Value::initBasic(ValueType vtype, bool allocated) {
type_ = vtype;
void Value::initBasic(ValueType type, bool allocated) {
type_ = type;
allocated_ = allocated;
comments_ = 0;
start_ = 0;
@@ -1101,13 +1101,13 @@ Value& Value::resolveReference(const char* key) {
}
// @param key is not null-terminated.
Value& Value::resolveReference(char const* key, char const* cend) {
Value& Value::resolveReference(char const* key, char const* end) {
JSON_ASSERT_MESSAGE(
type_ == nullValue || type_ == objectValue,
"in Json::Value::resolveReference(key, end): requires objectValue");
if (type_ == nullValue)
*this = Value(objectValue);
CZString actualKey(key, static_cast<unsigned>(cend - key),
CZString actualKey(key, static_cast<unsigned>(end - key),
CZString::duplicateOnCopy);
ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
if (it != value_.map_->end() && (*it).first == actualKey)
@@ -1126,13 +1126,13 @@ Value Value::get(ArrayIndex index, const Value& defaultValue) const {
bool Value::isValidIndex(ArrayIndex index) const { return index < size(); }
Value const* Value::find(char const* key, char const* cend) const {
Value const* Value::find(char const* begin, char const* end) const {
JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
"in Json::Value::find(key, end, found): requires "
"objectValue or nullValue");
if (type_ == nullValue)
return NULL;
CZString actualKey(key, static_cast<unsigned>(cend - key),
CZString actualKey(begin, static_cast<unsigned>(end - begin),
CZString::noDuplication);
ObjectValues::const_iterator it = value_.map_->find(actualKey);
if (it == value_.map_->end())
@@ -1184,10 +1184,10 @@ Value& Value::append(Value&& value) {
}
#endif
Value Value::get(char const* key,
char const* cend,
Value Value::get(char const* begin,
char const* end,
Value const& defaultValue) const {
Value const* found = find(key, cend);
Value const* found = find(begin, end);
return !found ? defaultValue : *found;
}
Value Value::get(char const* key, Value const& defaultValue) const {
@@ -1197,11 +1197,11 @@ Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const {
return get(key.data(), key.data() + key.length(), defaultValue);
}
bool Value::removeMember(const char* key, const char* cend, Value* removed) {
bool Value::removeMember(const char* begin, const char* end, Value* removed) {
if (type_ != objectValue) {
return false;
}
CZString actualKey(key, static_cast<unsigned>(cend - key),
CZString actualKey(begin, static_cast<unsigned>(end - begin),
CZString::noDuplication);
ObjectValues::iterator it = value_.map_->find(actualKey);
if (it == value_.map_->end())
@@ -1264,8 +1264,8 @@ Value Value::get(const CppTL::ConstString& key,
}
#endif
bool Value::isMember(char const* key, char const* cend) const {
Value const* value = find(key, cend);
bool Value::isMember(char const* begin, char const* end) const {
Value const* value = find(begin, end);
return NULL != value;
}
bool Value::isMember(char const* key) const {