From 236478cef7f826a2cc019febedc6854861243169 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 11 Aug 2010 13:55:54 +0300 Subject: [PATCH] Fixed compiler warnings from Windows compiler client/mysqlcheck.c: Added missing casts client/mysqldump.c: Added missing casts client/mysqlimport.c: Added missing casts extra/my_print_defaults.c: Added missing casts mysql-test/mysql-test-run.pl: Added suppression for non-critical warning on windows storage/maria/maria_pack.c: Added missing casts storage/xtradb/buf/buf0lru.c: Added missing casts storage/xtradb/fil/fil0fil.c: Added missing casts storage/xtradb/handler/i_s.cc: Added extra argument to call store() function for longlong. storage/xtradb/srv/srv0srv.c: Added cast to suppress compiler warning support-files/compiler_warnings.supp: Added suppression for some non critical compiler warnings on Windows unittest/mytap/tap.h: Fixed prototypes to be same as the actual functions --- client/mysqlcheck.c | 4 ++-- client/mysqldump.c | 8 ++++---- client/mysqlimport.c | 4 ++-- extra/my_print_defaults.c | 4 ++-- mysql-test/mysql-test-run.pl | 1 + storage/maria/maria_pack.c | 4 ++-- storage/xtradb/buf/buf0lru.c | 8 ++++---- storage/xtradb/fil/fil0fil.c | 4 ++-- storage/xtradb/handler/i_s.cc | 2 +- storage/xtradb/srv/srv0srv.c | 2 +- support-files/compiler_warnings.supp | 2 ++ unittest/mytap/tap.h | 4 ++-- 12 files changed, 25 insertions(+), 22 deletions(-) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index fd067e8a8ad..62eab5bf6e4 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -71,8 +71,8 @@ static struct my_option my_long_options[] = &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", &charsets_dir, - &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", (char**) &charsets_dir, + (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"check-only-changed", 'C', diff --git a/client/mysqldump.c b/client/mysqldump.c index 0045faa2229..bb09af4a3c2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -211,8 +211,8 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", &charsets_dir, - &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", (char**) &charsets_dir, + (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"comments", 'i', "Write additional information.", &opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, @@ -242,8 +242,8 @@ static struct my_option my_long_options[] = {"debug", '#', "This is a non-debug version. Catch this and exit.", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log.", &default_dbug_option, - &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", (char**) &default_dbug_option, + (char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", &debug_check_flag, &debug_check_flag, 0, diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 404106560c1..43994a4f514 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -73,8 +73,8 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", &charsets_dir, - &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", (char**) &charsets_dir, + (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", &default_charset, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index da7061471fa..847738951dd 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -55,8 +55,8 @@ static struct my_option my_long_options[] = {"debug", '#', "This is a non-debug version. Catch this and exit", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log", &default_dbug_option, - &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", (char**) &default_dbug_option, + (char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"defaults-file", 'c', "Like --config-file, except: if first option, " "then read this file only, do not read global or per-user config " diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index eb51d385f77..190020a817c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4038,6 +4038,7 @@ sub extract_warning_lines ($) { qr/unknown variable 'loose-/, qr/Now setting lower_case_table_names to [02]/, qr/Setting lower_case_table_names=2/, + qr/You have forced lower_case_table_names to 0/, qr/deprecated/, qr/Slave SQL thread retried transaction/, qr/Slave \(additional info\)/, diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index 0673f571a6b..167d0af3078 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -261,8 +261,8 @@ static struct my_option my_long_options[] = {"backup", 'b', "Make a backup of the table as table_name.OLD.", &backup, &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR_MP, - "Directory where character sets are.", &charsets_dir, - &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory where character sets are.", (char**) &charsets_dir, + (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', diff --git a/storage/xtradb/buf/buf0lru.c b/storage/xtradb/buf/buf0lru.c index 65fdf342e4f..7b01c4aec50 100644 --- a/storage/xtradb/buf/buf0lru.c +++ b/storage/xtradb/buf/buf0lru.c @@ -2131,7 +2131,7 @@ ibool buf_LRU_file_dump(void) /*===================*/ { - os_file_t dump_file = -1; + os_file_t dump_file = (os_file_t) -1; ibool success; byte* buffer_base = NULL; byte* buffer = NULL; @@ -2221,7 +2221,7 @@ buf_LRU_file_dump(void) ret = TRUE; end: - if (dump_file != -1) + if (dump_file != (os_file_t) -1) os_file_close(dump_file); if (buffer_base) ut_free(buffer_base); @@ -2235,7 +2235,7 @@ ibool buf_LRU_file_restore(void) /*======================*/ { - os_file_t dump_file = -1; + os_file_t dump_file = (os_file_t) -1; ibool success; byte* buffer_base = NULL; byte* buffer = NULL; @@ -2326,7 +2326,7 @@ buf_LRU_file_restore(void) " (requested: %lu, read: %lu)\n", req, reads); ret = TRUE; end: - if (dump_file != -1) + if (dump_file != (os_file_t) -1) os_file_close(dump_file); if (buffer_base) ut_free(buffer_base); diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c index bb1eed2a1e3..d69e5859d99 100644 --- a/storage/xtradb/fil/fil0fil.c +++ b/storage/xtradb/fil/fil0fil.c @@ -3044,7 +3044,7 @@ fil_open_single_table_tablespace( dulint new_id[31]; ulint root_page[31]; ulint n_index; - os_file_t info_file = -1; + os_file_t info_file = (os_file_t) -1; char* info_file_path; ulint i; int len; @@ -3130,7 +3130,7 @@ fil_open_single_table_tablespace( } skip_info: - if (info_file != -1) + if (info_file != (os_file_t) -1) os_file_close(info_file); /* diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index c48676c2892..5b5d5ef7186 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -2821,7 +2821,7 @@ i_s_innodb_table_stats_fill( field_store_string(i_s_table->field[0], buf); field_store_string(i_s_table->field[1], ptr); - i_s_table->field[2]->store(table->stat_n_rows); + i_s_table->field[2]->store(table->stat_n_rows, 1); i_s_table->field[3]->store(table->stat_clustered_index_size); i_s_table->field[4]->store(table->stat_sum_of_other_index_sizes); i_s_table->field[5]->store(table->stat_modified_counter); diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c index 86bf309bac1..bc2dd562697 100644 --- a/storage/xtradb/srv/srv0srv.c +++ b/storage/xtradb/srv/srv0srv.c @@ -2897,7 +2897,7 @@ loop: if (bpl) { retry_flush_batch: n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, - bpl, + (ulint) bpl, oldest_lsn + (lsn - lsn_old)); if (n_pages_flushed == ULINT_UNDEFINED) { os_thread_sleep(5000); diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 94e5b54d6fa..5039c28aab0 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -44,6 +44,7 @@ buf/buf0buf\.c: .*block_mutex.* might be used uninitialized btr/btr0cur\.c: null argument where non-null required: 1800-3000 btr/btr0btr\.c: null argument where non-null required: 2500-3000 ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 +fsp/fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits # # bdb is not critical to keep up to date @@ -108,6 +109,7 @@ signal\.c : .*unused parameter.* .* : conversion from '.*size_t' to 'UINT'.* .* : conversion from '.*size_t' to 'uInt'.* .* : conversion from '.*size_t' to 'uint16'.* +.* : The following environment variables were not found.* # # The following should be fixed by the ndb team diff --git a/unittest/mytap/tap.h b/unittest/mytap/tap.h index 206a939e43b..a75d0a4932b 100644 --- a/unittest/mytap/tap.h +++ b/unittest/mytap/tap.h @@ -106,7 +106,7 @@ extern int skip_big_tests; @param count The planned number of tests to run. */ -void plan(int const count); +void plan(int count); /** @@ -125,7 +125,7 @@ void plan(int const count); which case nothing is printed. */ -void ok(int const pass, char const *fmt, ...) +void ok(int pass, char const *fmt, ...) __attribute__((format(printf,2,3)));