Commit 145464c7 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Get rid of most CIL warnings. Addresses #1185.

git-svn-id: file:///svn/tokudb.1131b+1080a+1185@6456 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5aef408e
#include "brt-internal.h" #include "includes.h"
#include "toku_assert.h"
int toku_testsetup_leaf(BRT brt, BLOCKNUM *blocknum) { int toku_testsetup_leaf(BRT brt, BLOCKNUM *blocknum) {
BRTNODE node; BRTNODE node;
......
...@@ -24,7 +24,9 @@ struct ctpair_rwlock { ...@@ -24,7 +24,9 @@ struct ctpair_rwlock {
// initialize a read write lock // initialize a read write lock
static void ctpair_rwlock_init(CTPAIR_RWLOCK rwlock) { static __attribute__((__unused__))
void
ctpair_rwlock_init(CTPAIR_RWLOCK rwlock) {
int r; int r;
rwlock->pinned = rwlock->want_pin = 0; rwlock->pinned = rwlock->want_pin = 0;
r = pthread_cond_init(&rwlock->wait_pin, 0); assert(r == 0); r = pthread_cond_init(&rwlock->wait_pin, 0); assert(r == 0);
...@@ -34,7 +36,9 @@ static void ctpair_rwlock_init(CTPAIR_RWLOCK rwlock) { ...@@ -34,7 +36,9 @@ static void ctpair_rwlock_init(CTPAIR_RWLOCK rwlock) {
// destroy a read write lock // destroy a read write lock
static void ctpair_rwlock_destroy(CTPAIR_RWLOCK rwlock) { static __attribute__((__unused__))
void
ctpair_rwlock_destroy(CTPAIR_RWLOCK rwlock) {
int r; int r;
assert(rwlock->pinned == 0 && rwlock->want_pin == 0); assert(rwlock->pinned == 0 && rwlock->want_pin == 0);
assert(rwlock->writer == 0 && rwlock->want_write == 0); assert(rwlock->writer == 0 && rwlock->want_write == 0);
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* Dump the log from stdin to stdout. */ /* Dump the log from stdin to stdout. */
#include "includes.h"
#include "brttypes.h" #include "brttypes.h"
#include "log-internal.h" #include "log-internal.h"
#include "log_header.h" #include "log_header.h"
......
...@@ -126,6 +126,10 @@ CHECKS = \ ...@@ -126,6 +126,10 @@ CHECKS = \
$(REGRESSION_TESTS) \ $(REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the previous line # This line intentially kept commented so I can have a \ on the previous line
ifeq ($(CIL),1)
CC=../../../cil/cil-1.3.6/bin/cilly --merge --keepmerged
endif
build: $(BINS) build: $(BINS)
foo: foo:
echo $(BINS) echo $(BINS)
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "toku_assert.h" #include "includes.h"
#include "brt-internal.h"
#include "kv-pair.h"
#include <fcntl.h>
#include <string.h>
#include <zlib.h>
#include <arpa/inet.h>
#include <stdlib.h>
static void test_serialize(void) { static void test_serialize(void) {
// struct brt source_brt; // struct brt source_brt;
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h" #include "includes.h"
#include "key.h"
#include "brt-internal.h"
#include "memory.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "test.h" #include "test.h"
static const char fname[]= __FILE__ ".brt"; static const char fname[]= __FILE__ ".brt";
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h" #include "includes.h"
#include "key.h"
#include "brt-internal.h"
#include "memory.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "test.h" #include "test.h"
static const char fname[]= __FILE__ ".brt"; static const char fname[]= __FILE__ ".brt";
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h" #include "includes.h"
#include "key.h"
#include "brt-internal.h"
#include "memory.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "test.h" #include "test.h"
static TOKUTXN const null_txn = 0; static TOKUTXN const null_txn = 0;
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h" #include "includes.h"
#include "key.h"
#include "brt-internal.h"
#include "memory.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "test.h" #include "test.h"
static const char fname[]= __FILE__ ".brt"; static const char fname[]= __FILE__ ".brt";
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h" #include "includes.h"
#include "key.h"
#include "brt-internal.h"
#include "memory.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "test.h" #include "test.h"
static const char fname[]= __FILE__ ".brt"; static const char fname[]= __FILE__ ".brt";
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE f __attribute__((__unused__)), flush (CACHEFILE f __attribute__((__unused__)),
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE f __attribute__((__unused__)), flush (CACHEFILE f __attribute__((__unused__)),
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
cachetable_fd_test (void) { cachetable_fd_test (void) {
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE f __attribute__((__unused__)), flush (CACHEFILE f __attribute__((__unused__)),
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE cf __attribute__((__unused__)), flush (CACHEFILE cf __attribute__((__unused__)),
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE f __attribute__((__unused__)), flush (CACHEFILE f __attribute__((__unused__)),
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include <stdio.h> #include "includes.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <malloc.h>
#include <errno.h>
#include <pthread.h>
#include "toku_assert.h"
#include "memory.h"
#include "cachetable.h"
#include "test.h" #include "test.h"
// this mutex is used by some of the tests to serialize access to some // this mutex is used by some of the tests to serialize access to some
......
#include <stdio.h> #include "includes.h"
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <pthread.h>
#include "cachetable-rwlock.h"
int verbose = 0; int verbose = 0;
......
/* How fast can we read a file usng the cachetable interface. */ /* How fast can we read a file usng the cachetable interface. */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include <assert.h> #include "includes.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "cachetable.h"
enum { KEYLIMIT = 4, BLOCKSIZE=1<<20, N=2048}; enum { KEYLIMIT = 4, BLOCKSIZE=1<<20, N=2048};
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include <inttypes.h> #include "includes.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <malloc.h>
#include <errno.h>
#include <pthread.h>
#include "toku_assert.h"
#include "memory.h"
#include "cachetable.h"
#include "test.h" #include "test.h"
#if 0 #if 0
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include <inttypes.h> #include "includes.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include "memory.h"
#include "cachetable.h"
#include "toku_assert.h"
#include "test.h" #include "test.h"
// this mutex is used by some of the tests to serialize access to some // this mutex is used by some of the tests to serialize access to some
......
#include <stdio.h> #include "includes.h"
#include <unistd.h>
#include <assert.h>
#include "test.h" #include "test.h"
#include "cachetable.h"
static void static void
flush (CACHEFILE f __attribute__((__unused__)), flush (CACHEFILE f __attribute__((__unused__)),
......
#include <stdio.h> #include "includes.h"
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <pthread.h>
int verbose; int verbose;
......
#include <sys/types.h> #include "includes.h"
#include <assert.h>
typedef struct value *OMTVALUE;
#include "omt.h"
enum { N=10 }; enum { N=10 };
struct value { int x; } vs[N]; struct value { int x; } vs[N];
OMTVALUE ps[N]; OMTVALUE ps[N];
#define V(x) ((struct value *)(x))
static void test (void) { static void test (void) {
OMT o; OMT o;
OMTCURSOR curs, curs2, curs3; OMTCURSOR curs, curs2, curs3;
...@@ -28,11 +27,11 @@ static void test (void) { ...@@ -28,11 +27,11 @@ static void test (void) {
r = toku_omt_create_from_sorted_array(&o, ps, 10); assert(r==0); r = toku_omt_create_from_sorted_array(&o, ps, 10); assert(r==0);
r = toku_omt_cursor_create(&curs); assert(r==0); r = toku_omt_cursor_create(&curs); assert(r==0);
r = toku_omt_fetch(o, 5, &v, curs); assert(r==0); r = toku_omt_fetch(o, 5, &v, curs); assert(r==0);
assert(v->x==5); assert(V(v)->x==5);
r = toku_omt_cursor_next(curs, &v); r = toku_omt_cursor_next(curs, &v);
assert(r==0 && v->x==6); assert(r==0 && V(v)->x==6);
r = toku_omt_cursor_prev(curs, &v); r = toku_omt_cursor_prev(curs, &v);
assert(r==0 && v->x==5); assert(r==0 && V(v)->x==5);
toku_omt_cursor_destroy(&curs); toku_omt_cursor_destroy(&curs);
toku_omt_destroy(&o); toku_omt_destroy(&o);
...@@ -42,7 +41,7 @@ static void test (void) { ...@@ -42,7 +41,7 @@ static void test (void) {
r = toku_omt_fetch(o, 5, &v, curs); assert(r==0); r = toku_omt_fetch(o, 5, &v, curs); assert(r==0);
r = toku_omt_cursor_create(&curs2); assert(r==0); r = toku_omt_cursor_create(&curs2); assert(r==0);
r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0); r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0);
r = toku_omt_cursor_next(curs, &v); assert(r==0 && v->x==6); r = toku_omt_cursor_next(curs, &v); assert(r==0 && V(v)->x==6);
toku_omt_destroy(&o); toku_omt_destroy(&o);
toku_omt_cursor_destroy(&curs); toku_omt_cursor_destroy(&curs);
toku_omt_cursor_destroy(&curs2); toku_omt_cursor_destroy(&curs2);
...@@ -53,10 +52,10 @@ static void test (void) { ...@@ -53,10 +52,10 @@ static void test (void) {
r = toku_omt_fetch(o, 5, &v, curs); assert(r==0); r = toku_omt_fetch(o, 5, &v, curs); assert(r==0);
r = toku_omt_cursor_create(&curs2); assert(r==0); r = toku_omt_cursor_create(&curs2); assert(r==0);
r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0); r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0);
r = toku_omt_cursor_next(curs, &v); assert(r==0 && v->x==6); r = toku_omt_cursor_next(curs, &v); assert(r==0 && V(v)->x==6);
r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && v->x==3); r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && V(v)->x==3);
toku_omt_cursor_destroy(&curs); toku_omt_cursor_destroy(&curs);
r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && v->x==2); r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && V(v)->x==2);
toku_omt_cursor_destroy(&curs2); toku_omt_cursor_destroy(&curs2);
toku_omt_destroy(&o); toku_omt_destroy(&o);
...@@ -68,14 +67,14 @@ static void test (void) { ...@@ -68,14 +67,14 @@ static void test (void) {
r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0); r = toku_omt_fetch(o, 4, &v, curs2); assert(r==0);
r = toku_omt_cursor_create(&curs3); assert(r==0); r = toku_omt_cursor_create(&curs3); assert(r==0);
r = toku_omt_fetch(o, 9, &v, curs3); assert(r==0); r = toku_omt_fetch(o, 9, &v, curs3); assert(r==0);
r = toku_omt_cursor_next(curs, &v); assert(r==0 && v->x==6); r = toku_omt_cursor_next(curs, &v); assert(r==0 && V(v)->x==6);
r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && v->x==3); r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && V(v)->x==3);
r = toku_omt_cursor_next(curs3, &v); assert(r!=0 && !toku_omt_cursor_is_valid(curs3)); r = toku_omt_cursor_next(curs3, &v); assert(r!=0 && !toku_omt_cursor_is_valid(curs3));
toku_omt_cursor_destroy(&curs); toku_omt_cursor_destroy(&curs);
r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && v->x==2); r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && V(v)->x==2);
r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && v->x==1); r = toku_omt_cursor_prev(curs2, &v); assert(r==0 && V(v)->x==1);
r = toku_omt_fetch(o, 1, &v, curs3); assert(r==0); r = toku_omt_fetch(o, 1, &v, curs3); assert(r==0);
r = toku_omt_cursor_prev(curs3, &v); assert(r==0 && v->x==0); r = toku_omt_cursor_prev(curs3, &v); assert(r==0 && V(v)->x==0);
r = toku_omt_cursor_prev(curs3, &v); assert(r!=0 && !toku_omt_cursor_is_valid(curs3)); r = toku_omt_cursor_prev(curs3, &v); assert(r!=0 && !toku_omt_cursor_is_valid(curs3));
toku_omt_cursor_destroy(&curs2); toku_omt_cursor_destroy(&curs2);
toku_omt_destroy(&o); toku_omt_destroy(&o);
......
This diff is collapsed.
/* The goal of this test. Make sure that inserts stay behind deletes. */ /* The goal of this test. Make sure that inserts stay behind deletes. */
#include "brt.h" #include "includes.h"
#include "key.h"
#include "toku_assert.h"
#include "brt-internal.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
static TOKUTXN const null_txn = 0; static TOKUTXN const null_txn = 0;
static DB * const null_db = 0; static DB * const null_db = 0;
......
...@@ -26,16 +26,7 @@ ...@@ -26,16 +26,7 @@
* *
*/ */
#include "brt.h" #include "includes.h"
#include "key.h"
#include "toku_assert.h"
#include "brt-internal.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
static TOKUTXN const null_txn = 0; static TOKUTXN const null_txn = 0;
static DB * const null_db = 0; static DB * const null_db = 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