lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [1/3] git commit: refs/heads/clean-up-cfish-wip1 - Rename CharBuf#Nip_One to Nibble.
Date Wed, 21 Aug 2013 00:11:36 GMT
Updated Branches:
  refs/heads/clean-up-cfish-wip1 [created] 785945ddd


Rename CharBuf#Nip_One to Nibble.


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

Branch: refs/heads/clean-up-cfish-wip1
Commit: 9a68b0b467a902cb0731fb4d4df707a4f2a6a3b4
Parents: b5c62f6
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Tue Aug 20 16:41:14 2013 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Tue Aug 20 16:52:33 2013 -0700

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/CharBuf.c      | 16 ++++++++--------
 clownfish/runtime/core/Clownfish/CharBuf.cfh    |  4 ++--
 clownfish/runtime/core/Clownfish/Test/TestObj.c |  2 +-
 clownfish/runtime/core/Clownfish/VTable.c       |  2 +-
 core/Lucy/Highlight/Highlighter.c               |  6 +++---
 core/Lucy/Index/Segment.c                       |  2 +-
 core/Lucy/Search/QueryParser.c                  |  4 ++--
 core/Lucy/Search/QueryParser/QueryLexer.c       | 10 +++++-----
 core/Lucy/Store/FSFolder.c                      |  2 +-
 core/Lucy/Store/Folder.c                        |  2 +-
 core/Lucy/Store/Lock.c                          |  2 +-
 core/Lucy/Util/IndexFileNames.c                 |  2 +-
 core/Lucy/Util/Json.c                           |  2 +-
 13 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
