Fixed compiler warnings

dbug/tests.c:
  Added __attribute__((unused)) to get rid of compiler warning
server-tools/instance-manager/guardian.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/filesort.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/slave.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_load.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_table.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_blockrec.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_check.c:
  Added missing cast
storage/maria/ma_loghandler.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_recovery.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/pbxt/src/cache_xt.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Removed not used variable
storage/xtradb/handler/ha_innodb.cc:
  Use unused variable
vio/viosocket.c:
  Remove usage of not used variable
vio/viosslfactories.c:
  Added cast
This commit is contained in:
Michael Widenius 2011-11-30 00:34:05 +02:00
parent a19f4e3a3a
commit 47575bd0e0
15 changed files with 25 additions and 20 deletions

View File

@ -16,7 +16,7 @@ const char *func3()
void func2()
{
const char *s;
const char *s __attribute__((unused));
DBUG_ENTER("func2");
s=func3();
DBUG_PRINT("info", ("s=%s", s));

View File

@ -440,7 +440,7 @@ void Guardian::stop_instances()
/* Request mysqld to stop. */
bool instance_stopped= FALSE;
bool instance_stopped __attribute__((unused))= FALSE;
for (int cur_attempt= 0; cur_attempt < NUM_STOP_ATTEMPTS; ++cur_attempt)
{

View File

@ -827,7 +827,7 @@ static void make_sortkey(register SORTPARAM *param,
if (sort_field->need_strxnfrm)
{
char *from=(char*) res->ptr();
uint tmp_length;
uint tmp_length __attribute__((unused));
if ((uchar*) from == to)
{
set_if_smaller(length,sort_field->length);

View File

@ -513,7 +513,7 @@ terminate_slave_thread(THD *thd,
while (*slave_running) // Should always be true
{
int error;
int error __attribute__((unused));
DBUG_PRINT("loop", ("killing slave thread"));
pthread_mutex_lock(&thd->LOCK_thd_data);

View File

@ -140,7 +140,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
*/
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
bool transactional_table;
bool transactional_table __attribute__((unused));
DBUG_ENTER("mysql_load");
/*

View File

@ -6619,7 +6619,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint fast_alter_partition= 0;
bool partition_changed= FALSE;
#endif
bool need_lock_for_indexes= TRUE;
bool need_lock_for_indexes __attribute__((unused)) = TRUE;
KEY *key_info_buffer;
uint index_drop_count= 0;
uint *index_drop_buffer= NULL;

View File

@ -3676,7 +3676,7 @@ static my_bool _ma_update_block_record2(MARIA_HA *info,
MARIA_PINNED_PAGE page_link;
uint rownr, org_empty_size, head_length;
uint block_size= info->s->block_size;
uint errpos= 0;
uint errpos __attribute__((unused)) = 0;
uchar *dir;
pgcache_page_no_t page;
struct st_row_pos_info row_pos;

View File

@ -3884,7 +3884,8 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
_ma_check_print_error(param,
"Rows lost (Found %lu of %lu); Aborting "
"because safe repair was requested",
sort_info.new_info->s->state.state.records,
(ulong) sort_info.new_info->s->
state.state.records,
(ulong) start_records);
share->state.state.records=start_records;
goto err;

View File

@ -3201,7 +3201,7 @@ static uint16 translog_get_chunk_header_length(uchar *chunk)
case TRANSLOG_CHUNK_LSN:
{
/* 0 chunk referred as LSN (head or tail) */
translog_size_t rec_len;
translog_size_t rec_len __attribute__((unused));
uchar *start= chunk;
uchar *ptr= start + 1 + 2;
uint16 chunk_len, header_len;

View File

@ -2884,7 +2884,7 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
static int run_undo_phase(uint uncommitted)
{
LSN last_undo;
LSN last_undo __attribute__((unused));
DBUG_ENTER("run_undo_phase");
if (uncommitted > 0)

View File

@ -789,7 +789,7 @@ xtPublic void xt_ind_check_cache(XTIndexPtr ind)
ASSERT_NS(ind_cac_globals.cg_free_count == free_count);
/* Check the LRU list: */
XTIndBlockPtr list_block, plist_block;
XTIndBlockPtr list_block, plist_block __attribute__((unused));
plist_block = NULL;
list_block = ind_cac_globals.cg_lru_block;

View File

@ -3678,7 +3678,6 @@ func_exit:
ulint page_no;
ulint zip_size;
ulint height;
ulint root_height = 0;
rec_t* node_ptr;
dict_table_t* table;
dict_index_t* index;
@ -3717,7 +3716,6 @@ func_exit:
if (height == ULINT_UNDEFINED) {
height = btr_page_get_level(page, &mtr);
root_height = height;
}
if (height == 0) {

View File

@ -10801,7 +10801,7 @@ ha_innobase::check_if_incompatible_data(
if (info_row_type == ROW_TYPE_DEFAULT)
info_row_type = ROW_TYPE_COMPACT;
if ((info->used_fields & HA_CREATE_USED_ROW_FORMAT) &&
get_row_type() != ((info->row_type == ROW_TYPE_DEFAULT)
row_type != ((info->row_type == ROW_TYPE_DEFAULT)
? ROW_TYPE_COMPACT : info->row_type)) {
DBUG_PRINT("info", ("get_row_type()=%d != info->row_type=%d -> "

View File

@ -391,7 +391,9 @@ my_bool vio_poll_read(Vio *vio,uint timeout)
void vio_timeout(Vio *vio, uint which, uint timeout)
{
#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
#ifndef DBUG_OFF
int r;
#endif
DBUG_ENTER("vio_timeout");
{
@ -405,10 +407,12 @@ void vio_timeout(Vio *vio, uint which, uint timeout)
wait_timeout.tv_usec= 0;
#endif
r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
IF_WIN(const char*, const void*)&wait_timeout,
sizeof(wait_timeout));
#ifndef DBUG_OFF
r=
#endif
setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
IF_WIN(const char*, const void*)&wait_timeout,
sizeof(wait_timeout));
}
#ifndef DBUG_OFF

View File

@ -300,7 +300,8 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
verify= SSL_VERIFY_NONE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
ca_path, cipher, TLSv1_client_method(), &dummy)))
ca_path, cipher,
(SSL_METHOD*) TLSv1_client_method(), &dummy)))
{
return 0;
}
@ -322,7 +323,8 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
struct st_VioSSLFd *ssl_fd;
int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
ca_path, cipher, TLSv1_server_method(), error)))
ca_path, cipher,
(SSL_METHOD*) TLSv1_server_method(), error)))
{
return 0;
}