This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository libsds.
commit a3cacc6627331812497072f28df7c2bcfbaf7a77
Author: William Brown <firstyear(a)redhat.com>
Date: Fri Feb 17 13:09:29 2017 +1000
Rename compare on function
---
src/sds/bpt/bpt.c | 6 +++---
src/sds/bpt_cow/bpt_cow.c | 8 +++++---
src/sds/bpt_cow/node.c | 2 ++
src/sds/sds.h | 8 ++++----
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/sds/bpt/bpt.c b/src/sds/bpt/bpt.c
index 611cd00..26cca99 100644
--- a/src/sds/bpt/bpt.c
+++ b/src/sds/bpt/bpt.c
@@ -10,7 +10,7 @@
#include "bpt.h"
sds_result
-sds_bptree_init(sds_bptree_instance **binst_ptr, uint16_t checksumming, int64_t
(*compare)(void *a, void *b), void (*value_free_fn)(void *value), void (*key_free_fn)(void
*key), void *(*key_dup_fn)(void *key) ) {
+sds_bptree_init(sds_bptree_instance **binst_ptr, uint16_t checksumming, int64_t
(*key_cmp_fn)(void *a, void *b), void (*value_free_fn)(void *value), void
(*key_free_fn)(void *key), void *(*key_dup_fn)(void *key) ) {
if (binst_ptr == NULL) {
#ifdef DEBUG
sds_log("sds_btree_init", "Invalid pointer");
@@ -22,7 +22,7 @@ sds_bptree_init(sds_bptree_instance **binst_ptr, uint16_t checksumming,
int64_t
(*binst_ptr)->print_iter = 0;
(*binst_ptr)->offline_checksumming = checksumming;
(*binst_ptr)->search_checksumming = checksumming;
- (*binst_ptr)->key_cmp_fn = compare;
+ (*binst_ptr)->key_cmp_fn = key_cmp_fn;
(*binst_ptr)->value_free_fn = value_free_fn;
(*binst_ptr)->key_free_fn = key_free_fn;
(*binst_ptr)->key_dup_fn = key_dup_fn;
@@ -360,9 +360,9 @@ sds_bptree_delete(sds_bptree_instance *binst, void *key) {
} // While target node
} // If under half capacity
-fail:
#ifdef DEBUG
+fail:
sds_log("sds_bptree_insert", "<== Finishing delete of %d",
key);
#endif
diff --git a/src/sds/bpt_cow/bpt_cow.c b/src/sds/bpt_cow/bpt_cow.c
index d25cc29..8c9b157 100644
--- a/src/sds/bpt_cow/bpt_cow.c
+++ b/src/sds/bpt_cow/bpt_cow.c
@@ -22,7 +22,7 @@
static FILE *fp = NULL;
static uint64_t print_iter = 0;
-sds_result sds_bptree_cow_init(sds_bptree_cow_instance **binst_ptr, uint16_t
checksumming, int64_t (*compare)(void *a, void *b), void (*value_free_fn)(void *value),
void *(*value_dup_fn)(void *key), void (*key_free_fn)(void *key), void *(*key_dup_fn)(void
*key)) {
+sds_result sds_bptree_cow_init(sds_bptree_cow_instance **binst_ptr, uint16_t
checksumming, int64_t (*key_cmp_fn)(void *a, void *b), void (*value_free_fn)(void *value),
void *(*value_dup_fn)(void *key), void (*key_free_fn)(void *key), void *(*key_dup_fn)(void
*key)) {
if (binst_ptr == NULL) {
#ifdef DEBUG
sds_log("sds_btree_init", "Invalid pointer");
@@ -48,7 +48,7 @@ sds_result sds_bptree_cow_init(sds_bptree_cow_instance **binst_ptr,
uint16_t che
(*binst_ptr)->bi->print_iter = 0;
(*binst_ptr)->bi->offline_checksumming = checksumming;
(*binst_ptr)->bi->search_checksumming = checksumming;
- (*binst_ptr)->bi->key_cmp_fn = compare;
+ (*binst_ptr)->bi->key_cmp_fn = key_cmp_fn;
(*binst_ptr)->bi->value_free_fn = value_free_fn;
(*binst_ptr)->bi->value_dup_fn = value_dup_fn;
(*binst_ptr)->bi->key_free_fn = key_free_fn;
@@ -339,7 +339,9 @@ sds_result sds_bptree_cow_delete(sds_bptree_transaction *btxn, void
*key) {
}
} else if ( target_node == NULL && next_node->item_count == 0) {
- sds_log("sds_bptree_cow_delete", "Begine deleting the
root");
+#ifdef DEBUG
+ sds_log("sds_bptree_cow_delete", "Begin deleting the
root");
+#endif
if (btxn->root != next_node) {
sds_log("sds_bptree_cow_delete", "Transaction is
corrupted");
result = SDS_UNKNOWN_ERROR;
diff --git a/src/sds/bpt_cow/node.c b/src/sds/bpt_cow/node.c
index b7d3cc3..a602658 100644
--- a/src/sds/bpt_cow/node.c
+++ b/src/sds/bpt_cow/node.c
@@ -8,6 +8,7 @@
#include "bpt_cow.h"
+#ifdef DEBUG
static sds_result
sds_bptree_cow_node_path_verify(sds_bptree_transaction *btxn, sds_bptree_node *old_node,
sds_bptree_node *node) {
// Verify that the node has a valid parent path back to the root!
@@ -27,6 +28,7 @@ sds_bptree_cow_node_path_verify(sds_bptree_transaction *btxn,
sds_bptree_node *o
}
return SDS_SUCCESS;
}
+#endif
void
sds_bptree_cow_node_siblings(sds_bptree_node *target, sds_bptree_node **left,
sds_bptree_node **right) {
diff --git a/src/sds/sds.h b/src/sds/sds.h
index de03f4a..b2aa91a 100644
--- a/src/sds/sds.h
+++ b/src/sds/sds.h
@@ -974,13 +974,13 @@ sds_result sds_lqueue_destroy(sds_lqueue *q);
*
* \param binst_ptr Pointer to a struct pointer for the instance to initialise.
* \param checksumming Flag to enable online and search checksumming. 0 to disable.
- * \param compare Key comparison function.
+ * \param key_cmp_fn Key comparison function.
* \param value_free_fn Function to free values that are assigned to this structure.
* \param key_free_fn Function to free keys that are inside of this structure.
* \param key_dup_fn Function to duplication keys within the structure.
* \retval Result of the operation as sds_result.
*/
-sds_result sds_bptree_init(sds_bptree_instance **binst_ptr, uint16_t checksumming,
int64_t (*compare)(void *a, void *b), void (*value_free_fn)(void *value), void
(*key_free_fn)(void *key), void *(*key_dup_fn)(void *key));
+sds_result sds_bptree_init(sds_bptree_instance **binst_ptr, uint16_t checksumming,
int64_t (*key_cmp_fn)(void *a, void *b), void (*value_free_fn)(void *value), void
(*key_free_fn)(void *key), void *(*key_dup_fn)(void *key));
/**
* Bulk load data into a b+tree instance. The existing data in the b+tree instance
* will be destroyed during the operation. Keys *must* be sorted prior to calling
@@ -1140,7 +1140,7 @@ sds_result sds_bptree_subset(struct sds_bptree_instance *binst_a,
struct sds_bpt
*
* \param binst_ptr The pointer you wish to have filled with the cow b+tree instance.
* \param checksumming During DEBUG, this flag enables tree content checksumming.
- * \param compare Comparison function for keys in the tree.
+ * \param key_cmp_fn Comparison function for keys in the tree.
* \param value_free_fn During operation, the values assigned to this tree are owned by
the instance.
* This allows us to free the values when required.
* \param value_dup_fn During a copy on write operation, we need to be able to copy the
values in the tree.
@@ -1148,7 +1148,7 @@ sds_result sds_bptree_subset(struct sds_bptree_instance *binst_a,
struct sds_bpt
* \param key_dup_fn Duplicate a key value
* \retval Result of the operation as sds_result.
*/
-sds_result sds_bptree_cow_init(sds_bptree_cow_instance **binst_ptr, uint16_t
checksumming, int64_t (*compare)(void *a, void *b), void (*value_free_fn)(void *value),
void *(*value_dup_fn)(void *key), void (*key_free_fn)(void *key), void *(*key_dup_fn)(void
*key));
+sds_result sds_bptree_cow_init(sds_bptree_cow_instance **binst_ptr, uint16_t
checksumming, int64_t (*key_cmp_fn)(void *a, void *b), void (*value_free_fn)(void *value),
void *(*value_dup_fn)(void *key), void (*key_free_fn)(void *key), void *(*key_dup_fn)(void
*key));
/**
* Destroy an instance. This will destroy all open transactions and free all
* tree elements.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.