From c9fe55ff7af8a46856eb3188f41f647cfa608e4e Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 10 Feb 2025 14:32:47 +0100 Subject: [PATCH] MDEV-36056 Fix VS2019 compilation Fix casts introduced by dbfee9fc2bc8 in MDEV-34348 --- mysys/mf_keycache.c | 9 +++++---- storage/maria/ma_pagecache.c | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index a563d52c0e9..2307341ddb2 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -3762,10 +3762,11 @@ static void free_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block) static int cmp_sec_link(const void *_a, const void *_b) { - BLOCK_LINK *const *a= _a; - BLOCK_LINK *const *b= _b; - return (((*a)->hash_link->diskpos < (*b)->hash_link->diskpos) ? -1 : - ((*a)->hash_link->diskpos > (*b)->hash_link->diskpos) ? 1 : 0); + const BLOCK_LINK *a= *(const BLOCK_LINK **)_a; + const BLOCK_LINK *b= *(const BLOCK_LINK **)_b; + + return (a->hash_link->diskpos < b->hash_link->diskpos) ? -1 : + (a->hash_link->diskpos > b->hash_link->diskpos) ? 1 : 0; } diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 1682bd42893..650732f9178 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -4726,10 +4726,10 @@ static my_bool free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, static int cmp_sec_link(const void *a_, const void *b_) { - PAGECACHE_BLOCK_LINK *const *a= a_; - PAGECACHE_BLOCK_LINK *const *b= b_; - return (((*a)->hash_link->pageno < (*b)->hash_link->pageno) ? -1 : - ((*a)->hash_link->pageno > (*b)->hash_link->pageno) ? 1 : 0); + const PAGECACHE_BLOCK_LINK *a= *(const PAGECACHE_BLOCK_LINK **) a_; + const PAGECACHE_BLOCK_LINK *b= *(const PAGECACHE_BLOCK_LINK **) b_; + return ((a->hash_link->pageno < b->hash_link->pageno) ? -1 : + (a->hash_link->pageno > b->hash_link->pageno) ? 1 : 0); }