You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/07/21 15:35:11 UTC
[lucy-commits] [02/10] git commit: refs/heads/charmonizer-decoupling - Replace
INLINE with CFISH_INLINE in source files
Replace INLINE with CFISH_INLINE in source files
The source files can still include charmony.h, so this isn't really
needed. But I think it's a good idea to use CFISH_INLINE for
consistency.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/814c070c
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/814c070c
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/814c070c
Branch: refs/heads/charmonizer-decoupling
Commit: 814c070c8fa5d4defb46d38102bb68742aea4eb3
Parents: 4a955ce
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 21 00:53:26 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Jul 21 15:01:55 2013 +0200
----------------------------------------------------------------------
clownfish/runtime/core/Clownfish/ByteBuf.c | 6 ++--
clownfish/runtime/core/Clownfish/Err.c | 2 +-
clownfish/runtime/core/Clownfish/Hash.c | 12 ++++----
.../runtime/core/Clownfish/Util/SortUtils.c | 20 ++++++-------
core/Lucy/Search/Collector/SortCollector.c | 22 +++++++-------
core/Lucy/Search/HitQueue.c | 2 +-
core/Lucy/Search/ORMatcher.c | 8 +++---
core/Lucy/Search/PhraseMatcher.c | 2 +-
core/Lucy/Store/FSDirHandle.c | 2 +-
core/Lucy/Store/FSFileHandle.c | 30 ++++++++++----------
core/Lucy/Store/InStream.c | 16 +++++------
core/Lucy/Store/OutStream.c | 14 ++++-----
core/Lucy/Util/Json.c | 4 +--
core/Lucy/Util/SortExternal.c | 2 +-
core/LucyX/Search/ProximityMatcher.c | 2 +-
15 files changed, 72 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
index 6303816..7e9202d 100644
--- a/clownfish/runtime/core/Clownfish/ByteBuf.c
+++ b/clownfish/runtime/core/Clownfish/ByteBuf.c
@@ -107,7 +107,7 @@ BB_get_capacity(ByteBuf *self) {
return self->cap;
}
-static INLINE bool
+static CFISH_INLINE bool
SI_equals_bytes(ByteBuf *self, const void *bytes, size_t size) {
if (self->size != size) { return false; }
return (memcmp(self->buf, bytes, self->size) == 0);
@@ -138,7 +138,7 @@ BB_hash_sum(ByteBuf *self) {
return (int32_t)sum;
}
-static INLINE void
+static CFISH_INLINE void
SI_mimic_bytes(ByteBuf *self, const void *bytes, size_t size) {
if (size > self->cap) { S_grow(self, size); }
memmove(self->buf, bytes, size);
@@ -156,7 +156,7 @@ BB_mimic(ByteBuf *self, Obj *other) {
SI_mimic_bytes(self, twin->buf, twin->size);
}
-static INLINE void
+static CFISH_INLINE void
SI_cat_bytes(ByteBuf *self, const void *bytes, size_t size) {
const size_t new_size = self->size + size;
if (new_size > self->cap) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
index 0dd0363..af100c0 100644
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ b/clownfish/runtime/core/Clownfish/Err.c
@@ -183,7 +183,7 @@ Err_throw_at(VTable *vtable, const char *file, int line,
}
// Inlined, slightly optimized version of Obj_is_a.
-static INLINE bool
+static CFISH_INLINE bool
SI_obj_is_a(Obj *obj, VTable *target_vtable) {
VTable *vtable = obj->vtable;
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
index e18f512..b70020d 100644
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ b/clownfish/runtime/core/Clownfish/Hash.c
@@ -41,15 +41,15 @@ typedef struct HashEntry {
} HashEntry;
// Reset the iterator. Hash_Iterate must be called to restart iteration.
-static INLINE void
+static CFISH_INLINE void
SI_kill_iter(Hash *self);
// Return the entry associated with the key, if any.
-static INLINE HashEntry*
+static CFISH_INLINE HashEntry*
SI_fetch_entry(Hash *self, const Obj *key, int32_t hash_sum);
// Double the number of buckets and redistribute all entries.
-static INLINE HashEntry*
+static CFISH_INLINE HashEntry*
SI_rebuild_hash(Hash *self);
void
@@ -244,7 +244,7 @@ Hash_fetch_str(Hash *self, const char *key, size_t key_len) {
return Hash_fetch(self, (Obj*)key_buf);
}
-static INLINE HashEntry*
+static CFISH_INLINE HashEntry*
SI_fetch_entry(Hash *self, const Obj *key, int32_t hash_sum) {
uint32_t tick = hash_sum;
HashEntry *const entries = (HashEntry*)self->entries;
@@ -302,7 +302,7 @@ Hash_iterate(Hash *self) {
return self->size;
}
-static INLINE void
+static CFISH_INLINE void
SI_kill_iter(Hash *self) {
self->iter_tick = -1;
}
@@ -387,7 +387,7 @@ Hash_get_size(Hash *self) {
return self->size;
}
-static INLINE HashEntry*
+static CFISH_INLINE HashEntry*
SI_rebuild_hash(Hash *self) {
HashEntry *old_entries = (HashEntry*)self->entries;
HashEntry *entry = old_entries;
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/clownfish/runtime/core/Clownfish/Util/SortUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/SortUtils.c b/clownfish/runtime/core/Clownfish/Util/SortUtils.c
index f4c0236..1ff7e87 100644
--- a/clownfish/runtime/core/Clownfish/Util/SortUtils.c
+++ b/clownfish/runtime/core/Clownfish/Util/SortUtils.c
@@ -41,7 +41,7 @@ static void
S_msort_any(void *velems, void *vscratch, uint32_t left, uint32_t right,
Cfish_Sort_Compare_t compare, void *context, size_t width);
-static INLINE void
+static CFISH_INLINE void
SI_merge(void *left_vptr, uint32_t left_size,
void *right_vptr, uint32_t right_size,
void *vdest, size_t width, Cfish_Sort_Compare_t compare, void *context);
@@ -152,7 +152,7 @@ S_msort_any(void *velems, void *vscratch, uint32_t left, uint32_t right,
}
}
-static INLINE void
+static CFISH_INLINE void
SI_merge(void *left_vptr, uint32_t left_size,
void *right_vptr, uint32_t right_size,
void *vdest, size_t width, Cfish_Sort_Compare_t compare,
@@ -194,9 +194,9 @@ S_qsort8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
Cfish_Sort_Compare_t compare, void *context);
// Swap two elements.
-static INLINE void
+static CFISH_INLINE void
SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right);
-static INLINE void
+static CFISH_INLINE void
SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right);
/* Select a pivot by choosing the median of three values, guarding against
@@ -219,10 +219,10 @@ SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right);
* abb => abb => abb => abb
* aaa => aaa => aaa => aaa
*/
-static INLINE FOUR_BYTE_TYPE*
+static CFISH_INLINE FOUR_BYTE_TYPE*
SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
Cfish_Sort_Compare_t compare, void *context);
-static INLINE EIGHT_BYTE_TYPE*
+static CFISH_INLINE EIGHT_BYTE_TYPE*
SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
Cfish_Sort_Compare_t compare, void *context);
@@ -251,14 +251,14 @@ Sort_quicksort(void *elems, size_t num_elems, size_t width,
/************************* quicksort 4 byte *********************************/
-static INLINE void
+static CFISH_INLINE void
SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right) {
FOUR_BYTE_TYPE saved = elems[left];
elems[left] = elems[right];
elems[right] = saved;
}
-static INLINE FOUR_BYTE_TYPE*
+static CFISH_INLINE FOUR_BYTE_TYPE*
SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
Cfish_Sort_Compare_t compare, void *context) {
if (right - left > 1) {
@@ -356,14 +356,14 @@ S_qsort4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
/************************* quicksort 8 byte *********************************/
-static INLINE void
+static CFISH_INLINE void
SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right) {
EIGHT_BYTE_TYPE saved = elems[left];
elems[left] = elems[right];
elems[right] = saved;
}
-static INLINE EIGHT_BYTE_TYPE*
+static CFISH_INLINE EIGHT_BYTE_TYPE*
SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
Cfish_Sort_Compare_t compare, void *context) {
if (right - left > 1) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Search/Collector/SortCollector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Collector/SortCollector.c b/core/Lucy/Search/Collector/SortCollector.c
index 7c877bf..4bf9ba2 100644
--- a/core/Lucy/Search/Collector/SortCollector.c
+++ b/core/Lucy/Search/Collector/SortCollector.c
@@ -62,7 +62,7 @@ static int8_t
S_derive_action(SortRule *rule, SortCache *sort_cache);
// Decide whether a doc should be inserted into the HitQueue.
-static INLINE bool
+static CFISH_INLINE bool
SI_competitive(SortCollectorIVARS *ivars, int32_t doc_id);
SortCollector*
@@ -337,7 +337,7 @@ SortColl_collect(SortCollector *self, int32_t doc_id) {
}
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord1(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
void *const ords = ivars->ord_arrays[tick];
@@ -345,7 +345,7 @@ SI_compare_by_ord1(SortCollectorIVARS *ivars, uint32_t tick,
int32_t b_ord = NumUtil_u1get(ords, b);
return a_ord - b_ord;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord2(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
void *const ords = ivars->ord_arrays[tick];
@@ -353,7 +353,7 @@ SI_compare_by_ord2(SortCollectorIVARS *ivars, uint32_t tick,
int32_t b_ord = NumUtil_u2get(ords, b);
return a_ord - b_ord;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord4(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
void *const ords = ivars->ord_arrays[tick];
@@ -361,7 +361,7 @@ SI_compare_by_ord4(SortCollectorIVARS *ivars, uint32_t tick,
int32_t b_ord = NumUtil_u4get(ords, b);
return a_ord - b_ord;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord8(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
uint8_t *ords = (uint8_t*)ivars->ord_arrays[tick];
@@ -369,7 +369,7 @@ SI_compare_by_ord8(SortCollectorIVARS *ivars, uint32_t tick,
int32_t b_ord = ords[b];
return a_ord - b_ord;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord16(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
uint8_t *ord_bytes = (uint8_t*)ivars->ord_arrays[tick];
@@ -379,7 +379,7 @@ SI_compare_by_ord16(SortCollectorIVARS *ivars, uint32_t tick,
int32_t ord_b = NumUtil_decode_bigend_u16(address_b);
return ord_a - ord_b;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_ord32(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
uint8_t *ord_bytes = (uint8_t*)ivars->ord_arrays[tick];
@@ -389,7 +389,7 @@ SI_compare_by_ord32(SortCollectorIVARS *ivars, uint32_t tick,
int32_t ord_b = NumUtil_decode_bigend_u32(address_b);
return ord_a - ord_b;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_native_ord16(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
uint16_t *ords = (uint16_t*)ivars->ord_arrays[tick];
@@ -397,7 +397,7 @@ SI_compare_by_native_ord16(SortCollectorIVARS *ivars, uint32_t tick,
int32_t b_ord = ords[b];
return a_ord - b_ord;
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_native_ord32(SortCollectorIVARS *ivars, uint32_t tick,
int32_t a, int32_t b) {
int32_t *ords = (int32_t*)ivars->ord_arrays[tick];
@@ -406,7 +406,7 @@ SI_compare_by_native_ord32(SortCollectorIVARS *ivars, uint32_t tick,
// Bounds checking for doc id against the segment doc_max. We assume that any
// sort cache ord arrays can accomodate lookups up to this number.
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_validate_doc_id(SortCollectorIVARS *ivars, int32_t doc_id) {
// Check as uint32_t since we're using these doc ids as array indexes.
if ((uint32_t)doc_id > (uint32_t)ivars->seg_doc_max) {
@@ -416,7 +416,7 @@ SI_validate_doc_id(SortCollectorIVARS *ivars, int32_t doc_id) {
return doc_id;
}
-static INLINE bool
+static CFISH_INLINE bool
SI_competitive(SortCollectorIVARS *ivars, int32_t doc_id) {
/* Ordinarily, we would cache local copies of more member variables in
* const automatic variables in order to improve code clarity and provide
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Search/HitQueue.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/HitQueue.c b/core/Lucy/Search/HitQueue.c
index 868fcae..b80e6af 100644
--- a/core/Lucy/Search/HitQueue.c
+++ b/core/Lucy/Search/HitQueue.c
@@ -131,7 +131,7 @@ HitQ_jostle(HitQueue *self, Obj *element) {
return super_jostle(self, element);
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_compare_by_value(HitQueueIVARS *ivars, uint32_t tick,
MatchDocIVARS *a_ivars, MatchDocIVARS *b_ivars) {
Obj *a_val = VA_Fetch(a_ivars->values, tick);
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Search/ORMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/ORMatcher.c b/core/Lucy/Search/ORMatcher.c
index 94d5eca..22cfe3c 100644
--- a/core/Lucy/Search/ORMatcher.c
+++ b/core/Lucy/Search/ORMatcher.c
@@ -33,12 +33,12 @@ S_clear(ORMatcher *self, ORMatcherIVARS *ivars);
// Call Matcher_Next() on the top queue element and adjust the queue,
// removing the element if Matcher_Next() returns false.
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_top_next(ORMatcher *self, ORMatcherIVARS *ivars);
// Call Matcher_Advance() on the top queue element and adjust the queue,
// removing the element if Matcher_Advance() returns false.
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_top_advance(ORMatcher *self, ORMatcherIVARS *ivars, int32_t target);
/* React to a change in the top element, or "root" -- presumably the update of
@@ -173,14 +173,14 @@ S_clear(ORMatcher *self, ORMatcherIVARS *ivars) {
}
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_top_next(ORMatcher *self, ORMatcherIVARS *ivars) {
HeapedMatcherDoc *const top_hmd = ivars->top_hmd;
top_hmd->doc = Matcher_Next(top_hmd->matcher);
return S_adjust_root(self, ivars);
}
-static INLINE int32_t
+static CFISH_INLINE int32_t
SI_top_advance(ORMatcher *self, ORMatcherIVARS *ivars, int32_t target) {
HeapedMatcherDoc *const top_hmd = ivars->top_hmd;
top_hmd->doc = Matcher_Advance(top_hmd->matcher, target);
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Search/PhraseMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PhraseMatcher.c b/core/Lucy/Search/PhraseMatcher.c
index 0fb956d..3743b4f 100644
--- a/core/Lucy/Search/PhraseMatcher.c
+++ b/core/Lucy/Search/PhraseMatcher.c
@@ -192,7 +192,7 @@ PhraseMatcher_advance(PhraseMatcher *self, int32_t target) {
}
}
-static INLINE uint32_t
+static CFISH_INLINE uint32_t
SI_winnow_anchors(uint32_t *anchors_start, const uint32_t *const anchors_end,
const uint32_t *candidates, const uint32_t *const candidates_end,
uint32_t offset) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Store/FSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSDirHandle.c b/core/Lucy/Store/FSDirHandle.c
index 1d2d118..508f3ec 100644
--- a/core/Lucy/Store/FSDirHandle.c
+++ b/core/Lucy/Store/FSDirHandle.c
@@ -45,7 +45,7 @@ FSDH_destroy(FSDirHandle *self) {
SUPER_DESTROY(self, FSDIRHANDLE);
}
-static INLINE bool
+static CFISH_INLINE bool
SI_is_updir(const char *name, size_t len) {
if (len == 2 && strncmp(name, "..", 2) == 0) {
return true;
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Store/FSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFileHandle.c b/core/Lucy/Store/FSFileHandle.c
index ac523fa..94217bb 100644
--- a/core/Lucy/Store/FSFileHandle.c
+++ b/core/Lucy/Store/FSFileHandle.c
@@ -38,7 +38,7 @@
#include "Lucy/Store/FileWindow.h"
// Convert FileHandle flags to POSIX flags.
-static INLINE int
+static CFISH_INLINE int
SI_posix_flags(uint32_t fh_flags) {
int posix_flags = 0;
if (fh_flags & FH_WRITE_ONLY) { posix_flags |= O_WRONLY; }
@@ -59,26 +59,26 @@ SI_posix_flags(uint32_t fh_flags) {
// 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
// and set Err_error.
-static INLINE void*
+static CFISH_INLINE void*
SI_map(FSFileHandle *self, FSFileHandleIVARS *ivars, int64_t offset,
int64_t len);
// Release a memory mapped region assigned by SI_map.
-static INLINE bool
+static CFISH_INLINE bool
SI_unmap(FSFileHandle *self, char *ptr, int64_t len);
// 32-bit or 64-bit inlined helpers for FSFH_window.
-static INLINE bool
+static CFISH_INLINE bool
SI_window(FSFileHandle *self, FSFileHandleIVARS *ivars, FileWindow *window,
int64_t offset, int64_t len);
// Architecture- and OS- specific initialization for a read-only FSFileHandle.
-static INLINE bool
+static CFISH_INLINE bool
SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars);
// Windows-specific routine needed for closing read-only handles.
#ifdef CHY_HAS_WINDOWS_H
-static INLINE bool
+static CFISH_INLINE bool
SI_close_win_handles(FSFileHandle *self);
#endif
@@ -244,7 +244,7 @@ FSFH_window(FSFileHandle *self, FileWindow *window, int64_t offset,
#if IS_64_BIT
-static INLINE bool
+static CFISH_INLINE bool
SI_window(FSFileHandle *self, FSFileHandleIVARS *ivars, FileWindow *window,
int64_t offset, int64_t len) {
UNUSED_VAR(self);
@@ -286,7 +286,7 @@ FSFH_read(FSFileHandle *self, char *dest, int64_t offset, size_t len) {
#else
-static INLINE bool
+static CFISH_INLINE bool
SI_window(FSFileHandle *self, FSFileHandleIVARS *ivars, FileWindow *window,
int64_t offset, int64_t len) {
// Release the previously mmap'd region, if any.
@@ -325,7 +325,7 @@ FSFH_release_window(FSFileHandle *self, FileWindow *window) {
#ifdef CHY_HAS_SYS_MMAN_H
-static INLINE bool
+static CFISH_INLINE bool
SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars) {
UNUSED_VAR(self);
@@ -367,7 +367,7 @@ SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars) {
return true;
}
-static INLINE void*
+static CFISH_INLINE void*
SI_map(FSFileHandle *self, FSFileHandleIVARS *ivars, int64_t offset,
int64_t len) {
UNUSED_VAR(self);
@@ -388,7 +388,7 @@ SI_map(FSFileHandle *self, FSFileHandleIVARS *ivars, int64_t offset,
return buf;
}
-static INLINE bool
+static CFISH_INLINE bool
SI_unmap(FSFileHandle *self, char *buf, int64_t len) {
if (buf != NULL) {
if (munmap(buf, len)) {
@@ -436,7 +436,7 @@ FSFH_read(FSFileHandle *self, char *dest, int64_t offset, size_t len) {
#elif defined(CHY_HAS_WINDOWS_H)
-static INLINE bool
+static CFISH_INLINE bool
SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars) {
char *filepath = (char*)CB_Get_Ptr8(ivars->path);
SYSTEM_INFO sys_info;
@@ -490,7 +490,7 @@ SI_init_read_only(FSFileHandle *self, FSFileHandleIVARS *ivars) {
return true;
}
-static INLINE void*
+static CFISH_INLINE void*
SI_map(FSFileHandle *self, FSFileHandleIVARS *ivars, int64_t offset,
int64_t len) {
void *buf = NULL;
@@ -514,7 +514,7 @@ SI_map(FSFileHandle *self, FSFileHandleIVARS *ivars, int64_t offset,
return buf;
}
-static INLINE bool
+static CFISH_INLINE bool
SI_unmap(FSFileHandle *self, char *ptr, int64_t len) {
if (buf != NULL) {
if (!UnmapViewOfFile(buf)) {
@@ -529,7 +529,7 @@ SI_unmap(FSFileHandle *self, char *ptr, int64_t len) {
return true;
}
-static INLINE bool
+static CFISH_INLINE bool
SI_close_win_handles(FSFileHandle *self) {
FSFileHandleIVARS *ivars = FSFH_IVARS(self);
// Close both standard handle and mapping handle.
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Store/InStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/InStream.c b/core/Lucy/Store/InStream.c
index caf286e..c93d320 100644
--- a/core/Lucy/Store/InStream.c
+++ b/core/Lucy/Store/InStream.c
@@ -25,15 +25,15 @@
#include "Lucy/Store/RAMFileHandle.h"
// Inlined version of InStream_Tell.
-static INLINE int64_t
+static CFISH_INLINE int64_t
SI_tell(InStream *self);
// Inlined version of InStream_Read_Bytes.
-static INLINE void
+static CFISH_INLINE void
SI_read_bytes(InStream *self, char* buf, size_t len);
// Inlined version of InStream_Read_U8.
-static INLINE uint8_t
+static CFISH_INLINE uint8_t
SI_read_u8(InStream *self, InStreamIVARS *const ivars);
// Ensure that the buffer contains exactly the specified amount of data.
@@ -261,7 +261,7 @@ InStream_seek(InStream *self, int64_t target) {
}
}
-static INLINE int64_t
+static CFISH_INLINE int64_t
SI_tell(InStream *self) {
InStreamIVARS *const ivars = InStream_IVARS(self);
char *fw_buf = FileWindow_Get_Buf(ivars->window);
@@ -331,7 +331,7 @@ InStream_read_bytes(InStream *self, char* buf, size_t len) {
SI_read_bytes(self, buf, len);
}
-static INLINE void
+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);
@@ -383,7 +383,7 @@ InStream_read_i8(InStream *self) {
return (int8_t)SI_read_u8(self, ivars);
}
-static INLINE uint8_t
+static CFISH_INLINE uint8_t
SI_read_u8(InStream *self, InStreamIVARS *ivars) {
if (ivars->buf >= ivars->limit) { S_refill(self); }
return (uint8_t)(*ivars->buf++);
@@ -395,7 +395,7 @@ InStream_read_u8(InStream *self) {
return SI_read_u8(self, ivars);
}
-static INLINE uint32_t
+static CFISH_INLINE uint32_t
SI_read_u32(InStream *self) {
uint32_t retval;
SI_read_bytes(self, (char*)&retval, 4);
@@ -415,7 +415,7 @@ InStream_read_i32(InStream *self) {
return (int32_t)SI_read_u32(self);
}
-static INLINE uint64_t
+static CFISH_INLINE uint64_t
SI_read_u64(InStream *self) {
uint64_t retval;
SI_read_bytes(self, (char*)&retval, 8);
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Store/OutStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/OutStream.c b/core/Lucy/Store/OutStream.c
index b9122c2..00f2ac1 100644
--- a/core/Lucy/Store/OutStream.c
+++ b/core/Lucy/Store/OutStream.c
@@ -26,12 +26,12 @@
#include "Lucy/Store/RAMFileHandle.h"
// Inlined version of OutStream_Write_Bytes.
-static INLINE void
+static CFISH_INLINE void
SI_write_bytes(OutStream *self, OutStreamIVARS *ivars,
const void *bytes, size_t len);
// Inlined version of OutStream_Write_C32.
-static INLINE void
+static CFISH_INLINE void
SI_write_c32(OutStream *self, OutStreamIVARS *ivars, uint32_t value);
// Flush content in the buffer to the FileHandle.
@@ -176,7 +176,7 @@ OutStream_write_bytes(OutStream *self, const void *bytes, size_t len) {
SI_write_bytes(self, OutStream_IVARS(self), bytes, len);
}
-static INLINE void
+static CFISH_INLINE void
SI_write_bytes(OutStream *self, OutStreamIVARS *ivars,
const void *bytes, size_t len) {
// If this data is larger than the buffer size, flush and write.
@@ -200,7 +200,7 @@ SI_write_bytes(OutStream *self, OutStreamIVARS *ivars,
}
}
-static INLINE void
+static CFISH_INLINE void
SI_write_u8(OutStream *self, OutStreamIVARS *ivars, uint8_t value) {
if (ivars->buf_pos >= IO_STREAM_BUF_SIZE) {
S_flush(self, ivars);
@@ -220,7 +220,7 @@ OutStream_write_u8(OutStream *self, uint8_t value) {
SI_write_u8(self, ivars, value);
}
-static INLINE void
+static CFISH_INLINE void
SI_write_u32(OutStream *self, OutStreamIVARS *ivars, uint32_t value) {
#ifdef BIG_END
SI_write_bytes(self, ivars, &value, 4);
@@ -242,7 +242,7 @@ OutStream_write_u32(OutStream *self, uint32_t value) {
SI_write_u32(self, OutStream_IVARS(self), value);
}
-static INLINE void
+static CFISH_INLINE void
SI_write_u64(OutStream *self, OutStreamIVARS *ivars, uint64_t value) {
#ifdef BIG_END
SI_write_bytes(self, ivars, &value, 8);
@@ -287,7 +287,7 @@ OutStream_write_c32(OutStream *self, uint32_t value) {
SI_write_c32(self, OutStream_IVARS(self), value);
}
-static INLINE void
+static CFISH_INLINE void
SI_write_c32(OutStream *self, OutStreamIVARS *ivars, uint32_t value) {
uint8_t buf[C32_MAX_BYTES];
uint8_t *ptr = buf + sizeof(buf) - 1;
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Util/Json.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index 154c38d..5db17a5 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -67,7 +67,7 @@ S_unescape_text(char *const top, char *const end);
// Check that the supplied text begins with the specified keyword, which must
// then end on a word boundary (i.e. match "null" but not the first four
// letters of "nullify").
-static INLINE bool
+static CFISH_INLINE bool
SI_check_keyword(char *json, char* end, const char *keyword, size_t len);
// Make it possible to be loosen constraints during testing.
@@ -651,7 +651,7 @@ S_unescape_text(char *const top, char *const end) {
return CB_new_steal_from_trusted_str(target_buf, target_size, cap);
}
-static INLINE bool
+static CFISH_INLINE bool
SI_check_keyword(char *json, char* end, const char *keyword, size_t len) {
if ((size_t)(end - json) > len
&& strncmp(json, keyword, len) == 0
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 6337ee1..78a0d0b 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -98,7 +98,7 @@ SortEx_feed(SortExternal *self, void *data) {
ivars->cache_max++;
}
-static INLINE void*
+static CFISH_INLINE void*
SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
if (ivars->cache_tick >= ivars->cache_max) {
S_refill_cache(self, ivars);
http://git-wip-us.apache.org/repos/asf/lucy/blob/814c070c/core/LucyX/Search/ProximityMatcher.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityMatcher.c b/core/LucyX/Search/ProximityMatcher.c
index 9918620..9ca7cdb 100644
--- a/core/LucyX/Search/ProximityMatcher.c
+++ b/core/LucyX/Search/ProximityMatcher.c
@@ -197,7 +197,7 @@ ProximityMatcher_advance(ProximityMatcher *self, int32_t target) {
}
-static INLINE uint32_t
+static CFISH_INLINE uint32_t
SI_winnow_anchors(uint32_t *anchors_start, const uint32_t *const anchors_end,
const uint32_t *candidates, const uint32_t *const candidates_end,
uint32_t offset, uint32_t within) {