From ec7e32d1c8db02e08acdca184526860d8333b960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 11 Mar 2020 10:41:41 +0200 Subject: MDEV-21907: Mariabackup: Fix clang -Wconversion --- extra/mariabackup/backup_mysql.cc | 3 ++- extra/mariabackup/crc/crc-intel-pclmul.c | 2 +- extra/mariabackup/xtrabackup.cc | 42 +++++++++++--------------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 847340e6dc7..6c13079a8fc 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -505,7 +505,8 @@ get_mysql_vars(MYSQL *connection) } if (page_zip_level_var != NULL) { - page_zip_level = strtoul(page_zip_level_var, &endptr, 10); + page_zip_level = static_cast(strtoul(page_zip_level_var, + &endptr, 10)); ut_ad(*endptr == 0); } diff --git a/extra/mariabackup/crc/crc-intel-pclmul.c b/extra/mariabackup/crc/crc-intel-pclmul.c index cf4f3ef4380..032802c1823 100644 --- a/extra/mariabackup/crc/crc-intel-pclmul.c +++ b/extra/mariabackup/crc/crc-intel-pclmul.c @@ -358,7 +358,7 @@ crc32_reflected_less_than_16 (u32 *pcrc, const byte *inbuf, size_t inlen, else { data = ((const struct u16_unaligned_s *)inbuf)->a; - data |= inbuf[2] << 16; + data |= ((u32) inbuf[2]) << 16; data ^= crc; data <<= 8; crc >>= 24; diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index aac87c61742..5dd2182aad7 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -242,11 +242,6 @@ static char* innobase_ignored_opt; char* innobase_data_home_dir; char* innobase_data_file_path; -my_bool innobase_use_doublewrite; -my_bool innobase_file_per_table; -my_bool innobase_rollback_on_timeout; -my_bool innobase_create_status_file; - /* The following counter is used to convey information to InnoDB about server activity: in selects it is not sensible to call srv_active_wake_master_thread after each fetch or search, we only do @@ -1236,8 +1231,8 @@ struct my_option xb_server_options[] = &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer during --prepare.", - (G_PTR*) &innobase_use_doublewrite, - (G_PTR*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + (G_PTR*) &srv_use_doublewrite_buf, + (G_PTR*) &srv_use_doublewrite_buf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"innodb_io_capacity", OPT_INNODB_IO_CAPACITY, "Number of IOPs the server can do. Tunes the background IO rate", (G_PTR*) &srv_io_capacity, (G_PTR*) &srv_io_capacity, @@ -1256,8 +1251,8 @@ struct my_option xb_server_options[] = 1, 0}, {"innodb_file_per_table", OPT_INNODB_FILE_PER_TABLE, "Stores each InnoDB table to an .ibd file in the database dir.", - (G_PTR*) &innobase_file_per_table, - (G_PTR*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, + (G_PTR*) &srv_file_per_table, + (G_PTR*) &srv_file_per_table, 0, GET_BOOL, NO_ARG, FALSE, 0, 0, 0, 0, 0}, {"innodb_flush_method", OPT_INNODB_FLUSH_METHOD, @@ -1887,14 +1882,7 @@ static bool innodb_init_param() srv_n_read_io_threads = (ulint) innobase_read_io_threads; srv_n_write_io_threads = (ulint) innobase_write_io_threads; - srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; - - row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout; - - srv_file_per_table = (my_bool) innobase_file_per_table; - srv_max_n_open_files = ULINT_UNDEFINED - 5; - srv_innodb_status = (ibool) innobase_create_status_file; srv_print_verbose_log = verbose ? 2 : 1; @@ -3766,24 +3754,22 @@ xb_filters_free() /*********************************************************************** Set the open files limit. Based on set_max_open_files(). - +@param max_file_limit requested open files limit @return the resulting open files limit. May be less or more than the requested value. */ -static uint -xb_set_max_open_files( -/*==================*/ - uint max_file_limit) /*!