summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-06-24 02:25:14 +0300
committerMonty <monty@mariadb.org>2016-06-24 02:25:14 +0300
commit4dc50758603d6ed2891412fdb6d37cd8b5541999 (patch)
treec31def9d565271ff6ca10ec9c15433a12e91bba6 /mysys
parentec38c7e60bf8dbe54b1551e75254337bec1993a4 (diff)
downloadmariadb-git-4dc50758603d6ed2891412fdb6d37cd8b5541999.tar.gz
Fixed compiler warnings and test failures found by buildbot
Fixed ccfilter to detect errors where the column is included in the error message
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_hash.c2
-rw-r--r--mysys/ma_dyncol.c14
-rw-r--r--mysys/mf_iocache.c4
-rw-r--r--mysys/mulalloc.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 6be11edbfcf..98a34647844 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -308,7 +308,7 @@ static inline const uchar* hash_key(const LF_HASH *hash,
@note, that the hash value is limited to 2^31, because we need one
bit to distinguish between normal and dummy nodes.
*/
-static inline my_hash_value_type calc_hash(const CHARSET_INFO *cs,
+static inline my_hash_value_type calc_hash(CHARSET_INFO *cs,
const uchar *key,
size_t keylen)
{
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index db7d199bcd2..4d281b98d1c 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -566,7 +566,7 @@ static my_bool type_and_offset_read_named(DYNAMIC_COLUMN_TYPE *type,
return 1;
}
*type= (val & 0xf) + 1;
- *offset= val >> 4;
+ *offset= (size_t) (val >> 4);
return (*offset >= lim);
}
@@ -2803,7 +2803,7 @@ dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan,
else if (offs < first_offset)
goto err;
- offs+= plan[i].ddelta;
+ offs+= (size_t) plan[i].ddelta;
{
DYNAMIC_COLUMN_VALUE val;
val.type= tp; // only the type used in the header
@@ -2969,7 +2969,7 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
return ER_DYNCOL_FORMAT;
}
- offs+= plan[i].ddelta;
+ offs+= (size_t) plan[i].ddelta;
int2store(write, nm);
/* write rest of data at write + COLUMN_NUMBER_SIZE */
type_and_offset_store_num(write, new_offset_size, tp, offs);
@@ -3023,9 +3023,9 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
memmove((header_base + new_header_size +
plan[i].mv_offset + plan[i].ddelta),
header_base + header_size + plan[i].mv_offset,
- plan[i].mv_length);
+ (size_t) plan[i].mv_length);
}
- str->length+= plan[i].mv_length;
+ str->length+= (size_t) plan[i].mv_length;
/* new data adding */
if (i < add_column_count)
@@ -3514,8 +3514,8 @@ dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str,
Check if it is only "increasing" or only "decreasing" plan for (header
and data separately).
*/
- new_header.data_size= header.data_size + data_delta;
- new_header.nmpool_size= new_header.nmpool_size + name_delta;
+ new_header.data_size= (size_t) (header.data_size + data_delta);
+ new_header.nmpool_size= (size_t) (new_header.nmpool_size + name_delta);
DBUG_ASSERT(new_header.format != dyncol_fmt_num ||
new_header.nmpool_size == 0);
if ((new_header.offset_size=
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index db8d0b51ada..af1e0830aee 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -517,7 +517,7 @@ int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
{
my_off_t old_pos_in_file= info->pos_in_file;
res= info->write_function(info, Buffer, Count);
- Count-= info->pos_in_file - old_pos_in_file;
+ Count-= (size_t) (info->pos_in_file - old_pos_in_file);
Buffer+= info->pos_in_file - old_pos_in_file;
}
else
@@ -1226,7 +1226,7 @@ static int _my_b_cache_read_r(IO_CACHE *cache, uchar *Buffer, size_t Count)
static void copy_to_read_buffer(IO_CACHE *write_cache,
const uchar *write_buffer, my_off_t pos_in_file)
{
- size_t write_length= write_cache->pos_in_file - pos_in_file;
+ size_t write_length= (size_t) (write_cache->pos_in_file - pos_in_file);
IO_CACHE_SHARE *cshare= write_cache->share;
DBUG_ASSERT(cshare->source_cache == write_cache);
diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c
index fceecdc1dc7..e230cdf9b71 100644
--- a/mysys/mulalloc.c
+++ b/mysys/mulalloc.c
@@ -80,7 +80,7 @@ void *my_multi_malloc_large(myf myFlags, ...)
{
va_list args;
char **ptr,*start,*res;
- size_t tot_length,length;
+ ulonglong tot_length,length;
DBUG_ENTER("my_multi_malloc");
va_start(args,myFlags);
@@ -92,7 +92,7 @@ void *my_multi_malloc_large(myf myFlags, ...)
}
va_end(args);
- if (!(start=(char *) my_malloc(tot_length, myFlags)))
+ if (!(start=(char *) my_malloc((size_t) tot_length, myFlags)))
DBUG_RETURN(0); /* purecov: inspected */
va_start(args,myFlags);