mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-21174: Fix the 32-bit build
mtr_t::write(): Add explicit narrowing type casts to avoid warnings about lossy implicit conversions.
This commit is contained in:
parent
af5947f433
commit
2ac0e64cad
1 changed files with 6 additions and 3 deletions
|
@ -109,17 +109,20 @@ inline void mtr_t::write(const buf_block_t &block, byte *ptr, V val)
|
|||
case 1:
|
||||
if (w == OPT && mach_read_from_1(ptr) == val) return;
|
||||
ut_ad(w != NORMAL || mach_read_from_1(ptr) != val);
|
||||
mach_write_to_1(ptr, val);
|
||||
ut_ad(val == static_cast<byte>(val));
|
||||
*ptr= static_cast<byte>(val);
|
||||
break;
|
||||
case 2:
|
||||
ut_ad(val == static_cast<uint16_t>(val));
|
||||
if (w == OPT && mach_read_from_2(ptr) == val) return;
|
||||
ut_ad(w != NORMAL || mach_read_from_2(ptr) != val);
|
||||
mach_write_to_2(ptr, val);
|
||||
mach_write_to_2(ptr, static_cast<uint16_t>(val));
|
||||
break;
|
||||
case 4:
|
||||
ut_ad(val == static_cast<uint32_t>(val));
|
||||
if (w == OPT && mach_read_from_4(ptr) == val) return;
|
||||
ut_ad(w != NORMAL || mach_read_from_4(ptr) != val);
|
||||
mach_write_to_4(ptr, val);
|
||||
mach_write_to_4(ptr, static_cast<uint32_t>(val));
|
||||
break;
|
||||
case 8:
|
||||
if (w == OPT && mach_read_from_8(ptr) == val) return;
|
||||
|
|
Loading…
Reference in a new issue