summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-19 17:45:17 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commiteba44874ca9fc317696630cb371623142289fa99 (patch)
treef67cd5dbcaf102abef2fb26f76357d14feaded04 /mysys/mf_iocache.c
parentde7c2e5e545df90fc9814c60a8a5a8d20f22b2c3 (diff)
downloadmariadb-git-eba44874ca9fc317696630cb371623142289fa99.tar.gz
MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.
- Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r--mysys/mf_iocache.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 0c2c1da354c..a52ea2c5c40 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -154,8 +154,8 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
my_off_t pos;
my_off_t end_of_file= ~(my_off_t) 0;
DBUG_ENTER("init_io_cache");
- DBUG_PRINT("enter",("cache: 0x%lx type: %d pos: %ld",
- (ulong) info, (int) type, (ulong) seek_offset));
+ DBUG_PRINT("enter",("cache:%p type: %d pos: %llu",
+ info, (int) type, (ulonglong) seek_offset));
info->file= file;
info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */
@@ -437,8 +437,8 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
my_bool clear_cache)
{
DBUG_ENTER("reinit_io_cache");
- DBUG_PRINT("enter",("cache: 0x%lx type: %d seek_offset: %lu clear_cache: %d",
- (ulong) info, type, (ulong) seek_offset,
+ DBUG_PRINT("enter",("cache:%p type: %d seek_offset: %llu clear_cache: %d",
+ info, type, (ulonglong) seek_offset,
(int) clear_cache));
DBUG_ASSERT(type == READ_CACHE || type == WRITE_CACHE);
@@ -865,10 +865,10 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads)
{
DBUG_ENTER("init_io_cache_share");
- DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx "
- "write_cache: 0x%lx threads: %u",
- (long) read_cache, (long) cshare,
- (long) write_cache, num_threads));
+ DBUG_PRINT("io_cache_share", ("read_cache: %p share: %p "
+ "write_cache: %p threads: %u",
+ read_cache, cshare,
+ write_cache, num_threads));
DBUG_ASSERT(num_threads > 1);
DBUG_ASSERT(read_cache->type == READ_CACHE);
@@ -930,9 +930,9 @@ void remove_io_thread(IO_CACHE *cache)
flush_io_cache(cache);
mysql_mutex_lock(&cshare->mutex);
- DBUG_PRINT("io_cache_share", ("%s: 0x%lx",
+ DBUG_PRINT("io_cache_share", ("%s: %p",
(cache == cshare->source_cache) ?
- "writer" : "reader", (long) cache));
+ "writer" : "reader", cache));
/* Remove from share. */
total= --cshare->total_threads;
@@ -1006,9 +1006,9 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
/* Enter the lock. */
mysql_mutex_lock(&cshare->mutex);
cshare->running_threads--;
- DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
+ DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u",
(cache == cshare->source_cache) ?
- "writer" : "reader", (long) cache, (ulong) pos,
+ "writer" : "reader", cache, (ulong) pos,
cshare->running_threads));
if (cshare->source_cache)
@@ -1145,10 +1145,10 @@ static void unlock_io_cache(IO_CACHE *cache)
{
IO_CACHE_SHARE *cshare= cache->share;
DBUG_ENTER("unlock_io_cache");
- DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
+ DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u",
(cache == cshare->source_cache) ?
"writer" : "reader",
- (long) cache, (ulong) cshare->pos_in_file,
+ cache, (ulong) cshare->pos_in_file,
cshare->total_threads));
cshare->running_threads= cshare->total_threads;
@@ -1899,7 +1899,7 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
size_t length;
my_bool append_cache= (info->type == SEQ_READ_APPEND);
DBUG_ENTER("my_b_flush_io_cache");
- DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
+ DBUG_PRINT("enter", ("cache: %p", info));
if (!append_cache)
need_append_buffer_lock= 0;
@@ -1977,7 +1977,7 @@ int end_io_cache(IO_CACHE *info)
{
int error=0;
DBUG_ENTER("end_io_cache");
- DBUG_PRINT("enter",("cache: 0x%lx", (ulong) info));
+ DBUG_PRINT("enter",("cache: %p", info));
/*
Every thread must call remove_io_thread(). The last one destroys