Change width of size variables for RawPosting.

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

Branch: refs/heads/master
Commit: 5ba152510713a98c981e461e4102464a618f3807
Parents: 619ec10
Author: Marvin Humphrey <mar...@rectangular.com>
Authored: Wed May 4 18:45:01 2016 -0700
Committer: Marvin Humphrey <mar...@rectangular.com>
Committed: Wed May 4 19:21:37 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Index/Posting/RawPosting.cfh |  4 ++--
 core/Lucy/Index/Posting/RichPosting.c  | 10 +++++-----
 core/Lucy/Index/Posting/ScorePosting.c | 10 +++++-----
 core/Lucy/Index/PostingPool.c          |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/5ba15251/core/Lucy/Index/Posting/RawPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.cfh 
b/core/Lucy/Index/Posting/RawPosting.cfh
index 67ef714..db24ca9 100644
--- a/core/Lucy/Index/Posting/RawPosting.cfh
+++ b/core/Lucy/Index/Posting/RawPosting.cfh
@@ -40,8 +40,8 @@ class Lucy::Index::RawPosting nickname RawPost
     inherits Lucy::Index::Posting {
 
     uint32_t  freq;
-    uint32_t  content_len;
-    uint32_t  aux_len;
+    size_t    content_len;
+    size_t    aux_len;
     char[1]   blob; /* flexible array */
 
     /** Constructor.  Uses pre-allocated memory.

http://git-wip-us.apache.org/repos/asf/lucy/blob/5ba15251/core/Lucy/Index/Posting/RichPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RichPosting.c 
b/core/Lucy/Index/Posting/RichPosting.c
index da9da77..eeb5ca6 100644
--- a/core/Lucy/Index/Posting/RichPosting.c
+++ b/core/Lucy/Index/Posting/RichPosting.c
@@ -121,7 +121,7 @@ RichPost_Add_Inversion_To_Pool_IMP(RichPosting *self, 
PostingPool *post_pool,
     Inversion_Reset(inversion);
     while ((tokens = Inversion_Next_Cluster(inversion, &freq)) != NULL) {
         TokenIVARS *const token_ivars = Token_IVARS(*tokens);
-        uint32_t raw_post_bytes
+        size_t raw_post_bytes
             = MAX_RAW_POSTING_LEN(base_size, token_ivars->len, freq);
         RawPosting *raw_posting
             = RawPost_new(MemPool_Grab(mem_pool, raw_post_bytes), doc_id,
@@ -145,8 +145,8 @@ RichPost_Add_Inversion_To_Pool_IMP(RichPosting *self, 
PostingPool *post_pool,
         }
 
         // Resize raw posting memory allocation.
-        raw_post_ivars->aux_len = dest - start;
-        raw_post_bytes = dest - (char*)raw_posting;
+        raw_post_ivars->aux_len = (size_t)(dest - start);
+        raw_post_bytes = (size_t)(dest - (char*)raw_posting);
         MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
         PostPool_Feed(post_pool, (Obj*)raw_posting);
     }
@@ -183,8 +183,8 @@ RichPost_Read_Raw_IMP(RichPosting *self, InStream *instream,
     }
 
     // Resize raw posting memory allocation.
-    raw_post_ivars->aux_len = dest - start;
-    raw_post_bytes       = dest - (char*)raw_posting;
+    raw_post_ivars->aux_len = (size_t)(dest - start);
+    raw_post_bytes = (size_t)(dest - (char*)raw_posting);
     MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
 
     return raw_posting;

http://git-wip-us.apache.org/repos/asf/lucy/blob/5ba15251/core/Lucy/Index/Posting/ScorePosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/ScorePosting.c 
b/core/Lucy/Index/Posting/ScorePosting.c
index 048fa21..8044fa3 100644
--- a/core/Lucy/Index/Posting/ScorePosting.c
+++ b/core/Lucy/Index/Posting/ScorePosting.c
@@ -92,7 +92,7 @@ ScorePost_Add_Inversion_To_Pool_IMP(ScorePosting *self,
     Inversion_Reset(inversion);
     while ((tokens = Inversion_Next_Cluster(inversion, &freq)) != NULL) {
         TokenIVARS *const token_ivars = Token_IVARS(*tokens);
-        uint32_t raw_post_bytes
+        size_t raw_post_bytes
             = MAX_RAW_POSTING_LEN(base_size, token_ivars->len, freq);
         RawPosting *raw_posting
             = RawPost_new(MemPool_Grab(mem_pool, raw_post_bytes), doc_id,
@@ -115,8 +115,8 @@ ScorePost_Add_Inversion_To_Pool_IMP(ScorePosting *self,
         }
 
         // Resize raw posting memory allocation.
-        raw_post_ivars->aux_len = dest - start;
-        raw_post_bytes = dest - (char*)raw_posting;
+        raw_post_ivars->aux_len = (size_t)(dest - start);
+        raw_post_bytes = (size_t)(dest - (char*)raw_posting);
         MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
         PostPool_Feed(post_pool, (Obj*)raw_posting);
     }
@@ -204,8 +204,8 @@ ScorePost_Read_Raw_IMP(ScorePosting *self, InStream 
*instream,
     }
 
     // Resize raw posting memory allocation.
-    raw_post_ivars->aux_len = dest - start;
-    raw_post_bytes       = dest - (char*)raw_posting;
+    raw_post_ivars->aux_len = (size_t)(dest - start);
+    raw_post_bytes = (size_t)(dest - (char*)raw_posting);
     MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
 
     return raw_posting;

http://git-wip-us.apache.org/repos/asf/lucy/blob/5ba15251/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 9bb785a..0e76d4e 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -356,7 +356,7 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter 
*post_writer,
     ByteBuf *last_term_text
         = BB_new_bytes(post_ivars->blob, post_ivars->content_len);
     char     *last_text_buf  = BB_Get_Buf(last_term_text);
-    uint32_t  last_text_size = (uint32_t)BB_Get_Size(last_term_text);
+    size_t    last_text_size = BB_Get_Size(last_term_text);
     SkipStepper_Set_ID_And_Filepos(skip_stepper, 0, 0);
 
     // Initialize sentinel to be used on the last iter, using an empty string

Reply via email to