Skip to content

Commit 2d9421c

Browse files
author
Ignacio Galarza
committed
Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
2 parents bf63b81 + 2b85c64 commit 2d9421c

94 files changed

Lines changed: 241 additions & 240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/mysql_upgrade.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
373373
}
374374
else
375375
{
376-
int len;
376+
size_t len;
377377

378378
/*
379379
mysql_upgrade was run absolutely or relatively. We can find a sibling

client/mysqladmin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
837837
bool old= (find_type(argv[0], &command_typelib, 2) ==
838838
ADMIN_OLD_PASSWORD);
839839
#ifdef __WIN__
840-
uint pw_len= strlen(pw);
840+
uint pw_len= (uint) strlen(pw);
841841
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
842842
printf("Warning: single quotes were not trimmed from the password by"
843843
" your command\nline client, as you might have expected.\n");

client/mysqlbinlog.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static Exit_status safe_connect();
128128
class Load_log_processor
129129
{
130130
char target_dir_name[FN_REFLEN];
131-
int target_dir_name_len;
131+
size_t target_dir_name_len;
132132

133133
/*
134134
When we see first event corresponding to some LOAD DATA statement in
@@ -285,9 +285,9 @@ class Load_log_processor
285285
File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
286286
Exit_status load_old_format_file(NET* net, const char *server_fname,
287287
uint server_fname_len, File file);
288-
Exit_status process_first_event(const char *bname, uint blen,
288+
Exit_status process_first_event(const char *bname, size_t blen,
289289
const uchar *block,
290-
uint block_len, uint file_id,
290+
size_t block_len, uint file_id,
291291
Create_file_log_event *ce);
292292
};
293293

@@ -305,7 +305,7 @@ class Load_log_processor
305305
File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
306306
char *filename)
307307
{
308-
uint len;
308+
size_t len;
309309
char *tail;
310310
File file;
311311

@@ -319,7 +319,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
319319
return -1;
320320
}
321321

322-
le->set_fname_outside_temp_buf(filename,len+strlen(tail));
322+
le->set_fname_outside_temp_buf(filename,len+(uint) strlen(tail));
323323

324324
return file;
325325
}
@@ -411,9 +411,9 @@ Exit_status Load_log_processor::load_old_format_file(NET* net,
411411
@retval OK_CONTINUE No error, the program should continue.
412412
*/
413413
Exit_status Load_log_processor::process_first_event(const char *bname,
414-
uint blen,
414+
size_t blen,
415415
const uchar *block,
416-
uint block_len,
416+
size_t block_len,
417417
uint file_id,
418418
Create_file_log_event *ce)
419419
{
@@ -456,7 +456,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
456456
}
457457

458458
if (ce)
459-
ce->set_fname_outside_temp_buf(fname, strlen(fname));
459+
ce->set_fname_outside_temp_buf(fname, (uint) strlen(fname));
460460

461461
if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP)))
462462
{
@@ -1189,7 +1189,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
11891189
long dummy_my_timezone;
11901190
my_bool dummy_in_dst_time_gap;
11911191
/* We require a total specification (date AND time) */
1192-
if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) !=
1192+
if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
11931193
MYSQL_TIMESTAMP_DATETIME || was_cut)
11941194
{
11951195
error("Incorrect date and time argument: %s", str);

client/mysqlcheck.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int get_options(int *argc, char ***argv)
349349

350350
if (!what_to_do)
351351
{
352-
int pnlen = strlen(my_progname);
352+
size_t pnlen= strlen(my_progname);
353353

354354
if (pnlen < 6) /* name too short */
355355
what_to_do = DO_CHECK;
@@ -448,7 +448,8 @@ static int process_selected_tables(char *db, char **table_names, int tables)
448448
space is for more readable output in logs and in case of error
449449
*/
450450
char *table_names_comma_sep, *end;
451-
int i, tot_length = 0;
451+
size_t tot_length= 0;
452+
int i= 0;
452453

453454
for (i = 0; i < tables; i++)
454455
tot_length+= fixed_name_length(*(table_names + i)) + 2;
@@ -464,7 +465,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
464465
*end++= ',';
465466
}
466467
*--end = 0;
467-
handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
468+
handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
468469
my_free(table_names_comma_sep, MYF(0));
469470
}
470471
else
@@ -486,7 +487,7 @@ static uint fixed_name_length(const char *name)
486487
else if (*p == '.')
487488
extra_length+= 2;
488489
}
489-
return (p - name) + extra_length;
490+
return (uint) ((p - name) + extra_length);
490491
}
491492

492493

client/mysqldump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
802802
opt_set_charset= 0;
803803
opt_compatible_mode_str= argument;
804804
opt_compatible_mode= find_set(&compatible_mode_typelib,
805-
argument, strlen(argument),
805+
argument, (uint) strlen(argument),
806806
&err_ptr, &err_len);
807807
if (err_len)
808808
{

client/mysqlslap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ parse_option(const char *origin, option_string **stmt, char delm)
19291929
char *ptr= (char *)origin;
19301930
option_string **sptr= stmt;
19311931
option_string *tmp;
1932-
uint length= strlen(origin);
1932+
size_t length= strlen(origin);
19331933
uint count= 0; /* We know that there is always one */
19341934

19351935
for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string),

client/mysqltest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ void log_msg(const char *fmt, ...)
13161316
void cat_file(DYNAMIC_STRING* ds, const char* filename)
13171317
{
13181318
int fd;
1319-
uint len;
1319+
size_t len;
13201320
char buff[512];
13211321

13221322
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
@@ -1614,7 +1614,7 @@ int compare_files2(File fd, const char* filename2)
16141614
{
16151615
int error= RESULT_OK;
16161616
File fd2;
1617-
uint len, len2;
1617+
size_t len, len2;
16181618
char buff[512], buff2[512];
16191619

16201620
if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0)

client/sql_string.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ bool String::append(const char *s,uint32 arg_length)
468468

469469
bool String::append(const char *s)
470470
{
471-
return append(s, strlen(s));
471+
return append(s, (uint) strlen(s));
472472
}
473473

474474

extra/comp_err.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
660660
case 'u':
661661
case 'x':
662662
case 's':
663-
chksum= my_checksum(chksum, start, p-start);
663+
chksum= my_checksum(chksum, start, (uint) (p - start));
664664
start= 0; /* Not in format specifier anymore */
665665
break;
666666

extra/yassl/src/buffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void input_buffer::add_size(uint i)
106106

107107
uint input_buffer::get_capacity() const
108108
{
109-
return end_ - buffer_;
109+
return (uint) (end_ - buffer_);
110110
}
111111

112112

@@ -223,7 +223,7 @@ uint output_buffer::get_size() const
223223

224224
uint output_buffer::get_capacity() const
225225
{
226-
return end_ - buffer_;
226+
return (uint) (end_ - buffer_);
227227
}
228228

229229

0 commit comments

Comments
 (0)