Commit c57b2079 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21907: Fix or disable -Wconversion on GCC 5.3.0 i386

Fix or disable those -Wconversion that were missed by GCC 5.4.0
targeting AMD64.
parent f2245252
......@@ -20939,8 +20939,15 @@ innobase_get_computed_value(
}
if (len == UNIV_SQL_NULL) {
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
memcpy(mysql_rec + templ->mysql_col_offset,
static_cast<const byte*>(
index->table->vc_templ->default_rec
......
......@@ -643,7 +643,14 @@ ibuf_bitmap_page_set_bits(
} else {
ut_ad(val <= 1);
b &= static_cast<byte>(~(1U << bit_offset));
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
b |= static_cast<byte>(val << bit_offset);
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
}
mtr->write<1,mtr_t::OPT>(*block, map_byte, b);
......
......@@ -2094,7 +2094,7 @@ static void page_mem_free(const buf_block_t &block, rec_t *rec,
? ((n_heap & 0x8000)
? static_cast<uint16_t>(free - rec)
: static_cast<uint16_t>(free - block.frame))
: 0;
: uint16_t{0};
mach_write_to_2(rec - REC_NEXT, next);
}
else
......
......@@ -448,8 +448,9 @@ rec_init_offsets_comp_ordinary(
} while (field++, rec_offs_base(offsets)[++i] = len,
i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets)
= static_cast<offset_t>(rec - (lens + 1)) | REC_OFFS_COMPACT | any;
*rec_offs_base(offsets) = static_cast<offset_t>((rec - (lens + 1))
| REC_OFFS_COMPACT
| any);
}
#ifdef UNIV_DEBUG
......@@ -737,8 +738,8 @@ rec_init_offsets(
} while (++i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets)
= static_cast<offset_t>(rec - (lens + 1))
| REC_OFFS_COMPACT;
= static_cast<offset_t>((rec - (lens + 1))
| REC_OFFS_COMPACT);
} else {
/* Old-style record: determine extra size and end offsets */
offs = REC_N_OLD_EXTRA_BYTES;
......@@ -1591,7 +1592,14 @@ rec_convert_dtuple_to_rec_comp(
/* set the null flag if necessary */
if (dfield_is_null(field)) {
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
*nulls |= static_cast<byte>(null_mask);
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
null_mask <<= 1;
continue;
}
......@@ -1626,21 +1634,20 @@ rec_convert_dtuple_to_rec_comp(
ut_ad(DATA_BIG_COL(ifield->col));
ut_ad(len <= REC_ANTELOPE_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE);
*lens-- = (byte) (len >> 8) | 0xc0;
*lens-- = (byte) len;
*lens-- = static_cast<byte>(len >> 8 | 0xc0);
*lens-- = static_cast<byte>(len);
} else {
ut_ad(len <= field->type.len
|| DATA_LARGE_MTYPE(field->type.mtype)
|| !strcmp(index->name,
FTS_INDEX_TABLE_IND_NAME));
if (len < 128 || !DATA_BIG_LEN_MTYPE(
field->type.len, field->type.mtype)) {
*lens-- = (byte) len;
field->type.len, field->type.mtype)) {
*lens-- = static_cast<byte>(len);
} else {
ut_ad(len < 16384);
*lens-- = (byte) (len >> 8) | 0x80;
*lens-- = (byte) len;
*lens-- = static_cast<byte>(len >> 8 | 0x80);
*lens-- = static_cast<byte>(len);
}
}
......
......@@ -2951,8 +2951,15 @@ row_sel_store_mysql_field(
UNIV_MEM_ASSERT_RW(prebuilt->default_rec
+ templ->mysql_col_offset,
templ->mysql_col_len);
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
memcpy(mysql_rec + templ->mysql_col_offset,
(const byte*) prebuilt->default_rec
+ templ->mysql_col_offset,
......@@ -3048,8 +3055,15 @@ static bool row_sel_store_mysql_rec(
&& !prebuilt->m_read_virtual_key)) {
/* Initialize the NULL bit. */
if (templ->mysql_null_bit_mask) {
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
}
continue;
}
......@@ -3084,8 +3098,15 @@ static bool row_sel_store_mysql_rec(
}
if (dfield->len == UNIV_SQL_NULL) {
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
memcpy(mysql_rec
+ templ->mysql_col_offset,
(const byte*) prebuilt->default_rec
......@@ -3641,10 +3662,17 @@ row_sel_copy_cached_fields_for_mysql(
/* Copy NULL bit of the current field from cached_rec
to buf */
if (templ->mysql_null_bit_mask) {
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 may need this here */
#endif
buf[templ->mysql_null_byte_offset]
^= (buf[templ->mysql_null_byte_offset]
^ cached_rec[templ->mysql_null_byte_offset])
& (byte) templ->mysql_null_bit_mask;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
}
}
}
......
......@@ -184,7 +184,7 @@ static uint16_t wait_lock_get_heap_no(const lock_t* lock)
{
return lock_get_type(lock) == LOCK_REC
? static_cast<uint16_t>(lock_rec_find_set_bit(lock))
: 0;
: uint16_t{0};
}
/*******************************************************************//**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment