diff --git a/portability/toku_time.h b/portability/toku_time.h index f3bb81f4d1a..ccd1eae231e 100644 --- a/portability/toku_time.h +++ b/portability/toku_time.h @@ -18,6 +18,7 @@ static inline float toku_tdiff (struct timeval *a, struct timeval *b) { } #if !defined(HAVE_CLOCK_REALTIME) // OS X does not have clock_gettime, use clock_get_time +# include # include # include typedef int clockid_t; diff --git a/src/tests/blocking-first-empty.c b/src/tests/blocking-first-empty.c index 54d627ca5ab..15eb070cb48 100644 --- a/src/tests/blocking-first-empty.c +++ b/src/tests/blocking-first-empty.c @@ -53,7 +53,7 @@ static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptim r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-first.c b/src/tests/blocking-first.c index 74b19afed5e..691b9827e96 100644 --- a/src/tests/blocking-first.c +++ b/src/tests/blocking-first.c @@ -70,7 +70,7 @@ static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptim r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-last.c b/src/tests/blocking-last.c index 4ed34d5f142..188799084be 100644 --- a/src/tests/blocking-last.c +++ b/src/tests/blocking-last.c @@ -70,7 +70,7 @@ static void blocking_last(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-next-prev-deadlock.c b/src/tests/blocking-next-prev-deadlock.c index b89afe758de..42c671aa76f 100644 --- a/src/tests/blocking-next-prev-deadlock.c +++ b/src/tests/blocking-next-prev-deadlock.c @@ -77,21 +77,21 @@ static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee if (r != 0) break; if (verbose) - printf("%lu next %"PRIu64"\n", (unsigned long) toku_pthread_self(), get_key(&context.key)); + printf("%lu next %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), get_key(&context.key)); usleep(sleeptime); } if (verbose) - printf("%lu next=%d\n", (unsigned long) toku_pthread_self(), r); + printf("%lu next=%d\n", (unsigned long)(void *) toku_pthread_self(), r); assert(r == DB_NOTFOUND || r == DB_LOCK_DEADLOCK); int rr = cursor->c_close(cursor); assert(rr == 0); if (r == DB_NOTFOUND) { - if (verbose) printf("%lu commit\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu commit\n", (unsigned long)(void *) toku_pthread_self()); r = txn->commit(txn, 0); } else { - if (verbose) printf("%lu abort\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu abort\n", (unsigned long)(void *) toku_pthread_self()); r = txn->abort(txn); } assert(r == 0); @@ -123,21 +123,21 @@ static void blocking_prev(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee if (r != 0) break; if (verbose) - printf("%lu prev %"PRIu64"\n", (unsigned long) toku_pthread_self(), get_key(&context.key)); + printf("%lu prev %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), get_key(&context.key)); usleep(sleeptime); } if (verbose) - printf("%lu prev=%d\n", (unsigned long) toku_pthread_self(), r); + printf("%lu prev=%d\n", (unsigned long)(void *) toku_pthread_self(), r); assert(r == DB_NOTFOUND || r == DB_LOCK_DEADLOCK); int rr = cursor->c_close(cursor); assert(rr == 0); if (r == DB_NOTFOUND) { - if (verbose) printf("%lu commit\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu commit\n", (unsigned long)(void *) toku_pthread_self()); r = txn->commit(txn, 0); } else { - if (verbose) printf("%lu abort\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu abort\n", (unsigned long)(void *) toku_pthread_self()); r = txn->abort(txn); } assert(r == 0); diff --git a/src/tests/blocking-next-prev.c b/src/tests/blocking-next-prev.c index eb4c41160ec..376650e6dbd 100644 --- a/src/tests/blocking-next-prev.c +++ b/src/tests/blocking-next-prev.c @@ -76,21 +76,21 @@ static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee if (r != 0) break; if (verbose) - printf("%lu next %"PRIu64"\n", (unsigned long) toku_pthread_self(), get_key(&context.key)); + printf("%lu next %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), get_key(&context.key)); usleep(sleeptime); } if (verbose) - printf("%lu next=%d\n", (unsigned long) toku_pthread_self(), r); + printf("%lu next=%d\n", (unsigned long)(void *) toku_pthread_self(), r); assert(r == DB_NOTFOUND || r == DB_LOCK_DEADLOCK); int rr = cursor->c_close(cursor); assert(rr == 0); if (r == DB_NOTFOUND) { - if (verbose) printf("%lu commit\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu commit\n", (unsigned long)(void *) toku_pthread_self()); r = txn->commit(txn, 0); } else { - if (verbose) printf("%lu abort\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu abort\n", (unsigned long)(void *) toku_pthread_self()); r = txn->abort(txn); } assert(r == 0); @@ -122,21 +122,21 @@ static void blocking_prev(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee if (r != 0) break; if (verbose) - printf("%lu prev %"PRIu64"\n", (unsigned long) toku_pthread_self(), get_key(&context.key)); + printf("%lu prev %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), get_key(&context.key)); usleep(sleeptime); } if (verbose) - printf("%lu prev=%d\n", (unsigned long) toku_pthread_self(), r); + printf("%lu prev=%d\n", (unsigned long)(void *) toku_pthread_self(), r); assert(r == DB_NOTFOUND); int rr = cursor->c_close(cursor); assert(rr == 0); if (r == DB_NOTFOUND) { - if (verbose) printf("%lu commit\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu commit\n", (unsigned long)(void *) toku_pthread_self()); r = txn->commit(txn, 0); } else { - if (verbose) printf("%lu abort\n", (unsigned long) toku_pthread_self()); + if (verbose) printf("%lu abort\n", (unsigned long)(void *) toku_pthread_self()); r = txn->abort(txn); } assert(r == 0); diff --git a/src/tests/blocking-prelock-range.c b/src/tests/blocking-prelock-range.c index 432c3c009a6..870915d8e9f 100644 --- a/src/tests/blocking-prelock-range.c +++ b/src/tests/blocking-prelock-range.c @@ -25,7 +25,7 @@ static void blocking_range_lock(DB_ENV *db_env, DB *db, uint64_t nrows, long sle r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } } diff --git a/src/tests/blocking-put.c b/src/tests/blocking-put.c index 421b3992f26..0b7e4c4f557 100644 --- a/src/tests/blocking-put.c +++ b/src/tests/blocking-put.c @@ -24,7 +24,7 @@ static void blocking_put(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } } diff --git a/src/tests/blocking-set-range-0.c b/src/tests/blocking-set-range-0.c index c0a819347d3..ac5ad19b25d 100644 --- a/src/tests/blocking-set-range-0.c +++ b/src/tests/blocking-set-range-0.c @@ -79,7 +79,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-set-range-n.c b/src/tests/blocking-set-range-n.c index 6bb74507010..bd7c11fbb51 100644 --- a/src/tests/blocking-set-range-n.c +++ b/src/tests/blocking-set-range-n.c @@ -74,7 +74,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-set-range-reverse-0.c b/src/tests/blocking-set-range-reverse-0.c index 4550c0999b8..a9b8c84b4b8 100644 --- a/src/tests/blocking-set-range-reverse-0.c +++ b/src/tests/blocking-set-range-reverse-0.c @@ -77,7 +77,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(context.key.data); diff --git a/src/tests/blocking-set.c b/src/tests/blocking-set.c index 968db22d3e9..15149860567 100644 --- a/src/tests/blocking-set.c +++ b/src/tests/blocking-set.c @@ -67,7 +67,7 @@ static void blocking_set(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } toku_free(val.data); diff --git a/src/tests/blocking-table-lock.c b/src/tests/blocking-table-lock.c index ea2bb429656..413672982d6 100644 --- a/src/tests/blocking-table-lock.c +++ b/src/tests/blocking-table-lock.c @@ -18,7 +18,7 @@ static void blocking_table_lock(DB_ENV *db_env, DB *db, uint64_t nrows, long sle r = txn->commit(txn, 0); assert(r == 0); if (verbose) - printf("%lu %"PRIu64"\n", (unsigned long) toku_pthread_self(), i); + printf("%lu %"PRIu64"\n", (unsigned long)(void *) toku_pthread_self(), i); } } diff --git a/src/tests/threaded_stress_test_helpers.h b/src/tests/threaded_stress_test_helpers.h index c3817e6042e..c7984ccb364 100644 --- a/src/tests/threaded_stress_test_helpers.h +++ b/src/tests/threaded_stress_test_helpers.h @@ -203,7 +203,7 @@ static void *worker(void *arg_v) { DB_ENV *env = arg->env; DB_TXN *txn = NULL; if (verbose) { - printf("%lu starting %p\n", (unsigned long) toku_pthread_self(), arg->operation); + printf("%lu starting %p\n", (unsigned long)(void *) toku_pthread_self(), arg->operation); } if (arg->single_txn) { r = env->txn_begin(env, 0, &txn, arg->txn_type); CKERR(r); @@ -237,7 +237,7 @@ static void *worker(void *arg_v) { CHK(txn->commit(txn, 0)); } if (verbose) - printf("%lu returning\n", (unsigned long) toku_pthread_self()); + printf("%lu returning\n", (unsigned long)(void *) toku_pthread_self()); toku_free(random_buf); return arg; }