Tricky type changes to match Vec_Get_Size.

After converting variables assigned the return value of Vec_Get_Size
from `uint32_t` to `size_t`, at least one cast or other type conversion
is performed.


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

Branch: refs/heads/master
Commit: e7d675a67fefcca764d538b5dafc76d57ed42c47
Parents: f0884c6
Author: Marvin Humphrey <mar...@rectangular.com>
Authored: Tue Mar 29 20:10:23 2016 -0700
Committer: Marvin Humphrey <mar...@rectangular.com>
Committed: Tue Mar 29 21:04:54 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Index/BackgroundMerger.c              | 14 +++++++-------
 core/Lucy/Index/DeletionsReader.c               |  4 ++--
 core/Lucy/Index/Inverter.c                      |  2 +-
 core/Lucy/Index/PolyLexicon.c                   |  8 ++++----
 core/Lucy/Index/PolyReader.c                    |  6 +++---
 core/Lucy/Index/PostingPool.c                   |  4 ++--
 core/Lucy/Index/Segment.c                       |  2 +-
 core/Lucy/Index/SortFieldWriter.c               |  6 +++---
 core/Lucy/Index/SortWriter.c                    |  4 ++--
 core/Lucy/Search/Collector/SortCollector.c      |  2 +-
 core/Lucy/Search/HitQueue.c                     |  2 +-
 core/Lucy/Search/IndexSearcher.c                |  4 ++--
 core/Lucy/Search/PhraseQuery.c                  |  4 ++--
 core/Lucy/Search/PolyQuery.c                    |  2 +-
 core/Lucy/Search/PolySearcher.c                 |  6 +++---
 core/Lucy/Search/SortSpec.c                     |  2 +-
 core/Lucy/Test/Analysis/TestStandardTokenizer.c |  5 +++--
 core/Lucy/Util/BlobSortEx.c                     |  4 ++--
 core/Lucy/Util/Freezer.c                        |  2 +-
 core/LucyX/Search/ProximityQuery.c              |  4 ++--
 20 files changed, 44 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/BackgroundMerger.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index 8e04daa..a7f86a0 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -203,12 +203,12 @@ BGMerger_Optimize_IMP(BackgroundMerger *self) {
     BGMerger_IVARS(self)->optimize = true;
 }
 
