summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2016-06-14 12:28:05 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2016-06-14 19:17:29 +0300
commit34a104ba0ccbe254100a235c04e4648136c9aa7e (patch)
tree4a139924427d1afbe848ffdd944c9aa75053c23f /storage
parent1bf25092cbf700049b16f556980c84a9674a811f (diff)
downloadmariadb-git-34a104ba0ccbe254100a235c04e4648136c9aa7e.tar.gz
MDEV-10229: TokuDB fails to build with CLang
Structure initialization must feature all members present within the struct.
Diffstat (limited to 'storage')
-rw-r--r--storage/tokudb/ft-index/ft/logger/recover.cc6
-rw-r--r--storage/tokudb/ft-index/ft/serialize/ft_node-serialize.cc2
-rw-r--r--storage/tokudb/ft-index/ft/txn/txn.cc8
-rw-r--r--storage/tokudb/ft-index/portability/toku_pthread.h19
-rw-r--r--storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h2
5 files changed, 9 insertions, 28 deletions
diff --git a/storage/tokudb/ft-index/ft/logger/recover.cc b/storage/tokudb/ft-index/ft/logger/recover.cc
index 680485201da..7a5fa361e2d 100644
--- a/storage/tokudb/ft-index/ft/logger/recover.cc
+++ b/storage/tokudb/ft-index/ft/logger/recover.cc
@@ -785,7 +785,7 @@ static int toku_recover_xcommit (struct logtype_xcommit *l, RECOVER_ENV renv) {
assert(txn!=NULL);
// commit the transaction
- toku_txn_progress_extra extra = { time(NULL), l->lsn, "commit", l->xid };
+ toku_txn_progress_extra extra = { time(NULL), l->lsn, "commit", l->xid, 0 };
int r = toku_txn_commit_with_lsn(txn, true, l->lsn, toku_recover_txn_progress, &extra);
assert(r == 0);
@@ -828,7 +828,7 @@ static int toku_recover_xabort (struct logtype_xabort *l, RECOVER_ENV renv) {
assert(txn!=NULL);
// abort the transaction
- toku_txn_progress_extra extra = { time(NULL), l->lsn, "abort", l->xid };
+ toku_txn_progress_extra extra = { time(NULL), l->lsn, "abort", l->xid, 0 };
r = toku_txn_abort_with_lsn(txn, l->lsn, toku_recover_txn_progress, &extra);
assert(r == 0);
@@ -1363,7 +1363,7 @@ static void recover_abort_live_txn(TOKUTXN txn) {
// sanity check that the recursive call successfully NULLs out txn->child
invariant(txn->child == NULL);
// abort the transaction
- toku_txn_progress_extra extra = { time(NULL), ZERO_LSN, "abort live", txn->txnid };
+ toku_txn_progress_extra extra = { time(NULL), ZERO_LSN, "abort live", txn->txnid, 0 };
int r = toku_txn_abort_txn(txn, toku_recover_txn_progress, &extra);
assert(r == 0);
diff --git a/storage/tokudb/ft-index/ft/serialize/ft_node-serialize.cc b/storage/tokudb/ft-index/ft/serialize/ft_node-serialize.cc
index 6fd452aba54..84f3f98cfb5 100644
--- a/storage/tokudb/ft-index/ft/serialize/ft_node-serialize.cc
+++ b/storage/tokudb/ft-index/ft/serialize/ft_node-serialize.cc
@@ -643,7 +643,7 @@ serialize_and_compress_in_parallel(FTNODE node,
struct serialize_compress_work work[npartitions];
workset_lock(&ws);
for (int i = 0; i < npartitions; i++) {
- work[i] = (struct serialize_compress_work) { .base = {{NULL}},
+ work[i] = (struct serialize_compress_work) { .base = {{NULL, NULL}},
.node = node,
.i = i,
.compression_method = compression_method,
diff --git a/storage/tokudb/ft-index/ft/txn/txn.cc b/storage/tokudb/ft-index/ft/txn/txn.cc
index 922c955a6b5..9aa93375126 100644
--- a/storage/tokudb/ft-index/ft/txn/txn.cc
+++ b/storage/tokudb/ft-index/ft/txn/txn.cc
@@ -333,14 +333,14 @@ static txn_child_manager tcm;
.do_fsync = false,
.force_fsync_on_commit = false,
.do_fsync_lsn = ZERO_LSN,
- .xa_xid = {0},
+ .xa_xid = {0, 0, 0, {}},
.progress_poll_fun = NULL,
.progress_poll_fun_extra = NULL,
- .txn_lock = ZERO_MUTEX_INITIALIZER,
+ .txn_lock = TOKU_MUTEX_INITIALIZER,
.open_fts = open_fts,
.roll_info = roll_info,
- .state_lock = ZERO_MUTEX_INITIALIZER,
- .state_cond = ZERO_COND_INITIALIZER,
+ .state_lock = TOKU_MUTEX_INITIALIZER,
+ .state_cond = TOKU_COND_INITIALIZER,
.state = TOKUTXN_LIVE,
.num_pin = 0,
.client_id = 0,
diff --git a/storage/tokudb/ft-index/portability/toku_pthread.h b/storage/tokudb/ft-index/portability/toku_pthread.h
index a9dc660b6a7..4a564e4029b 100644
--- a/storage/tokudb/ft-index/portability/toku_pthread.h
+++ b/storage/tokudb/ft-index/portability/toku_pthread.h
@@ -125,16 +125,6 @@ typedef struct toku_mutex_aligned {
toku_mutex_t aligned_mutex __attribute__((__aligned__(64)));
} toku_mutex_aligned_t;
-// Different OSes implement mutexes as different amounts of nested structs.
-// C++ will fill out all missing values with zeroes if you provide at least one zero, but it needs the right amount of nesting.
-#if defined(__FreeBSD__)
-# define ZERO_MUTEX_INITIALIZER {0}
-#elif defined(__APPLE__)
-# define ZERO_MUTEX_INITIALIZER {{0}}
-#else // __linux__, at least
-# define ZERO_MUTEX_INITIALIZER {{{0}}}
-#endif
-
#if TOKU_PTHREAD_DEBUG
# define TOKU_MUTEX_INITIALIZER { .pmutex = PTHREAD_MUTEX_INITIALIZER, .owner = 0, .locked = false, .valid = true }
#else
@@ -276,15 +266,6 @@ typedef struct toku_cond {
pthread_cond_t pcond;
} toku_cond_t;
-// Different OSes implement mutexes as different amounts of nested structs.
-// C++ will fill out all missing values with zeroes if you provide at least one zero, but it needs the right amount of nesting.
-#if defined(__FreeBSD__)
-# define ZERO_COND_INITIALIZER {0}
-#elif defined(__APPLE__)
-# define ZERO_COND_INITIALIZER {{0}}
-#else // __linux__, at least
-# define ZERO_COND_INITIALIZER {{{0}}}
-#endif
#define TOKU_COND_INITIALIZER {PTHREAD_COND_INITIALIZER}
static inline void
diff --git a/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h b/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h
index f9da1693847..fc4acecff10 100644
--- a/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h
+++ b/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h
@@ -1825,7 +1825,7 @@ static int run_workers(
{
int r;
const struct perf_formatter *perf_formatter = &perf_formatters[cli_args->perf_output_format];
- toku_mutex_t mutex = ZERO_MUTEX_INITIALIZER;
+ toku_mutex_t mutex = TOKU_MUTEX_INITIALIZER;
toku_mutex_init(&mutex, nullptr);
struct rwlock rwlock;
rwlock_init(&rwlock);