Commit 21c6462e authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#2977 compile libtokudb.so with icc 12.0.3 refs[t:2977]

git-svn-id: file:///svn/toku/tokudb@30158 c7de825b-a66e-492c-adef-691d508d4ae1
parent 166c4cb1
......@@ -71,7 +71,7 @@ int brt_loader_call_error_function(brtloader_error_callback loader_error) {
error_callback_lock(loader_error);
r = loader_error->error;
if (r && loader_error->error_callback && !loader_error->did_callback) {
loader_error->did_callback = 1;
loader_error->did_callback = TRUE;
loader_error->error_callback(loader_error->db,
loader_error->which_db,
loader_error->error,
......
......@@ -66,7 +66,11 @@ typedef struct {
#if !TOKU_WINDOWS && !defined(BOOL_DEFINED)
#define BOOL_DEFINED
typedef enum __toku_bool { FALSE=0, TRUE=1} BOOL;
#include <stdbool.h>
// typedef enum __toku_bool { FALSE=0, TRUE=1} BOOL;
#define TRUE true
#define FALSE false
typedef bool BOOL;
#endif
typedef struct tokulogger *TOKULOGGER;
......
......@@ -32,7 +32,7 @@ static inline unsigned int rbuf_get_roffset(struct rbuf *r) {
return r->ndone;
}
static inline unsigned int rbuf_char (struct rbuf *r) {
static inline unsigned char rbuf_char (struct rbuf *r) {
assert(r->ndone<r->size);
return r->buf[r->ndone++];
}
......
......@@ -33,12 +33,6 @@ static void test2 (int memcheck, int limit) {
if (0) {
r = toku_brt_flush(t);
assert(r==0);
{
int n = toku_get_n_items_malloced();
if (verbose) printf("%s:%d i=%d n_items_malloced=%d\n", __FILE__, __LINE__, i, n);
if (n!=3) toku_print_malloced_items();
assert(n==3);
}
}
}
if (verbose) printf("%s:%d inserted\n", __FILE__, __LINE__);
......
......@@ -459,7 +459,7 @@ static const ULE_S ule_committed_delete = {
};
static BRT_MSG_S
msg_init(int type, XIDS xids,
msg_init(enum brt_msg_type type, XIDS xids,
DBT *key, DBT *val) {
BRT_MSG_S msg;
msg.type = type;
......
......@@ -362,7 +362,14 @@ indexer_xid_state(DB_INDEXER *indexer, TXNID xid) {
TOKUTXN_STATE result = TOKUTXN_RETIRED;
// TEST
if (indexer->i->test_xid_state) {
result = indexer->i->test_xid_state(indexer, xid);
int r = indexer->i->test_xid_state(indexer, xid);
switch (r) {
case 0: result = TOKUTXN_LIVE; break;
case 1: result = TOKUTXN_COMMITTING; break;
case 2: result = TOKUTXN_ABORTING; break;
case 3: result = TOKUTXN_RETIRED; break;
default: assert(0); break;
}
} else {
DB_ENV *env = indexer->i->env;
TOKUTXN txn = NULL;
......@@ -416,7 +423,7 @@ static TOKUTXN
indexer_get_innermost_live_txn(DB_INDEXER *indexer, XIDS xids) {
DB_ENV *env = indexer->i->env;
uint8_t num_xids = xids_get_num_xids(xids);
TXNID xid = xids_get_xid(xids, num_xids-1);
TXNID xid = xids_get_xid(xids, (u_int8_t)(num_xids-1));
TOKUTXN txn = NULL;
int result = toku_txnid2txn(env->i->logger, xid, &txn);
invariant(result == 0);
......
......@@ -2,47 +2,53 @@
#include "test.h"
int main(int argc, const char *argv[]) {
static void test_create_close(BOOL allow_overlaps) {
int r;
toku_range_tree *tree;
BOOL allow_overlaps;
BOOL temp;
parse_args(argc, argv);
for (allow_overlaps = FALSE; allow_overlaps <= TRUE; allow_overlaps++) {
#ifdef TOKU_RT_NOOVERLAPS
if (allow_overlaps) continue;
if (allow_overlaps) return;
#endif
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, toku_malloc, toku_free, toku_realloc);
CKERR(r);
toku_range_tree *tree = NULL;
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree!=NULL);
r = toku_rt_get_allow_overlaps(tree, &temp);
CKERR(r);
assert((temp != 0) == (allow_overlaps != 0));
r = toku_rt_close(tree);
CKERR(r);
tree = NULL;
}
assert(tree!=NULL);
BOOL temp;
r = toku_rt_get_allow_overlaps(tree, &temp);
CKERR(r);
assert((temp != 0) == (allow_overlaps != 0));
for (allow_overlaps = FALSE; allow_overlaps <= TRUE; allow_overlaps++) {
r = toku_rt_close(tree);
CKERR(r);
tree = NULL;
}
static void test_create_close_nomem(BOOL allow_overlaps) {
#ifdef TOKU_RT_NOOVERLAPS
if (allow_overlaps) continue;
if (allow_overlaps) return;
#endif
int i;
for (i = 1; i <= 1; i++) {
mallocced = 0;
failon = i;
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps,
for (int i = 1; i <= 1; i++) {
mallocced = 0;
failon = i;
toku_range_tree *tree = NULL;
int r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps,
fail_malloc, toku_free, toku_realloc);
CKERR2(r, ENOMEM);
CKERR2(r, ENOMEM);
assert(tree==NULL);
}
assert(tree==NULL);
}
}
int main(int argc, const char *argv[]) {
parse_args(argc, argv);
test_create_close(false);
test_create_close(true);
test_create_close_nomem(false);
test_create_close_nomem(true);
return 0;
}
......@@ -183,17 +183,17 @@ x1_parse_args (int argc, char * const argv[]) {
verbose--;
if (verbose<0) verbose=0;
} else if (strcmp(argv[0], "--commit")==0) {
do_commit=1;
do_commit=TRUE;
} else if (strcmp(argv[0], "--abort")==0 || strcmp(argv[0], "--test") == 0) {
do_abort=1;
do_abort=TRUE;
} else if (strcmp(argv[0], "--explicit-abort")==0) {
do_explicit_abort=1;
do_explicit_abort=TRUE;
} else if (strcmp(argv[0], "--recover-committed")==0) {
do_recover_committed=1;
do_recover_committed=TRUE;
} else if (strcmp(argv[0], "--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
do_recover_aborted=1;
do_recover_aborted=TRUE;
} else if (strcmp(argv[0], "--recover-only") == 0) {
do_recover_only=1;
do_recover_only=TRUE;
} else if (strcmp(argv[0], "-h")==0) {
resultcode=0;
do_usage:
......
......@@ -184,17 +184,17 @@ x1_parse_args (int argc, char * const argv[]) {
verbose--;
if (verbose<0) verbose=0;
} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
do_commit=1;
do_commit=TRUE;
} else if (strcmp(argv[0], "--abort")==0) {
do_abort=1;
do_abort=TRUE;
} else if (strcmp(argv[0], "--explicit-abort")==0) {
do_explicit_abort=1;
do_explicit_abort=TRUE;
} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
do_recover_committed=1;
do_recover_committed=TRUE;
} else if (strcmp(argv[0], "--recover-aborted")==0) {
do_recover_aborted=1;
do_recover_aborted=TRUE;
} else if (strcmp(argv[0], "--recover-only") == 0) {
do_recover_only=1;
do_recover_only=TRUE;
} else if (strcmp(argv[0], "-h")==0) {
resultcode=0;
do_usage:
......
......@@ -172,13 +172,13 @@ x2_parse_args (int argc, char *const argv[]) {
verbose--;
if (verbose<0) verbose=0;
} else if (strcmp(argv[0],"--abort")==0 || strcmp(argv[0], "--test") == 0) {
do_abort=1;
do_abort=TRUE;
} else if (strcmp(argv[0],"--commit")==0) {
do_commit=1;
do_commit=TRUE;
} else if (strcmp(argv[0],"--recover-committed")==0) {
do_recover_committed=1;
do_recover_committed=TRUE;
} else if (strcmp(argv[0],"--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
do_recover_aborted=1;
do_recover_aborted=TRUE;
} else if (strcmp(argv[0], "-h")==0) {
resultcode=0;
do_usage:
......
......@@ -172,13 +172,13 @@ x2_parse_args (int argc, char * const argv[]) {
verbose--;
if (verbose<0) verbose=0;
} else if (strcmp(argv[0],"--abort")==0) {
do_abort=1;
do_abort=TRUE;
} else if (strcmp(argv[0],"--commit")==0 || strcmp(argv[0], "--test") == 0) {
do_commit=1;
do_commit=TRUE;
} else if (strcmp(argv[0],"--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
do_recover_committed=1;
do_recover_committed=TRUE;
} else if (strcmp(argv[0],"--recover-aborted")==0) {
do_recover_aborted=1;
do_recover_aborted=TRUE;
} else if (strcmp(argv[0], "-h")==0) {
resultcode=0;
do_usage:
......
......@@ -2578,7 +2578,7 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags, int i
if (!(env->i->open_flags & DB_INIT_TXN)) return toku_ydb_do_error(env, EINVAL, "Environment does not have transactions enabled\n");
u_int32_t txn_flags = 0;
txn_flags |= DB_TXN_NOWAIT; //We do not support blocking locks.
TOKU_ISOLATION child_isolation = 0;
TOKU_ISOLATION child_isolation = TOKU_ISO_SERIALIZABLE;
u_int32_t iso_flags = flags & DB_ISOLATION_FLAGS;
if (!(iso_flags == 0 ||
iso_flags == DB_TXN_SNAPSHOT ||
......
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