lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [2/3] git commit: refs/heads/master - Cease using CHY short names
Date Sat, 12 Jul 2014 13:20:10 GMT
Cease using CHY short names

Also include charmony.h directly from .c files where needed preparing
for the next commit.


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

Branch: refs/heads/master
Commit: a6a6a2588acde85134e8158294cdd710d5f28d00
Parents: 3bf78f0
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Wed Jul 9 19:29:58 2014 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sat Jul 12 15:16:56 2014 +0200

----------------------------------------------------------------------
 c/src/Lucy/Analysis/RegexTokenizer.c          |  6 +++---
 core/Lucy/Search/Collector/SortCollector.c    | 20 ++++++++++++--------
 core/Lucy/Search/Matcher.c                    |  1 -
 core/Lucy/Store/CompoundFileReader.c          |  4 +++-
 core/Lucy/Store/FSDirHandle.c                 |  2 ++
 core/Lucy/Store/FSFileHandle.c                | 13 ++++++++-----
 core/Lucy/Store/FSFolder.c                    | 18 ++++++++++--------
 core/Lucy/Store/Folder.c                      |  4 +++-
 core/Lucy/Store/InStream.c                    | 22 +++++++++++++---------
 core/Lucy/Store/OutStream.c                   |  6 ++++--
 core/Lucy/Test/Search/TestSortSpec.c          |  6 ++++--
 core/Lucy/Test/Store/TestCompoundFileWriter.c |  2 ++
 core/Lucy/Test/Store/TestFSDirHandle.c        |  2 ++
 core/Lucy/Test/Store/TestFSFolder.c           |  2 ++
 core/Lucy/Test/Store/TestIOChunks.c           |  4 +++-
 core/Lucy/Test/Store/TestIOPrimitives.c       |  2 ++
 core/Lucy/Util/Debug.c                        |  1 -
 17 files changed, 73 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/c/src/Lucy/Analysis/RegexTokenizer.c
----------------------------------------------------------------------
diff --git a/c/src/Lucy/Analysis/RegexTokenizer.c b/c/src/Lucy/Analysis/RegexTokenizer.c
index 09f20aa..ab51012 100644
--- a/c/src/Lucy/Analysis/RegexTokenizer.c
+++ b/c/src/Lucy/Analysis/RegexTokenizer.c
@@ -28,7 +28,7 @@
 #include "Lucy/Analysis/Token.h"
 #include "Lucy/Analysis/Inversion.h"
 
-#if defined(HAS_PCRE_H)
+#if defined(CHY_HAS_PCRE_H)
 
 #include <pcre.h>
 
@@ -156,7 +156,7 @@ S_count_code_points(const char *string, size_t len) {
     return num_code_points;
 }
 
-#else // HAS_PCRE_H
+#else // CHY_HAS_PCRE_H
 
 bool
 RegexTokenizer_is_available(void) {
@@ -202,5 +202,5 @@ RegexTokenizer_Tokenize_Utf8_IMP(RegexTokenizer *self, const char *string,
           " without PCRE.");
 }
 
-#endif // HAS_PCRE_H
+#endif // CHY_HAS_PCRE_H
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Search/Collector/SortCollector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Collector/SortCollector.c b/core/Lucy/Search/Collector/SortCollector.c
index 801d5c0..80561b0 100644
--- a/core/Lucy/Search/Collector/SortCollector.c
+++ b/core/Lucy/Search/Collector/SortCollector.c
@@ -18,6 +18,8 @@
 #define C_LUCY_MATCHDOC
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include "Lucy/Search/Collector/SortCollector.h"
 #include "Lucy/Index/SegReader.h"
 #include "Lucy/Index/SortCache.h"
