Skip to content

Commit d34479e

Browse files
committed
Issue 920: Fix android build with casting fix
This patch removes an unchecked conversion from a 64bit wide type to a 32bit wide type, fixing a compile error on some platforms. Issue:920
1 parent dd6921f commit d34479e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib_json/json_reader.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,11 +1905,10 @@ CharReader* CharReaderBuilder::newCharReader() const {
19051905
settings_["allowDroppedNullPlaceholders"].asBool();
19061906
features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
19071907
features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
1908-
#if defined(JSON_HAS_INT64)
1909-
features.stackLimit_ = settings_["stackLimit"].asUInt64();
1910-
#else
1911-
features.stackLimit_ = settings_["stackLimit"].asUInt();
1912-
#endif
1908+
1909+
// Stack limit is always a size_t, so we get this as an unsigned int
1910+
// regardless of it we have 64-bit integer support enabled.
1911+
features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt());
19131912
features.failIfExtra_ = settings_["failIfExtra"].asBool();
19141913
features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
19151914
features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();

0 commit comments

Comments
 (0)