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. --- mysys/mf_keycache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 2f0f2bf05c0..edf8cd3be8a 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2429,7 +2429,7 @@ restart: The call is thread safe because only the current thread might change the block->hash_link value */ - error= my_pwrite(block->hash_link->file, + error= (int)my_pwrite(block->hash_link->file, block->buffer + block->offset, block->length - block->offset, block->hash_link->diskpos + block->offset, @@ -2674,7 +2674,7 @@ static void read_block_primary(SIMPLE_KEY_CACHE_CB *keycache, else { block->status|= BLOCK_READ; - block->length= got_length; + block->length= (uint)got_length; /* Do not set block->offset here. If this block is marked BLOCK_CHANGED later, we want to flush only the modified part. So @@ -3809,7 +3809,7 @@ static int flush_cached_blocks(SIMPLE_KEY_CACHE_CB *keycache, (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE)); block->status|= BLOCK_IN_FLUSHWRITE; keycache_pthread_mutex_unlock(&keycache->cache_lock); - error= my_pwrite(file, block->buffer + block->offset, + error= (int)my_pwrite(file, block->buffer + block->offset, block->length - block->offset, block->hash_link->diskpos + block->offset, MYF(MY_NABP | MY_WAIT_IF_FULL)); -- cgit v1.2.1