summaryrefslogtreecommitdiff
path: root/mysys/mf_keycache.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_keycache.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_keycache.c')
-rw-r--r--mysys/mf_keycache.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 34aeb569faf..683e3edecd0 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -609,11 +609,11 @@ int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
keycache->waiting_for_hash_link.last_thread= NULL;
keycache->waiting_for_block.last_thread= NULL;
DBUG_PRINT("exit",
- ("disk_blocks: %d block_root: 0x%lx hash_entries: %d\
- hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx",
- keycache->disk_blocks, (long) keycache->block_root,
- keycache->hash_entries, (long) keycache->hash_root,
- keycache->hash_links, (long) keycache->hash_link_root));
+ ("disk_blocks: %d block_root: %p hash_entries: %d\
+ hash_root: %p hash_links: %d hash_link_root: %p",
+ keycache->disk_blocks, keycache->block_root,
+ keycache->hash_entries, keycache->hash_root,
+ keycache->hash_links, keycache->hash_link_root));
}
else
{
@@ -963,7 +963,7 @@ static
void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup)
{
DBUG_ENTER("end_simple_key_cache");
- DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
+ DBUG_PRINT("enter", ("key_cache: %p", keycache));
if (!keycache->key_cache_inited)
DBUG_VOID_RETURN;
@@ -4366,7 +4366,7 @@ int flush_simple_key_cache_blocks(SIMPLE_KEY_CACHE_CB *keycache,
{
int res= 0;
DBUG_ENTER("flush_key_blocks");
- DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
+ DBUG_PRINT("enter", ("keycache: %p", keycache));
if (!keycache->key_cache_inited)
DBUG_RETURN(0);
@@ -4795,11 +4795,11 @@ void keycache_debug_log_close(void)
static int fail_block(BLOCK_LINK *block)
{
- F_B_PRT("block->next_used: %lx\n", (ulong) block->next_used);
- F_B_PRT("block->prev_used: %lx\n", (ulong) block->prev_used);
- F_B_PRT("block->next_changed: %lx\n", (ulong) block->next_changed);
- F_B_PRT("block->prev_changed: %lx\n", (ulong) block->prev_changed);
- F_B_PRT("block->hash_link: %lx\n", (ulong) block->hash_link);
+ F_B_PRT("block->next_used: %p\n", block->next_used);
+ F_B_PRT("block->prev_used: %p\n", block->prev_used);
+ F_B_PRT("block->next_changed: %p\n", block->next_changed);
+ F_B_PRT("block->prev_changed: %p\n", block->prev_changed);
+ F_B_PRT("block->hash_link: %p\n", block->hash_link);
F_B_PRT("block->status: %u\n", block->status);
F_B_PRT("block->length: %u\n", block->length);
F_B_PRT("block->offset: %u\n", block->offset);
@@ -4810,9 +4810,9 @@ static int fail_block(BLOCK_LINK *block)
static int fail_hlink(HASH_LINK *hlink)
{
- F_B_PRT("hlink->next: %lx\n", (ulong) hlink->next);
- F_B_PRT("hlink->prev: %lx\n", (ulong) hlink->prev);
- F_B_PRT("hlink->block: %lx\n", (ulong) hlink->block);
+ F_B_PRT("hlink->next: %p\n", hlink->next);
+ F_B_PRT("hlink->prev: %p\n", hlink->prev);
+ F_B_PRT("hlink->block: %p\n", hlink->block);
F_B_PRT("hlink->diskpos: %lu\n", (ulong) hlink->diskpos);
F_B_PRT("hlink->file: %d\n", hlink->file);
return 0; /* Let the assert fail. */
@@ -5358,7 +5358,7 @@ void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
uint i;
uint partitions= keycache->partitions;
DBUG_ENTER("partitioned_end_key_cache");
- DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
+ DBUG_PRINT("enter", ("key_cache: %p", keycache));
for (i= 0; i < partitions; i++)
{
@@ -5672,7 +5672,7 @@ int flush_partitioned_key_cache_blocks(PARTITIONED_KEY_CACHE_CB *keycache,
int err= 0;
ulonglong *dirty_part_map= (ulonglong *) file_extra;
DBUG_ENTER("partitioned_flush_key_blocks");
- DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
+ DBUG_PRINT("enter", ("keycache: %p", keycache));
for (i= 0; i < partitions; i++)
{