@@ -101,7 +103,7 @@ SortColl_init(SortCollector *self, Schema *schema, SortSpec *sort_spec,
     SortCollectorIVARS *const ivars = SortColl_IVARS(self);
     ivars->total_hits    = 0;
     ivars->bubble_doc    = INT32_MAX;
-    ivars->bubble_score  = F32_NEGINF;
+    ivars->bubble_score  = CHY_F32_NEGINF;
     ivars->seg_doc_max   = 0;
 
     // Assign.
@@ -155,7 +157,7 @@ SortColl_init(SortCollector *self, Schema *schema, SortSpec *sort_spec,
 
     // Prepare a MatchDoc-in-waiting.
     VArray *values = ivars->need_values ? VA_new(num_rules) : NULL;
-    float   score  = ivars->need_score  ? F32_NEGINF : F32_NAN;
+    float   score  = ivars->need_score  ? CHY_F32_NEGINF : CHY_F32_NAN;
     ivars->bumped = MatchDoc_new(INT32_MAX, score, values);
     DECREF(values);
 
@@ -231,8 +233,8 @@ SortColl_Set_Reader_IMP(SortCollector *self, SegReader *reader) {
     MatchDocIVARS *const bumped_ivars = MatchDoc_IVARS(ivars->bumped);
     bumped_ivars->doc_id = INT32_MAX;
     ivars->bubble_doc    = INT32_MAX;
-    bumped_ivars->score  = ivars->need_score ? F32_NEGINF : F32_NAN;
-    ivars->bubble_score  = ivars->need_score ? F32_NEGINF : F32_NAN;
+    bumped_ivars->score  = ivars->need_score ? CHY_F32_NEGINF : CHY_F32_NAN;
+    ivars->bubble_score  = ivars->need_score ? CHY_F32_NEGINF : CHY_F32_NAN;
     ivars->actions       = ivars->auto_actions;
 
     // Obtain sort caches. Derive actions array for this segment.
@@ -285,7 +287,7 @@ SortColl_Collect_IMP(SortCollector *self, int32_t doc_id) {
         MatchDocIVARS *const match_doc_ivars = MatchDoc_IVARS(match_doc);
         match_doc_ivars->doc_id = doc_id + ivars->base;
 
-        if (ivars->need_score && match_doc_ivars->score == F32_NEGINF) {
+        if (ivars->need_score && match_doc_ivars->score == CHY_F32_NEGINF)
{
             match_doc_ivars->score = Matcher_Score(ivars->matcher);
         }
 
@@ -321,15 +323,17 @@ SortColl_Collect_IMP(SortCollector *self, int32_t doc_id) {
 
             // Recycle.
             MatchDoc_IVARS(ivars->bumped)->score = ivars->need_score
-                                                   ? F32_NEGINF
-                                                   : F32_NAN;
+                                                   ? CHY_F32_NEGINF
+                                                   : CHY_F32_NAN;
         }
         else {
             // The queue isn't full yet, so create a fresh MatchDoc.
             VArray *values = ivars->need_values
                              ? VA_new(ivars->num_rules)
                              : NULL;
-            float fake_score = ivars->need_score ? F32_NEGINF : F32_NAN;
+            float fake_score = ivars->need_score
+                               ? CHY_F32_NEGINF
+                               : CHY_F32_NAN;
             ivars->bumped = MatchDoc_new(INT32_MAX, fake_score, values);
             DECREF(values);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Search/Matcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Matcher.c b/core/Lucy/Search/Matcher.c
index 2003369..2d70175 100644
--- a/core/Lucy/Search/Matcher.c
+++ b/core/Lucy/Search/Matcher.c
@@ -17,7 +17,6 @@
 #define C_LUCY_MATCHER
 #define CFISH_USE_SHORT_NAMES
 #define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
 
 #include "Lucy/Search/Matcher.h"
 #include "Clownfish/Err.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/CompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.c b/core/Lucy/Store/CompoundFileReader.c
index edf31c6..afc8cd4 100644
--- a/core/Lucy/Store/CompoundFileReader.c
+++ b/core/Lucy/Store/CompoundFileReader.c
@@ -18,6 +18,8 @@
 #define C_LUCY_CFREADERDIRHANDLE
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include "Lucy/Store/CompoundFileReader.h"
 #include "Lucy/Store/CompoundFileWriter.h"
 #include "Lucy/Store/FileHandle.h"
@@ -94,7 +96,7 @@ CFReader_do_open(CompoundFileReader *self, Folder *folder) {
             String *orig = (String*)VA_Fetch(files, i);
             if (Str_Starts_With(orig, folder_name)) {
                 Obj *record = Hash_Delete(ivars->records, (Obj*)orig);
-                size_t offset = folder_name_len + sizeof(DIR_SEP) - 1;
+                size_t offset = folder_name_len + sizeof(CHY_DIR_SEP) - 1;
                 size_t len    = Str_Length(orig) - offset;
                 String *filename = Str_SubString(orig, offset, len);
                 Hash_Store(ivars->records, (Obj*)filename, (Obj*)record);

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/FSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSDirHandle.c b/core/Lucy/Store/FSDirHandle.c
index 8a04fa1..f17ea15 100644
--- a/core/Lucy/Store/FSDirHandle.c
+++ b/core/Lucy/Store/FSDirHandle.c
@@ -21,6 +21,8 @@
 #include <errno.h>
 #include <sys/stat.h>
 
+#include "charmony.h"
+
 #include "Lucy/Util/ToolSet.h"
 #include "Clownfish/Err.h"
 #include "Clownfish/VArray.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/FSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFileHandle.c b/core/Lucy/Store/FSFileHandle.c
index c4e95d3..74f5ffc 100644
--- a/core/Lucy/Store/FSFileHandle.c
+++ b/core/Lucy/Store/FSFileHandle.c
@@ -17,6 +17,8 @@
 #define C_LUCY_FSFILEHANDLE
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h> // open, POSIX flags
@@ -54,7 +56,7 @@ SI_posix_flags(uint32_t fh_flags) {
     return posix_flags;
 }
 
-#define IS_64_BIT (SIZEOF_PTR == 8 ? 1 : 0)
+#define IS_64_BIT (CHY_SIZEOF_PTR == 8 ? 1 : 0)
 
 // Memory map a region of the file with shared (read-only) permissions.  If
 // the requested length is 0, return NULL.  If an error occurs, return NULL
@@ -115,7 +117,7 @@ FSFH_do_open(FSFileHandle *self, String *path, uint32_t flags) {
         }
         else {
             // Derive length.
-            ivars->len = lseek64(ivars->fd, INT64_C(0), SEEK_END);
+            ivars->len = chy_lseek64(ivars->fd, INT64_C(0), SEEK_END);
             if (ivars->len == -1) {
                 Err_set_error(Err_new(Str_newf("lseek64 on %o failed: %s",
                                                ivars->path, strerror(errno))));
@@ -123,7 +125,8 @@ FSFH_do_open(FSFileHandle *self, String *path, uint32_t flags) {
                 return NULL;
             }
             else {
-                int64_t check_val = lseek64(ivars->fd, INT64_C(0), SEEK_SET);
+                int64_t check_val
+                    = chy_lseek64(ivars->fd, INT64_C(0), SEEK_SET);
                 if (check_val == -1) {
                     Err_set_error(Err_new(Str_newf("lseek64 on %o failed: %s",
                                                    ivars->path, strerror(errno))));
@@ -343,14 +346,14 @@ SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars) {
     }
 
     // Derive len.
-    ivars->len = lseek64(ivars->fd, INT64_C(0), SEEK_END);
+    ivars->len = chy_lseek64(ivars->fd, INT64_C(0), SEEK_END);
     if (ivars->len == -1) {
         Err_set_error(Err_new(Str_newf("lseek64 on %o failed: %s", ivars->path,
                                        strerror(errno))));
         return false;
     }
     else {
-        int64_t check_val = lseek64(ivars->fd, INT64_C(0), SEEK_SET);
+        int64_t check_val = chy_lseek64(ivars->fd, INT64_C(0), SEEK_SET);
         if (check_val == -1) {
             Err_set_error(Err_new(Str_newf("lseek64 on %o failed: %s",
                                            ivars->path, strerror(errno))));

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/FSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index abbae12..9d4d03f 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -17,6 +17,8 @@
 #define C_LUCY_FSFOLDER
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -271,10 +273,10 @@ FSFolder_Local_Find_Folder_IMP(FSFolder *self, String *name) {
 static String*
 S_fullpath(FSFolder *self, String *path) {
     FSFolderIVARS *const ivars = FSFolder_IVARS(self);
-    String *fullpath = Str_newf("%o%s%o", ivars->path, DIR_SEP, path);
+    String *fullpath = Str_newf("%o%s%o", ivars->path, CHY_DIR_SEP, path);
     String *retval;
-    if (DIR_SEP[0] != '/') {
-        retval = Str_Swap_Chars(fullpath, '/', DIR_SEP[0]);
+    if (CHY_DIR_SEP[0] != '/') {
+        retval = Str_Swap_Chars(fullpath, '/', CHY_DIR_SEP[0]);
         DECREF(fullpath);
     }
     else {
@@ -294,13 +296,13 @@ S_fullpath_ptr(FSFolder *self, String *path) {
 
     char *buf = (char*)MALLOCATE(full_size + 1);
     memcpy(buf, folder_ptr, folder_size);
-    buf[folder_size] = DIR_SEP[0];
+    buf[folder_size] = CHY_DIR_SEP[0];
     memcpy(buf + folder_size + 1, path_ptr, path_size);
     buf[full_size] = '\0';
 
-    if (DIR_SEP[0] != '/') {
+    if (CHY_DIR_SEP[0] != '/') {
         for (size_t i = 0; i < full_size; ++i) {
-            if (buf[i] == '/') { buf[i] = DIR_SEP[0]; }
+            if (buf[i] == '/') { buf[i] = CHY_DIR_SEP[0]; }
         }
     }
 
@@ -395,7 +397,7 @@ S_hard_link(char *from8, char *to8) {
 
 static bool
 S_is_absolute(String *path) {
-    return Str_Starts_With_Utf8(path, DIR_SEP, 1);
+    return Str_Starts_With_Utf8(path, CHY_DIR_SEP, 1);
 }
 
 static String*
@@ -404,7 +406,7 @@ S_absolutify(String *path) {
 
     char *cwd = getcwd(NULL, 0);
     if (!cwd) { THROW(ERR, "getcwd failed"); }
-    String *abs_path = Str_newf("%s" DIR_SEP "%o", cwd, path);
+    String *abs_path = Str_newf("%s" CHY_DIR_SEP "%o", cwd, path);
     free(cwd);
 
     return abs_path;

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/Folder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.c b/core/Lucy/Store/Folder.c
index 86776a8..7ec92b6 100644
--- a/core/Lucy/Store/Folder.c
+++ b/core/Lucy/Store/Folder.c
@@ -19,6 +19,8 @@
 #include <ctype.h>
 #include <limits.h>
 
+#include "charmony.h"
+
 #include "Lucy/Store/Folder.h"
 #include "Lucy/Store/CompoundFileReader.h"
 #include "Lucy/Store/CompoundFileWriter.h"
@@ -41,7 +43,7 @@ Folder_init(Folder *self, String *path) {
     }
     else {
         // Copy path, strip trailing slash or equivalent.
-        if (Str_Ends_With_Utf8(path, DIR_SEP, strlen(DIR_SEP))) {
+        if (Str_Ends_With_Utf8(path, CHY_DIR_SEP, strlen(CHY_DIR_SEP))) {
             ivars->path = Str_SubString(path, 0, Str_Length(path) - 1);
         }
         else {

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/InStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/InStream.c b/core/Lucy/Store/InStream.c
index 9e7380e..366caca 100644
--- a/core/Lucy/Store/InStream.c
+++ b/core/Lucy/Store/InStream.c
@@ -17,6 +17,8 @@
 #define C_LUCY_INSTREAM
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include "Lucy/Store/InStream.h"
 #include "Lucy/Store/FileHandle.h"
 #include "Lucy/Store/FSFileHandle.h"
@@ -270,7 +272,7 @@ static CFISH_INLINE int64_t
 SI_tell(InStream *self) {
     InStreamIVARS *const ivars = InStream_IVARS(self);
     char *fw_buf = FileWindow_Get_Buf(ivars->window);
-    int64_t pos_in_buf = PTR_TO_I64(ivars->buf) - PTR_TO_I64(fw_buf);
+    int64_t pos_in_buf = CHY_PTR_TO_I64(ivars->buf) - CHY_PTR_TO_I64(fw_buf);
     return pos_in_buf + FileWindow_Get_Offset(ivars->window) - ivars->offset;
 }
 
@@ -287,7 +289,8 @@ InStream_Length_IMP(InStream *self) {
 char*
 InStream_Buf_IMP(InStream *self, size_t request) {
     InStreamIVARS *const ivars = InStream_IVARS(self);
-    const int64_t bytes_in_buf = PTR_TO_I64(ivars->limit) - PTR_TO_I64(ivars->buf);
+    const int64_t bytes_in_buf
+        = CHY_PTR_TO_I64(ivars->limit) - CHY_PTR_TO_I64(ivars->buf);
 
     /* It's common for client code to overestimate how much is needed, because
      * the request has to figure in worst-case for compressed data.  However,
@@ -318,12 +321,12 @@ void
 InStream_Advance_Buf_IMP(InStream *self, char *buf) {
     InStreamIVARS *const ivars = InStream_IVARS(self);
     if (buf > ivars->limit) {
-        int64_t overrun = PTR_TO_I64(buf) - PTR_TO_I64(ivars->limit);
+        int64_t overrun = CHY_PTR_TO_I64(buf) - CHY_PTR_TO_I64(ivars->limit);
         THROW(ERR, "Supplied value is %i64 bytes beyond end of buffer",
               overrun);
     }
     else if (buf < ivars->buf) {
-        int64_t underrun = PTR_TO_I64(ivars->buf) - PTR_TO_I64(buf);
+        int64_t underrun = CHY_PTR_TO_I64(ivars->buf) - CHY_PTR_TO_I64(buf);
         THROW(ERR, "Can't Advance_Buf backwards: (underrun: %i64))", underrun);
     }
     else {
@@ -339,7 +342,8 @@ InStream_Read_Bytes_IMP(InStream *self, char* buf, size_t len) {
 static CFISH_INLINE void
 SI_read_bytes(InStream *self, char* buf, size_t len) {
     InStreamIVARS *const ivars = InStream_IVARS(self);
-    const int64_t available = PTR_TO_I64(ivars->limit) - PTR_TO_I64(ivars->buf);
+    const int64_t available
+        = CHY_PTR_TO_I64(ivars->limit) - CHY_PTR_TO_I64(ivars->buf);
     if (available >= (int64_t)len) {
         // Request is entirely within buffer, so copy.
         memcpy(buf, ivars->buf, len);
@@ -404,7 +408,7 @@ static CFISH_INLINE uint32_t
 SI_read_u32(InStream *self) {
     uint32_t retval;
     SI_read_bytes(self, (char*)&retval, 4);
-#ifdef LITTLE_END
+#ifdef CHY_LITTLE_END
     retval = NumUtil_decode_bigend_u32((char*)&retval);
 #endif
     return retval;
@@ -424,7 +428,7 @@ static CFISH_INLINE uint64_t
 SI_read_u64(InStream *self) {
     uint64_t retval;
     SI_read_bytes(self, (char*)&retval, 8);
-#ifdef LITTLE_END
+#ifdef CHY_LITTLE_END
     retval = NumUtil_decode_bigend_u64((char*)&retval);
 #endif
     return retval;
@@ -444,7 +448,7 @@ float
 InStream_Read_F32_IMP(InStream *self) {
     union { float f; uint32_t u32; } duo;
     SI_read_bytes(self, (char*)&duo, sizeof(float));
-#ifdef LITTLE_END
+#ifdef CHY_LITTLE_END
     duo.u32 = NumUtil_decode_bigend_u32(&duo.u32);
 #endif
     return duo.f;
@@ -454,7 +458,7 @@ double
 InStream_Read_F64_IMP(InStream *self) {
     union { double d; uint64_t u64; } duo;
     SI_read_bytes(self, (char*)&duo, sizeof(double));
-#ifdef LITTLE_END
+#ifdef CHY_LITTLE_END
     duo.u64 = NumUtil_decode_bigend_u64(&duo.u64);
 #endif
     return duo.d;

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Store/OutStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/OutStream.c b/core/Lucy/Store/OutStream.c
index 63af1e4..f61466e 100644
--- a/core/Lucy/Store/OutStream.c
+++ b/core/Lucy/Store/OutStream.c
@@ -17,6 +17,8 @@
 #define C_LUCY_OUTSTREAM
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include "Lucy/Store/OutStream.h"
 #include "Lucy/Store/FileHandle.h"
 #include "Lucy/Store/FSFileHandle.h"
@@ -222,7 +224,7 @@ OutStream_Write_U8_IMP(OutStream *self, uint8_t value) {
 
 static CFISH_INLINE void
 SI_write_u32(OutStream *self, OutStreamIVARS *ivars, uint32_t value) {
-#ifdef BIG_END
+#ifdef CHY_BIG_END
     SI_write_bytes(self, ivars, &value, 4);
 #else
     char  buf[4];
@@ -244,7 +246,7 @@ OutStream_Write_U32_IMP(OutStream *self, uint32_t value) {
 
 static CFISH_INLINE void
 SI_write_u64(OutStream *self, OutStreamIVARS *ivars, uint64_t value) {
-#ifdef BIG_END
+#ifdef CHY_BIG_END
     SI_write_bytes(self, ivars, &value, 8);
 #else
     char  buf[sizeof(uint64_t)];

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Search/TestSortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.c b/core/Lucy/Test/Search/TestSortSpec.c
index 467e045..46a43d2 100644
--- a/core/Lucy/Test/Search/TestSortSpec.c
+++ b/core/Lucy/Test/Search/TestSortSpec.c
@@ -21,6 +21,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "charmony.h"
+
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
 #include "Lucy/Test.h"
@@ -295,13 +297,13 @@ S_random_int64() {
 static Obj*
 S_random_float32() {
     uint64_t num = TestUtils_random_u64();
-    return (Obj*)Float32_new(U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX));
+    return (Obj*)Float32_new(CHY_U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX));
 }
 
 static Obj*
 S_random_float64() {
     uint64_t num = TestUtils_random_u64();
-    return (Obj*)Float64_new(U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX));
+    return (Obj*)Float64_new(CHY_U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX));
 }
 
 static VArray*

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Store/TestCompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileWriter.c b/core/Lucy/Test/Store/TestCompoundFileWriter.c
index a41575d..8c139a9 100644
--- a/core/Lucy/Test/Store/TestCompoundFileWriter.c
+++ b/core/Lucy/Test/Store/TestCompoundFileWriter.c
@@ -17,6 +17,8 @@
 #define TESTLUCY_USE_SHORT_NAMES
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Lucy/Test.h"
 #include "Lucy/Test/Store/TestCompoundFileWriter.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Store/TestFSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.c b/core/Lucy/Test/Store/TestFSDirHandle.c
index 2e87b3c..5568255 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.c
+++ b/core/Lucy/Test/Store/TestFSDirHandle.c
@@ -17,6 +17,8 @@
 #define TESTLUCY_USE_SHORT_NAMES
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 // rmdir
 #ifdef CHY_HAS_DIRECT_H
   #include <direct.h>

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Store/TestFSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c
index f26cd7b..5d41705 100644
--- a/core/Lucy/Test/Store/TestFSFolder.c
+++ b/core/Lucy/Test/Store/TestFSFolder.c
@@ -17,6 +17,8 @@
 #define TESTLUCY_USE_SHORT_NAMES
 #include "Lucy/Util/ToolSet.h"
 
+#include "charmony.h"
+
 // mkdir, rmdir
 #ifdef CHY_HAS_DIRECT_H
   #include <direct.h>

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Store/TestIOChunks.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOChunks.c b/core/Lucy/Test/Store/TestIOChunks.c
index ce22121..1df0651 100644
--- a/core/Lucy/Test/Store/TestIOChunks.c
+++ b/core/Lucy/Test/Store/TestIOChunks.c
@@ -20,6 +20,8 @@
 #include <stdlib.h>
 #include <time.h>
 
+#include "charmony.h"
+
 #define TESTLUCY_USE_SHORT_NAMES
 #include "Lucy/Util/ToolSet.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
@@ -104,7 +106,7 @@ test_Buf(TestBatchRunner *runner) {
 
     int64_t  expected = InStream_Length(instream) - InStream_Tell(instream);
     char    *buff     = InStream_Buf(instream, 100000);
-    int64_t  got      = PTR_TO_I64(ivars->limit) - PTR_TO_I64(buff);
+    int64_t  got      = CHY_PTR_TO_I64(ivars->limit) - CHY_PTR_TO_I64(buff);
     TEST_TRUE(runner, got == expected,
               "Requests greater than file size get pared down");
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Test/Store/TestIOPrimitives.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOPrimitives.c b/core/Lucy/Test/Store/TestIOPrimitives.c
index dd3cdb5..66caf76 100644
--- a/core/Lucy/Test/Store/TestIOPrimitives.c
+++ b/core/Lucy/Test/Store/TestIOPrimitives.c
@@ -20,6 +20,8 @@
 #include <stdlib.h>
 #include <time.h>
 
+#include "charmony.h"
+
 #define TESTLUCY_USE_SHORT_NAMES
 #include "Lucy/Util/ToolSet.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/a6a6a258/core/Lucy/Util/Debug.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Debug.c b/core/Lucy/Util/Debug.c
index aa88c7e..df529b9 100644
--- a/core/Lucy/Util/Debug.c
+++ b/core/Lucy/Util/Debug.c
@@ -17,7 +17,6 @@
 #define C_LUCY_DEBUG
 #define CFISH_USE_SHORT_NAMES
 #define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
 
 #include "Lucy/Util/Debug.h"
 


Mime
View raw message