Skip to content

Commit 2eb27b3

Browse files
committed
fixed JSON testsuite errors and warnings with VS2012
1 parent f5351b2 commit 2eb27b3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎JSON/src/Query.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ Var Query::find(const std::string& path) const
101101
{
102102
if ( firstOffset == -1 )
103103
{
104-
firstOffset = matches[0].offset;
104+
firstOffset = static_cast<int>(matches[0].offset);
105105
}
106106
std::string num = token->substr(matches[1].offset, matches[1].length);
107107
indexes.push_back(NumberParser::parse(num));
108-
offset = matches[0].offset + matches[0].length;
108+
offset = static_cast<int>(matches[0].offset + matches[0].length);
109109
}
110110

111111
std::string name(*token);

‎JSON/testsuite/src/JSONTest.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void JSONTest::testStringProperty()
214214
Object::Ptr object = result.extract<Object::Ptr>();
215215
Var test = object->get("test");
216216
assert(test.isString());
217-
std::string value = test;
217+
std::string value = test.convert<std::string>();
218218
assert(value.compare("value") == 0);
219219
}
220220

@@ -360,7 +360,7 @@ void JSONTest::testObjectProperty()
360360

361361
test = object->get("property");
362362
assert(test.isString());
363-
std::string value = test;
363+
std::string value = test.convert<std::string>();
364364
assert(value.compare("value") == 0);
365365
}
366366

@@ -556,7 +556,7 @@ void JSONTest::testStringElement()
556556
Array::Ptr array = result.extract<Array::Ptr>();
557557
Var test = array->get(0);
558558
assert(test.isString());
559-
std::string value = test;
559+
std::string value = test.convert<std::string>();
560560
assert(value.compare("value") == 0);
561561
}
562562

0 commit comments

Comments
 (0)