Skip to content

Commit 7429bb2

Browse files
hjmjohnsoncdunn2001
authored andcommitted
COMP: Fix type mismatch ambiguity
jsoncpp/src/test_lib_json/main.cpp:354:31: error: implicit conversion changes signedness: 'int' to 'std::__1::vector<Json::Value *, std::__1::allocator<Json::Value *> >::size_type' aka 'unsigned long') [-Werror,-Wsign-conversion] JSONTEST_ASSERT_EQUAL(vec[i], &array[i]); ~~~ ^
1 parent 2eb20a9 commit 7429bb2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test_lib_json/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
350350
JSONTEST_ASSERT_EQUAL(Json::Value("index1"), array[2]);
351351
JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[3]);
352352
// checking address
353-
for (int i = 0; i < 3; i++) {
353+
for (Json::ArrayIndex i = 0; i < 3; i++) {
354354
JSONTEST_ASSERT_EQUAL(vec[i], &array[i]);
355355
}
356356
vec.push_back(&array[3]);
@@ -362,7 +362,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
362362
JSONTEST_ASSERT_EQUAL(Json::Value("index1"), array[3]);
363363
JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[4]);
364364
// checking address
365-
for (int i = 0; i < 4; i++) {
365+
for (Json::ArrayIndex i = 0; i < 4; i++) {
366366
JSONTEST_ASSERT_EQUAL(vec[i], &array[i]);
367367
}
368368
vec.push_back(&array[4]);
@@ -376,7 +376,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
376376
JSONTEST_ASSERT_EQUAL(Json::Value("index2"), array[4]);
377377
JSONTEST_ASSERT_EQUAL(Json::Value("index5"), array[5]);
378378
// checking address
379-
for (int i = 0; i < 5; i++) {
379+
for (Json::ArrayIndex i = 0; i < 5; i++) {
380380
JSONTEST_ASSERT_EQUAL(vec[i], &array[i]);
381381
}
382382
vec.push_back(&array[5]);

0 commit comments

Comments
 (0)