Fixed warning "maybe uninitialized" (issue #909)

This commit is contained in:
Benoit Blanchon
2019-02-28 12:20:46 +01:00
parent f483b06735
commit 5c297ba4a2
3 changed files with 9 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ inline JsonVariant::JsonVariant(const JsonArray &array) {
_content.asArray = const_cast<JsonArray *>(&array);
} else {
_type = Internals::JSON_UNDEFINED;
_content.asArray = 0; // <- prevent warning 'maybe-uninitialized'
}
}
@@ -32,6 +33,7 @@ inline JsonVariant::JsonVariant(const JsonObject &object) {
_content.asObject = const_cast<JsonObject *>(&object);
} else {
_type = Internals::JSON_UNDEFINED;
_content.asObject = 0; // <- prevent warning 'maybe-uninitialized'
}
}