Commit 8d413c32 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix several truncation and formatting warnings.

parent 47327679
......@@ -217,7 +217,7 @@ static bool str_to_ipv4(const char *str, size_t str_length, in_addr *ipv4_addres
{
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, size_t str_length, in_addr *ipv4_addres
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): "
"invalid IPv4 address: too long.",
str_length, str));
(int)str_length, str));
return false;
}
......@@ -248,7 +248,7 @@ static bool str_to_ipv4(const char *str, size_t str_length, in_addr *ipv4_addres
{
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, size_t str_length, in_addr *ipv4_addres
{
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, size_t str_length, in_addr *ipv4_addres
{
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, size_t str_length, in_addr *ipv4_addres
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, size_t str_length, in_addr *ipv4_addres
{
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, size_t str_length, in_addr *ipv4_addres
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, size_t str_length, in_addr *ipv4_addres
{
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;
......
......@@ -824,7 +824,7 @@ MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, uint flags)
we may allocate too much, but better safe than memory overrun.
And in the FLUSH case, the memory is released quickly anyway.
*/
sql_lock->lock_count= locks - locks_buf;
sql_lock->lock_count= (uint)(locks - locks_buf);
DBUG_ASSERT(sql_lock->lock_count <= lock_count);
DBUG_PRINT("info", ("sql_lock->table_count %d sql_lock->lock_count %d",
sql_lock->table_count, sql_lock->lock_count));
......
......@@ -1292,7 +1292,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
}
/* fill in user_host value: the format is "%s[%s] @ %s [%s]" */
user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
user_host_len= (uint)(strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
sctx->priv_user, "[",
sctx->user ? sctx->user : (thd->slave_thread ? "SQL_SLAVE" : ""), "] @ ",
sctx->host ? sctx->host : "", " [",
......
......@@ -92,7 +92,7 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count)
DBUG_RETURN(1);
}
elength= wlength - (ebuffer - wbuffer);
elength= wlength - (uint)(ebuffer - wbuffer);
set_iv(iv, pos_in_file, crypt_data->inbuf_counter);
if (encryption_crypt(ebuffer, elength, info->buffer, &length,
......@@ -184,7 +184,7 @@ static int my_b_encr_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
my_errno= 1;
DBUG_RETURN(info->error= -1);
}
wlength= elength + ebuffer - wbuffer;
wlength= elength + (uint)(ebuffer - wbuffer);
if (length == info->buffer_length)
{
......
......@@ -1484,8 +1484,8 @@ uint maria_multi_check(THD *thd, char *packet, uint packet_length)
size_t subpacket_length= net_field_length((uchar **)&packet_start);
size_t length_length= packet_start - packet;
// length of command + 3 bytes where that length was stored
DBUG_PRINT("info", ("sub-packet length: %ld + %d command: %x",
(ulong)subpacket_length, length_length,
DBUG_PRINT("info", ("sub-packet length: %zu + %zu command: %x",
subpacket_length, length_length,
packet_start[3]));
if (subpacket_length == 0 ||
......
......@@ -327,7 +327,7 @@ int compare_order_elements(ORDER *ord1, ORDER *ord2)
Item *item2= (*ord2->item)->real_item();
DBUG_ASSERT(item1->type() == Item::FIELD_ITEM &&
item2->type() == Item::FIELD_ITEM);
int cmp= ((Item_field *) item1)->field - ((Item_field *) item2)->field;
ptrdiff_t cmp= ((Item_field *) item1)->field - ((Item_field *) item2)->field;
if (cmp == 0)
{
if (ord1->direction == ord2->direction)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment