diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 917e142af91..c5995d74ca3 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -4791,8 +4791,7 @@ static int replace_data_file(HA_CHECK *param, MI_INFO *info, File new_file) */ if (info->s->file_map) { - (void) my_munmap((char*) info->s->file_map, - (size_t) info->s->mmaped_length); + (void) my_munmap((char*) info->s->file_map, info->s->mmaped_length); info->s->file_map= NULL; } diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index c4baca3d89f..cb49ded0c20 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -95,7 +95,7 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) #if defined(HAVE_MADVISE) madvise((char*) info->s->file_map, size, MADV_RANDOM); #endif - info->s->mmaped_length= size; + info->s->mmaped_length= (size_t) size; info->s->file_read= mi_mmap_pread; info->s->file_write= mi_mmap_pwrite; DBUG_RETURN(0); @@ -118,8 +118,7 @@ int mi_munmap_file(MI_INFO *info) { int ret; DBUG_ENTER("mi_unmap_file"); - if ((ret= my_munmap((void*) info->s->file_map, - (size_t) info->s->mmaped_length))) + if ((ret= my_munmap((void*) info->s->file_map, info->s->mmaped_length))) DBUG_RETURN(ret); info->s->file_read= mi_nommap_pread; info->s->file_write= mi_nommap_pwrite; diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index e61cd745936..4fd287c6038 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -114,7 +114,7 @@ int mi_lock_database(MI_INFO *info, int lock_type) if (myisam_flush) { if (share->file_map) - my_msync(info->dfile, share->file_map, (size_t)share->mmaped_length, MS_SYNC); + my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC); if (mysql_file_sync(share->kfile, MYF(0))) mark_crashed= error= my_errno; if (mysql_file_sync(info->dfile, MYF(0))) @@ -529,7 +529,7 @@ int _mi_writeinfo(register MI_INFO *info, uint operation) if (myisam_flush) { if (share->file_map) - my_msync(info->dfile, share->file_map, (size_t)share->mmaped_length, MS_SYNC); + my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC); mysql_file_sync(share->kfile, 0); mysql_file_sync(info->dfile, 0); } diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index fc32bb7e518..242bc82bd16 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -1551,7 +1551,7 @@ void _mi_unmap_file(MI_INFO *info) { DBUG_ASSERT(info->s->options & HA_OPTION_COMPRESS_RECORD); - (void) my_munmap((char*) info->s->file_map, (size_t) info->s->mmaped_length); + (void) my_munmap((char*) info->s->file_map, info->s->mmaped_length); if (myisam_mmap_size != SIZE_T_MAX) { diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index ff12cb53dd9..c63baa13875 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -224,7 +224,7 @@ typedef struct st_mi_isam_share THR_LOCK lock; mysql_mutex_t intern_lock; /* Locking for use with _locking */ mysql_rwlock_t *key_root_lock; - my_off_t mmaped_length; + size_t mmaped_length; uint nonmmaped_inserts; /* counter of writing in non-mmaped area */ mysql_rwlock_t mmap_lock;