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

Get rid of icc warnings (with port-win warnings.) Addresss #1185.

git-svn-id: file:///svn/tokudb.1131b+1080a+1185+nostatementexprs@6466 c7de825b-a66e-492c-adef-691d508d4ae1
parent 74a2df5c
......@@ -40,14 +40,16 @@ VISIBILITY=-fvisibility=hidden
endif
endif
CFLAGS = -Werror -Wall $(FORMAT) $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS) $(FPICFLAGS) $(SHADOW) $(VISIBILITY)
CFLAGS = -Werror -Wall $(FORMAT) $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS) $(FPICFLAGS) $(SHADOW) $(VISIBILITY)
ifneq ($(CC),icc)
CFLAGS += -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn -g3 -ggdb3
else
CFLAGS += -g
CFLAGS += -diag-enable port-win
CFLAGS += -diag-disable 177 # Don't complain about static variables that are not used.
#CFLAGS += -diag-disable 188 # Don't complain about enumerated type mixed with another type.
CFLAGS += -diag-disable 589 # Don't complain about goto into a block that skips initializing variables. GCC catches the actual uninitialized variables.
CFLAGS += -diag-disable 869 # Don't complain about unused variables (since we defined __attribute__ to be nothing.)
CFLAGS += -diag-disable 981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
CFLAGS += -diag-disable 1324 # Don't complain about rdtsc clobbering its registers more than once.
endif
......@@ -151,7 +153,7 @@ check-fanout:
BRT_INTERNAL_H_INCLUDES = brt-internal.h cachetable.h fifo.h omt.h brt.h brt-search.h brttypes.h ybt.h log.h ../include/db.h kv-pair.h memory.h mempool.h leafentry.h
brt-test-helpers.o: $(BRT_INTERNAL_H_INCLUDES) toku_assert.h
logformat: logformat.c toku_assert.c
logformat: logformat.c
brt-serialize-test.o: $(BRT_INTERNAL_H_INCLUDES)
test_toku_malloc_plain_free: newbrt.o
......
......@@ -237,14 +237,14 @@ void toku_serialize_brtnode_to (int fd, BLOCKNUM blocknum, BRTNODE node, struct
//printf("%s:%d p%d=%p n_entries=%d\n", __FILE__, __LINE__, i, node->mdicts[i], mdict_n_entries(node->mdicts[i]));
wbuf_int(&w, toku_fifo_n_entries(BNC_BUFFER(node,i)));
FIFO_ITERATE(BNC_BUFFER(node,i), key, keylen, data, datalen, type, xid,
({
{
assert(type>=0 && type<256);
wbuf_char(&w, (unsigned char)type);
wbuf_TXNID(&w, xid);
wbuf_bytes(&w, key, keylen);
wbuf_bytes(&w, data, datalen);
check_local_fingerprint+=node->rand4fingerprint*toku_calc_fingerprint_cmd(type, xid, key, keylen, data, datalen);
}));
});
}
//printf("%s:%d check_local_fingerprint=%8x\n", __FILE__, __LINE__, check_local_fingerprint);
if (check_local_fingerprint!=node->local_fingerprint) printf("%s:%d node=%" PRId64 " fingerprint expected=%08x actual=%08x\n", __FILE__, __LINE__, node->thisnodename.b, check_local_fingerprint, node->local_fingerprint);
......@@ -882,7 +882,7 @@ int toku_serialize_fifo_at (int fd, off_t freeoff, FIFO fifo) {
freeoff+=size;
}
FIFO_ITERATE(fifo, key, keylen, val, vallen, type, xid,
({
{
size_t size=keylen+vallen+1+8+4+4;
char *MALLOC_N(size, buf);
assert(buf!=0);
......@@ -903,7 +903,7 @@ int toku_serialize_fifo_at (int fd, off_t freeoff, FIFO fifo) {
assert(r==(ssize_t)size);
freeoff+=size;
toku_free(buf);
}));
});
unlock_for_pwrite();
return 0;
}
......
......@@ -23,9 +23,9 @@ static void verify_local_fingerprint (BRTNODE node) {
if (node->height>0) {
for (i=0; i<node->u.n.n_children; i++)
FIFO_ITERATE(BNC_BUFFER(node,i), key, keylen, data, datalen, type, xid,
({
{
fp += node->rand4fingerprint * toku_calc_fingerprint_cmd(type, xid, key, keylen, data, datalen);
}));
});
assert(fp==node->local_fingerprint);
} else {
toku_verify_counts(node);
......
......@@ -884,7 +884,7 @@ static int handle_split_of_child (BRT t, BRTNODE node, int childnum,
// Remove all the cmds from the local fingerprint. Some may get added in again when we try to push to the child.
FIFO_ITERATE(old_h, skey, skeylen, sval, svallen, type, xid,
({
{
u_int32_t old_fingerprint = node->local_fingerprint;
u_int32_t new_fingerprint = old_fingerprint - node->rand4fingerprint*toku_calc_fingerprint_cmd(type, xid, skey, skeylen, sval, svallen);
if (t->txn_that_created != xid) {
......@@ -892,7 +892,7 @@ static int handle_split_of_child (BRT t, BRTNODE node, int childnum,
assert(r==0);
}
node->local_fingerprint = new_fingerprint;
}));
});
//verify_local_fingerprint_nonleaf(node);
......@@ -923,12 +923,11 @@ static int handle_split_of_child (BRT t, BRTNODE node, int childnum,
node->u.n.n_bytes_in_buffers -= old_count; /* By default, they are all removed. We might add them back in. */
/* Keep pushing to the children, but not if the children would require a pushdown */
FIFO_ITERATE(old_h, skey, skeylen, sval, svallen, type, xid, ({
DBT skd, svd;
BRT_CMD_S brtcmd = { (enum brt_cmd_type)type, xid, .u.id= {toku_fill_dbt(&skd, skey, skeylen),
toku_fill_dbt(&svd, sval, svallen)} };
FIFO_ITERATE(old_h, skey, skeylen, sval, svallen, type, xid, {
DBT skd; DBT svd;
BRT_CMD_S brtcmd = build_brt_cmd((enum brt_cmd_type)type, xid, toku_fill_dbt(&skd, skey, skeylen), toku_fill_dbt(&svd, sval, svallen));
//verify_local_fingerprint_nonleaf(childa); verify_local_fingerprint_nonleaf(childb);
int pusha = 0, pushb = 0;
int pusha = 0; int pushb = 0;
switch (type) {
case BRT_INSERT:
case BRT_DELETE_BOTH:
......@@ -980,7 +979,7 @@ static int handle_split_of_child (BRT t, BRTNODE node, int childnum,
printf("Bad type %d\n", type); // Don't use default: because I want a compiler warning if I forget a enum case, and I want a runtime error if the type isn't one of the expected ones.
assert(0);
ok: /*nothing*/;
}));
});
toku_fifo_free(&old_h);
......@@ -1928,9 +1927,8 @@ static void verify_local_fingerprint_nonleaf (BRTNODE node) {
if (node->height==0) return;
for (i=0; i<node->u.n.n_children; i++)
FIFO_ITERATE(BNC_BUFFER(node,i), key, keylen, data, datalen, type, xid,
({
fp += node->rand4fingerprint * toku_calc_fingerprint_cmd(type, xid, key, keylen, data, datalen);
}));
fp += node->rand4fingerprint * toku_calc_fingerprint_cmd(type, xid, key, keylen, data, datalen);
);
assert(fp==node->local_fingerprint);
}
......@@ -2697,12 +2695,12 @@ toku_dump_brtnode (BRT brt, BLOCKNUM blocknum, int depth, bytevec lorange, ITEML
for (i=0; i< node->u.n.n_children; i++) {
printf("%*schild %d buffered (%d entries):\n", depth+1, "", i, toku_fifo_n_entries(BNC_BUFFER(node,i)));
FIFO_ITERATE(BNC_BUFFER(node,i), key, keylen, data, datalen, type, xid,
({
{
data=data; datalen=datalen; keylen=keylen;
printf("%*s xid=%"PRIu64" %u (type=%d)\n", depth+2, "", xid, ntohl(*(int*)key), type);
//assert(strlen((char*)key)+1==keylen);
//assert(strlen((char*)data)+1==datalen);
}));
});
}
for (i=0; i<node->u.n.n_children; i++) {
printf("%*schild %d\n", depth, "", i);
......
......@@ -49,7 +49,7 @@ dump_header (int f, struct brt_header **header) {
printf(" fifo has %d entries\n", toku_fifo_n_entries(h->fifo));
if (dump_data) {
FIFO_ITERATE(h->fifo, key, keylen, data, datalen, type, xid,
({
{
printf(" ");
switch (type) {
case BRT_NONE: printf("NONE"); goto ok;
......@@ -68,7 +68,7 @@ dump_header (int f, struct brt_header **header) {
printf(" ");
print_item(data, datalen);
printf("\n");
}));
});
}
}
......@@ -130,7 +130,7 @@ dump_node (int f, BLOCKNUM blocknum, struct brt_header *h) {
printf(" buffer contains %u bytes (%d items)\n", BNC_NBYTESINBUF(n, i), toku_fifo_n_entries(BNC_BUFFER(n,i)));
if (dump_data) {
FIFO_ITERATE(BNC_BUFFER(n,i), key, keylen, data, datalen, typ, xid,
({
{
printf(" TYPE=");
switch ((enum brt_cmd_type)typ) {
case BRT_NONE: printf("NONE"); goto ok;
......@@ -151,7 +151,7 @@ dump_node (int f, BLOCKNUM blocknum, struct brt_header *h) {
print_item(data, datalen);
}
printf("\n");
})
}
);
}
}
......
......@@ -101,6 +101,13 @@ struct brt_cmd {
};
typedef struct brt_cmd BRT_CMD_S, *BRT_CMD;
static inline
BRT_CMD_S
build_brt_cmd (enum brt_cmd_type type, TXNID xid, DBT *key, DBT *val) {
BRT_CMD_S result = {type, xid, .u.id={key,val}};
return result;
}
#define UU(x) x __attribute__((__unused__))
typedef struct leafentry *LEAFENTRY;
......
......@@ -28,7 +28,7 @@ unsigned long toku_fifo_memory_size(FIFO); // return how much memory the fifo us
//int toku_fifo_peek_deq_cmdstruct (FIFO, BRT_CMD, DBT*, DBT*); // fill in the BRT_CMD, using the two DBTs for the DBT part.
void toku_fifo_iterate (FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,ITEMLEN datalen,int type, TXNID xid, void*), void*);
#define FIFO_ITERATE(fifo,keyvar,keylenvar,datavar,datalenvar,typevar,xidvar,body) ({ \
#define FIFO_ITERATE(fifo,keyvar,keylenvar,datavar,datalenvar,typevar,xidvar,body) do { \
int fifo_iterate_off; \
for (fifo_iterate_off = toku_fifo_iterate_internal_start(fifo); \
toku_fifo_iterate_internal_has_more(fifo, fifo_iterate_off); \
......@@ -41,7 +41,7 @@ void toku_fifo_iterate (FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,I
int typevar = e->type; \
TXNID xidvar = e->xid; \
body; \
} })
} } while (0)
// Internal functions for the iterator.
int toku_fifo_iterate_internal_start(FIFO fifo);
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include <arpa/inet.h>
#include "brt-internal.h"
#include "toku_assert.h"
#include "x1764.h"
#include "includes.h"
// Calculate the fingerprint for a kvpair
static void toku_calc_more_murmur_kvpair (struct x1764 *mm, const void *key, int keylen, const void *val, int vallen) {
......
......@@ -6,7 +6,9 @@
#endif
#define _FILE_OFFSET_BITS 64
#include <arpa/inet.h>
// Portability first!
#include "portability.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
......
......@@ -27,10 +27,9 @@
* The case of a committed pair and a provisional pair can be represented by a committed pair, since it doesn't matter whether the transction aborts or commits, the value is the same.
*/
#include "brttypes.h"
#include "portability.h"
#include "rbuf.h"
#include "x1764.h"
#include <arpa/inet.h>
u_int32_t toku_le_crc(LEAFENTRY v);
......@@ -80,7 +79,7 @@ static inline u_int64_t getint64 (unsigned char *p) {
return (H<<32) + L;
}
#define LESWITCHCALL(le,funname, ...) ({ \
#define LESWITCHCALL(le,funname, ...) do { \
switch(get_le_state(le)) { \
case LE_COMMITTED: { \
unsigned char* __klenaddr = 1+(unsigned char*)le; u_int32_t __klen = getint(__klenaddr); \
......@@ -111,7 +110,7 @@ static inline u_int64_t getint64 (unsigned char *p) {
unsigned char* __plenaddr = __klen + __kvaladdr; u_int32_t __plen = getint(__plenaddr); \
unsigned char* __pvaladdr = 4 + __plenaddr; \
return funname ## _le_provpair(__xid, __klen, __kvaladdr, __plen, __pvaladdr, ## __VA_ARGS__); } \
} abort(); })
} abort(); } while (0)
u_int32_t leafentry_memsize (LEAFENTRY le); // the size of a leafentry in memory.
......
......@@ -16,10 +16,10 @@ struct logbytes {
struct logbytes *next;
int nbytes;
LSN lsn;
char bytes[0];
char bytes[1];
};
#define MALLOC_LOGBYTES(n) toku_malloc(sizeof(struct logbytes)+n)
#define MALLOC_LOGBYTES(n) toku_malloc(sizeof(struct logbytes)+n -1)
int toku_logger_create(TOKULOGGER */*resultp*/);
void toku_logger_set_cachetable (TOKULOGGER, CACHETABLE);
......
This diff is collapsed.
#ifndef PORTABILITY_H
#define PORTABILITY_H
// Portability layer
#if defined(__ICC)
// Intel compiler.
// Define ntohl using bswap.
// Define __attribute__ to be null
#include <sys/types.h>
static inline
u_int32_t
ntohl(u_int32_t x) {
return _bswap(x);
}
static inline
u_int32_t
htonl(u_int32_t x) {
return _bswap(x);
}
#define __attribute__(x)
#elif defined __GNUC__
// Gcc:
// Define ntohl using arpa/inet.h
#include <arpa/inet.h>
#else
#error Not ICC and not GNUC. What compiler?
#endif
#endif
......@@ -3,10 +3,11 @@
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "portability.h"
#include "memarena.h"
#include "toku_assert.h"
#include "brttypes.h"
#include "memory.h"
#include "memarena.h"
#include <arpa/inet.h>
struct rbuf {
unsigned char *buf;
......
......@@ -5,18 +5,6 @@
#include "includes.h"
#include "brttypes.h"
#include "log-internal.h"
#include "log_header.h"
#include "toku_assert.h"
#include <arpa/inet.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <zlib.h>
#if 0
static u_int32_t crc=0;
static u_int32_t actual_len=0;
......
......@@ -42,6 +42,7 @@ else
CFLAGS += -g
CFLAGS += -diag-enable port-win
CFLAGS += -diag-disable 177 # Don't complain about static variables that are not used.
CFLAGS += -diag-disable 869
CFLAGS += -diag-disable 981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
endif
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lpthread -lz
......
#include <arpa/inet.h>
#include "../portability.h"
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "key.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include <unistd.h>
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "key.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include <unistd.h>
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "key.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include <unistd.h>
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "key.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include <unistd.h>
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "key.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include <string.h>
#include <unistd.h>
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
......
......@@ -266,7 +266,7 @@ static void flush_n (CACHEFILE f __attribute__((__unused__)), CACHEKEY key __att
void *extra __attribute__((__unused__)),
long size __attribute__((__unused__)),
BOOL write_me __attribute__((__unused__)), BOOL keep_me __attribute__((__unused__)),
LSN modified_lsn __attribute__((__unused__)), BOOL rename_p __attribute ((__unused__))) {
LSN modified_lsn __attribute__((__unused__)), BOOL rename_p __attribute__ ((__unused__))) {
int *v = value;
assert(*v==0);
}
......
#include "fifo.h"
#include "memory.h"
#include "toku_assert.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "includes.h"
int verbose;
......@@ -53,7 +48,7 @@ test_fifo_enq (int n) {
}
i = 0;
FIFO_ITERATE(f, key, keylen, val, vallen, type, xid, ({
FIFO_ITERATE(f, key, keylen, val, vallen, type, xid, {
if (verbose) printf("checkit %d %d\n", i, type);
buildkey(i);
buildval(i);
......@@ -62,7 +57,7 @@ test_fifo_enq (int n) {
assert(i % 256 == type);
assert((TXNID)i==xid);
i += 1;
}));
});
assert(i == n);
if (thekey) free(thekey);
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include "key.h"
#include <unistd.h>
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include "key.h"
#include <unistd.h>
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include "key.h"
#include <unistd.h>
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2008 Tokutek Inc. All rights reserved."
#include "brt.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
#include "key.h"
#include <unistd.h>
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <dirent.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "log-internal.h"
#include "toku_assert.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define dname __FILE__ ".dir"
#define rmrf "rm -rf " dname "/"
......
......@@ -8,9 +8,9 @@ typedef OMTVALUE TESTVALUE;
/* Things that would go in a omt-tests.h if we split to multiple files later. */
int verbose=0;
#define CKERR(r) ({ if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, strerror(r)); assert(r==0); })
#define CKERR2(r,r2) ({ if (r!=r2) fprintf(stderr, "%s:%d error %d %s, expected %d\n", __FILE__, __LINE__, r, strerror(r), r2); assert(r==r2); })
#define CKERR2s(r,r2,r3) ({ if (r!=r2 && r!=r3) fprintf(stderr, "%s:%d error %d %s, expected %d or %d\n", __FILE__, __LINE__, r, strerror(r), r2,r3); assert(r==r2||r==r3); })
#define CKERR(r) do { if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, strerror(r)); assert(r==0); } while (0)
#define CKERR2(r,r2) do { if (r!=r2) fprintf(stderr, "%s:%d error %d %s, expected %d\n", __FILE__, __LINE__, r, strerror(r), r2); assert(r==r2); } while (0)
#define CKERR2s(r,r2,r3) do { if (r!=r2 && r!=r3) fprintf(stderr, "%s:%d error %d %s, expected %d or %d\n", __FILE__, __LINE__, r, strerror(r), r2,r3); assert(r==r2||r==r3); } while (0)
#include <string.h>
static void
......
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include "brt.h"
#include "key.h"
#include "includes.h"
static const char fname[]= __FILE__ ".brt";
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#include "toku_assert.h"
#include "brttypes.h"
#include "includes.h"
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static __attribute__((__noreturn__)) void catch_abort (int sig __attribute__((__unused__))) {
exit(1);
......
......@@ -4,11 +4,9 @@
* they match both key and value.
*/
#include <unistd.h>
#include "brt.h"
#include "includes.h"
#include "test.h"
#include "toku_assert.h"
static TOKUTXN const null_txn = 0;
......
/* Test an overflow condition on the leaf. See #632. */
#include "brt.h"
#include "key.h"
#include "toku_assert.h"
#include <string.h>
#include <unistd.h>
#include "includes.h"
int verbose;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "toku_assert.h"
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "includes.h"
#define fname __FILE__ ".tmp"
......
#include "x1764.h"
#include "toku_assert.h"
#include <stdio.h>
#include <stdlib.h>
#include "includes.h"
static void
test0 (void) {
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#define _FILE_OFFSET_BITS 64
#include "ybt.h"
#include "memory.h"
#include "toku_assert.h"
#include <string.h>
#include "includes.h"
static void ybt_test0 (void) {
void *v0=0,*v1=0;
......
......@@ -14,6 +14,6 @@ void toku_do_assert(int,const char*/*expr_as_string*/,const char */*fun*/,const
#ifdef SLOW_ASSERT
#define assert(expr) toku_do_assert((expr) != 0, #expr, __FUNCTION__, __FILE__, __LINE__)
#else
#define assert(expr) ({ if ((expr)==0) toku_do_assert(0, #expr, __FUNCTION__, __FILE__, __LINE__); })
#define assert(expr) do { if ((expr)==0) toku_do_assert(0, #expr, __FUNCTION__, __FILE__, __LINE__); } while (0)
#endif
#endif
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