From 6c279ad6a71c63cb595fde7c951aadb31c3dbebc Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 6 Feb 2018 12:55:58 +0000 Subject: MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now. --- sql/sql_time.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/sql_time.cc') diff --git a/sql/sql_time.cc b/sql/sql_time.cc index 567739243ff..0dfb1c4d88b 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -256,8 +256,8 @@ adjust_time_range_with_warn(MYSQL_TIME *ltime, uint dec) */ static uint to_ascii(CHARSET_INFO *cs, - const char *src, uint src_length, - char *dst, uint dst_length) + const char *src, size_t src_length, + char *dst, size_t dst_length) { int cnvres; @@ -280,7 +280,7 @@ to_ascii(CHARSET_INFO *cs, /* Character set-aware version of str_to_time() */ bool -str_to_time(CHARSET_INFO *cs, const char *str,uint length, +str_to_time(CHARSET_INFO *cs, const char *str, size_t length, MYSQL_TIME *l_time, ulonglong fuzzydate, MYSQL_TIME_STATUS *status) { char cnv[32]; @@ -294,7 +294,7 @@ str_to_time(CHARSET_INFO *cs, const char *str,uint length, /* Character set-aware version of str_to_datetime() */ -bool str_to_datetime(CHARSET_INFO *cs, const char *str, uint length, +bool str_to_datetime(CHARSET_INFO *cs, const char *str, size_t length, MYSQL_TIME *l_time, ulonglong flags, MYSQL_TIME_STATUS *status) { @@ -318,7 +318,7 @@ bool str_to_datetime(CHARSET_INFO *cs, const char *str, uint length, bool str_to_datetime_with_warn(CHARSET_INFO *cs, - const char *str, uint length, MYSQL_TIME *l_time, + const char *str, size_t length, MYSQL_TIME *l_time, ulonglong flags) { MYSQL_TIME_STATUS status; @@ -786,7 +786,7 @@ DATE_TIME_FORMAT DATE_TIME_FORMAT *date_time_format_copy(THD *thd, DATE_TIME_FORMAT *format) { DATE_TIME_FORMAT *new_format; - ulong length= sizeof(*format) + format->format.length + 1; + size_t length= sizeof(*format) + format->format.length + 1; char *format_pos; if (thd) -- cgit v1.2.1