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_error.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/sql_error.h') diff --git a/sql/sql_error.h b/sql/sql_error.h index c74f6519129..67c6e50d283 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -591,7 +591,7 @@ private: @return true if the Warning_info contains an SQL-condition with the given message. */ - bool has_sql_condition(const char *message_str, ulong message_length) const; + bool has_sql_condition(const char *message_str, size_t message_length) const; /** Reset the warning information. Clear all warnings, @@ -1089,7 +1089,7 @@ public: ulong current_statement_warn_count() const { return get_warning_info()->current_statement_warn_count(); } - bool has_sql_condition(const char *message_str, ulong message_length) const + bool has_sql_condition(const char *message_str, size_t message_length) const { return get_warning_info()->has_sql_condition(message_str, message_length); } void reset_for_next_command() @@ -1240,9 +1240,9 @@ void push_warning_printf(THD *thd, Sql_condition::enum_warning_level level, bool mysqld_show_warnings(THD *thd, ulong levels_to_show); -uint32 convert_error_message(char *to, uint32 to_length, +size_t convert_error_message(char *to, size_t to_length, CHARSET_INFO *to_cs, - const char *from, uint32 from_length, + const char *from, size_t from_length, CHARSET_INFO *from_cs, uint *errors); extern const LEX_CSTRING warning_level_names[]; -- cgit v1.2.1