-static uint32_t
+static size_t
 S_maybe_merge(BackgroundMerger *self) {
     BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
     Vector *to_merge = IxManager_Recycle(ivars->manager, ivars->polyreader,
                                          ivars->del_writer, 0, 
ivars->optimize);
-    int32_t num_to_merge = Vec_Get_Size(to_merge);
+    size_t num_to_merge = Vec_Get_Size(to_merge);
 
     // There's no point in merging one segment if it has no deletions, because
     // we'd just be rewriting it. */
@@ -228,7 +228,7 @@ S_maybe_merge(BackgroundMerger *self) {
     SegWriter_Prep_Seg_Dir(ivars->seg_writer);
 
     // Consolidate segments.
-    for (uint32_t i = 0, max = num_to_merge; i < max; i++) {
+    for (size_t i = 0, max = num_to_merge; i < max; i++) {
         SegReader *seg_reader = (SegReader*)Vec_Fetch(to_merge, i);
         String    *seg_name   = SegReader_Get_Seg_Name(seg_reader);
         int64_t    doc_count  = Seg_Get_Count(ivars->segment);
@@ -319,12 +319,12 @@ S_merge_updated_deletions(BackgroundMerger *self) {
 
         SegWriter_Prep_Seg_Dir(seg_writer);
 
-        for (uint32_t i = 0, max = Vec_Get_Size(merge_seg_readers); i < max; 
i++) {
+        for (size_t i = 0, max = Vec_Get_Size(merge_seg_readers); i < max; 
i++) {
             SegReader *seg_reader
                 = (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 = i;
+                seg_tick = (uint32_t)i;
                 offset = I32Arr_Get(offsets, seg_tick);
                 DECREF(offsets);
             }
@@ -372,8 +372,8 @@ void
 BGMerger_Prepare_Commit_IMP(BackgroundMerger *self) {
     BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
     Vector   *seg_readers     = PolyReader_Get_Seg_Readers(ivars->polyreader);
-    uint32_t  num_seg_readers = Vec_Get_Size(seg_readers);
-    uint32_t  segs_merged     = 0;
+    size_t    num_seg_readers = Vec_Get_Size(seg_readers);
+    size_t    segs_merged     = 0;
 
     if (ivars->prepared) {
         THROW(ERR, "Can't call Prepare_Commit() more than once");

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/DeletionsReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsReader.c 
b/core/Lucy/Index/DeletionsReader.c
index 52eb96b..82f32be 100644
--- a/core/Lucy/Index/DeletionsReader.c
+++ b/core/Lucy/Index/DeletionsReader.c
@@ -166,8 +166,8 @@ DefDelReader_Read_Deletions_IMP(DefaultDeletionsReader 
*self) {
     // Start with deletions files in the most recently added segments and work
     // backwards.  The first one we find which addresses our segment is the
     // one we need.
-    for (int32_t i = Vec_Get_Size(segments) - 1; i >= 0; i--) {
-        Segment *other_seg = (Segment*)Vec_Fetch(segments, i);
+    for (int32_t i = (int32_t)Vec_Get_Size(segments) - 1; i >= 0; i--) {
+        Segment *other_seg = (Segment*)Vec_Fetch(segments, (size_t)i);
         Hash *metadata
             = (Hash*)Seg_Fetch_Metadata_Utf8(other_seg, "deletions", 9);
         if (metadata) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Inverter.c b/core/Lucy/Index/Inverter.c
index 245b937..1cdf606 100644
--- a/core/Lucy/Index/Inverter.c
+++ b/core/Lucy/Index/Inverter.c
@@ -80,7 +80,7 @@ Inverter_Iterate_IMP(Inverter *self) {
         Vec_Sort(ivars->entries);
         ivars->sorted = true;
     }
-    return Vec_Get_Size(ivars->entries);
+    return (uint32_t)Vec_Get_Size(ivars->entries);
 }
 
 int32_t

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/PolyLexicon.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PolyLexicon.c b/core/Lucy/Index/PolyLexicon.c
index 5c414a5..4794689 100644
--- a/core/Lucy/Index/PolyLexicon.c
+++ b/core/Lucy/Index/PolyLexicon.c
@@ -36,17 +36,17 @@ PolyLex_new(String *field, Vector *sub_readers) {
 
 PolyLexicon*
 PolyLex_init(PolyLexicon *self, String *field, Vector *sub_readers) {
-    uint32_t  num_sub_readers = Vec_Get_Size(sub_readers);
+    size_t    num_sub_readers = Vec_Get_Size(sub_readers);
     Vector   *seg_lexicons    = Vec_new(num_sub_readers);
 
     // Init.
     Lex_init((Lexicon*)self, field);
     PolyLexiconIVARS *const ivars = PolyLex_IVARS(self);
     ivars->term            = NULL;
-    ivars->lex_q           = SegLexQ_new(num_sub_readers);
+    ivars->lex_q           = SegLexQ_new((uint32_t)num_sub_readers);
 
     // Derive.
-    for (uint32_t i = 0; i < num_sub_readers; i++) {
+    for (size_t i = 0; i < num_sub_readers; i++) {
         LexiconReader *lex_reader = (LexiconReader*)Vec_Fetch(sub_readers, i);
         if (lex_reader && CERTIFY(lex_reader, LEXICONREADER)) {
             Lexicon *seg_lexicon = LexReader_Lexicon(lex_reader, field, NULL);
@@ -192,7 +192,7 @@ PolyLex_Get_Term_IMP(PolyLexicon *self) {
 uint32_t
 PolyLex_Get_Num_Seg_Lexicons_IMP(PolyLexicon *self) {
     PolyLexiconIVARS *const ivars = PolyLex_IVARS(self);
-    return Vec_Get_Size(ivars->seg_lexicons);
+    return (uint32_t)Vec_Get_Size(ivars->seg_lexicons);
 }
 
 SegLexQueue*

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/PolyReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PolyReader.c b/core/Lucy/Index/PolyReader.c
index aa85e7b..5c807d2 100644
--- a/core/Lucy/Index/PolyReader.c
+++ b/core/Lucy/Index/PolyReader.c
@@ -103,7 +103,7 @@ S_first_non_null(Vector *array) {
 static void
 S_init_sub_readers(PolyReader *self, Vector *sub_readers) {
     PolyReaderIVARS *const ivars = PolyReader_IVARS(self);
-    uint32_t  num_sub_readers = Vec_Get_Size(sub_readers);
+    size_t   num_sub_readers = Vec_Get_Size(sub_readers);
     int32_t *starts = (int32_t*)MALLOCATE(num_sub_readers * sizeof(int32_t));
     Hash  *data_readers = Hash_new(0);
 
@@ -113,7 +113,7 @@ S_init_sub_readers(PolyReader *self, Vector *sub_readers) {
 
     // Accumulate doc_max, subreader start offsets, and DataReaders.
     ivars->doc_max = 0;
-    for (uint32_t i = 0; i < num_sub_readers; i++) {
+    for (size_t i = 0; i < num_sub_readers; i++) {
         SegReader *seg_reader = (SegReader*)Vec_Fetch(sub_readers, i);
         Hash *components = SegReader_Get_Components(seg_reader);
         starts[i] = ivars->doc_max;
@@ -131,7 +131,7 @@ S_init_sub_readers(PolyReader *self, Vector *sub_readers) {
         }
         DECREF(iter);
     }
-    ivars->offsets = I32Arr_new_steal(starts, num_sub_readers);
+    ivars->offsets = I32Arr_new_steal(starts, (uint32_t)num_sub_readers);
 
     HashIterator *iter = HashIter_new(data_readers);
     while (HashIter_Next(iter)) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 74714f3..a69c229 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -174,7 +174,7 @@ PostPool_Get_Mem_Pool_IMP(PostingPool *self) {
 void
 PostPool_Flip_IMP(PostingPool *self) {
     PostingPoolIVARS *const ivars = PostPool_IVARS(self);
-    uint32_t num_runs   = Vec_Get_Size(ivars->runs);
+    size_t   num_runs   = Vec_Get_Size(ivars->runs);
     uint32_t sub_thresh = num_runs > 0
                           ? ivars->mem_thresh / num_runs
                           : ivars->mem_thresh;
@@ -217,7 +217,7 @@ PostPool_Flip_IMP(PostingPool *self) {
     }
 
     // Assign.
-    for (uint32_t i = 0; i < num_runs; i++) {
+    for (size_t i = 0; i < num_runs; i++) {
         PostingPool *run = (PostingPool*)Vec_Fetch(ivars->runs, i);
         if (run != NULL) {
             PostPool_Set_Mem_Thresh(run, sub_thresh);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/Segment.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Segment.c b/core/Lucy/Index/Segment.c
index fb8a66f..05e52f0 100644
--- a/core/Lucy/Index/Segment.c
+++ b/core/Lucy/Index/Segment.c
@@ -166,7 +166,7 @@ Seg_Add_Field_IMP(Segment *self, String *field) {
         return (int32_t)Int_Get_Value(num);
     }
     else {
-        int32_t field_num = Vec_Get_Size(ivars->by_num);
+        int32_t field_num = (int32_t)Vec_Get_Size(ivars->by_num);
         Hash_Store(ivars->by_name, field, (Obj*)Int_new(field_num));
         Vec_Push(ivars->by_num, (Obj*)Str_Clone(field));
         return field_num;

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c 
b/core/Lucy/Index/SortFieldWriter.c
index 93c690b..12490da 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -483,7 +483,7 @@ void
 SortFieldWriter_Flip_IMP(SortFieldWriter *self) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     uint32_t num_items = SortFieldWriter_Buffer_Count(self);
-    uint32_t num_runs = Vec_Get_Size(ivars->runs);
+    size_t   num_runs = Vec_Get_Size(ivars->runs);
 
     if (ivars->flipped) { THROW(ERR, "Can't call Flip() twice"); }
     ivars->flipped = true;
@@ -491,7 +491,7 @@ SortFieldWriter_Flip_IMP(SortFieldWriter *self) {
     // Sanity check.
     if (num_runs && num_items) {
         THROW(ERR, "Sanity check failed: num_runs: %u32 num_items: %u32",
-              num_runs, num_items);
+              (uint32_t)num_runs, num_items);
     }
 
     if (num_items) {
@@ -518,7 +518,7 @@ SortFieldWriter_Flip_IMP(SortFieldWriter *self) {
         // Assign streams and a slice of mem_thresh.
         size_t sub_thresh = ivars->mem_thresh / num_runs;
         if (sub_thresh < 65536) { sub_thresh = 65536; }
-        for (uint32_t i = 0; i < num_runs; i++) {
+        for (size_t i = 0; i < num_runs; i++) {
             SortFieldWriter *run = (SortFieldWriter*)Vec_Fetch(ivars->runs, i);
             S_flip_run(run, sub_thresh, ivars->ord_in, ivars->ix_in,
                        ivars->dat_in);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Index/SortWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortWriter.c b/core/Lucy/Index/SortWriter.c
index 1b937c3..7554482 100644
--- a/core/Lucy/Index/SortWriter.c
+++ b/core/Lucy/Index/SortWriter.c
@@ -213,11 +213,11 @@ SortWriter_Finish_IMP(SortWriter *self) {
     OutStream_Close(ivars->temp_ix_out);
     OutStream_Close(ivars->temp_dat_out);
 
-    for (uint32_t i = 1, max = Vec_Get_Size(field_writers); i < max; i++) {
+    for (size_t i = 1, max = Vec_Get_Size(field_writers); i < max; i++) {
         SortFieldWriter *field_writer
             = (SortFieldWriter*)Vec_Delete(field_writers, i);
         if (field_writer) {
-            String *field = Seg_Field_Name(ivars->segment, i);
+            String *field = Seg_Field_Name(ivars->segment, (int32_t)i);
             SortFieldWriter_Flip(field_writer);
             int32_t count = SortFieldWriter_Finish(field_writer);
             Hash_Store(ivars->counts, field, (Obj*)Str_newf("%i32", count));

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Search/Collector/SortCollector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Collector/SortCollector.c 
b/core/Lucy/Search/Collector/SortCollector.c
index e58e80a..c945965 100644
--- a/core/Lucy/Search/Collector/SortCollector.c
+++ b/core/Lucy/Search/Collector/SortCollector.c
@@ -89,7 +89,7 @@ SortColl_init(SortCollector *self, Schema *schema, SortSpec 
*sort_spec,
     Vector *rules = sort_spec
                     ? (Vector*)INCREF(SortSpec_Get_Rules(sort_spec))
                     : S_default_sort_rules();
-    uint32_t num_rules = Vec_Get_Size(rules);
+    uint32_t num_rules = (uint32_t)Vec_Get_Size(rules);
 
     // Validate.
     if (sort_spec && !schema) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Search/HitQueue.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/HitQueue.c b/core/Lucy/Search/HitQueue.c
index 12324e7..94d4101 100644
--- a/core/Lucy/Search/HitQueue.c
+++ b/core/Lucy/Search/HitQueue.c
@@ -48,7 +48,7 @@ HitQ_init(HitQueue *self, Schema *schema, SortSpec *sort_spec,
     HitQueueIVARS *const ivars = HitQ_IVARS(self);
     if (sort_spec) {
         Vector   *rules      = SortSpec_Get_Rules(sort_spec);
-        uint32_t  num_rules  = Vec_Get_Size(rules);
+        uint32_t  num_rules  = (uint32_t)Vec_Get_Size(rules);
         uint32_t  action_num = 0;
 
         if (!schema) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Search/IndexSearcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/IndexSearcher.c b/core/Lucy/Search/IndexSearcher.c
index 78faca2..0274733 100644
--- a/core/Lucy/Search/IndexSearcher.c
+++ b/core/Lucy/Search/IndexSearcher.c
@@ -139,7 +139,7 @@ IxSearcher_Collect_IMP(IndexSearcher *self, Query *query, 
Collector *collector)
                                                Query_Get_Boost(query), false);
 
     // Accumulate hits into the Collector.
-    for (uint32_t i = 0, max = Vec_Get_Size(seg_readers); i < max; i++) {
+    for (size_t i = 0, max = Vec_Get_Size(seg_readers); i < max; i++) {
         SegReader *seg_reader = (SegReader*)Vec_Fetch(seg_readers, i);
         DeletionsReader *del_reader = (DeletionsReader*)SegReader_Fetch(
                                           seg_reader,
@@ -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, i);
+            int32_t  seg_start = I32Arr_Get(seg_starts, (uint32_t)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/e7d675a6/core/Lucy/Search/PhraseQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PhraseQuery.c b/core/Lucy/Search/PhraseQuery.c
index f40cdde..a74547d 100644
--- a/core/Lucy/Search/PhraseQuery.c
+++ b/core/Lucy/Search/PhraseQuery.c
@@ -350,7 +350,7 @@ PhraseCompiler_Highlight_Spans_IMP(PhraseCompiler *self, 
Searcher *searcher,
         = PhraseQuery_IVARS((PhraseQuery*)ivars->parent);
     Vector *const      terms     = parent_ivars->terms;
     Vector *const      spans     = Vec_new(0);
-    const uint32_t     num_terms = Vec_Get_Size(terms);
+    const uint32_t     num_terms = (uint32_t)Vec_Get_Size(terms);
     UNUSED_VAR(searcher);
 
     // Bail if no terms or field doesn't match.
@@ -395,7 +395,7 @@ PhraseCompiler_Highlight_Spans_IMP(PhraseCompiler *self, 
Searcher *searcher,
     }
 
     // Proceed only if all terms are present.
-    uint32_t num_tvs = Vec_Get_Size(term_vectors);
+    uint32_t num_tvs = (uint32_t)Vec_Get_Size(term_vectors);
     if (num_tvs == num_terms) {
         TermVector *first_tv = (TermVector*)Vec_Fetch(term_vectors, 0);
         TermVector *last_tv

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Search/PolyQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PolyQuery.c b/core/Lucy/Search/PolyQuery.c
index d3d839c..2bc5daa 100644
--- a/core/Lucy/Search/PolyQuery.c
+++ b/core/Lucy/Search/PolyQuery.c
@@ -70,7 +70,7 @@ PolyQuery_Get_Children_IMP(PolyQuery *self) {
 void
 PolyQuery_Serialize_IMP(PolyQuery *self, OutStream *outstream) {
     PolyQueryIVARS *const ivars = PolyQuery_IVARS(self);
-    const uint32_t num_kids = Vec_Get_Size(ivars->children);
+    const uint32_t num_kids = (uint32_t)Vec_Get_Size(ivars->children);
     OutStream_Write_F32(outstream, ivars->boost);
     OutStream_Write_U32(outstream, num_kids);
     for (uint32_t i = 0; i < num_kids; i++) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Search/PolySearcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PolySearcher.c b/core/Lucy/Search/PolySearcher.c
index 79f1831..40cd204 100644
--- a/core/Lucy/Search/PolySearcher.c
+++ b/core/Lucy/Search/PolySearcher.c
@@ -41,7 +41,7 @@ PolySearcher_new(Schema *schema, Vector *searchers) {
 
 PolySearcher*
 PolySearcher_init(PolySearcher *self, Schema *schema, Vector *searchers) {
-    const uint32_t num_searchers = Vec_Get_Size(searchers);
+    const uint32_t num_searchers = (uint32_t)Vec_Get_Size(searchers);
     int32_t *starts_array = (int32_t*)MALLOCATE(num_searchers * 
sizeof(int32_t));
     int32_t  doc_max      = 0;
 
@@ -182,8 +182,8 @@ PolySearcher_Collect_IMP(PolySearcher *self, Query *query,
     Vector *const searchers = ivars->searchers;
     I32Array *starts = ivars->starts;
 
-    for (uint32_t i = 0, max = Vec_Get_Size(searchers); i < max; i++) {
-        int32_t start = I32Arr_Get(starts, i);
+    for (size_t i = 0, max = Vec_Get_Size(searchers); i < max; i++) {
+        int32_t start = I32Arr_Get(starts, (uint32_t)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/e7d675a6/core/Lucy/Search/SortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SortSpec.c b/core/Lucy/Search/SortSpec.c
index 337a827..c6fa2e4 100644
--- a/core/Lucy/Search/SortSpec.c
+++ b/core/Lucy/Search/SortSpec.c
@@ -75,7 +75,7 @@ SortSpec_Get_Rules_IMP(SortSpec *self) {
 void
 SortSpec_Serialize_IMP(SortSpec *self, OutStream *target) {
     SortSpecIVARS *const ivars = SortSpec_IVARS(self);
-    uint32_t num_rules = Vec_Get_Size(ivars->rules);
+    uint32_t num_rules = (uint32_t)Vec_Get_Size(ivars->rules);
     OutStream_Write_C32(target, num_rules);
     for (uint32_t i = 0; i < num_rules; i++) {
         SortRule *rule = (SortRule*)Vec_Fetch(ivars->rules, i);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Test/Analysis/TestStandardTokenizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestStandardTokenizer.c 
b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
index c6bda82..548bf2f 100644
--- a/core/Lucy/Test/Analysis/TestStandardTokenizer.c
+++ b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
@@ -112,12 +112,13 @@ test_tokenizer(TestBatchRunner *runner) {
         Vector *tests = (Vector*)Json_slurp_json((Folder*)modules_folder, 
path);
         if (!tests) { RETHROW(Err_get_error()); }
 
-        for (uint32_t i = 0, max = Vec_Get_Size(tests); i < max; i++) {
+        for (size_t i = 0, max = Vec_Get_Size(tests); i < max; i++) {
             Hash *test = (Hash*)Vec_Fetch(tests, i);
             String *text = (String*)Hash_Fetch_Utf8(test, "text", 4);
             Vector *wanted = (Vector*)Hash_Fetch_Utf8(test, "words", 5);
             Vector *got = StandardTokenizer_Split(tokenizer, text);
-            TEST_TRUE(runner, Vec_Equals(wanted, (Obj*)got), "UCD test #%d", i 
+ 1);
+            TEST_TRUE(runner, Vec_Equals(wanted, (Obj*)got), "UCD test #%d",
+                      (int)i + 1);
             DECREF(got);
         }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Util/BlobSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BlobSortEx.c b/core/Lucy/Util/BlobSortEx.c
index 351a8a1..e82c00e 100644
--- a/core/Lucy/Util/BlobSortEx.c
+++ b/core/Lucy/Util/BlobSortEx.c
@@ -147,7 +147,7 @@ BlobSortEx_Flip_IMP(BlobSortEx *self) {
     BlobSortEx_Flush(self);
 
     // Recalculate the approximate mem allowed for each run.
-    uint32_t num_runs = Vec_Get_Size(ivars->runs);
+    uint32_t num_runs = (uint32_t)Vec_Get_Size(ivars->runs);
     if (num_runs) {
         run_mem_thresh = (ivars->mem_thresh / 2) / num_runs;
         if (run_mem_thresh < 65536) {
@@ -195,7 +195,7 @@ BlobSortEx_Peek_Last_IMP(BlobSortEx *self) {
 uint32_t
 BlobSortEx_Get_Num_Runs_IMP(BlobSortEx *self) {
     BlobSortExIVARS *const ivars = BlobSortEx_IVARS(self);
-    return Vec_Get_Size(ivars->runs);
+    return (uint32_t)Vec_Get_Size(ivars->runs);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/Lucy/Util/Freezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.c b/core/Lucy/Util/Freezer.c
index 2a71de0..fa0d121 100644
--- a/core/Lucy/Util/Freezer.c
+++ b/core/Lucy/Util/Freezer.c
@@ -229,7 +229,7 @@ Freezer_read_blob(InStream *instream) {
 void
 Freezer_serialize_varray(Vector *array, OutStream *outstream) {
     uint32_t last_valid_tick = 0;
-    size_t size = Vec_Get_Size(array);
+    uint32_t size = (uint32_t)Vec_Get_Size(array);
     OutStream_Write_C32(outstream, size);
     for (uint32_t i = 0; i < size; i++) {
         Obj *elem = Vec_Fetch(array, i);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e7d675a6/core/LucyX/Search/ProximityQuery.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityQuery.c 
b/core/LucyX/Search/ProximityQuery.c
index 10e2ec3..a4d42cc 100644
--- a/core/LucyX/Search/ProximityQuery.c
+++ b/core/LucyX/Search/ProximityQuery.c
@@ -379,7 +379,7 @@ ProximityCompiler_Highlight_Spans_IMP(ProximityCompiler 
*self,
         = ProximityQuery_IVARS((ProximityQuery*)ivars->parent);
     Vector         *const terms  = parent_ivars->terms;
     Vector         *const spans  = Vec_new(0);
-    const uint32_t  num_terms    = Vec_Get_Size(terms);
+    const uint32_t  num_terms    = (uint32_t)Vec_Get_Size(terms);
     UNUSED_VAR(searcher);
 
     // Bail if no terms or field doesn't match.
@@ -424,7 +424,7 @@ ProximityCompiler_Highlight_Spans_IMP(ProximityCompiler 
*self,
     }
 
     // Proceed only if all terms are present.
-    uint32_t num_tvs = Vec_Get_Size(term_vectors);
+    uint32_t num_tvs = (uint32_t)Vec_Get_Size(term_vectors);
     if (num_tvs == num_terms) {
         TermVector *first_tv = (TermVector*)Vec_Fetch(term_vectors, 0);
         TermVector *last_tv

Reply via email to