summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2014-06-04 13:23:00 +0300
committerMichael Widenius <monty@askmonty.org>2014-06-04 13:23:00 +0300
commit414e8388bf8925ba128e10adc0086589f9f36016 (patch)
treecafea70e278afd8dad82a32f218da712748cebd7
parent113333d44725fe35a5eb52c7df58140e1cce45f8 (diff)
downloadmariadb-git-414e8388bf8925ba128e10adc0086589f9f36016.tar.gz
Fixed compiler warnings
mysys/psi_noop.c: Fixed wrong prototype sql/rpl_gtid.cc: Added #ifndef to hide not used variable storage/connect/connect.cc: Added volatile to avoid compiler warning in gcc 4.8.1 storage/connect/filamvct.cpp: Added volatile to avoid compiler warning in gcc 4.8.1 storage/maria/ma_checkpoint.c: Removed cast to avoid compiler warning storage/myisam/mi_delete_table.c: Added attribute to avoid compiler warning storage/tokudb/ha_tokudb.cc: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/hatoku_hton.cc: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/tokudb_card.h: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/tokudb_status.h: Use LINT_INIT_STRUCT to avoid compiler warnings
-rw-r--r--mysys/psi_noop.c2
-rw-r--r--sql/rpl_gtid.cc2
-rw-r--r--storage/connect/connect.cc2
-rwxr-xr-xstorage/connect/filamvct.cpp2
-rw-r--r--storage/maria/ma_checkpoint.c4
-rw-r--r--storage/myisam/mi_delete_table.c3
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/hatoku_hton.cc7
-rw-r--r--storage/tokudb/tokudb_card.h4
-rw-r--r--storage/tokudb/tokudb_status.h14
10 files changed, 24 insertions, 20 deletions
diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c
index 8c9f2773170..2a351b5dd8d 100644
--- a/mysys/psi_noop.c
+++ b/mysys/psi_noop.c
@@ -236,7 +236,7 @@ static void set_thread_state_noop(const char* state NNN)
return;
}
-static void set_thread_info_noop(const char* info NNN, int info_len NNN)
+static void set_thread_info_noop(const char* info NNN, uint info_len NNN)
{
return;
}
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 17c3b15c902..105bdad6f97 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -326,7 +326,9 @@ rpl_slave_state::update(uint32 domain_id, uint32 server_id, uint64 sub_id,
{
if (rgi->gtid_ignore_duplicate_state==rpl_group_info::GTID_DUPLICATE_OWNER)
{
+#ifndef DBUG_OFF
Relay_log_info *rli= rgi->rli;
+#endif
uint32 count= elem->owner_count;
DBUG_ASSERT(count > 0);
DBUG_ASSERT(elem->owner_rli == rli);
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 32997f53068..2d8aeb8b5f4 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -191,7 +191,7 @@ PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h)
PTDB tdbp;
PTABLE tabp;
PDBUSER dup= PlgGetUser(g);
- PCATLG cat= (dup) ? dup->Catalog : NULL; // Safe over longjmp
+ volatile PCATLG cat= (dup) ? dup->Catalog : NULL; // Safe over longjmp
if (trace)
printf("CntGetTDB: name=%s mode=%d cat=%p\n", name, mode, cat);
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 1957c7f29ac..edadc25b50b 100755
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -1459,7 +1459,7 @@ bool VCMFAM::AllocateBuffer(PGLOBAL g)
bool VCMFAM::InitInsert(PGLOBAL g)
{
int rc;
- PVCTCOL cp = (PVCTCOL)Tdbp->GetColumns();
+ volatile PVCTCOL cp = (PVCTCOL)Tdbp->GetColumns();
// We come here in MODE_INSERT only
if (Last == Nrec) {
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index 98d18b2f420..e4adf5fbccd 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -230,8 +230,8 @@ static int really_execute_checkpoint(void)
sizeof(checkpoint_start_log_horizon_char);
for (i= 0; i < (sizeof(record_pieces)/sizeof(record_pieces[0])); i++)
{
- log_array[TRANSLOG_INTERNAL_PARTS + 1 + i]=
- *(LEX_CUSTRING *)&record_pieces[i];
+ log_array[TRANSLOG_INTERNAL_PARTS + 1 + i].str= record_pieces[i].str;
+ log_array[TRANSLOG_INTERNAL_PARTS + 1 + i].length= record_pieces[i].length;
total_rec_length+= (translog_size_t) record_pieces[i].length;
}
if (unlikely(translog_write_record(&lsn, LOGREC_CHECKPOINT,
diff --git a/storage/myisam/mi_delete_table.c b/storage/myisam/mi_delete_table.c
index 7be9c8f7b22..7da960011ca 100644
--- a/storage/myisam/mi_delete_table.c
+++ b/storage/myisam/mi_delete_table.c
@@ -27,7 +27,8 @@
#endif
static int delete_one_file(const char *name, const char *ext,
- PSI_file_key pskey, myf flags)
+ PSI_file_key pskey __attribute__((unused)),
+ myf flags)
{
char from[FN_REFLEN];
DBUG_ENTER("delete_one_file");
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 27610747a33..8de77867c51 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -2110,8 +2110,8 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) {
TOKUDB_HANDLER_DBUG_ENTER("%s", frm_name);
uchar* mysql_frm_data = NULL;
size_t mysql_frm_len = 0;
- DBT key = {};
- DBT stored_frm = {};
+ DBT key; LINT_INIT_STRUCT(key);
+ DBT stored_frm; LINT_INIT_STRUCT(stored_frm);
int error = 0;
HA_METADATA_KEY curr_key = hatoku_frm_data;
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index 2291f2345bb..7e22f2d72ed 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -972,8 +972,8 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch
DB* status_db = NULL;
DB_TXN* txn = NULL;
HA_METADATA_KEY curr_key = hatoku_frm_data;
- DBT key = {};
- DBT value = {};
+ DBT key; LINT_INIT_STRUCT(key);
+ DBT value; LINT_INIT_STRUCT(value);
bool do_commit;
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
@@ -1713,7 +1713,8 @@ static int tokudb_report_fractal_tree_block_map_iterator(uint64_t checkpoint_cou
static int tokudb_report_fractal_tree_block_map_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) {
int error;
DB *db;
- struct tokudb_report_fractal_tree_block_map_iterator_extra e = {}; // avoid struct initializers so that we can compile with older gcc versions
+ struct tokudb_report_fractal_tree_block_map_iterator_extra e; // avoid struct initializers so that we can compile with older gcc versions
+ LINT_INIT_STRUCT(e);
error = db_create(&db, db_env, 0);
if (error) {
diff --git a/storage/tokudb/tokudb_card.h b/storage/tokudb/tokudb_card.h
index 4c9d7b3d353..9535b5ed49b 100644
--- a/storage/tokudb/tokudb_card.h
+++ b/storage/tokudb/tokudb_card.h
@@ -233,8 +233,8 @@ namespace tokudb {
for (uint64_t i = 0; i < num_key_parts; i++)
unique_rows[i] = 1;
// stop looking when the entire dictionary was analyzed, or a cap on execution time was reached, or the analyze was killed.
- DBT key = {}; key.flags = DB_DBT_REALLOC;
- DBT prev_key = {}; prev_key.flags = DB_DBT_REALLOC;
+ DBT key; LINT_INIT_STRUCT(key); key.flags = DB_DBT_REALLOC;
+ DBT prev_key; LINT_INIT_STRUCT(prev_key); prev_key.flags = DB_DBT_REALLOC;
while (1) {
error = cursor->c_get(cursor, &key, 0, DB_NEXT);
if (error != 0) {
diff --git a/storage/tokudb/tokudb_status.h b/storage/tokudb/tokudb_status.h
index e352092d56b..5bedcc4fda5 100644
--- a/storage/tokudb/tokudb_status.h
+++ b/storage/tokudb/tokudb_status.h
@@ -112,8 +112,8 @@ namespace tokudb {
// get the value for a given key in the status dictionary. copy the value to the supplied buffer.
// returns 0 if successful.
int get_status(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void *p, size_t s, size_t *sp) {
- DBT key = {}; key.data = &k; key.size = sizeof k;
- DBT val = {}; val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
+ DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
+ DBT val; LINT_INIT_STRUCT(val); val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
int error = status_db->get(status_db, txn, &key, &val, 0);
if (error == 0) {
*sp = val.size;
@@ -124,8 +124,8 @@ namespace tokudb {
// get the value for a given key in the status dictionary. put the value in a realloced buffer.
// returns 0 if successful.
int get_status_realloc(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void **pp, size_t *sp) {
- DBT key = {}; key.data = &k; key.size = sizeof k;
- DBT val = {}; val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
+ DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
+ DBT val; LINT_INIT_STRUCT(val); val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
int error = status_db->get(status_db, txn, &key, &val, 0);
if (error == 0) {
*pp = val.data;
@@ -138,8 +138,8 @@ namespace tokudb {
// auto create a txn if necessary.
// returns 0 if successful.
int write_metadata(DB *status_db, void *key_data, uint key_size, void* val_data, uint val_size, DB_TXN *txn) {
- DBT key = {}; key.data = key_data; key.size = key_size;
- DBT value = {}; value.data = val_data; value.size = val_size;
+ DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
+ DBT value; LINT_INIT_STRUCT(value); value.data = val_data; value.size = val_size;
int error = status_db->put(status_db, txn, &key, &value, 0);
return error;
}
@@ -155,7 +155,7 @@ namespace tokudb {
// auto create a txn if necessary.
// returns 0 if successful.
int remove_metadata(DB *status_db, void *key_data, uint key_size, DB_TXN *txn) {
- DBT key = {}; key.data = key_data; key.size = key_size;
+ DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY);
return error;
}