diff options
author | Michael Widenius <monty@askmonty.org> | 2011-11-30 00:34:05 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-11-30 00:34:05 +0200 |
commit | 47575bd0e05d49955a4d7f46409cc6316fed8d7c (patch) | |
tree | c03da6793450dadab5b254ce0b53eacc29243706 | |
parent | a19f4e3a3af4c18ec89f8f8a4ae32e3c7d7fec70 (diff) | |
download | mariadb-git-47575bd0e05d49955a4d7f46409cc6316fed8d7c.tar.gz |
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
-rw-r--r-- | dbug/tests.c | 2 | ||||
-rw-r--r-- | server-tools/instance-manager/guardian.cc | 2 | ||||
-rw-r--r-- | sql/filesort.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | storage/maria/ma_blockrec.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_recovery.c | 2 | ||||
-rw-r--r-- | storage/pbxt/src/cache_xt.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0fil.c | 2 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | vio/viosocket.c | 12 | ||||
-rw-r--r-- | vio/viosslfactories.c | 6 |
15 files changed, 25 insertions, 20 deletions
diff --git a/dbug/tests.c b/dbug/tests.c index d76266d34a3..e1d416d6c43 100644 --- a/dbug/tests.c +++ b/dbug/tests.c @@ -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)); diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index b49b0ec0a00..1df602534e0 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -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) { diff --git a/sql/filesort.cc b/sql/filesort.cc index e95ff08fcdd..54b41531cdd 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -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); diff --git a/sql/slave.cc b/sql/slave.cc index d779d8cdc9e..1971001d759 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -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); diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 23105d84a9d..42e4489cb07 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -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"); /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7328157182d..465404d32d2 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -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; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index c7c1a131441..71bbb389ca2 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -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; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 9f3c9059397..9ce8e42cae0 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -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; diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index ce7253d4c39..709bcd26e6a 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -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; diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index 73ecb208662..ccd9af612be 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -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) diff --git a/storage/pbxt/src/cache_xt.cc b/storage/pbxt/src/cache_xt.cc index 24e42d9e984..f4a2c4a4fde 100644 --- a/storage/pbxt/src/cache_xt.cc +++ b/storage/pbxt/src/cache_xt.cc @@ -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; diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c index 1ef0a9a46fb..bcf134f4292 100644 --- a/storage/xtradb/fil/fil0fil.c +++ b/storage/xtradb/fil/fil0fil.c @@ -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) { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 744865a31f3..e865172a0f7 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -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 -> " diff --git a/vio/viosocket.c b/vio/viosocket.c index 381d028d6a0..f3799351de9 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -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 diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 3c0c2f3a7ec..31863a0830f 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -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; } |