summaryrefslogtreecommitdiff
path: root/sql/item_inetfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-02 22:35:13 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-02 22:35:13 +0400
commit8ae8cd63485eb063de0b70ea6f3acf7102a61fef (patch)
tree70fa448baa769b6c8c331063a61bf929ad61c976 /sql/item_inetfunc.cc
parent6857cb57fe7090f131b272f31485b7a478a0b324 (diff)
parent387bdf07ae0973bc3e4dc3f5064d2a29c64bb769 (diff)
downloadmariadb-git-8ae8cd63485eb063de0b70ea6f3acf7102a61fef.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/item_inetfunc.cc')
-rw-r--r--sql/item_inetfunc.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/item_inetfunc.cc b/sql/item_inetfunc.cc
index 6a09747fa1a..9aaa64823f7 100644
--- a/sql/item_inetfunc.cc
+++ b/sql/item_inetfunc.cc
@@ -211,13 +211,13 @@ String *Item_func_inet_str_base::val_str_ascii(String *buffer)
IPv4-part differently on different platforms.
*/
-static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
+static bool str_to_ipv4(const char *str, size_t str_length, in_addr *ipv4_address)
{
if (str_length < 7)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): "
"invalid IPv4 address: too short.",
- str_length, str));
+ (int) str_length, str));
return false;
}
@@ -225,7 +225,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): "
"invalid IPv4 address: too long.",
- str_length, str));
+ (int) str_length, str));
return false;
}
@@ -236,7 +236,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
int dot_count= 0;
char c= 0;
- while (((p - str) < str_length) && *p)
+ while (((p - str) < (int)str_length) && *p)
{
c= *p++;
@@ -248,7 +248,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too many characters in a group.",
- str_length, str));
+ (int) str_length, str));
return false;
}
@@ -258,7 +258,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"invalid byte value.",
- str_length, str));
+ (int) str_length, str));
return false;
}
}
@@ -268,7 +268,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too few characters in a group.",
- str_length, str));
+ (int) str_length, str));
return false;
}
@@ -281,7 +281,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
if (dot_count > 3)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
- "too many dots.", str_length, str));
+ "too many dots.", (int) str_length, str));
return false;
}
}
@@ -289,7 +289,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"invalid character at pos %d.",
- str_length, str, (int) (p - str)));
+ (int) str_length, str, (int) (p - str)));
return false;
}
}
@@ -297,7 +297,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
if (c == '.')
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
- "ending at '.'.", str_length, str));
+ "ending at '.'.", (int) str_length, str));
return false;
}
@@ -305,14 +305,14 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too few groups.",
- str_length, str));
+ (int) str_length, str));
return false;
}
ipv4_bytes[3]= (unsigned char) byte_value;
DBUG_PRINT("info", ("str_to_ipv4(%.*s): valid IPv4 address: %d.%d.%d.%d",
- str_length, str,
+ (int) str_length, str,
ipv4_bytes[0], ipv4_bytes[1],
ipv4_bytes[2], ipv4_bytes[3]));
return true;
@@ -493,7 +493,7 @@ static bool str_to_ipv6(const char *str, int str_length, in6_addr *ipv6_address)
return false;
}
- int bytes_to_move= dst - gap_ptr;
+ int bytes_to_move= (int)(dst - gap_ptr);
for (int i= 1; i <= bytes_to_move; ++i)
{