Change easy-to-review Read_C32 to CU32.

All of these have the type of the lvalue show up in the diff, making it
easy to confirm that the types match.


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

Branch: refs/heads/master
Commit: 17a3d60bbe2b5a1279052278225b2875668b2968
Parents: 795626b
Author: Marvin Humphrey <[email protected]>
Authored: Wed Apr 20 15:29:23 2016 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Wed Apr 20 15:29:23 2016 -0700

----------------------------------------------------------------------
 c/src/Lucy/Index/DocReader.c           |  8 ++++----
 core/Lucy/Index/HighlightReader.c      |  2 +-
 core/Lucy/Index/LexIndex.c             |  4 ++--
 core/Lucy/Index/Posting/MatchPosting.c |  6 +++---
 core/Lucy/Index/Posting/RichPosting.c  |  6 +++---
 core/Lucy/Index/Posting/ScorePosting.c |  4 ++--
 core/Lucy/Plan/TextType.c              |  6 +++---
 core/Lucy/Search/SortSpec.c            |  2 +-
 core/Lucy/Util/Freezer.c               | 12 ++++++------
 core/LucyX/Search/ProximityQuery.c     |  2 +-
 10 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/c/src/Lucy/Index/DocReader.c
----------------------------------------------------------------------
diff --git a/c/src/Lucy/Index/DocReader.c b/c/src/Lucy/Index/DocReader.c
index 1e7767b..3610dfc 100644
--- a/c/src/Lucy/Index/DocReader.c
+++ b/c/src/Lucy/Index/DocReader.c
@@ -71,7 +71,7 @@ DefDocReader_Fetch_Doc_IMP(DefaultDocReader *self, int32_t 
doc_id) {
         // Read the field value.
         switch (FType_Primitive_ID(type) & FType_PRIMITIVE_ID_MASK) {
             case FType_TEXT: {
-                    uint32_t value_len = InStream_Read_C32(dat_in);
+                    uint32_t value_len = InStream_Read_CU32(dat_in);
                     char *buf = (char*)MALLOCATE(value_len + 1);
                     InStream_Read_Bytes(dat_in, buf, value_len);
                     buf[value_len] = '\0'; 
@@ -79,7 +79,7 @@ DefDocReader_Fetch_Doc_IMP(DefaultDocReader *self, int32_t 
doc_id) {
                     break;
                 }
             case FType_BLOB: {
-                    uint32_t value_len = InStream_Read_C32(dat_in);
+                    uint32_t value_len = InStream_Read_CU32(dat_in);
                     char *buf = (char*)MALLOCATE(value_len);
                     InStream_Read_Bytes(dat_in, buf, value_len);
                     value = (Obj*)Blob_new_steal(buf, value_len);
@@ -92,10 +92,10 @@ DefDocReader_Fetch_Doc_IMP(DefaultDocReader *self, int32_t 
doc_id) {
                 value = (Obj*)Float_new(InStream_Read_F64(dat_in));
                 break;
             case FType_INT32:
-                value = (Obj*)Int_new((int32_t)InStream_Read_C32(dat_in));
+                value = (Obj*)Int_new(InStream_Read_CI32(dat_in));
                 break;
             case FType_INT64:
-                value = (Obj*)Int_new((int64_t)InStream_Read_C64(dat_in));
+                value = (Obj*)Int_new(InStream_Read_CI64(dat_in));
                 break;
             default:
                 value = NULL;

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Index/HighlightReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightReader.c 
b/core/Lucy/Index/HighlightReader.c
index 2afaf66..590a6bd 100644
--- a/core/Lucy/Index/HighlightReader.c
+++ b/core/Lucy/Index/HighlightReader.c
@@ -200,7 +200,7 @@ DefHLReader_Fetch_Doc_Vec_IMP(DefaultHighlightReader *self, 
int32_t doc_id) {
     int64_t file_pos = InStream_Read_I64(ix_in);
     InStream_Seek(dat_in, file_pos);
 
-    uint32_t num_fields = InStream_Read_C32(dat_in);
+    uint32_t num_fields = InStream_Read_CU32(dat_in);
     while (num_fields--) {
         String *field = Freezer_read_string(dat_in);
         Blob *field_buf = Freezer_read_blob(dat_in);

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Index/LexIndex.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexIndex.c b/core/Lucy/Index/LexIndex.c
index 162933f..2c6586b 100644
--- a/core/Lucy/Index/LexIndex.c
+++ b/core/Lucy/Index/LexIndex.c
@@ -129,11 +129,11 @@ S_read_entry(LexIndex *self) {
     int64_t offset = (int64_t)NumUtil_decode_bigend_u64(ivars->offsets + 
ivars->tick);
     InStream_Seek(ix_in, offset);
     TermStepper_Read_Key_Frame(ivars->term_stepper, ix_in);
-    int32_t doc_freq = InStream_Read_C32(ix_in);
+    int32_t doc_freq = InStream_Read_CI32(ix_in);
     TInfo_Set_Doc_Freq(tinfo, doc_freq);
     TInfo_Set_Post_FilePos(tinfo, InStream_Read_C64(ix_in));
     int64_t skip_filepos = doc_freq >= ivars->skip_interval
-                           ? InStream_Read_C64(ix_in)
+                           ? InStream_Read_CI64(ix_in)
                            : 0;
     TInfo_Set_Skip_FilePos(tinfo, skip_filepos);
     TInfo_Set_Lex_FilePos(tinfo, InStream_Read_C64(ix_in));

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Index/Posting/MatchPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/MatchPosting.c 
b/core/Lucy/Index/Posting/MatchPosting.c
index c0ead4e..ae4e1f2 100644
--- a/core/Lucy/Index/Posting/MatchPosting.c
+++ b/core/Lucy/Index/Posting/MatchPosting.c
@@ -81,7 +81,7 @@ MatchPost_Reset_IMP(MatchPosting *self) {
 void
 MatchPost_Read_Record_IMP(MatchPosting *self, InStream *instream) {
     MatchPostingIVARS *const ivars = MatchPost_IVARS(self);
-    const uint32_t doc_code = InStream_Read_C32(instream);
+    const uint32_t doc_code = InStream_Read_CU32(instream);
     const uint32_t doc_delta = doc_code >> 1;
 
     // Apply delta doc and retrieve freq.
@@ -100,12 +100,12 @@ MatchPost_Read_Raw_IMP(MatchPosting *self, InStream 
*instream,
                        MemoryPool *mem_pool) {
     const char *const text_buf  = Str_Get_Ptr8(term_text);
     const size_t      text_size = Str_Get_Size(term_text);
-    const uint32_t    doc_code  = InStream_Read_C32(instream);
+    const uint32_t    doc_code  = InStream_Read_CU32(instream);
     const uint32_t    delta_doc = doc_code >> 1;
     const int32_t     doc_id    = last_doc_id + delta_doc;
     const uint32_t    freq      = (doc_code & 1)
                                   ? 1
-                                  : InStream_Read_C32(instream);
+                                  : InStream_Read_CU32(instream);
     const size_t base_size = Class_Get_Obj_Alloc_Size(RAWPOSTING);
     size_t raw_post_bytes  = MAX_RAW_POSTING_LEN(base_size, text_size);
     void *const allocation = MemPool_Grab(mem_pool, raw_post_bytes);

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Index/Posting/RichPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RichPosting.c 
b/core/Lucy/Index/Posting/RichPosting.c
index b3ff7e4..db590d4 100644
--- a/core/Lucy/Index/Posting/RichPosting.c
+++ b/core/Lucy/Index/Posting/RichPosting.c
@@ -72,7 +72,7 @@ RichPost_Read_Record_IMP(RichPosting *self, InStream 
*instream) {
     float     aggregate_weight = 0.0;
 
     // Decode delta doc.
-    uint32_t doc_code = InStream_Read_C32(instream);
+    uint32_t doc_code = InStream_Read_CU32(instream);
     ivars->doc_id += doc_code >> 1;
 
     // If the stored num was odd, the freq is 1.
@@ -158,12 +158,12 @@ RichPost_Read_Raw_IMP(RichPosting *self, InStream 
*instream,
                       MemoryPool *mem_pool) {
     const char *const text_buf  = Str_Get_Ptr8(term_text);
     const size_t      text_size = Str_Get_Size(term_text);
-    const uint32_t    doc_code  = InStream_Read_C32(instream);
+    const uint32_t    doc_code  = InStream_Read_CU32(instream);
     const uint32_t    delta_doc = doc_code >> 1;
     const int32_t     doc_id    = last_doc_id + delta_doc;
     const uint32_t    freq      = (doc_code & 1)
                                   ? 1
-                                  : InStream_Read_C32(instream);
+                                  : InStream_Read_CU32(instream);
     const size_t base_size = Class_Get_Obj_Alloc_Size(RAWPOSTING);
     size_t raw_post_bytes  = MAX_RAW_POSTING_LEN(base_size, text_size, freq);
     void *const allocation = MemPool_Grab(mem_pool, raw_post_bytes);

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Index/Posting/ScorePosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/ScorePosting.c 
b/core/Lucy/Index/Posting/ScorePosting.c
index bc84bf8..048fa21 100644
--- a/core/Lucy/Index/Posting/ScorePosting.c
+++ b/core/Lucy/Index/Posting/ScorePosting.c
@@ -177,12 +177,12 @@ ScorePost_Read_Raw_IMP(ScorePosting *self, InStream 
*instream,
                        MemoryPool *mem_pool) {
     const char *const text_buf  = Str_Get_Ptr8(term_text);
     const size_t      text_size = Str_Get_Size(term_text);
-    const uint32_t    doc_code  = InStream_Read_C32(instream);
+    const uint32_t    doc_code  = InStream_Read_CU32(instream);
     const uint32_t    delta_doc = doc_code >> 1;
     const int32_t     doc_id    = last_doc_id + delta_doc;
     const uint32_t    freq      = (doc_code & 1)
                                   ? 1
-                                  : InStream_Read_C32(instream);
+                                  : InStream_Read_CU32(instream);
     const size_t base_size = Class_Get_Obj_Alloc_Size(RAWPOSTING);
     size_t raw_post_bytes  = MAX_RAW_POSTING_LEN(base_size, text_size, freq);
     void *const allocation = MemPool_Grab(mem_pool, raw_post_bytes);

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Plan/TextType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/TextType.c b/core/Lucy/Plan/TextType.c
index 4737b8c..4b84fa8 100644
--- a/core/Lucy/Plan/TextType.c
+++ b/core/Lucy/Plan/TextType.c
@@ -151,7 +151,7 @@ void
 TextTermStepper_Read_Key_Frame_IMP(TextTermStepper *self,
                                    InStream *instream) {
     TextTermStepperIVARS *const ivars = TextTermStepper_IVARS(self);
-    const uint32_t text_len = InStream_Read_C32(instream);
+    const uint32_t text_len = InStream_Read_CU32(instream);
 
     // Allocate space.
     char *ptr = BB_Grow(ivars->bytebuf, text_len);
@@ -173,8 +173,8 @@ TextTermStepper_Read_Key_Frame_IMP(TextTermStepper *self,
 void
 TextTermStepper_Read_Delta_IMP(TextTermStepper *self, InStream *instream) {
     TextTermStepperIVARS *const ivars = TextTermStepper_IVARS(self);
-    const uint32_t text_overlap     = InStream_Read_C32(instream);
-    const uint32_t finish_chars_len = InStream_Read_C32(instream);
+    const uint32_t text_overlap     = InStream_Read_CU32(instream);
+    const uint32_t finish_chars_len = InStream_Read_CU32(instream);
     const uint32_t total_text_len   = text_overlap + finish_chars_len;
 
     // Allocate space.

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Search/SortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SortSpec.c b/core/Lucy/Search/SortSpec.c
index c6fa2e4..9994bb4 100644
--- a/core/Lucy/Search/SortSpec.c
+++ b/core/Lucy/Search/SortSpec.c
@@ -53,7 +53,7 @@ SortSpec_Destroy_IMP(SortSpec *self) {
 
 SortSpec*
 SortSpec_Deserialize_IMP(SortSpec *self, InStream *instream) {
-    uint32_t num_rules = InStream_Read_C32(instream);
+    uint32_t num_rules = InStream_Read_CU32(instream);
     Vector *rules = Vec_new(num_rules);
 
     // Add rules.

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/Lucy/Util/Freezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.c b/core/Lucy/Util/Freezer.c
index fa0d121..20e5e33 100644
--- a/core/Lucy/Util/Freezer.c
+++ b/core/Lucy/Util/Freezer.c
@@ -126,7 +126,7 @@ Freezer_deserialize(Obj *obj, InStream *instream) {
         obj = (Obj*)Freezer_deserialize_hash((Hash*)obj, instream);
     }
     else if (Obj_is_a(obj, INTEGER)) {
-        int64_t value = (int64_t)InStream_Read_C64(instream);
+        int64_t value = InStream_Read_CI64(instream);
         obj = (Obj*)Int_init((Integer*)obj, value);
     }
     else if (Obj_is_a(obj, FLOAT)) {
@@ -245,11 +245,11 @@ Freezer_serialize_varray(Vector *array, OutStream 
*outstream) {
 
 Vector*
 Freezer_deserialize_varray(Vector *array, InStream *instream) {
-    uint32_t size = InStream_Read_C32(instream);
+    uint32_t size = InStream_Read_CU32(instream);
     Vec_init(array, size);
-    for (uint32_t tick = InStream_Read_C32(instream);
+    for (uint32_t tick = InStream_Read_CU32(instream);
          tick < size;
-         tick += InStream_Read_C32(instream)
+         tick += InStream_Read_CU32(instream)
         ) {
         Obj *obj = THAW(instream);
         Vec_Store(array, tick, obj);
@@ -281,12 +281,12 @@ Freezer_serialize_hash(Hash *hash, OutStream *outstream) {
 
 Hash*
 Freezer_deserialize_hash(Hash *hash, InStream *instream) {
-    uint32_t size = InStream_Read_C32(instream);
+    uint32_t size = InStream_Read_CU32(instream);
 
     Hash_init(hash, size);
 
     while (size--) {
-        uint32_t len = InStream_Read_C32(instream);
+        uint32_t len = InStream_Read_CU32(instream);
         char *key_buf = (char*)MALLOCATE(len + 1);
         InStream_Read_Bytes(instream, key_buf, len);
         key_buf[len] = '\0';

http://git-wip-us.apache.org/repos/asf/lucy/blob/17a3d60b/core/LucyX/Search/ProximityQuery.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityQuery.c 
b/core/LucyX/Search/ProximityQuery.c
index 6b01d5b..637fcce 100644
--- a/core/LucyX/Search/ProximityQuery.c
+++ b/core/LucyX/Search/ProximityQuery.c
@@ -95,7 +95,7 @@ ProximityQuery_Deserialize_IMP(ProximityQuery *self, InStream 
*instream) {
     float boost = InStream_Read_F32(instream);
     String *field = Freezer_read_string(instream);
     Vector *terms = Freezer_read_varray(instream);
-    uint32_t within = InStream_Read_C32(instream);
+    uint32_t within = InStream_Read_CU32(instream);
     return S_do_init(self, field, terms, boost, within);
 }
 

Reply via email to