Commit 4b4a669e authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

icc make lock_tree with -Werror. addresses #1185

git-svn-id: file:///svn/tokudb.1131b+1080a+1185@6408 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a261149
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "test.h" #include "test.h"
toku_range_tree* toku__lt_ifexist_selfwrite(toku_lock_tree* tree, DB_TXN* txn); toku_range_tree* toku__lt_ifexist_selfwrite(toku_lock_tree* tree, DB_TXN* txn);
toku_range_tree* toku__lt_ifexist_selfread(toku_lock_tree* tree, DB_TXN* txn);
int r; int r;
toku_lock_tree* lt [10] = {0}; toku_lock_tree* lt [10] = {0};
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
#include "test.h" #include "test.h"
toku_range_tree* toku__lt_ifexist_selfwrite(toku_lock_tree* tree, DB_TXN* txn); static void initial_setup(void);
toku_range_tree* toku__lt_ifexist_selfread(toku_lock_tree* tree, DB_TXN* txn);
void initial_setup(void);
static int r; static int r;
static u_int32_t lt_refs[100]; static u_int32_t lt_refs[100];
...@@ -17,7 +14,7 @@ static char subdb [100][5]; ...@@ -17,7 +14,7 @@ static char subdb [100][5];
static u_int32_t max_locks = 10; static u_int32_t max_locks = 10;
int nums[10000]; int nums[10000];
void setup_ltm(void) { static void setup_ltm(void) {
assert(!ltm); assert(!ltm);
r = toku_ltm_create(&ltm, max_locks, dbpanic, r = toku_ltm_create(&ltm, max_locks, dbpanic,
get_compare_fun_from_db, get_dup_compare_from_db, get_compare_fun_from_db, get_dup_compare_from_db,
...@@ -26,7 +23,7 @@ void setup_ltm(void) { ...@@ -26,7 +23,7 @@ void setup_ltm(void) {
assert(ltm); assert(ltm);
} }
void db_open_tree(BOOL dups, size_t index, size_t db_id_index) { static void db_open_tree(BOOL dups, size_t index, size_t db_id_index) {
assert((lt_refs[index] == 0 && !lts[index]) || assert((lt_refs[index] == 0 && !lts[index]) ||
(lt_refs[index] > 0 && lts[index])); (lt_refs[index] > 0 && lts[index]));
assert(ltm); assert(ltm);
...@@ -36,27 +33,27 @@ void db_open_tree(BOOL dups, size_t index, size_t db_id_index) { ...@@ -36,27 +33,27 @@ void db_open_tree(BOOL dups, size_t index, size_t db_id_index) {
assert(lts[index]); assert(lts[index]);
} }
void db_close_tree(size_t index) { static void db_close_tree(size_t index) {
assert(lts[index] && ltm && lt_refs[index] > 0); assert(lts[index] && ltm && lt_refs[index] > 0);
r = toku_lt_remove_ref(lts[index]); CKERR(r); r = toku_lt_remove_ref(lts[index]); CKERR(r);
lt_refs[index]--; lt_refs[index]--;
if (lt_refs[index] == 0) { lts[index] = NULL; } if (lt_refs[index] == 0) { lts[index] = NULL; }
} }
void txn_open_tree(size_t index) { static void txn_open_tree(size_t index) {
assert(lts[index] && ltm && lt_refs[index] > 0); assert(lts[index] && ltm && lt_refs[index] > 0);
toku_lt_add_ref(lts[index]); toku_lt_add_ref(lts[index]);
lt_refs[index]++; lt_refs[index]++;
} }
void txn_close_tree(size_t index) { static void txn_close_tree(size_t index) {
assert(lts[index] && ltm && lt_refs[index] > 0); assert(lts[index] && ltm && lt_refs[index] > 0);
r = toku_lt_remove_ref(lts[index]); CKERR(r); r = toku_lt_remove_ref(lts[index]); CKERR(r);
lt_refs[index]--; lt_refs[index]--;
if (lt_refs[index] == 0) { lts[index] = NULL; } if (lt_refs[index] == 0) { lts[index] = NULL; }
} }
void close_ltm(void) { static void close_ltm(void) {
assert(ltm); assert(ltm);
r = toku_ltm_close(ltm); r = toku_ltm_close(ltm);
CKERR(r); CKERR(r);
...@@ -64,7 +61,7 @@ void close_ltm(void) { ...@@ -64,7 +61,7 @@ void close_ltm(void) {
ltm = NULL; ltm = NULL;
} }
void run_test(BOOL dups) { static void run_test(BOOL dups) {
setup_ltm(); setup_ltm();
//Start: //Start:
...@@ -112,7 +109,7 @@ void run_test(BOOL dups) { ...@@ -112,7 +109,7 @@ void run_test(BOOL dups) {
close_ltm(); close_ltm();
} }
void initial_setup(void) { static void initial_setup(void) {
u_int32_t i; u_int32_t i;
ltm = NULL; ltm = NULL;
......
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