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/strfunc.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sql/strfunc.cc') diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 45a0f8f6558..43089684061 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -45,7 +45,7 @@ static const char field_separator=','; -ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, +ulonglong find_set(TYPELIB *lib, const char *str, size_t length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning) { CHARSET_INFO *strip= cs ? cs : &my_charset_latin1; @@ -111,7 +111,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, > 0 position in TYPELIB->type_names +1 */ -uint find_type(const TYPELIB *lib, const char *find, uint length, +uint find_type(const TYPELIB *lib, const char *find, size_t length, bool part_match) { uint found_count=0, found_pos=0; @@ -152,7 +152,7 @@ uint find_type(const TYPELIB *lib, const char *find, uint length, >0 Offset+1 in typelib for matched string */ -uint find_type2(const TYPELIB *typelib, const char *x, uint length, +uint find_type2(const TYPELIB *typelib, const char *x, size_t length, CHARSET_INFO *cs) { int pos; @@ -265,8 +265,8 @@ uint check_word(TYPELIB *lib, const char *val, const char *end, */ -uint strconvert(CHARSET_INFO *from_cs, const char *from, uint from_length, - CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors) +uint strconvert(CHARSET_INFO *from_cs, const char *from, size_t from_length, + CHARSET_INFO *to_cs, char *to, size_t to_length, uint *errors) { int cnvres; my_wc_t wc; -- cgit v1.2.1