Commit c88f5f1a authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5206 merge signed types fix to main

git-svn-id: file:///svn/toku/tokudb@45638 c7de825b-a66e-492c-adef-691d508d4ae1
parent ab842ae7
...@@ -413,7 +413,7 @@ ct_maybe_merge_child(struct flusher_advice *fa, ...@@ -413,7 +413,7 @@ ct_maybe_merge_child(struct flusher_advice *fa,
flush_some_child(h, root_node, &new_fa); flush_some_child(h, root_node, &new_fa);
(void) __sync_fetch_and_add(&STATUS_VALUE(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_RUNNING), -1); (void) __sync_fetch_and_sub(&STATUS_VALUE(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_RUNNING), 1);
toku_free(ctme.target_key.data); toku_free(ctme.target_key.data);
} }
......
...@@ -2108,7 +2108,7 @@ static void putbuf_int32 (struct dbuf *dbuf, int v) { ...@@ -2108,7 +2108,7 @@ static void putbuf_int32 (struct dbuf *dbuf, int v) {
putbuf_bytes(dbuf, &v, 4); putbuf_bytes(dbuf, &v, 4);
} }
static void putbuf_int64 (struct dbuf *dbuf, unsigned long long v) { static void putbuf_int64 (struct dbuf *dbuf, long long v) {
putbuf_int32(dbuf, v>>32); putbuf_int32(dbuf, v>>32);
putbuf_int32(dbuf, v&0xFFFFFFFF); putbuf_int32(dbuf, v&0xFFFFFFFF);
} }
......
...@@ -621,7 +621,7 @@ int toku_omt_delete_at(OMT omt, u_int32_t index) { ...@@ -621,7 +621,7 @@ int toku_omt_delete_at(OMT omt, u_int32_t index) {
OMTVALUE v; OMTVALUE v;
int r; int r;
if (index>=omt_size(omt)) return EINVAL; if (index>=omt_size(omt)) return EINVAL;
if ((r=maybe_resize_or_convert(omt, -1+omt_size(omt)))) return r; if ((r=maybe_resize_or_convert(omt, omt_size(omt)-1))) return r;
if (omt->is_array && index!=0 && index!=omt->i.a.num_values-1) { if (omt->is_array && index!=0 && index!=omt->i.a.num_values-1) {
if ((r=omt_convert_to_tree(omt))) return r; if ((r=omt_convert_to_tree(omt))) return r;
} }
......
...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
BOOL UU(is_clone) BOOL UU(is_clone)
) { ) {
if (w) { if (w) {
int curr_size = __sync_fetch_and_add(&total_size, -1); int curr_size = __sync_fetch_and_sub(&total_size, 1);
assert(curr_size <= 200); assert(curr_size <= 200);
usleep(500*1000); usleep(500*1000);
} }
......
...@@ -64,7 +64,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre ...@@ -64,7 +64,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre
if (do_write_errors && event_count_trigger == event_add_and_fetch()) { if (do_write_errors && event_count_trigger == event_add_and_fetch()) {
event_hit(); event_hit();
errno = ENOSPC; errno = ENOSPC;
r = -1; r = (size_t) -1;
} else { } else {
r = fwrite(ptr, size, nmemb, stream); r = fwrite(ptr, size, nmemb, stream);
if (r!=nmemb) { if (r!=nmemb) {
......
...@@ -45,7 +45,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre ...@@ -45,7 +45,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count); if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOSPC; errno = ENOSPC;
r = -1; r = (size_t) -1;
} else { } else {
r = fwrite(ptr, size, nmemb, stream); r = fwrite(ptr, size, nmemb, stream);
if (r!=nmemb) { if (r!=nmemb) {
......
...@@ -72,7 +72,7 @@ insert_something(FT_HANDLE t, CACHETABLE UU(ct), void *UU(extra)) ...@@ -72,7 +72,7 @@ insert_something(FT_HANDLE t, CACHETABLE UU(ct), void *UU(extra))
{ {
assert(t); assert(t);
int r = 0; int r = 0;
unsigned int dummy_value = 1 << 31; unsigned int dummy_value = 1U << 31;
DBT key; DBT key;
DBT val; DBT val;
toku_fill_dbt(&key, &dummy_value, sizeof(unsigned int)); toku_fill_dbt(&key, &dummy_value, sizeof(unsigned int));
......
...@@ -29,10 +29,10 @@ static uint64_t htonl64(uint64_t x) { ...@@ -29,10 +29,10 @@ static uint64_t htonl64(uint64_t x) {
typedef size_t (*malloc_usable_size_fun_t)(void *p); typedef size_t (*malloc_usable_size_fun_t)(void *p);
#if defined(HAVE_MALLOC_USABLE_SIZE) #if defined(HAVE_MALLOC_USABLE_SIZE)
size_t malloc_usable_size(void *p); size_t malloc_usable_size(void *p) __THROW;
static malloc_usable_size_fun_t malloc_usable_size_f = malloc_usable_size; static malloc_usable_size_fun_t malloc_usable_size_f = malloc_usable_size;
#elif defined(HAVE_MALLOC_SIZE) #elif defined(HAVE_MALLOC_SIZE)
size_t malloc_size(void *p); size_t malloc_size(void *p) __THROW;
static malloc_usable_size_fun_t malloc_usable_size_f = malloc_size; static malloc_usable_size_fun_t malloc_usable_size_f = malloc_size;
#endif #endif
......
...@@ -29,10 +29,10 @@ static uint64_t htonl64(uint64_t x) { ...@@ -29,10 +29,10 @@ static uint64_t htonl64(uint64_t x) {
typedef size_t (*malloc_usable_size_fun_t)(void *p); typedef size_t (*malloc_usable_size_fun_t)(void *p);
#if defined(HAVE_MALLOC_USABLE_SIZE) #if defined(HAVE_MALLOC_USABLE_SIZE)
size_t malloc_usable_size(void *p); size_t malloc_usable_size(void *p) __THROW;
static malloc_usable_size_fun_t malloc_usable_size_f = malloc_usable_size; static malloc_usable_size_fun_t malloc_usable_size_f = malloc_usable_size;
#elif defined(HAVE_MALLOC_SIZE) #elif defined(HAVE_MALLOC_SIZE)
size_t malloc_size(void *p); size_t malloc_size(void *p) __THROW;
static malloc_usable_size_fun_t malloc_usable_size_f = malloc_size; static malloc_usable_size_fun_t malloc_usable_size_f = malloc_size;
#endif #endif
......
...@@ -176,7 +176,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre ...@@ -176,7 +176,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre
if (fwrite_count_trigger == fwrite_count || event_count == event_count_trigger) { if (fwrite_count_trigger == fwrite_count || event_count == event_count_trigger) {
error_injected++; error_injected++;
errno = ENOSPC; errno = ENOSPC;
r = -1; r = (size_t) -1;
} else { } else {
r = fwrite(ptr, size, nmemb, stream); r = fwrite(ptr, size, nmemb, stream);
if (r!=nmemb) { if (r!=nmemb) {
......
...@@ -15,8 +15,8 @@ enum {NUM_DBS=2}; ...@@ -15,8 +15,8 @@ enum {NUM_DBS=2};
int USE_PUTS=0; int USE_PUTS=0;
uint32_t num_rows = 1; uint32_t num_rows = 1;
uint32_t which_db_to_fail = -1; uint32_t which_db_to_fail = (uint32_t) -1;
uint32_t which_row_to_fail = -1; uint32_t which_row_to_fail = (uint32_t) -1;
enum how_to_fail { FAIL_NONE, FAIL_KSIZE, FAIL_VSIZE } how_to_fail = FAIL_NONE; enum how_to_fail { FAIL_NONE, FAIL_KSIZE, FAIL_VSIZE } how_to_fail = FAIL_NONE;
static int put_multiple_generate(DB *dest_db, static int put_multiple_generate(DB *dest_db,
...@@ -198,7 +198,7 @@ int num_rows_set = FALSE; ...@@ -198,7 +198,7 @@ int num_rows_set = FALSE;
int test_main(int argc, char * const *argv) { int test_main(int argc, char * const *argv) {
do_args(argc, argv); do_args(argc, argv);
run_test(1, -1, -1, FAIL_NONE); run_test(1, (uint32_t) -1, (uint32_t) -1, FAIL_NONE);
run_test(1, 0, 0, FAIL_NONE); run_test(1, 0, 0, FAIL_NONE);
run_test(1, 0, 0, FAIL_KSIZE); run_test(1, 0, 0, FAIL_KSIZE);
run_test(1, 0, 0, FAIL_VSIZE); run_test(1, 0, 0, FAIL_VSIZE);
......
...@@ -113,7 +113,8 @@ unlock_and_maybe_close_db(struct db_bucket *bucket, ARG arg) { ...@@ -113,7 +113,8 @@ unlock_and_maybe_close_db(struct db_bucket *bucket, ARG arg) {
int r = db->close(db, 0); int r = db->close(db, 0);
CKERR(r); CKERR(r);
bucket->is_open = false; bucket->is_open = false;
assert(__sync_fetch_and_add(&open_buckets, -1) > 0); int old_open_buckets = __sync_fetch_and_sub(&open_buckets, 1);
assert(old_open_buckets > 0);
verbose_printf("decided to close a bucket's db before unlocking\n"); verbose_printf("decided to close a bucket's db before unlocking\n");
} }
toku_mutex_unlock(&bucket->mutex); toku_mutex_unlock(&bucket->mutex);
......
...@@ -33,7 +33,7 @@ test_main (int argc, char *const argv[]) { ...@@ -33,7 +33,7 @@ test_main (int argc, char *const argv[]) {
DB_ENV *env; DB_ENV *env;
r = db_env_create(&env, 0); assert(r==0); r = db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors env->set_errfile(env,0); // Turn off those annoying errors
r = env->open(env, ENVDIR, -1, 0644); r = env->open(env, ENVDIR, (u_int32_t) -1, 0644);
CKERR2(r, EINVAL); CKERR2(r, EINVAL);
assert(n_handle_error==0); assert(n_handle_error==0);
r = env->close(env, 0); assert(r==0); r = env->close(env, 0); assert(r==0);
...@@ -62,7 +62,7 @@ test_main (int argc, char *const argv[]) { ...@@ -62,7 +62,7 @@ test_main (int argc, char *const argv[]) {
env->set_errfile(env, write_here); env->set_errfile(env, write_here);
if (do_errcall) if (do_errcall)
env->set_errcall(env, handle_error); env->set_errcall(env, handle_error);
r = env->open(env, ENVDIR, -1, 0644); r = env->open(env, ENVDIR, (u_int32_t) -1, 0644);
assert(r==EINVAL); assert(r==EINVAL);
r = env->close(env, 0); assert(r==0); r = env->close(env, 0); assert(r==0);
fclose(write_here); fclose(write_here);
......
...@@ -130,7 +130,7 @@ toku_txn_id(DB_TXN * txn) { ...@@ -130,7 +130,7 @@ toku_txn_id(DB_TXN * txn) {
HANDLE_PANICKED_ENV(txn->mgrp); HANDLE_PANICKED_ENV(txn->mgrp);
toku_ydb_barf(); toku_ydb_barf();
abort(); abort();
return -1; return (u_int32_t) -1;
} }
static u_int64_t static u_int64_t
......
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