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 2015/11/07 18:06:39 UTC
[5/6] lucy git commit: Tighten Sort_Ex_Compare parameter types
Tighten Sort_Ex_Compare parameter types
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/38ac0f0b
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/38ac0f0b
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/38ac0f0b
Branch: refs/heads/master
Commit: 38ac0f0b2bf4ea0b0af28a0022b5c66498a956ac
Parents: 670e013
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Nov 5 20:19:54 2015 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Nov 5 20:19:54 2015 +0100
----------------------------------------------------------------------
core/Lucy/Index/PostingPool.c | 6 +++---
core/Lucy/Index/PostingPool.cfh | 2 +-
core/Lucy/Index/SortFieldWriter.c | 6 +++---
core/Lucy/Index/SortFieldWriter.cfh | 2 +-
core/Lucy/Util/BlobSortEx.c | 4 ++--
core/Lucy/Util/BlobSortEx.cfh | 2 +-
core/Lucy/Util/SortExternal.cfh | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 357755a..4ef1c3e 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -144,9 +144,9 @@ PostPool_Destroy_IMP(PostingPool *self) {
}
int
-PostPool_Compare_IMP(PostingPool *self, void *va, void *vb) {
- RawPostingIVARS *const a = RawPost_IVARS(*(RawPosting**)va);
- RawPostingIVARS *const b = RawPost_IVARS(*(RawPosting**)vb);
+PostPool_Compare_IMP(PostingPool *self, Obj **ptr_a, Obj **ptr_b) {
+ RawPostingIVARS *const a = RawPost_IVARS(*(RawPosting**)ptr_a);
+ RawPostingIVARS *const b = RawPost_IVARS(*(RawPosting**)ptr_b);
const size_t a_len = a->content_len;
const size_t b_len = b->content_len;
const size_t len = a_len < b_len ? a_len : b_len;
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Index/PostingPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.cfh b/core/Lucy/Index/PostingPool.cfh
index 587955b..a494f8e 100644
--- a/core/Lucy/Index/PostingPool.cfh
+++ b/core/Lucy/Index/PostingPool.cfh
@@ -85,7 +85,7 @@ class Lucy::Index::PostingPool nickname PostPool
/** Compares two non-NULL RawPosting objects.
*/
int
- Compare(PostingPool *self, void *va, void *vb);
+ Compare(PostingPool *self, Obj **ptr_a, Obj **ptr_b);
void
Finish(PostingPool *self);
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 95007a9..f73698c 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -327,10 +327,10 @@ S_write_val(Obj *val, int8_t prim_id, OutStream *ix_out, OutStream *dat_out,
}
int
-SortFieldWriter_Compare_IMP(SortFieldWriter *self, void *va, void *vb) {
+SortFieldWriter_Compare_IMP(SortFieldWriter *self, Obj **ptr_a, Obj **ptr_b) {
SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
- SFWriterElemIVARS *a = SFWriterElem_IVARS(*(SFWriterElem**)va);
- SFWriterElemIVARS *b = SFWriterElem_IVARS(*(SFWriterElem**)vb);
+ SFWriterElemIVARS *a = SFWriterElem_IVARS(*(SFWriterElem**)ptr_a);
+ SFWriterElemIVARS *b = SFWriterElem_IVARS(*(SFWriterElem**)ptr_b);
int32_t comparison
= FType_null_back_compare_values(ivars->type, a->value, b->value);
if (comparison == 0) { comparison = a->doc_id - b->doc_id; }
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Index/SortFieldWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.cfh b/core/Lucy/Index/SortFieldWriter.cfh
index a2d0ddc..f0bcdea 100644
--- a/core/Lucy/Index/SortFieldWriter.cfh
+++ b/core/Lucy/Index/SortFieldWriter.cfh
@@ -83,7 +83,7 @@ class Lucy::Index::SortFieldWriter
Finish(SortFieldWriter *self);
int
- Compare(SortFieldWriter *self, void *va, void *vb);
+ Compare(SortFieldWriter *self, Obj **ptr_a, Obj **ptr_b);
int32_t
Get_Null_Ord(SortFieldWriter *self);
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Util/BlobSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BlobSortEx.c b/core/Lucy/Util/BlobSortEx.c
index 6d41488..3126c1d 100644
--- a/core/Lucy/Util/BlobSortEx.c
+++ b/core/Lucy/Util/BlobSortEx.c
@@ -165,9 +165,9 @@ BlobSortEx_Flip_IMP(BlobSortEx *self) {
}
int
-BlobSortEx_Compare_IMP(BlobSortEx *self, void *va, void *vb) {
+BlobSortEx_Compare_IMP(BlobSortEx *self, Obj **ptr_a, Obj **ptr_b) {
UNUSED_VAR(self);
- return Blob_compare((Blob**)va, (Blob**)vb);
+ return Blob_compare((Blob**)ptr_a, (Blob**)ptr_b);
}
Vector*
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Util/BlobSortEx.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BlobSortEx.cfh b/core/Lucy/Util/BlobSortEx.cfh
index 47cef86..e603a9b 100644
--- a/core/Lucy/Util/BlobSortEx.cfh
+++ b/core/Lucy/Util/BlobSortEx.cfh
@@ -49,7 +49,7 @@ class Lucy::Util::BlobSortEx
Flip(BlobSortEx *self);
int
- Compare(BlobSortEx *self, void *va, void *vb);
+ Compare(BlobSortEx *self, Obj **ptr_a, Obj **ptr_b);
incremented Vector*
Peek_Cache(BlobSortEx *self);
http://git-wip-us.apache.org/repos/asf/lucy/blob/38ac0f0b/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index cdc2dbb..d5395ee 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -56,7 +56,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
/** Compare two sortable elements.
*/
abstract int
- Compare(SortExternal *self, void *va, void *vb);
+ Compare(SortExternal *self, Obj **ptr_a, Obj **ptr_b);
/** Flush all elements currently in the buffer.
*