Adapt calls into I32Array APIs for size change.

Add/remove casts for functions where the width of a size argument has
changed.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3f0e59ba
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3f0e59ba
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3f0e59ba

Branch: refs/heads/master
Commit: 3f0e59ba8f3f7c99f6ea8950d48c4fcd28a700b9
Parents: ffb3c83
Author: Marvin Humphrey <mar...@rectangular.com>
Authored: Tue Apr 5 19:09:54 2016 -0700
Committer: Marvin Humphrey <mar...@rectangular.com>
Committed: Wed Apr 6 13:03:09 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Index/BackgroundMerger.c        | 4 ++--
 core/Lucy/Index/DeletionsWriter.c         | 2 +-
 core/Lucy/Index/DocWriter.c               | 2 +-
 core/Lucy/Index/HighlightWriter.c         | 2 +-
 core/Lucy/Index/PolyReader.c              | 2 +-
 core/Lucy/Index/PostingPool.c             | 2 +-
 core/Lucy/Index/SortFieldWriter.c         | 2 +-
 core/Lucy/Search/IndexSearcher.c          | 2 +-
 core/Lucy/Search/PolySearcher.c           | 2 +-
 core/Lucy/Test/Object/TestBitVector.c     | 2 +-
 core/Lucy/Test/Search/TestSeriesMatcher.c | 2 +-
 core/LucyX/Search/MockMatcher.c           | 4 ++--
 12 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/BackgroundMerger.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index a7f86a0..14ffe1d 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -324,7 +324,7 @@ S_merge_updated_deletions(BackgroundMerger *self) {
                 = (SegReader*)Vec_Fetch(merge_seg_readers, i);
             if (SegReader_Get_Seg_Num(seg_reader) == merge_seg_num) {
                 I32Array *offsets = PolyReader_Offsets(merge_polyreader);
-                seg_tick = (uint32_t)i;
+                seg_tick = i;
                 offset = I32Arr_Get(offsets, seg_tick);
                 DECREF(offsets);
             }
@@ -345,7 +345,7 @@ S_merge_updated_deletions(BackgroundMerger *self) {
                 // Find the slot where the deleted doc resides in the
                 // rewritten segment. If the doc was already deleted when we
                 // were merging, do nothing.
-                int32_t remapped = I32Arr_Get(doc_map, del);
+                int32_t remapped = I32Arr_Get(doc_map, (size_t)del);
                 if (remapped) {
                     // It's a new deletion, so carry it forward and zap it in
                     // the rewritten segment.

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/DeletionsWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsWriter.c 
b/core/Lucy/Index/DeletionsWriter.c
index 1b25462..e2b9b09 100644
--- a/core/Lucy/Index/DeletionsWriter.c
+++ b/core/Lucy/Index/DeletionsWriter.c
@@ -64,7 +64,7 @@ DelWriter_Generate_Doc_Map_IMP(DeletionsWriter *self, Matcher 
*deletions,
         }
     }
 
-    return I32Arr_new_steal(doc_map, doc_max + 1);
+    return I32Arr_new_steal(doc_map, (size_t)doc_max + 1);
 }
 
 int32_t DefDelWriter_current_file_format = 1;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/DocWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocWriter.c b/core/Lucy/Index/DocWriter.c
index 08f450c..818f45b 100644
--- a/core/Lucy/Index/DocWriter.c
+++ b/core/Lucy/Index/DocWriter.c
@@ -180,7 +180,7 @@ DocWriter_Add_Segment_IMP(DocWriter *self, SegReader 
*reader,
                   DEFAULTDOCREADER);
 
         for (int32_t i = 1, max = SegReader_Doc_Max(reader); i <= max; i++) {
-            if (I32Arr_Get(doc_map, i)) {
+            if (I32Arr_Get(doc_map, (size_t)i)) {
                 int64_t  start = OutStream_Tell(dat_out);
 
                 // Copy record over.

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/HighlightWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightWriter.c 
b/core/Lucy/Index/HighlightWriter.c
index 518750c..08ad85a 100644
--- a/core/Lucy/Index/HighlightWriter.c
+++ b/core/Lucy/Index/HighlightWriter.c
@@ -233,7 +233,7 @@ HLWriter_Add_Segment_IMP(HighlightWriter *self, SegReader 
*reader,
 
         for (orig = 1; orig <= doc_max; orig++) {
             // Skip deleted docs.
-            if (doc_map && !I32Arr_Get(doc_map, orig)) {
+            if (doc_map && !I32Arr_Get(doc_map, (size_t)orig)) {
                 continue;
             }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/PolyReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PolyReader.c b/core/Lucy/Index/PolyReader.c
index 37dfcec..4febdeb 100644
--- a/core/Lucy/Index/PolyReader.c
+++ b/core/Lucy/Index/PolyReader.c
@@ -131,7 +131,7 @@ S_init_sub_readers(PolyReader *self, Vector *sub_readers) {
         }
         DECREF(iter);
     }
-    ivars->offsets = I32Arr_new_steal(starts, (uint32_t)num_sub_readers);
+    ivars->offsets = I32Arr_new_steal(starts, num_sub_readers);
 
     HashIterator *iter = HashIter_new(data_readers);
     while (HashIter_Next(iter)) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index a69c229..74b0e0c 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -513,7 +513,7 @@ PostPool_Refill_IMP(PostingPool *self) {
         // Skip deletions.
         if (doc_map != NULL) {
             const int32_t remapped
-                = I32Arr_Get(doc_map, rawpost_ivars->doc_id - doc_base);
+                = I32Arr_Get(doc_map, (size_t)(rawpost_ivars->doc_id - 
doc_base));
             if (!remapped) {
                 continue;
             }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c 
b/core/Lucy/Index/SortFieldWriter.c
index 12490da..4118ece 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -457,7 +457,7 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
         int32_t ord = SortCache_Ordinal(sort_cache, raw_doc_id);
         if (ord != null_ord) {
             int32_t remapped = doc_map
-                               ? I32Arr_Get(doc_map, raw_doc_id)
+                               ? I32Arr_Get(doc_map, (size_t)raw_doc_id)
                                : raw_doc_id;
             if (remapped) {
                 Obj *val = SortCache_Value(sort_cache, ord);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Search/IndexSearcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/IndexSearcher.c b/core/Lucy/Search/IndexSearcher.c
index 0274733..000d66c 100644
--- a/core/Lucy/Search/IndexSearcher.c
+++ b/core/Lucy/Search/IndexSearcher.c
@@ -147,7 +147,7 @@ IxSearcher_Collect_IMP(IndexSearcher *self, Query *query, 
Collector *collector)
         Matcher *matcher
             = Compiler_Make_Matcher(compiler, seg_reader, need_score);
         if (matcher) {
-            int32_t  seg_start = I32Arr_Get(seg_starts, (uint32_t)i);
+            int32_t  seg_start = I32Arr_Get(seg_starts, i);
             Matcher *deletions = DelReader_Iterator(del_reader);
             Coll_Set_Reader(collector, seg_reader);
             Coll_Set_Base(collector, seg_start);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Search/PolySearcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PolySearcher.c b/core/Lucy/Search/PolySearcher.c
index 40cd204..65f286d 100644
--- a/core/Lucy/Search/PolySearcher.c
+++ b/core/Lucy/Search/PolySearcher.c
@@ -183,7 +183,7 @@ PolySearcher_Collect_IMP(PolySearcher *self, Query *query,
     I32Array *starts = ivars->starts;
 
     for (size_t i = 0, max = Vec_Get_Size(searchers); i < max; i++) {
-        int32_t start = I32Arr_Get(starts, (uint32_t)i);
+        int32_t start = I32Arr_Get(starts, i);
         Searcher *searcher = (Searcher*)Vec_Fetch(searchers, i);
         OffsetCollector *offset_coll = OffsetColl_new(collector, start);
         Searcher_Collect(searcher, query, (Collector*)offset_coll);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Test/Object/TestBitVector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Object/TestBitVector.c 
b/core/Lucy/Test/Object/TestBitVector.c
index 1ad92fa..c8c4203 100644
--- a/core/Lucy/Test/Object/TestBitVector.c
+++ b/core/Lucy/Test/Object/TestBitVector.c
@@ -418,7 +418,7 @@ test_To_Array(TestBatchRunner *runner) {
     // Create the array and compare it to the source.
     array = BitVec_To_Array(bit_vec);
     for (i = 0; i < num_unique; i++) {
-        if (I32Arr_Get(array, i) != (int32_t)source_ints[i]) { break; }
+        if (I32Arr_Get(array, (size_t)i) != (int32_t)source_ints[i]) { break; }
     }
     TEST_INT_EQ(runner, i, num_unique, "To_Array (%ld == %ld)", i,
                 num_unique);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/Lucy/Test/Search/TestSeriesMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSeriesMatcher.c 
b/core/Lucy/Test/Search/TestSeriesMatcher.c
index b6c949b..7becce4 100644
--- a/core/Lucy/Test/Search/TestSeriesMatcher.c
+++ b/core/Lucy/Test/Search/TestSeriesMatcher.c
@@ -71,7 +71,7 @@ S_generate_match_list(int32_t first, int32_t max, int32_t 
doc_inc) {
     }
     if (i != count) { THROW(ERR, "Screwed up somehow: %i32 %i32", i, count); }
 
-    return I32Arr_new_steal(doc_ids, count);
+    return I32Arr_new_steal(doc_ids, (size_t)count);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f0e59ba/core/LucyX/Search/MockMatcher.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/MockMatcher.c b/core/LucyX/Search/MockMatcher.c
index 1cce741..308719b 100644
--- a/core/LucyX/Search/MockMatcher.c
+++ b/core/LucyX/Search/MockMatcher.c
@@ -58,7 +58,7 @@ MockMatcher_Next_IMP(MockMatcher* self) {
         ivars->tick--;
         return 0;
     }
-    return I32Arr_Get(ivars->doc_ids, ivars->tick);
+    return I32Arr_Get(ivars->doc_ids, (size_t)ivars->tick);
 }
 
 float
@@ -74,7 +74,7 @@ MockMatcher_Score_IMP(MockMatcher* self) {
 int32_t
 MockMatcher_Get_Doc_ID_IMP(MockMatcher* self) {
     MockMatcherIVARS *const ivars = MockMatcher_IVARS(self);
-    return I32Arr_Get(ivars->doc_ids, ivars->tick);
+    return I32Arr_Get(ivars->doc_ids, (size_t)ivars->tick);
 }
 
 

Reply via email to