Repository: lucy Updated Branches: refs/heads/master a26954e8e -> 4677247ce
Make straightforward int type adjustments. Either cast or change types to quiet -Wconversion warnings. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/882fbc1e Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/882fbc1e Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/882fbc1e Branch: refs/heads/master Commit: 882fbc1e9e0006e79d4eaaacef8f30444e88c924 Parents: 641449d Author: Marvin Humphrey <[email protected]> Authored: Tue Apr 26 18:05:44 2016 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Tue Apr 26 18:20:29 2016 -0700 ---------------------------------------------------------------------- core/Lucy/Test/Analysis/TestNormalizer.c | 2 +- core/Lucy/Test/Index/TestPolyReader.c | 8 ++++---- core/Lucy/Test/Search/TestSeriesMatcher.c | 2 +- core/Lucy/Test/Store/TestIOPrimitives.c | 6 +++--- core/Lucy/Test/Store/TestInStream.c | 2 +- core/Lucy/Test/Util/TestSortExternal.c | 20 ++++++++++---------- 6 files changed, 20 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Analysis/TestNormalizer.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Analysis/TestNormalizer.c b/core/Lucy/Test/Analysis/TestNormalizer.c index 2323c2e..6bb0fb7 100644 --- a/core/Lucy/Test/Analysis/TestNormalizer.c +++ b/core/Lucy/Test/Analysis/TestNormalizer.c @@ -156,7 +156,7 @@ test_utf8proc_normalization(TestBatchRunner *runner) { // Normalize again. size_t normalized_len = strlen((char*)normalized); uint8_t *dupe; - int32_t dupe_check = utf8proc_map(normalized, normalized_len, &dupe, + int32_t dupe_check = utf8proc_map(normalized, (ssize_t)normalized_len, &dupe, UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_COMPAT | http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Index/TestPolyReader.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Index/TestPolyReader.c b/core/Lucy/Test/Index/TestPolyReader.c index 91ebd98..e8b8a67 100644 --- a/core/Lucy/Test/Index/TestPolyReader.c +++ b/core/Lucy/Test/Index/TestPolyReader.c @@ -30,15 +30,15 @@ TestPolyReader_new() { static void test_sub_tick(TestBatchRunner *runner) { - size_t num_segs = 255; + uint32_t num_segs = 255; int32_t *ints = (int32_t*)MALLOCATE(num_segs * sizeof(int32_t)); - size_t i; + uint32_t i; for (i = 0; i < num_segs; i++) { - ints[i] = i; + ints[i] = (int32_t)i; } I32Array *offsets = I32Arr_new(ints, num_segs); for (i = 1; i < num_segs; i++) { - if (PolyReader_sub_tick(offsets, i) != i - 1) { break; } + if (PolyReader_sub_tick(offsets, (int32_t)i) != i - 1) { break; } } TEST_UINT_EQ(runner, i, num_segs, "got all sub_tick() calls right"); DECREF(offsets); http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Search/TestSeriesMatcher.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Search/TestSeriesMatcher.c b/core/Lucy/Test/Search/TestSeriesMatcher.c index 0fd0ae6..bdd2e78 100644 --- a/core/Lucy/Test/Search/TestSeriesMatcher.c +++ b/core/Lucy/Test/Search/TestSeriesMatcher.c @@ -61,7 +61,7 @@ S_make_series_matcher(I32Array *doc_ids, I32Array *offsets, int32_t doc_max) { static I32Array* S_generate_match_list(int32_t first, int32_t max, int32_t doc_inc) { int32_t count = (max - first + doc_inc - 1) / doc_inc; - int32_t *doc_ids = (int32_t*)MALLOCATE(count * sizeof(int32_t)); + int32_t *doc_ids = (int32_t*)MALLOCATE((size_t)count * sizeof(int32_t)); int32_t doc_id = first; int32_t i = 0; http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Store/TestIOPrimitives.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Store/TestIOPrimitives.c b/core/Lucy/Test/Store/TestIOPrimitives.c index 9b78e82..e7d32f2 100644 --- a/core/Lucy/Test/Store/TestIOPrimitives.c +++ b/core/Lucy/Test/Store/TestIOPrimitives.c @@ -48,7 +48,7 @@ test_i8(TestBatchRunner *runner) { int i; for (i = -128; i < 128; i++) { - OutStream_Write_I8(outstream, i); + OutStream_Write_I8(outstream, (int8_t)i); } OutStream_Close(outstream); @@ -72,7 +72,7 @@ test_u8(TestBatchRunner *runner) { int i; for (i = 0; i < 256; i++) { - OutStream_Write_U8(outstream, i); + OutStream_Write_U8(outstream, (uint8_t)i); } OutStream_Close(outstream); @@ -398,7 +398,7 @@ test_cu64(TestBatchRunner *runner) { for (i = 0; i < 1000; i++) { char buffer[10]; const char *buf = buffer; - size_t size = InStream_Read_Raw_C64(raw_instream, buffer); + int size = InStream_Read_Raw_C64(raw_instream, buffer); uint64_t got = NumUtil_decode_cu64(&buf); UNUSED_VAR(size); if (got != ints[i]) { http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Store/TestInStream.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Store/TestInStream.c b/core/Lucy/Test/Store/TestInStream.c index 3aaf42d..c32f985 100644 --- a/core/Lucy/Test/Store/TestInStream.c +++ b/core/Lucy/Test/Store/TestInStream.c @@ -104,7 +104,7 @@ test_Clone_and_Reopen(TestBatchRunner *runner) { InStream *clone; InStream *reopened; - for (uint32_t i = 0; i < 26; i++) { + for (uint8_t i = 0; i < 26; i++) { OutStream_Write_U8(outstream, 'a' + i); } OutStream_Close(outstream); http://git-wip-us.apache.org/repos/asf/lucy/blob/882fbc1e/core/Lucy/Test/Util/TestSortExternal.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Util/TestSortExternal.c b/core/Lucy/Test/Util/TestSortExternal.c index c648595..b55dcc2 100644 --- a/core/Lucy/Test/Util/TestSortExternal.c +++ b/core/Lucy/Test/Util/TestSortExternal.c @@ -234,12 +234,12 @@ test_sort_packed_ints(TestBatchRunner *runner) { Vector *blobs = Vec_new(num_ints); for (uint32_t i = 0; i < num_ints; ++i) { - char buf[4]; - buf[0] = i >> 24; - buf[1] = i >> 16; - buf[2] = i >> 8; - buf[3] = i; - Blob *blob = Blob_new(buf, 4); + uint8_t buf[4]; + buf[0] = (uint8_t)((i >> 24) & 0xFF); + buf[1] = (uint8_t)((i >> 16) & 0xFF); + buf[2] = (uint8_t)((i >> 8) & 0xFF); + buf[3] = (uint8_t)(i & 0xFF); + Blob *blob = Blob_new((char*)buf, 4); Vec_Push(blobs, (Obj*)blob); } @@ -254,12 +254,12 @@ test_sort_random_strings(TestBatchRunner *runner) { Vector *blobs = Vec_new(num_strings); for (uint32_t i = 0; i < num_strings; ++i) { - char buf[1201]; + uint8_t buf[1201]; int size = rand() % 1200 + 1; for (int i = 0; i < size; ++i) { - buf[i] = rand(); + buf[i] = (uint8_t)(rand() % 256); } - Blob *blob = Blob_new(buf, (size_t)size); + Blob *blob = Blob_new((char*)buf, (size_t)size); Vec_Push(blobs, (Obj*)blob); } @@ -273,7 +273,7 @@ test_sort_random_strings(TestBatchRunner *runner) { static void test_run(TestBatchRunner *runner) { Vector *letters = Vec_new(26); - for (int i = 0; i < 26; ++i) { + for (char i = 0; i < 26; ++i) { char ch = 'a' + i; Blob *blob = Blob_new(&ch, 1); Vec_Push(letters, (Obj*)blob);
