Harmless casts in SortFieldWriter.

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

Branch: refs/heads/master
Commit: 06c0800442c90a86702160b10ec9896e8e473694
Parents: f6a4e0a
Author: Marvin Humphrey <mar...@rectangular.com>
Authored: Thu May 26 20:00:45 2016 -0700
Committer: Marvin Humphrey <mar...@rectangular.com>
Committed: Thu May 26 20:00:45 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Index/SortFieldWriter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/06c08004/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c 
b/core/Lucy/Index/SortFieldWriter.c
index bf3b3e4..85fb411 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -57,7 +57,7 @@ S_SFWriterElem_create(Obj *value, int32_t doc_id);
 
 static int64_t
 SI_increase_to_word_multiple(int64_t amount) {
-    const int64_t remainder = amount % sizeof(void*);
+    const int64_t remainder = amount % (int64_t)sizeof(void*);
     if (remainder) {
         amount += sizeof(void*);
         amount -= remainder;
@@ -175,7 +175,7 @@ void
 SortFieldWriter_Add_IMP(SortFieldWriter *self, int32_t doc_id, Obj *value) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     Counter *counter   = ivars->counter;
-    Counter_Add(counter, ivars->mem_per_entry);
+    Counter_Add(counter, (int64_t)ivars->mem_per_entry);
     if (ivars->prim_id == FType_TEXT) {
         int64_t size = (int64_t)Str_Get_Size((String*)value) + 1;
         size = SI_increase_to_word_multiple(size);

Reply via email to