Commit 323dbd4e authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

compile the lock_tree with icc. addresses #1185

git-svn-id: file:///svn/tokudb.1131b+1080a+1185@6388 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3543cdb4
......@@ -11,9 +11,18 @@ endif
VISIBILITY = -fvisibility=hidden
CFLAGS = -W -Wall -Wextra -fPIC $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS = -Wall -fPIC $(OPTFLAGS) $(GCOV_FLAGS)
ifeq ($(CC),icc)
CFLAGS += -g
CFLAGS += -diag-disable 177
CFLAGS += -diag-disable 589
CFLAGS += -diag-disable 981
CFLAGS += -diag-disable 1324
else
CFLAGS += -g3 -ggdb3
CFLAGS += -Werror -Wextra -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute
endif
CFLAGS += $(VISIBILITY) $(PROF_FLAGS)
CPPFLAGS = -I. -I.. -I../range_tree -I../../include -I../../newbrt -L../range_tree
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......
......@@ -14,10 +14,11 @@
BOOL toku_db_id_equals(const toku_db_id* a, const toku_db_id* b) {
assert(a && b);
return a == b ||
(a->saved_hash == b->saved_hash &&
!strcmp(a->absolute_path, b->absolute_path) &&
!strcmp(a->sub_database_name, b->sub_database_name));
return (BOOL)
(a == b ||
(a->saved_hash == b->saved_hash &&
!strcmp(a->absolute_path, b->absolute_path) &&
!strcmp(a->sub_database_name, b->sub_database_name)));
}
void toku_db_id_add_ref(toku_db_id* db_id) {
......
......@@ -86,7 +86,7 @@ static inline toku_idlth_elt* toku__idlth_next(toku_idlth* idlth) {
assert(idlth->iter_is_valid);
idlth->iter_curr = idlth->iter_curr->next_in_iteration;
idlth->iter_is_valid = idlth->iter_curr != &idlth->iter_head;
idlth->iter_is_valid = (BOOL)(idlth->iter_curr != &idlth->iter_head);
return idlth->iter_curr;
}
......@@ -197,5 +197,5 @@ BOOL toku_idlth_is_empty(toku_idlth* idlth) {
(idlth->iter_head.next_in_iteration == &idlth->iter_head));
assert((idlth->num_keys == 0) ==
(idlth->iter_head.prev_in_iteration == &idlth->iter_head));
return idlth->num_keys == 0;
return (BOOL)(idlth->num_keys == 0);
}
......@@ -293,7 +293,7 @@ static inline BOOL toku__lt_lock_test_incr_per_db(toku_lock_tree* tree,
u_int32_t replace_locks) {
assert(tree);
assert(replace_locks <= tree->curr_locks);
return tree->curr_locks - replace_locks < tree->max_locks;
return (BOOL)(tree->curr_locks - replace_locks < tree->max_locks);
}
static inline void toku__lt_lock_incr_per_db(toku_lock_tree* tree, u_int32_t replace_locks) {
......@@ -380,8 +380,7 @@ toku_range_tree* toku__lt_ifexist_selfread(toku_lock_tree* tree, TXNID txn) {
/* Provides access to a selfwrite tree for a particular transaction.
Returns NULL if it does not exist yet. */
toku_range_tree* toku__lt_ifexist_selfwrite(toku_lock_tree* tree,
TXNID txn) {
static toku_range_tree* toku__lt_ifexist_selfwrite(toku_lock_tree* tree, TXNID txn) {
assert(tree);
rt_forest* forest = toku_rth_find(tree->rth, txn);
return forest ? forest->self_write : NULL;
......@@ -462,8 +461,8 @@ static inline int toku__lt_selfwrite(toku_lock_tree* tree, TXNID txn,
static inline BOOL toku__dominated(toku_interval* query, toku_interval* by) {
assert(query && by);
return (toku__lt_point_cmp(query->left, by->left) >= 0 &&
toku__lt_point_cmp(query->right, by->right) <= 0);
return (BOOL)(toku__lt_point_cmp(query->left, by->left) >= 0 &&
toku__lt_point_cmp(query->right, by->right) <= 0);
}
/*
......@@ -567,7 +566,7 @@ static inline int toku__lt_meets(toku_lock_tree* tree, toku_interval* query,
r = toku_rt_find(rt, query, query_size, &buf, &buflen, &numfound);
if (r!=0) return r;
assert(numfound <= query_size);
*met = numfound != 0;
*met = (BOOL)(numfound != 0);
return 0;
}
......@@ -594,7 +593,7 @@ static inline int toku__lt_meets_peer(toku_lock_tree* tree, toku_interval* query
r = toku_rt_find(rt, query, query_size, &buf, &buflen, &numfound);
if (r!=0) return r;
assert(numfound <= query_size);
*met = numfound == 2 || (numfound == 1 && toku__lt_txn_cmp(buf[0].data, self));
*met = (BOOL) (numfound == 2 || (numfound == 1 && toku__lt_txn_cmp(buf[0].data, self)));
return 0;
}
......@@ -690,7 +689,7 @@ static inline void toku__init_insert(toku_range* to_insert,
as an endpoint of the given range. */
static inline BOOL toku__lt_p_independent(toku_point* point, toku_interval* range) {
assert(point && range);
return point != range->left && point != range->right;
return (BOOL)(point != range->left && point != range->right);
}
static inline int toku__lt_determine_extreme(toku_lock_tree* tree,
......@@ -745,7 +744,6 @@ static inline int toku__lt_find_extreme(toku_lock_tree* tree,
BOOL ignore_right = TRUE;
return toku__lt_determine_extreme(tree, to_insert, &ignore_left,
&ignore_right, numfound, 1);
return 0;
}
static inline int toku__lt_alloc_extreme(toku_lock_tree* tree, toku_range* to_insert,
......@@ -982,9 +980,10 @@ static inline BOOL toku__r_backwards(toku_interval* range) {
toku_point* right = (toku_point*)range->right;
/* Optimization: if all the pointers are equal, clearly left == right. */
return (left->key_payload != right->key_payload ||
left->data_payload != right->data_payload) &&
toku__lt_point_cmp(left, right) > 0;
return (BOOL)
((left->key_payload != right->key_payload ||
left->data_payload != right->data_payload) &&
toku__lt_point_cmp(left, right) > 0);
}
static inline int toku__lt_unlock_deferred_txns(toku_lock_tree* tree);
......@@ -1171,7 +1170,7 @@ static inline int toku__lt_borderwrite_insert(toku_lock_tree* tree,
BOOL found_p = FALSE;
BOOL found_s = FALSE;
r = toku__lt_get_border(tree, numfound == 0, &pred, &succ,
r = toku__lt_get_border(tree, (BOOL)(numfound == 0), &pred, &succ,
&found_p, &found_s, to_insert);
if (r!=0) return toku__lt_panic(tree, r);
......
......@@ -85,7 +85,7 @@ static inline toku_lth_elt* toku__lth_next(toku_lth* lth) {
assert(lth->iter_is_valid);
lth->iter_curr = lth->iter_curr->next_in_iteration;
lth->iter_is_valid = lth->iter_curr != &lth->iter_head;
lth->iter_is_valid = (BOOL)(lth->iter_curr != &lth->iter_head);
return lth->iter_curr;
}
......
......@@ -85,7 +85,7 @@ static inline toku_rth_elt* toku__rth_next(toku_rth* rth) {
assert(rth->iter_is_valid);
rth->iter_curr = rth->iter_curr->next_in_iteration;
rth->iter_is_valid = rth->iter_curr != &rth->iter_head;
rth->iter_is_valid = (BOOL)(rth->iter_curr != &rth->iter_head);
return rth->iter_curr;
}
......@@ -192,5 +192,5 @@ BOOL toku_rth_is_empty(toku_rth* rth) {
(rth->iter_head.next_in_iteration == &rth->iter_head));
assert((rth->num_keys == 0) ==
(rth->iter_head.prev_in_iteration == &rth->iter_head));
return rth->num_keys == 0;
return (BOOL)(rth->num_keys == 0);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment