# At a local mysql-trunk repository of davi
3091 Davi Arnaut 2011-05-16
Fix warnings emitted by Clang.
@ mysys/thr_alarm.c
Remove spurious MYF(0).
@ sql/binlog.h
Access declarations are deprecated; use using declarations instead.
@ sql/handler.cc
Ignore unused result of RUN_HOOK().
@ sql/rpl_injector.cc
transaction does not implement a copy constructor.
@ sql/rpl_injector.h
Remove the unused new_trans method.
@ sql/rpl_master.cc
Ignore unused result of RUN_HOOK().
@ sql/rpl_slave.cc
Ignore unused result of RUN_HOOK().
@ sql/transaction.cc
Ignore unused result of RUN_HOOK().
@ storage/innobase/handler/i_s.cc
Clang does not support this deprecated GCC construct.
@ strings/decimal.c
Move minus operator next to the variable being negated.
The mini_shift variable has no previous assignment at this point.
modified:
mysys/thr_alarm.c
sql/binlog.h
sql/handler.cc
sql/rpl_injector.cc
sql/rpl_injector.h
sql/rpl_master.cc
sql/rpl_slave.cc
sql/transaction.cc
storage/innobase/handler/i_s.cc
strings/decimal.c
=== modified file 'mysys/thr_alarm.c'
--- a/mysys/thr_alarm.c 2011-01-11 09:09:21 +0000
+++ b/mysys/thr_alarm.c 2011-05-16 13:24:37 +0000
@@ -260,7 +260,7 @@ void thr_end_alarm(thr_alarm_t *alarmed)
{
if ((ALARM*) queue_element(&alarm_queue,i) == alarm_data)
{
- queue_remove(&alarm_queue,i),MYF(0);
+ queue_remove(&alarm_queue,i);
if (alarm_data->malloced)
my_free(alarm_data);
found++;
=== modified file 'sql/binlog.h'
--- a/sql/binlog.h 2011-05-12 17:29:19 +0000
+++ b/sql/binlog.h 2011-05-16 13:24:37 +0000
@@ -106,8 +106,8 @@ class MYSQL_BIN_LOG: public TC_LOG, priv
int new_file_impl(bool need_lock);
public:
- MYSQL_LOG::generate_name;
- MYSQL_LOG::is_open;
+ using MYSQL_LOG::generate_name;
+ using MYSQL_LOG::is_open;
/* This is relay log */
bool is_relay_log;
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2011-05-12 17:29:19 +0000
+++ b/sql/handler.cc 2011-05-16 13:24:37 +0000
@@ -235,7 +235,7 @@ handlerton *ha_checktype(THD *thd, enum
return NULL;
}
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
switch (database_type) {
case DB_TYPE_MRG_ISAM:
@@ -1252,7 +1252,7 @@ int ha_commit_trans(THD *thd, bool all)
goto end;
}
DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
- RUN_HOOK(transaction, after_commit, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_commit, (thd, FALSE));
end:
if (rw_trans && mdl_request.ticket)
{
@@ -1421,7 +1421,7 @@ int ha_rollback_trans(THD *thd, bool all
if (is_real_trans && thd->transaction.all.cannot_safely_rollback() &&
!thd->slave_thread && thd->killed != THD::KILL_CONNECTION)
thd->transaction.push_unsafe_rollback_warnings(thd);
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
DBUG_RETURN(error);
}
=== modified file 'sql/rpl_injector.cc'
--- a/sql/rpl_injector.cc 2011-02-01 08:51:58 +0000
+++ b/sql/rpl_injector.cc 2011-05-16 13:24:37 +0000
@@ -229,17 +229,6 @@ void injector::free_instance()
}
}
-
-injector::transaction injector::new_trans(THD *thd)
-{
- DBUG_ENTER("injector::new_trans(THD*)");
- /*
- Currently, there is no alternative to using 'mysql_bin_log' since that
- is hardcoded into the way the handler is using the binary log.
- */
- DBUG_RETURN(transaction(&mysql_bin_log, thd));
-}
-
void injector::new_trans(THD *thd, injector::transaction *ptr)
{
DBUG_ENTER("injector::new_trans(THD *, transaction *)");
=== modified file 'sql/rpl_injector.h'
--- a/sql/rpl_injector.h 2011-02-01 08:51:58 +0000
+++ b/sql/rpl_injector.h 2011-05-16 13:24:37 +0000
@@ -344,13 +344,10 @@ public:
two calls are equivalent, with the exception that the latter will
overwrite the transaction.
- injector::transaction trans1= inj->new_trans(thd);
-
injector::transaction trans2;
inj->new_trans(thd, &trans);
*/
- transaction new_trans(THD *);
- void new_trans(THD *, transaction *);
+ void new_trans(THD *, transaction *);
int record_incident(THD*, Incident incident);
int record_incident(THD*, Incident incident, LEX_STRING const message);
=== modified file 'sql/rpl_master.cc'
--- a/sql/rpl_master.cc 2011-04-19 03:29:06 +0000
+++ b/sql/rpl_master.cc 2011-05-16 13:24:37 +0000
@@ -1252,7 +1252,7 @@ end:
end_io_cache(&log);
mysql_file_close(file, MYF(MY_WME));
- RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
+ (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
my_eof(thd);
THD_STAGE_INFO(thd, stage_waiting_to_finalize_termination);
mysql_mutex_lock(&LOCK_thread_count);
@@ -1264,7 +1264,7 @@ end:
err:
THD_STAGE_INFO(thd, stage_waiting_to_finalize_termination);
end_io_cache(&log);
- RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
+ (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
/*
Exclude iteration through thread list
this is needed for purge_logs() - it will iterate through
@@ -1387,7 +1387,7 @@ int reset_master(THD* thd)
if (mysql_bin_log.reset_logs(thd))
return 1;
- RUN_HOOK(binlog_transmit, after_reset_master, (thd, 0 /* flags */));
+ (void) RUN_HOOK(binlog_transmit, after_reset_master, (thd, 0 /* flags */));
return 0;
}
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2011-05-16 11:10:48 +0000
+++ b/sql/rpl_slave.cc 2011-05-16 13:24:37 +0000
@@ -3391,7 +3391,7 @@ err:
// print the current replication position
sql_print_information("Slave I/O thread exiting, read up to log '%s', position %s",
mi->get_io_rpl_log_name(), llstr(mi->get_master_log_pos(), llbuff));
- RUN_HOOK(binlog_relay_io, thread_stop, (thd, mi));
+ (void) RUN_HOOK(binlog_relay_io, thread_stop, (thd, mi));
thd->reset_query();
thd->reset_db(NULL, 0);
if (mysql)
@@ -5724,7 +5724,7 @@ int reset_slave(THD *thd, Master_info* m
goto err;
}
- RUN_HOOK(binlog_relay_io, after_reset_slave, (thd, mi));
+ (void) RUN_HOOK(binlog_relay_io, after_reset_slave, (thd, mi));
err:
unlock_slave_threads(mi);
if (error)
=== modified file 'sql/transaction.cc'
--- a/sql/transaction.cc 2011-05-12 17:29:19 +0000
+++ b/sql/transaction.cc 2011-05-16 13:24:37 +0000
@@ -175,14 +175,14 @@ bool trans_commit(THD *thd)
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
res= ha_commit_trans(thd, TRUE);
+ /*
+ if res is non-zero, then ha_commit_trans has rolled back the
+ transaction, so the hooks for rollback will be called.
+ */
if (res)
- /*
- if res is non-zero, then ha_commit_trans has rolled back the
- transaction, so the hooks for rollback will be called.
- */
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
else
- RUN_HOOK(transaction, after_commit, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_commit, (thd, FALSE));
thd->variables.option_bits&= ~OPTION_BEGIN;
thd->transaction.all.reset_unsafe_rollback_flags();
thd->lex->start_transaction_opt= 0;
@@ -254,7 +254,7 @@ bool trans_rollback(THD *thd)
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
res= ha_rollback_trans(thd, TRUE);
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
thd->variables.option_bits&= ~OPTION_BEGIN;
thd->transaction.all.reset_unsafe_rollback_flags();
thd->lex->start_transaction_opt= 0;
@@ -299,14 +299,14 @@ bool trans_commit_stmt(THD *thd)
thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation;
}
+ /*
+ if res is non-zero, then ha_commit_trans has rolled back the
+ transaction, so the hooks for rollback will be called.
+ */
if (res)
- /*
- if res is non-zero, then ha_commit_trans has rolled back the
- transaction, so the hooks for rollback will be called.
- */
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
else
- RUN_HOOK(transaction, after_commit, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_commit, (thd, FALSE));
thd->transaction.stmt.reset();
@@ -345,7 +345,7 @@ bool trans_rollback_stmt(THD *thd)
thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation;
}
- RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ (void) RUN_HOOK(transaction, after_rollback, (thd, FALSE));
thd->transaction.stmt.reset();
=== modified file 'storage/innobase/handler/i_s.cc'
--- a/storage/innobase/handler/i_s.cc 2011-04-27 21:49:19 +0000
+++ b/storage/innobase/handler/i_s.cc 2011-05-16 13:24:37 +0000
@@ -151,7 +151,8 @@ do { \
} \
} while (0)
-#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && !defined __INTEL_COMPILER
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && \
+ !defined __INTEL_COMPILER && !defined __clang__
#define STRUCT_FLD(name, value) name: value
#else
#define STRUCT_FLD(name, value) value
=== modified file 'strings/decimal.c'
--- a/strings/decimal.c 2011-05-12 12:50:11 +0000
+++ b/strings/decimal.c 2011-05-16 13:24:37 +0000
@@ -678,7 +678,7 @@ int decimal_shift(decimal_t *dec, int sh
if (do_left)
{
do_mini_left_shift(dec, l_mini_shift, beg, end);
- mini_shift=- l_mini_shift;
+ mini_shift= -l_mini_shift;
}
else
{
Attachment: [text/bzr-bundle] bzr/davi.arnaut@oracle.com-20110516132437-ta86b4id8jh2xapi.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (davi:3091) | Davi Arnaut | 16 May |