Skip to content

Commit

Permalink
Merge 319842e into 45733df
Browse files Browse the repository at this point in the history
  • Loading branch information
Troels51 committed Sep 14, 2020
2 parents 45733df + 319842e commit 0279c20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/json/allocator.h
Expand Up @@ -38,7 +38,7 @@ template <typename T> class SecureAllocator {
* The pointer argument is tagged as "volatile" to prevent the
* compiler optimizing out this critical step.
*/
void deallocate(volatile pointer p, size_type n) {
void deallocate(pointer p, size_type n) {
std::memset(p, 0, n * sizeof(T));
// free using "global operator delete"
::operator delete(p);
Expand Down
12 changes: 6 additions & 6 deletions src/test_lib_json/main.cpp
Expand Up @@ -1817,7 +1817,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, StaticString) {

JSONTEST_FIXTURE_LOCAL(ValueTest, WideString) {
// https://github.com/open-source-parsers/jsoncpp/issues/756
const std::string uni = u8"\u5f0f\uff0c\u8fdb"; // "式,进"
const std::string uni = reinterpret_cast<const char*>(u8"\u5f0f\uff0c\u8fdb"); // "式,进"
std::string styled;
{
Json::Value v;
Expand Down Expand Up @@ -2905,8 +2905,8 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, strictModeParseNumber) {
}

JSONTEST_FIXTURE_LOCAL(ReaderTest, parseChineseWithOneError) {
checkParse(R"({ "pr)"
u8"\u4f50\u85e4" // 佐藤
checkParse(R"({ "pr)" +
std::string(reinterpret_cast<const char*>(u8"\u4f50\u85e4")) + // 佐藤
R"(erty" :: "value" })",
{{18, 19, "Syntax error: value, object or array expected."}},
"* Line 1, Column 19\n Syntax error: value, object or array "
Expand Down Expand Up @@ -3008,7 +3008,7 @@ JSONTEST_FIXTURE_LOCAL(CharReaderTest, parseString) {
bool ok = reader->parse(doc, doc + std::strlen(doc), &root, &errs);
JSONTEST_ASSERT(ok);
JSONTEST_ASSERT(errs.empty());
JSONTEST_ASSERT_EQUAL(u8"\u8A2a", root[0].asString()); // "訪"
JSONTEST_ASSERT_EQUAL((const char*)u8"\u8A2a", root[0].asString()); // "訪"
}
{
char const doc[] = R"([ "\uD801" ])";
Expand Down Expand Up @@ -3373,7 +3373,7 @@ struct CharReaderAllowDropNullTest : JsonTest::TestCase {
Value emptyArray = Value{Json::arrayValue};

ValueCheck checkEq(const Value& v) {
return [=](const Value& root) { JSONTEST_ASSERT_EQUAL(root, v); };
return [=, this](const Value& root) { JSONTEST_ASSERT_EQUAL(root, v); };
}

static ValueCheck objGetAnd(std::string idx, ValueCheck f) {
Expand Down Expand Up @@ -3724,7 +3724,7 @@ JSONTEST_FIXTURE_LOCAL(IteratorTest, reverseIterator) {
using Iter = decltype(json.begin());
auto re = std::reverse_iterator<Iter>(json.begin());
for (auto it = std::reverse_iterator<Iter>(json.end()); it != re; ++it) {
values.push_back(it->asString());
values.push_back((*it).asString());
}
JSONTEST_ASSERT((values == std::vector<std::string>{"b", "a"}));
}
Expand Down

0 comments on commit 0279c20

Please sign in to comment.