summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-28 20:04:14 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-28 20:04:14 +0100
commit2901497b187ffcefbec73c4ac9b5270174e8682c (patch)
tree7546fe994305164a171948be01d7a261427b47d6
parent78683672707bad90169b68b4c5d8aadc0e895f3d (diff)
downloadmariadb-git-2901497b187ffcefbec73c4ac9b5270174e8682c.tar.gz
MDEV-4243 Warnings/errors while compiling with clang
-rw-r--r--libmysqld/lib_sql.cc2
-rw-r--r--mysys/default.c2
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/opt_sum.cc2
-rw-r--r--storage/csv/ha_tina.cc6
-rw-r--r--storage/federatedx/ha_federatedx.cc2
-rw-r--r--storage/innobase/sync/sync0sync.c4
-rw-r--r--storage/maria/ma_bitmap.c11
-rw-r--r--storage/maria/ma_blockrec.c2
-rw-r--r--storage/maria/ma_test3.c2
-rw-r--r--storage/xtradb/sync/sync0sync.c4
-rw-r--r--strings/decimal.c2
13 files changed, 19 insertions, 24 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b454fc0d2e0..298907b2644 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -440,7 +440,7 @@ static MYSQL_RES * emb_store_result(MYSQL *mysql)
int emb_read_change_user_result(MYSQL *mysql)
{
mysql->net.read_pos= (uchar*)""; // fake an OK packet
- return mysql_errno(mysql) ? packet_error : 1 /* length of the OK packet */;
+ return mysql_errno(mysql) ? (int)packet_error : 1 /* length of the OK packet */;
}
MYSQL_METHODS embedded_methods=
diff --git a/mysys/default.c b/mysys/default.c
index c7ac0d89462..db1aa111cdf 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -814,7 +814,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
continue;
/* Configuration File Directives */
- if ((*ptr == '!'))
+ if (*ptr == '!')
{
if (recursion_level >= max_recursion_level)
{
diff --git a/sql/log.cc b/sql/log.cc
index 6c04055cfc1..112a02bd29e 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2253,7 +2253,7 @@ static int find_uniq_filename(char *name)
my_dirend(dir_info);
/* check if reached the maximum possible extension number */
- if ((max_found == MAX_LOG_UNIQUE_FN_EXT))
+ if (max_found == MAX_LOG_UNIQUE_FN_EXT)
{
sql_print_error("Log filename extension number exhausted: %06lu. \
Please fix this by archiving old logs and \
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 331b86ca29f..72e8b21066e 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1369,7 +1369,7 @@ failed my_b_read"));
Log_event *res= 0;
#ifndef max_allowed_packet
THD *thd=current_thd;
- uint max_allowed_packet= thd ? slave_max_allowed_packet:~(ulong)0;
+ uint max_allowed_packet= thd ? slave_max_allowed_packet:~(uint)0;
#endif
if (data_len > max_allowed_packet)
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index fa3a07b72c5..069fe6452e8 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -84,7 +84,7 @@ static ulonglong get_exact_record_count(List<TABLE_LIST> &tables)
while ((tl= ti++))
{
ha_rows tmp= tl->table->file->records();
- if ((tmp == HA_POS_ERROR))
+ if (tmp == HA_POS_ERROR)
return ULONGLONG_MAX;
count*= tmp;
}
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index d31e5ee8d89..54a85ec3a44 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1436,9 +1436,9 @@ int ha_tina::rnd_end()
DBUG_RETURN(-1);
/* Open the file again */
- if (((data_file= mysql_file_open(csv_key_file_data,
- share->data_file_name,
- O_RDONLY, MYF(MY_WME))) == -1))
+ if ((data_file= mysql_file_open(csv_key_file_data,
+ share->data_file_name,
+ O_RDONLY, MYF(MY_WME))) == -1)
DBUG_RETURN(my_errno ? my_errno : -1);
/*
As we reopened the data file, increase share->data_file_version
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index a10285a81aa..f6d9b3a4014 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -764,7 +764,7 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share, TABLE *table,
user:@hostname:port/db/table
Then password is a null string, so set to NULL
*/
- if ((share->password[0] == '\0'))
+ if (share->password[0] == '\0')
share->password= NULL;
}
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index fb7101fdb8d..fba43ad859c 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -316,9 +316,9 @@ mutex_create_func(
/* NOTE! The very first mutexes are not put to the mutex list */
- if ((mutex == &mutex_list_mutex)
+ if (mutex == &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
- || (mutex == &sync_thread_mutex)
+ || mutex == &sync_thread_mutex
#endif /* UNIV_SYNC_DEBUG */
) {
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index f5d32d6a191..407b4ed2b92 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -135,8 +135,7 @@ const char *bits_to_txt[]=
"tail 00-40 % full", "tail 40-80 % full", "tail/blob full"
};
-/*#define WRONG_BITMAP_FLUSH 1*/ /*define only for provoking bugs*/
-#undef WRONG_BITMAP_FLUSH
+#define WRONG_BITMAP_FLUSH 0 /*define to 1 only for provoking bugs*/
static my_bool _ma_read_bitmap_page(MARIA_HA *info,
MARIA_FILE_BITMAP *bitmap,
@@ -164,11 +163,7 @@ static inline my_bool write_changed_bitmap(MARIA_SHARE *share,
*/
bitmap->changed_not_flushed= 1;
- if ((bitmap->non_flushable == 0)
-#ifdef WRONG_BITMAP_FLUSH
- || 1
-#endif
- )
+ if ((bitmap->non_flushable == 0) || WRONG_BITMAP_FLUSH)
{
res= pagecache_write(share->pagecache,
&bitmap->file, bitmap->page, 0,
@@ -495,7 +490,7 @@ my_bool _ma_bitmap_flush_all(MARIA_SHARE *share)
{
bitmap->flush_all_requested++;
bitmap->waiting_for_non_flushable++;
-#ifndef WRONG_BITMAP_FLUSH
+#if !WRONG_BITMAP_FLUSH
while (bitmap->non_flushable > 0)
{
DBUG_PRINT("info", ("waiting for bitmap to be flushable"));
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 71faa11fd2b..622d2581cc9 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -7123,7 +7123,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn,
memcpy(field_pos, field_length_data, size_length);
field_length_data+= size_length;
- memcpy(field_pos + size_length, &header, sizeof(&header));
+ memcpy(field_pos + size_length, &header, sizeof(header));
header+= blob_length;
*blob_lengths++= blob_length;
break;
diff --git a/storage/maria/ma_test3.c b/storage/maria/ma_test3.c
index c11de6f8242..64b22e45c1b 100644
--- a/storage/maria/ma_test3.c
+++ b/storage/maria/ma_test3.c
@@ -114,7 +114,7 @@ int main(int argc,char **argv)
sleep(1);
return 0;
}
- rnd(1);
+ (void)rnd(1);
}
for (i=0 ; i < forks ; i++)
diff --git a/storage/xtradb/sync/sync0sync.c b/storage/xtradb/sync/sync0sync.c
index efc43c4cbe5..25f96d9817a 100644
--- a/storage/xtradb/sync/sync0sync.c
+++ b/storage/xtradb/sync/sync0sync.c
@@ -315,9 +315,9 @@ mutex_create_func(
/* NOTE! The very first mutexes are not put to the mutex list */
- if ((mutex == &mutex_list_mutex)
+ if (mutex == &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
- || (mutex == &sync_thread_mutex)
+ || mutex == &sync_thread_mutex
#endif /* UNIV_SYNC_DEBUG */
) {
diff --git a/strings/decimal.c b/strings/decimal.c
index 3245f224b44..ecb7d9b55f1 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -669,7 +669,7 @@ int decimal_shift(decimal_t *dec, int shift)
if (do_left)
{
do_mini_left_shift(dec, l_mini_shift, beg, end);
- mini_shift=- l_mini_shift;
+ mini_shift= -l_mini_shift;
}
else
{