Avoid warnings about using uninitialized variable
This commit is contained in:
parent
22611457f9
commit
efaa8a8441
|
@ -146,7 +146,7 @@ void JsonSerializationCodeGenerator::generate(ostream &os) const
|
||||||
os << " pull(static_cast<::" << baseClass->qualifiedName << " &>(reflectable), value, errors);\n";
|
os << " pull(static_cast<::" << baseClass->qualifiedName << " &>(reflectable), value, errors);\n";
|
||||||
}
|
}
|
||||||
os << " // set error context for current record\n"
|
os << " // set error context for current record\n"
|
||||||
" const char *previousRecord;\n"
|
" const char *previousRecord = nullptr;\n"
|
||||||
" if (errors) {\n"
|
" if (errors) {\n"
|
||||||
" previousRecord = errors->currentRecord;\n"
|
" previousRecord = errors->currentRecord;\n"
|
||||||
" errors->currentRecord = \""
|
" errors->currentRecord = \""
|
||||||
|
|
|
@ -936,7 +936,7 @@ inline void pull(Type &reflectable, const char *name, const rapidjson::GenericVa
|
||||||
}
|
}
|
||||||
|
|
||||||
// set error context for current member
|
// set error context for current member
|
||||||
const char *previousMember;
|
const char *previousMember = nullptr;
|
||||||
if (errors) {
|
if (errors) {
|
||||||
previousMember = errors->currentMember;
|
previousMember = errors->currentMember;
|
||||||
errors->currentMember = name;
|
errors->currentMember = name;
|
||||||
|
|
|
@ -112,7 +112,7 @@ template <> inline void push<NestingArray>(const NestingArray &reflectable, Valu
|
||||||
template <>
|
template <>
|
||||||
inline void pull<TestObject>(TestObject &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
inline void pull<TestObject>(TestObject &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
||||||
{
|
{
|
||||||
const char *previousRecord;
|
const char *previousRecord = nullptr;
|
||||||
if (errors) {
|
if (errors) {
|
||||||
previousRecord = errors->currentRecord;
|
previousRecord = errors->currentRecord;
|
||||||
errors->currentRecord = "TestObject";
|
errors->currentRecord = "TestObject";
|
||||||
|
@ -141,7 +141,7 @@ inline void pull<TestObject>(TestObject &reflectable, const GenericValue<UTF8<ch
|
||||||
template <>
|
template <>
|
||||||
inline void pull<NestingObject>(NestingObject &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
inline void pull<NestingObject>(NestingObject &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
||||||
{
|
{
|
||||||
const char *previousRecord;
|
const char *previousRecord = nullptr;
|
||||||
if (errors) {
|
if (errors) {
|
||||||
previousRecord = errors->currentRecord;
|
previousRecord = errors->currentRecord;
|
||||||
errors->currentRecord = "NestingObject";
|
errors->currentRecord = "NestingObject";
|
||||||
|
@ -156,7 +156,7 @@ inline void pull<NestingObject>(NestingObject &reflectable, const GenericValue<U
|
||||||
template <>
|
template <>
|
||||||
inline void pull<NestingArray>(NestingArray &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
inline void pull<NestingArray>(NestingArray &reflectable, const GenericValue<UTF8<char>>::ConstObject &value, JsonDeserializationErrors *errors)
|
||||||
{
|
{
|
||||||
const char *previousRecord;
|
const char *previousRecord = nullptr;
|
||||||
if (errors) {
|
if (errors) {
|
||||||
previousRecord = errors->currentRecord;
|
previousRecord = errors->currentRecord;
|
||||||
errors->currentRecord = "NestingArray";
|
errors->currentRecord = "NestingArray";
|
||||||
|
|
Loading…
Reference in New Issue