index 6890d8b..043dedf 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ b/clownfish/runtime/core/Clownfish/CharBuf.c
@@ -138,9 +138,9 @@ CB_Hash_Sum_IMP(CharBuf *self) {
     uint32_t hashvalue = 5381;
     ZombieCharBuf *iterator = ZCB_WRAP(self);
 
-    const CB_Nip_One_t nip_one = METHOD_PTR(iterator->vtable, Cfish_CB_Nip_One);
+    const CB_Nibble_t nibble = METHOD_PTR(iterator->vtable, Cfish_CB_Nibble);
     while (iterator->size) {
-        uint32_t code_point = (uint32_t)nip_one((CharBuf*)iterator);
+        uint32_t code_point = (uint32_t)nibble((CharBuf*)iterator);
         hashvalue = ((hashvalue << 5) + hashvalue) ^ code_point;
     }
 
@@ -391,13 +391,13 @@ CB_BaseX_To_I64_IMP(CharBuf *self, uint32_t base) {
 
     // Advance past minus sign.
     if (ZCB_Code_Point_At(iterator, 0) == '-') {
-        ZCB_Nip_One(iterator);
+        ZCB_Nibble(iterator);
         is_negative = true;
     }
 
     // Accumulate.
     while (iterator->size) {
-        int32_t code_point = ZCB_Nip_One(iterator);
+        int32_t code_point = ZCB_Nibble(iterator);
         if (isalnum(code_point)) {
             int32_t addend = isdigit(code_point)
                              ? code_point - '0'
@@ -641,7 +641,7 @@ CB_Nip_IMP(CharBuf *self, size_t count) {
 }
 
 int32_t
-CB_Nip_One_IMP(CharBuf *self) {
+CB_Nibble_IMP(CharBuf *self) {
     if (self->size == 0) {
         return 0;
     }
@@ -747,8 +747,8 @@ CB_compare(const void *va, const void *vb) {
     ZombieCharBuf *iterator_a = ZCB_WRAP(a);
     ZombieCharBuf *iterator_b = ZCB_WRAP(b);
     while (iterator_a->size && iterator_b->size) {
-        int32_t code_point_a = ZCB_Nip_One(iterator_a);
-        int32_t code_point_b = ZCB_Nip_One(iterator_b);
+        int32_t code_point_a = ZCB_Nibble(iterator_a);
+        int32_t code_point_b = ZCB_Nibble(iterator_b);
         const int32_t comparison = code_point_a - code_point_b;
         if (comparison != 0) { return comparison; }
     }
@@ -874,7 +874,7 @@ ViewCB_Nip_IMP(ViewCharBuf *self, size_t count) {
 }
 
 int32_t
-ViewCB_Nip_One_IMP(ViewCharBuf *self) {
+ViewCB_Nibble_IMP(ViewCharBuf *self) {
     if (self->size == 0) {
         return 0;
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/clownfish/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.cfh b/clownfish/runtime/core/Clownfish/CharBuf.cfh
index edfc251..12fcf6d 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.cfh
+++ b/clownfish/runtime/core/Clownfish/CharBuf.cfh
@@ -264,7 +264,7 @@ class Clownfish::CharBuf cnick CB
      * point, or 0 if the string was empty.
      */
     int32_t
-    Nip_One(CharBuf *self);
+    Nibble(CharBuf *self);
 
     /** Remove characters (measured in code points) from the end of the
      * CharBuf.  Returns the number chopped.
@@ -339,7 +339,7 @@ class Clownfish::ViewCharBuf cnick ViewCB
     Nip(ViewCharBuf *self, size_t count);
 
     int32_t
-    Nip_One(ViewCharBuf *self);
+    Nibble(ViewCharBuf *self);
 
     /** Throws an error. */
     char*

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
index 83f154b..a3fd446 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestObj.c
@@ -70,7 +70,7 @@ test_To_String(TestBatchRunner *runner) {
     ZombieCharBuf *temp = ZCB_WRAP(string);
     while (ZCB_Get_Size(temp)) {
         if (ZCB_Starts_With_Str(temp, "TestObj", 7)) { break; }
-        ZCB_Nip_One(temp);
+        ZCB_Nibble(temp);
     }
     TEST_TRUE(runner, ZCB_Starts_With_Str(temp, "TestObj", 7), "To_String");
     DECREF(string);

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 5420412..5914dd1 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -329,7 +329,7 @@ S_scrunch_charbuf(CharBuf *source, CharBuf *target) {
     ZombieCharBuf *iterator = ZCB_WRAP(source);
     CB_Set_Size(target, 0);
     while (ZCB_Get_Size(iterator)) {
-        uint32_t code_point = ZCB_Nip_One(iterator);
+        uint32_t code_point = ZCB_Nibble(iterator);
         if (code_point > 127) {
             THROW(ERR, "Can't fold case for %o", source);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Highlight/Highlighter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Highlight/Highlighter.c b/core/Lucy/Highlight/Highlighter.c
index d07df31..7481500 100644
--- a/core/Lucy/Highlight/Highlighter.c
+++ b/core/Lucy/Highlight/Highlighter.c
@@ -404,7 +404,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
         }
 
         do {
-            uint32_t code_point = ZCB_Nip_One(temp);
+            uint32_t code_point = ZCB_Nibble(temp);
             start++;
             this_excerpt_len--;
 
@@ -704,7 +704,7 @@ S_encode_entities(CharBuf *text, CharBuf *encoded) {
 
     // Scan first so that we only allocate once.
     uint32_t code_point;
-    while (0 != (code_point = ZCB_Nip_One(temp))) {
+    while (0 != (code_point = ZCB_Nibble(temp))) {
         if (code_point > 127
             || (!isgraph(code_point) && !isspace(code_point))
             || code_point == '<'
@@ -722,7 +722,7 @@ S_encode_entities(CharBuf *text, CharBuf *encoded) {
     CB_Grow(encoded, space);
     CB_Set_Size(encoded, 0);
     ZCB_Assign(temp, text);
-    while (0 != (code_point = ZCB_Nip_One(temp))) {
+    while (0 != (code_point = ZCB_Nibble(temp))) {
         if (code_point > 127
             || (!isgraph(code_point) && !isspace(code_point))
            ) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Index/Segment.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Segment.c b/core/Lucy/Index/Segment.c
index 67feec8..6deea89 100644
--- a/core/Lucy/Index/Segment.c
+++ b/core/Lucy/Index/Segment.c
@@ -69,7 +69,7 @@ Seg_valid_seg_name(const CharBuf *name) {
         ZombieCharBuf *scratch = ZCB_WRAP(name);
         ZCB_Nip(scratch, 4);
         uint32_t code_point;
-        while (0 != (code_point = ZCB_Nip_One(scratch))) {
+        while (0 != (code_point = ZCB_Nibble(scratch))) {
             if (!isalnum(code_point)) { return false; }
         }
         if (ZCB_Get_Size(scratch) == 0) { return true; } // Success!

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Search/QueryParser.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index 9ecb710..2346bf2 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -831,9 +831,9 @@ S_unescape(QueryParser *self, CharBuf *orig, CharBuf *target) {
     CB_Set_Size(target, 0);
     CB_Grow(target, CB_Get_Size(orig) + 4);
 
-    while (0 != (code_point = ZCB_Nip_One(source))) {
+    while (0 != (code_point = ZCB_Nibble(source))) {
         if (code_point == '\\') {
-            uint32_t next_code_point = ZCB_Nip_One(source);
+            uint32_t next_code_point = ZCB_Nibble(source);
             if (next_code_point == ':'
                 || next_code_point == '"'
                 || next_code_point == '\\'

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Search/QueryParser/QueryLexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.c b/core/Lucy/Search/QueryParser/QueryLexer.c
index 7c8ae41..e5def1c 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.c
+++ b/core/Lucy/Search/QueryParser/QueryLexer.c
@@ -235,9 +235,9 @@ S_consume_text(ZombieCharBuf *qstring) {
     ZombieCharBuf *text  = ZCB_WRAP((CharBuf*)qstring);
     size_t tick = 0;
     while (1) {
-        uint32_t code_point = ZCB_Nip_One(qstring);
+        uint32_t code_point = ZCB_Nibble(qstring);
         if (code_point == '\\') {
-            code_point = ZCB_Nip_One(qstring);
+            code_point = ZCB_Nibble(qstring);
             tick++;
             if (code_point == 0) {
                 break;
@@ -261,13 +261,13 @@ S_consume_text(ZombieCharBuf *qstring) {
 static ParserElem*
 S_consume_quoted_string(ZombieCharBuf *qstring) {
     ZombieCharBuf *text = ZCB_WRAP((CharBuf*)qstring);
-    if (ZCB_Nip_One(qstring) != '"') {
+    if (ZCB_Nibble(qstring) != '"') {
         THROW(ERR, "Internal error: expected a quote");
     }
 
     size_t tick = 1;
     while (1) {
-        uint32_t code_point = ZCB_Nip_One(qstring);
+        uint32_t code_point = ZCB_Nibble(qstring);
         if (code_point == '"') {
             tick += 1;
             break;
@@ -276,7 +276,7 @@ S_consume_quoted_string(ZombieCharBuf *qstring) {
             break;
         }
         else if (code_point == '\\') {
-            ZCB_Nip_One(qstring);
+            ZCB_Nibble(qstring);
             tick += 2;
         }
         else {

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Store/FSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index 00b719e..d9cc23a 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -299,7 +299,7 @@ static bool
 S_is_local_entry(const CharBuf *path) {
     ZombieCharBuf *scratch = ZCB_WRAP(path);
     uint32_t code_point;
-    while (0 != (code_point = ZCB_Nip_One(scratch))) {
+    while (0 != (code_point = ZCB_Nibble(scratch))) {
         if (code_point == '/') { return false; }
     }
     return true;

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Store/Folder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.c b/core/Lucy/Store/Folder.c
index 32892f2..a0012e1 100644
--- a/core/Lucy/Store/Folder.c
+++ b/core/Lucy/Store/Folder.c
@@ -432,7 +432,7 @@ S_enclosing_folder(Folder *self, ZombieCharBuf *path) {
     // Find first component of the file path.
     ZombieCharBuf *scratch        = ZCB_WRAP((CharBuf*)path);
     ZombieCharBuf *path_component = ZCB_WRAP((CharBuf*)path);
-    while (0 != (code_point = ZCB_Nip_One(scratch))) {
+    while (0 != (code_point = ZCB_Nibble(scratch))) {
         if (code_point == '/') {
             ZCB_Truncate(path_component, path_component_len);
             ZCB_Nip(path, path_component_len + 1);

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Store/Lock.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index 9d56377..71a6f49 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -41,7 +41,7 @@ Lock_init(Lock *self, Folder *folder, const CharBuf *name,
     }
     ZombieCharBuf *scratch = ZCB_WRAP(name);
     uint32_t code_point;
-    while (0 != (code_point = ZCB_Nip_One(scratch))) {
+    while (0 != (code_point = ZCB_Nibble(scratch))) {
         if (isalnum(code_point)
             || code_point == '.'
             || code_point == '-'

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Util/IndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.c b/core/Lucy/Util/IndexFileNames.c
index 1a02f2c..72229b6 100644
--- a/core/Lucy/Util/IndexFileNames.c
+++ b/core/Lucy/Util/IndexFileNames.c
@@ -55,7 +55,7 @@ IxFileNames_extract_gen(const CharBuf *name) {
     // Advance past first underscore.  Bail if we run out of string or if we
     // encounter a NULL.
     while (1) {
-        uint32_t code_point = ZCB_Nip_One(num_string);
+        uint32_t code_point = ZCB_Nibble(num_string);
         if (code_point == 0) { return 0; }
         else if (code_point == '_') { break; }
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/9a68b0b4/core/Lucy/Util/Json.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index 5db17a5..8a2c22f 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -179,7 +179,7 @@ S_append_json_string(Obj *dump, CharBuf *json) {
     // Process string data.
     ZombieCharBuf *iterator = ZCB_WRAP((CharBuf*)dump);
     while (ZCB_Get_Size(iterator)) {
-        uint32_t code_point = ZCB_Nip_One(iterator);
+        uint32_t code_point = ZCB_Nibble(iterator);
         if (code_point > 127) {
             // There is no need to escape any high characters, including those
             // above the BMP, as we assume that the destination channel can


Mime
View raw message