diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-12 18:25:02 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-26 10:37:46 +0000 |
commit | 9891ee5a2aadd2672d8d7f6b217e852344ff86eb (patch) | |
tree | 2f5950ed243a10e36e1d8b9609c6426946fe9011 | |
parent | 859d100d70a9dba222b229bbc0d5a01194e8ed5f (diff) | |
download | mariadb-git-9891ee5a2aadd2672d8d7f6b217e852344ff86eb.tar.gz |
Fix and reenable Windows compiler warning C4800 (size_t conversion).
-rw-r--r-- | cmake/os/Windows.cmake | 4 | ||||
m--------- | libmariadb | 0 | ||||
-rw-r--r-- | mysys/file_logger.c | 4 | ||||
-rw-r--r-- | pcre/pcregrep.c | 4 | ||||
-rw-r--r-- | pcre/pcretest.c | 4 | ||||
-rw-r--r-- | plugin/auth_examples/qa_auth_client.c | 2 | ||||
-rw-r--r-- | plugin/auth_examples/qa_auth_interface.c | 2 | ||||
-rw-r--r-- | plugin/auth_examples/test_plugin.c | 2 | ||||
-rw-r--r-- | plugin/fulltext/plugin_example.c | 2 | ||||
-rw-r--r-- | plugin/server_audit/server_audit.c | 30 | ||||
-rw-r--r-- | plugin/server_audit/test_audit_v4.c | 6 | ||||
-rw-r--r-- | plugin/simple_password_check/simple_password_check.c | 2 | ||||
-rw-r--r-- | sql/sql_bootstrap.cc | 6 | ||||
-rw-r--r-- | strings/ctype-bin.c | 8 | ||||
-rw-r--r-- | strings/ctype-mb.c | 4 | ||||
-rw-r--r-- | strings/ctype-simple.c | 10 | ||||
-rw-r--r-- | strings/ctype-tis620.c | 10 | ||||
-rw-r--r-- | strings/ctype-uca.c | 8 | ||||
-rw-r--r-- | strings/ctype-ucs2.c | 4 | ||||
-rw-r--r-- | strings/ctype.c | 4 | ||||
-rw-r--r-- | strings/my_vsnprintf.c | 6 | ||||
-rw-r--r-- | vio/viopipe.c | 4 | ||||
-rw-r--r-- | vio/viosocket.c | 4 | ||||
-rw-r--r-- | vio/viossl.c | 12 |
24 files changed, 71 insertions, 71 deletions
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 4fd01e5914e..b089a7f59f0 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -139,8 +139,8 @@ IF(MSVC) ENDIF() #TODO: update the code and remove the disabled warnings - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267 ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267") IF(MYSQL_MAINTAINER_MODE MATCHES "ERR") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") diff --git a/libmariadb b/libmariadb -Subproject f3944bbd36af729b2f13313587018679c57de67 +Subproject c038615c8a6ad584893302b4852a719979afd2e diff --git a/mysys/file_logger.c b/mysys/file_logger.c index 078286cd7d0..35a077c4391 100644 --- a/mysys/file_logger.c +++ b/mysys/file_logger.c @@ -172,7 +172,7 @@ int logger_vprintf(LOGGER_HANDLE *log, const char* fmt, va_list ap) if (n_bytes >= sizeof(cvtbuf)) n_bytes= sizeof(cvtbuf) - 1; - result= my_write(log->file, (uchar *) cvtbuf, n_bytes, MYF(0)); + result= (int)my_write(log->file, (uchar *) cvtbuf, n_bytes, MYF(0)); exit: flogger_mutex_unlock(&log->lock); @@ -196,7 +196,7 @@ int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size) goto exit; /* Log rotation needed but failed */ } - result= my_write(log->file, (uchar *) buffer, size, MYF(0)); + result= (int)my_write(log->file, (uchar *) buffer, size, MYF(0)); exit: flogger_mutex_unlock(&log->lock); diff --git a/pcre/pcregrep.c b/pcre/pcregrep.c index 317f7454e13..a58ff823509 100644 --- a/pcre/pcregrep.c +++ b/pcre/pcregrep.c @@ -951,7 +951,7 @@ Returns: TRUE if the path is not excluded static BOOL test_incexc(char *path, patstr *ip, patstr *ep) { -int plen = strlen(path); +int plen = (int)strlen(path); for (; ep != NULL; ep = ep->next) { @@ -2502,7 +2502,7 @@ compile_pattern(patstr *p, int options, int popts, int fromfile, char buffer[PATBUFSIZE]; const char *error; char *ps = p->string; -int patlen = strlen(ps); +int patlen = (int)strlen(ps); int errptr; if (p->compiled != NULL) return TRUE; diff --git a/pcre/pcretest.c b/pcre/pcretest.c index f1303037281..a0e65ed9808 100644 --- a/pcre/pcretest.c +++ b/pcre/pcretest.c @@ -1904,7 +1904,7 @@ for (;;) { if (f == stdin) printf("%s", prompt); - if (fgets((char *)here, rlen, f) == NULL) + if (fgets((char *)here, (int)rlen, f) == NULL) return (here == start)? NULL : start; } @@ -2025,7 +2025,7 @@ pcre_uint32 c = 0; int yield = 0; if (length < 0) - length = strlen((char *)p); + length = (int)strlen((char *)p); while (length-- > 0) { diff --git a/plugin/auth_examples/qa_auth_client.c b/plugin/auth_examples/qa_auth_client.c index a7ee2f83a39..2153ee71504 100644 --- a/plugin/auth_examples/qa_auth_client.c +++ b/plugin/auth_examples/qa_auth_client.c @@ -90,7 +90,7 @@ static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) return CR_ERROR; /* send the reply to the server */ res= vio->write_packet(vio, (const unsigned char *) reply, - strlen(reply) + 1); + (int)strlen(reply) + 1); if (res) return CR_ERROR; diff --git a/plugin/auth_examples/qa_auth_interface.c b/plugin/auth_examples/qa_auth_interface.c index c9bc6c5aae4..5002330fb80 100644 --- a/plugin/auth_examples/qa_auth_interface.c +++ b/plugin/auth_examples/qa_auth_interface.c @@ -226,7 +226,7 @@ static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) return CR_ERROR; /* send the reply to the server */ res= vio->write_packet(vio, (const unsigned char *) reply, - strlen(reply) + 1); + (int)strlen(reply) + 1); if (res) return CR_ERROR; diff --git a/plugin/auth_examples/test_plugin.c b/plugin/auth_examples/test_plugin.c index 2b20a8cb56c..8cc17894be4 100644 --- a/plugin/auth_examples/test_plugin.c +++ b/plugin/auth_examples/test_plugin.c @@ -205,7 +205,7 @@ static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) return CR_ERROR; /* send the reply to the server */ res= vio->write_packet(vio, (const unsigned char *) reply, - strlen(reply) + 1); + (int)strlen(reply) + 1); if (res) return CR_ERROR; diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c index 778918cb439..72d78db50f1 100644 --- a/plugin/fulltext/plugin_example.c +++ b/plugin/fulltext/plugin_example.c @@ -150,7 +150,7 @@ static void add_word(MYSQL_FTPARSER_PARAM *param, const char *word, size_t len) MYSQL_FTPARSER_BOOLEAN_INFO bool_info= { FT_TOKEN_WORD, 0, 0, 0, 0, ' ', 0 }; - param->mysql_add_word(param, word, len, &bool_info); + param->mysql_add_word(param, word, (int)len, &bool_info); } /* diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index b75f6b9a863..e2097b58a17 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -300,7 +300,7 @@ static size_t big_buffer_alloced= 0; static unsigned int query_log_limit= 0; static char servhost[256]; -static size_t servhost_len; +static uint servhost_len; static char *syslog_ident; static char syslog_ident_buffer[128]= "mysql-server_auditing"; @@ -622,7 +622,7 @@ static void remove_blanks(char *user) struct user_name { - int name_len; + size_t name_len; char *name; }; @@ -657,7 +657,7 @@ static int cmp_users(const void *ia, const void *ib) { const struct user_name *a= (const struct user_name *) ia; const struct user_name *b= (const struct user_name *) ib; - int dl= a->name_len - b->name_len; + int dl= (int)(a->name_len - b->name_len); if (dl != 0) return dl; @@ -665,7 +665,7 @@ static int cmp_users(const void *ia, const void *ib) } -static char *coll_search(struct user_coll *c, const char *n, int len) +static char *coll_search(struct user_coll *c, const char *n, size_t len) { struct user_name un; struct user_name *found; @@ -677,7 +677,7 @@ static char *coll_search(struct user_coll *c, const char *n, int len) } -static int coll_insert(struct user_coll *c, char *n, int len) +static int coll_insert(struct user_coll *c, char *n, size_t len) { if (c->n_users >= c->n_alloced) { @@ -917,7 +917,7 @@ static void get_str_n(char *dest, int *dest_len, size_t dest_size, memcpy(dest, src, src_len); dest[src_len]= 0; - *dest_len= src_len; + *dest_len= (int)src_len; } @@ -1232,7 +1232,7 @@ static void change_connection(struct connection_info *cn, event->ip, event->ip_length); } -static int write_log(const char *message, int len) +static int write_log(const char *message, size_t len) { if (output_type == OUTPUT_FILE) { @@ -1246,7 +1246,7 @@ static int write_log(const char *message, int len) { syslog(syslog_facility_codes[syslog_facility] | syslog_priority_codes[syslog_priority], - "%s %.*s", syslog_info, len, message); + "%s %.*s", syslog_info, (int)len, message); } return 0; } @@ -1739,9 +1739,9 @@ static int log_table(const struct connection_info *cn, (void) time(&ctime); csize= log_header(message, sizeof(message)-1, &ctime, servhost, servhost_len, - event->user, SAFE_STRLEN(event->user), - event->host, SAFE_STRLEN(event->host), - event->ip, SAFE_STRLEN(event->ip), + event->user, (unsigned int)SAFE_STRLEN(event->user), + event->host, (unsigned int)SAFE_STRLEN(event->host), + event->ip, (unsigned int)SAFE_STRLEN(event->ip), event->thread_id, cn->query_id, type); csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, ",%.*s,%.*s,",event->database_length, event->database, @@ -1761,9 +1761,9 @@ static int log_rename(const struct connection_info *cn, (void) time(&ctime); csize= log_header(message, sizeof(message)-1, &ctime, servhost, servhost_len, - event->user, SAFE_STRLEN(event->user), - event->host, SAFE_STRLEN(event->host), - event->ip, SAFE_STRLEN(event->ip), + event->user, (unsigned int)SAFE_STRLEN(event->user), + event->host, (unsigned int)SAFE_STRLEN(event->host), + event->ip, (unsigned int)SAFE_STRLEN(event->ip), event->thread_id, cn->query_id, "RENAME"); csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, ",%.*s,%.*s|%.*s.%.*s,",event->database_length, event->database, @@ -2344,7 +2344,7 @@ static int server_audit_init(void *p __attribute__((unused))) if (gethostname(servhost, sizeof(servhost))) strcpy(servhost, "unknown"); - servhost_len= strlen(servhost); + servhost_len= (uint)strlen(servhost); logger_init_mutexes(); #if defined(HAVE_PSI_INTERFACE) && !defined(FLOGGER_NO_PSI) diff --git a/plugin/server_audit/test_audit_v4.c b/plugin/server_audit/test_audit_v4.c index ae7527f8449..85d45e35808 100644 --- a/plugin/server_audit/test_audit_v4.c +++ b/plugin/server_audit/test_audit_v4.c @@ -56,11 +56,11 @@ static int auditing_v4(MYSQL_THD thd, mysql_event_class_t class, const void *ev) ev_302.general_error_code= event->general_error_code; ev_302.general_thread_id= event->general_thread_id; ev_302.general_user= event->general_user.str; - ev_302.general_user_length= event->general_user.length; + ev_302.general_user_length= (unsigned int)event->general_user.length; ev_302.general_command= event->general_command.str; - ev_302.general_command_length= event->general_command.length; + ev_302.general_command_length= (unsigned int)event->general_command.length; ev_302.general_query= event->general_query.str; - ev_302.general_query_length= event->general_query.length; + ev_302.general_query_length= (unsigned int)event->general_query.length; ev_302.general_charset= event->general_charset; ev_302.general_time= event->general_time; ev_302.general_rows= event->general_rows; diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c index 8b460c5ed9d..977a7487b78 100644 --- a/plugin/simple_password_check/simple_password_check.c +++ b/plugin/simple_password_check/simple_password_check.c @@ -25,7 +25,7 @@ static unsigned min_length, min_digits, min_letters, min_others; static int validate(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password) { - unsigned digits=0 , uppers=0 , lowers=0, others=0, length= password->length; + unsigned digits=0 , uppers=0 , lowers=0, others=0, length= (unsigned)password->length; const char *ptr= password->str, *end= ptr + length; if (strncmp(password->str, username->str, length) == 0) diff --git a/sql/sql_bootstrap.cc b/sql/sql_bootstrap.cc index 4ef9885b34d..9733831b41f 100644 --- a/sql/sql_bootstrap.cc +++ b/sql/sql_bootstrap.cc @@ -82,14 +82,14 @@ int read_bootstrap_query(char *query, int *query_length, */ if (query_len + len + 1 >= MAX_BOOTSTRAP_QUERY_SIZE) { - int new_len= MAX_BOOTSTRAP_QUERY_SIZE - query_len - 1; + size_t new_len= MAX_BOOTSTRAP_QUERY_SIZE - query_len - 1; if ((new_len > 0) && (query_len < MAX_BOOTSTRAP_QUERY_SIZE)) { memcpy(query + query_len, line, new_len); query_len+= new_len; } query[query_len]= '\0'; - *query_length= query_len; + *query_length= (int)query_len; return READ_BOOTSTRAP_QUERY_SIZE; } @@ -111,7 +111,7 @@ int read_bootstrap_query(char *query, int *query_length, Return the query found. */ query[query_len]= '\0'; - *query_length= query_len; + *query_length= (int)query_len; return READ_BOOTSTRAP_SUCCESS; } } diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 0bbbd282530..612fdbab38c 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -402,7 +402,7 @@ my_strnxfrm_8bit_bin(CHARSET_INFO *cs, if (dst != src) memcpy(dst, src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, dst, dst + srclen, dst + dstlen, - nweights - srclen, flags, 0); + (uint)(nweights - srclen), flags, 0); } @@ -416,7 +416,7 @@ my_strnxfrm_8bit_nopad_bin(CHARSET_INFO *cs, if (dst != src) memcpy(dst, src, srclen); return my_strxfrm_pad_desc_and_reverse_nopad(cs, dst, dst + srclen, - dst + dstlen, nweights - srclen, + dst + dstlen,(uint)(nweights - srclen), flags, 0); } @@ -464,13 +464,13 @@ skip: if (nmatch > 0) { match[0].beg= 0; - match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].end= (uint) (str- (const uchar*)b-1); match[0].mb_len= match[0].end; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= match[1].end-match[1].beg; } } diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index bfd533e6f98..19caa22edb4 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -528,12 +528,12 @@ uint my_instr_mb(CHARSET_INFO *cs, if (nmatch) { match[0].beg= 0; - match[0].end= (size_t) (b-b0); + match[0].end= (uint) (b-b0); match[0].mb_len= res; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= 0; /* Not computed */ } } diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index fc5218caba1..d6e5f02d463 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -78,8 +78,8 @@ size_t my_strnxfrm_simple_internal(CHARSET_INFO * cs, const uchar *map= cs->sort_order; uchar *d0= dst; uint frmlen; - if ((frmlen= MY_MIN(dstlen, *nweights)) > srclen) - frmlen= srclen; + if ((frmlen= (uint)MY_MIN(dstlen, *nweights)) > srclen) + frmlen= (uint)srclen; if (dst != src) { const uchar *end; @@ -321,7 +321,7 @@ size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), const char* fmt, ...) { va_list args; - int result; + size_t result; va_start(args,fmt); result= my_vsnprintf(to, n, fmt, args); va_end(args); @@ -1226,13 +1226,13 @@ skip: if (nmatch > 0) { match[0].beg= 0; - match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].end= (uint) (str- (const uchar*)b-1); match[0].mb_len= match[0].end; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= match[1].end-match[1].beg; } } diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 5e24c84056c..bfd8b0db1d5 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -449,7 +449,7 @@ static const uchar sort_order_tis620[]= static size_t thai2sortable(uchar *tstr, size_t len) { uchar *p; - int tlen; + size_t tlen; uchar l2bias; tlen= len; @@ -609,10 +609,10 @@ my_strnxfrm_tis620(CHARSET_INFO *cs, set_if_smaller(dstlen, nweights); set_if_smaller(len, dstlen); len= my_strxfrm_pad_desc_and_reverse(cs, dst, dst + len, dst + dstlen, - dstlen - len, flags, 0); + (uint)(dstlen - len), flags, 0); if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0) { - uint fill_length= dstlen0 - len; + size_t fill_length= dstlen0 - len; cs->cset->fill(cs, (char*) dst + len, fill_length, cs->pad_char); len= dstlen0; } @@ -632,10 +632,10 @@ my_strnxfrm_tis620_nopad(CHARSET_INFO *cs, set_if_smaller(dstlen, nweights); set_if_smaller(len, dstlen); len= my_strxfrm_pad_desc_and_reverse_nopad(cs, dst, dst + len, dst + dstlen, - dstlen - len, flags, 0); + (uint)(dstlen - len), flags, 0); if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0) { - uint fill_length= dstlen0 - len; + size_t fill_length= dstlen0 - len; memset(dst + len, 0x00, fill_length); len= dstlen0; } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index e3ed531df93..f75b5c7c7a4 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -31260,7 +31260,7 @@ static my_bool my_uca_alloc_contractions(MY_CONTRACTIONS *contractions, MY_CHARSET_LOADER *loader, size_t n) { - uint size= n * sizeof(MY_CONTRACTION); + size_t size= n * sizeof(MY_CONTRACTION); if (!(contractions->item= (loader->once_alloc)(size)) || !(contractions->flags= (char *) (loader->once_alloc)(MY_UCA_CNT_FLAG_SIZE))) return 1; @@ -34005,7 +34005,7 @@ apply_one_rule(MY_CHARSET_LOADER *loader, { MY_CONTRACTIONS *contractions= &dst->contractions; to= my_uca_init_one_contraction(contractions, - r->curr, nshift, r->with_context); + r->curr, (uint)nshift, r->with_context); /* Store weights of the "reset to" character */ dst->contractions.nitems--; /* Temporarily hide - it's incomplete */ rc= my_char_weight_put(dst, @@ -34202,9 +34202,9 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, ncontractions++; } - ncontractions += src->contractions.nitems; + ncontractions += (int)src->contractions.nitems; - if ((my_uca_generate_pages(loader, dst, src, npages))) + if ((my_uca_generate_pages(loader, dst, src, (uint)npages))) return TRUE; if (ncontractions) diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index cba44afc926..80bb6745b19 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1078,7 +1078,7 @@ my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill) } -static int +static size_t my_vsnprintf_mb2(char *dst, size_t n, const char* fmt, va_list ap) { char *start=dst, *end= dst + n - 1; @@ -2327,7 +2327,7 @@ my_charlen_utf32(CHARSET_INFO *cs __attribute__((unused)), /* Defines my_well_formed_char_length_utf32 */ -static int +static size_t my_vsnprintf_utf32(char *dst, size_t n, const char* fmt, va_list ap) { char *start= dst, *end= dst + n; diff --git a/strings/ctype.c b/strings/ctype.c index 0aed6c8bf52..64ebd51676f 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -904,11 +904,11 @@ my_string_metadata_get(MY_STRING_METADATA *metadata, if (cs->mbmaxlen == 1 && !(cs->state & MY_CS_NONASCII)) { metadata->char_length= length; - metadata->repertoire= my_string_repertoire_8bit(cs, str, length); + metadata->repertoire= my_string_repertoire_8bit(cs, str, (ulong)length); } else { - my_string_metadata_get_mb(metadata, cs, str, length); + my_string_metadata_get_mb(metadata, cs, str, (ulong)length); } } diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 34ec811adac..c6d9e8530dd 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -92,10 +92,10 @@ static const char *get_length(const char *fmt, size_t *length, uint *pre_zero) */ static const char *get_length_arg(const char *fmt, ARGS_INFO *args_arr, - uint *arg_count, size_t *length, uint *flags) + size_t *arg_count, size_t *length, uint *flags) { fmt= get_length(fmt+1, length, flags); - *arg_count= MY_MAX(*arg_count, (uint) *length); + *arg_count= MY_MAX(*arg_count, *length); (*length)--; DBUG_ASSERT(*fmt == '$' && *length < MAX_ARGS); args_arr[*length].arg_type= 'd'; @@ -330,7 +330,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end, { ARGS_INFO args_arr[MAX_ARGS]; PRINT_INFO print_arr[MAX_PRINT_INFO]; - uint idx= 0, arg_count= arg_index; + size_t idx= 0, arg_count= arg_index; start: /* Here we are at the beginning of positional argument, right after $ */ diff --git a/vio/viopipe.c b/vio/viopipe.c index f9af50bc3c9..d3447a95c6e 100644 --- a/vio/viopipe.c +++ b/vio/viopipe.c @@ -78,7 +78,7 @@ size_t vio_read_pipe(Vio *vio, uchar *buf, size_t count) disable_iocp_notification(&vio->overlapped); /* Attempt to read from the pipe (overlapped I/O). */ - if (ReadFile(vio->hPipe, buf, count, &transferred, &vio->overlapped)) + if (ReadFile(vio->hPipe, buf, (DWORD)count, &transferred, &vio->overlapped)) { /* The operation completed immediately. */ ret= transferred; @@ -101,7 +101,7 @@ size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count) disable_iocp_notification(&vio->overlapped); /* Attempt to write to the pipe (overlapped I/O). */ - if (WriteFile(vio->hPipe, buf, count, &transferred, &vio->overlapped)) + if (WriteFile(vio->hPipe, buf, (DWORD)count, &transferred, &vio->overlapped)) { /* The operation completed immediately. */ ret= transferred; diff --git a/vio/viosocket.c b/vio/viosocket.c index cb353c1ce75..6d76d99eb99 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -1296,7 +1296,7 @@ int vio_getnameinfo(const struct sockaddr *sa, } return getnameinfo(sa, sa_length, - hostname, hostname_size, - port, port_size, + hostname, (uint)hostname_size, + port, (uint)port_size, flags); } diff --git a/vio/viossl.c b/vio/viossl.c index e7cc85ea539..000a526a892 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -141,10 +141,10 @@ size_t vio_ssl_read(Vio *vio, uchar *buf, size_t size) vio->ssl_arg)); if (vio->async_context && vio->async_context->active) - ret= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, size); + ret= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, (int)size); else { - while ((ret= SSL_read(ssl, buf, size)) < 0) + while ((ret= SSL_read(ssl, buf, (int)size)) < 0) { enum enum_vio_io_event event; @@ -174,10 +174,10 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size) if (vio->async_context && vio->async_context->active) ret= my_ssl_write_async(vio->async_context, (SSL *)vio->ssl_arg, buf, - size); + (int)size); else { - while ((ret= SSL_write(ssl, buf, size)) < 0) + while ((ret= SSL_write(ssl, buf, (int)size)) < 0) { enum enum_vio_io_event event; @@ -200,7 +200,7 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size) static long yassl_recv(void *ptr, void *buf, size_t len, int flag __attribute__((unused))) { - return vio_read(ptr, buf, len); + return (long)vio_read(ptr, buf, len); } @@ -208,7 +208,7 @@ static long yassl_recv(void *ptr, void *buf, size_t len, static long yassl_send(void *ptr, const void *buf, size_t len, int flag __attribute__((unused))) { - return vio_write(ptr, buf, len); + return (long)vio_write(ptr, buf, len); } #endif |