Fix some warnings

This commit is contained in:
Vladislav Vaintroub 2017-10-27 19:21:58 +00:00
parent a81ea75390
commit 769f060398
3 changed files with 7 additions and 5 deletions

View file

@ -62,6 +62,7 @@ static int uncompress_zlib(String *to, const uchar *from, uint from_length,
z_stream stream;
uchar original_pack_length;
int wbits;
ulonglong avail_out;
original_pack_length= *from & 0x07;
wbits= *from & 8 ? -MAX_WBITS : MAX_WBITS;
@ -75,14 +76,15 @@ static int uncompress_zlib(String *to, const uchar *from, uint from_length,
return 1;
}
stream.avail_out= read_bigendian(from, original_pack_length);
avail_out= (ulonglong)read_bigendian(from, original_pack_length);
if (stream.avail_out > field_length)
if (avail_out > field_length)
{
my_error(ER_ZLIB_Z_DATA_ERROR, MYF(0));
return 1;
}
stream.avail_out= (uint)avail_out;
if (to->alloc(stream.avail_out))
return 1;

View file

@ -1767,7 +1767,7 @@ public:
option.var_type|= GET_BIT;
reverse_semantics= my_count_bits(bitmask_arg) > 1;
bitmask= reverse_semantics ? ~bitmask_arg : bitmask_arg;
option.block_size= reverse_semantics ? -(long) bitmask : bitmask;
option.block_size= reverse_semantics ? -(long) bitmask : (long)bitmask;
set(global_var_ptr(), def_val);
SYSVAR_ASSERT(def_val < 2);
SYSVAR_ASSERT(size == sizeof(ulonglong));

View file

@ -199,7 +199,7 @@ public:
bool is_owned() const UNIV_NOTHROW
{
return(os_thread_eq(
my_atomic_loadlint(&m_context.m_thread_id),
(os_thread_id_t)my_atomic_loadlint(&m_context.m_thread_id),
os_thread_get_curr_id()));
}
@ -221,7 +221,7 @@ public:
os_thread_id_t get_thread_id() const
UNIV_NOTHROW
{
return(my_atomic_loadlint(&m_context.m_thread_id));
return((os_thread_id_t)my_atomic_loadlint(&m_context.m_thread_id));
}
/** Magic number to check for memory corruption. */