Commit 90d4f3a8 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #293

Addresses #307
\marginpar{Code review/refactor pass}
Write locks should be done now.
Modified makefile

Tests updated to remove warnings.
Not all tests pass currently.


git-svn-id: file:///svn/tokudb@2031 c7de825b-a66e-492c-adef-691d508d4ae1
parent fabca64f
......@@ -15,12 +15,9 @@ else
GCOV_FLAGS =
endif
CFLAGS = -W -Wall -Werror -fPIC $(OPTFLAGS) $(GCOV_FLAGS)
CFLAGS = -W -Wall -Wextra -Werror -fPIC $(OPTFLAGS) $(GCOV_FLAGS)
CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute
ifneq ($(W),)
CFLAGS+= -Wunreachable-code
endif
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute -Wunreachable-code
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
......
This diff is collapsed.
......@@ -108,15 +108,6 @@ typedef struct {
u_int32_t data_len; /**< and its length */
} toku_point;
/**
A comparison function between toku_point's.
It is implemented as a wrapper of db compare and dup_compare functions,
but it checks whether the point is +/- infty.
Parameters are of type toku_point.
Return values conform to cmp from qsort(3).
*/
int toku_lt_point_cmp(void* a, void* b);
/**
Create a lock tree. Should be called only inside DB->open.
......
......@@ -29,7 +29,9 @@ ifeq ($(GCOV),GCOV)
else
GCOV_FLAGS =
endif
CFLAGS = -Wall -Werror $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CFLAGS = -W -Wall -Wextra -Werror $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute -Wunreachable-code
CPPFLAGS += -L../ -L../../range_tree
CPPFLAGS += -I. -I../ -I../../range_tree -I../../../newbrt -I../../../include -lpthread
......
......@@ -36,8 +36,12 @@ int dbcmp (DB *db __attribute__((__unused__)), const DBT *a, const DBT*b) {
return toku_keycompare(a->data, a->size, b->data, b->size);
}
void dbpanic(DB* db) {
BOOL panicked = FALSE;
int dbpanic(DB* db) {
if (verbose) printf("AHH!!!! Run away %p!!!\n", db);
panicked = TRUE;
return EINVAL;
}
......@@ -92,3 +96,13 @@ DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) {
dbt->size = size;
return dbt;
}
/**
A comparison function between toku_point's.
It is implemented as a wrapper of db compare and dup_compare functions,
but it checks whether the point is +/- infty.
Parameters are of type toku_point.
Return values conform to cmp from qsort(3).
*/
extern int __toku_lt_point_cmp(void* a, void* b);
......@@ -179,6 +179,8 @@ static void do_point_test(int (*acquire)(toku_lock_tree*, DB_TXN*,
}
int main(int argc, const char *argv[]) {
parse_args(argc, argv);
int r;
toku_lock_tree* lt = NULL;
DB* db = (DB*)1;
......
......@@ -123,8 +123,8 @@ void lt_find(BOOL dups, toku_range_tree* rt,
}
unsigned i;
for (i = 0; i < numfound; i++) {
if (toku_lt_point_cmp(buf[i].left, &left ) == 0 &&
toku_lt_point_cmp(buf[i].right, &right) == 0 &&
if (__toku_lt_point_cmp(buf[i].left, &left ) == 0 &&
__toku_lt_point_cmp(buf[i].right, &right) == 0 &&
buf[i].data == find_txn) return;
}
assert(FALSE); //Crash since we didn't find it.
......@@ -419,7 +419,7 @@ void runtest(BOOL dups) {
void init_test(void) {
int i;
unsigned i;
for (i = 0; i < sizeof(nums)/sizeof(nums[0]); i++) nums[i] = i;
buflen = 64;
......@@ -431,6 +431,7 @@ void init_test(void) {
int main(int argc, const char *argv[]) {
parse_args(argc, argv);
init_test();
......
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