summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-28 10:38:02 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commit7354dc67737fdeb105656f5cec055da627bb9c29 (patch)
tree7cc2b5f975d5e32eb94cd1344b259ea1b24018d6 /client
parent509928718d52a14739fcfb2ebf0e68b4c8e01be5 (diff)
downloadmariadb-git-7354dc67737fdeb105656f5cec055da627bb9c29.tar.gz
MDEV-13384 - misc Windows warnings fixed
Diffstat (limited to 'client')
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqlbinlog.cc2
-rw-r--r--client/mysqldump.c10
-rw-r--r--client/mysqlslap.c6
-rw-r--r--client/mysqltest.cc24
5 files changed, 23 insertions, 21 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index c10dc20e7d7..7ba15b772b5 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -501,7 +501,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
last_fn_libchar -= 6;
}
- len= last_fn_libchar - self_name;
+ len= (int)(last_fn_libchar - self_name);
my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 584f6955453..2712e6ea668 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -604,7 +604,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
Exit_status Load_log_processor::process(Create_file_log_event *ce)
{
const char *bname= ce->fname + dirname_length(ce->fname);
- uint blen= ce->fname_len - (bname-ce->fname);
+ size_t blen= ce->fname_len - (bname-ce->fname);
return process_first_event(bname, blen, ce->block, ce->block_len,
ce->file_id, ce);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index c8ebd2217a3..a260065c64c 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -247,8 +247,8 @@ static struct my_option my_long_options[] =
&opt_slave_apply, &opt_slave_apply, 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},
{"comments", 'i', "Write additional information.",
&opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
@@ -285,8 +285,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,
@@ -5733,7 +5733,7 @@ static int replace(DYNAMIC_STRING *ds_str,
return 1;
init_dynamic_string_checked(&ds_tmp, "",
ds_str->length + replace_len, 256);
- dynstr_append_mem_checked(&ds_tmp, ds_str->str, start - ds_str->str);
+ dynstr_append_mem_checked(&ds_tmp, ds_str->str, (uint)(start - ds_str->str));
dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len);
dynstr_append_checked(&ds_tmp, start + search_len);
dynstr_set_checked(ds_str, ds_tmp.str);
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index a78bf35d51b..60e0939491c 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -587,8 +587,8 @@ static struct my_option my_long_options[] =
&auto_generate_sql_number, &auto_generate_sql_number,
0, GET_ULL, REQUIRED_ARG, 100, 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},
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
@@ -817,7 +817,7 @@ get_random_string(char *buf)
DBUG_ENTER("get_random_string");
for (x= RAND_STRING_SIZE; x > 0; x--)
*buf_ptr++= ALPHANUMERICS[random() % ALPHANUMERICS_SIZE];
- DBUG_RETURN(buf_ptr - buf);
+ DBUG_RETURN((uint)(buf_ptr - buf));
}
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 30ca28577f3..e2fe43645f8 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -767,7 +767,7 @@ public:
if (show_from != buf)
{
// The last new line was found in this buf, adjust offset
- show_offset+= (show_from - buf) + 1;
+ show_offset+= (int)(show_from - buf) + 1;
DBUG_PRINT("info", ("adjusted offset to %d", show_offset));
}
DBUG_PRINT("info", ("show_offset: %d", show_offset));
@@ -2700,7 +2700,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
DBUG_ASSERT(query_end);
memset(&command, 0, sizeof(command));
command.query= (char*)query;
- command.first_word_len= (*query_end - query);
+ command.first_word_len= (int)(*query_end - query);
command.first_argument= command.query + command.first_word_len;
command.end= (char*)*query_end;
command.abort_on_error= 1; /* avoid uninitialized variables */
@@ -6501,7 +6501,7 @@ void do_delimiter(struct st_command* command)
if (!(*p))
die("Can't set empty delimiter");
- delimiter_length= strmake_buf(delimiter, p) - delimiter;
+ delimiter_length= (uint)(strmake_buf(delimiter, p) - delimiter);
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
command->last_argument= p + delimiter_length;
@@ -6987,7 +6987,7 @@ int read_command(struct st_command** command_ptr)
command->first_argument= p;
command->end= strend(command->query);
- command->query_len= (command->end - command->query);
+ command->query_len= (int)(command->end - command->query);
parser.read_lines++;
DBUG_RETURN(0);
}
@@ -7544,7 +7544,7 @@ void fix_win_paths(char *val, size_t len)
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
- char* val, ulonglong len, my_bool is_null)
+ char* val, size_t len, my_bool is_null)
{
char null[]= "NULL";
@@ -8540,7 +8540,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if (flags & QUERY_PRINT_ORIGINAL_FLAG)
{
print_query= command->query;
- print_len= command->end - command->query;
+ print_len= (int)(command->end - command->query);
}
replace_dynstr_append_mem(ds, print_query, print_len);
dynstr_append_mem(ds, delimiter, delimiter_length);
@@ -10237,7 +10237,7 @@ void free_replace_regex()
*/
#define SECURE_REG_BUF if (buf_len < need_buf_len) \
{ \
- int off= res_p - buf; \
+ ssize_t off= res_p - buf; \
buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \
res_p= buf + off; \
buf_len= need_buf_len; \
@@ -10262,13 +10262,15 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
regmatch_t *subs;
char *replace_end;
char *buf= *buf_p;
- int len;
- int buf_len, need_buf_len;
+ size_t len;
+ size_t buf_len, need_buf_len;
int cflags= REG_EXTENDED | REG_DOTALL;
int err_code;
char *res_p,*str_p,*str_end;
- buf_len= *buf_len_p;
+ DBUG_ASSERT(*buf_len_p > 0);
+
+ buf_len= (size_t)*buf_len_p;
len= strlen(string);
str_end= string + len;
@@ -10411,7 +10413,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
}
else /* no match this time, just copy the string as is */
{
- int left_in_str= str_end-str_p;
+ size_t left_in_str= str_end-str_p;
need_buf_len= (res_p-buf) + left_in_str;
SECURE_REG_BUF
memcpy(res_p,str_p,left_in_str);