From 3dfeae0e221c7ced19372383df5eef1bafc7fe6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 25 Nov 2020 11:32:49 +0200 Subject: Cleanup: Fix Intel compiler warnings about sign conversions --- storage/innobase/btr/btr0cur.cc | 4 ++-- storage/innobase/include/rw_lock.h | 4 ++-- storage/innobase/page/page0cur.cc | 2 +- storage/innobase/row/row0merge.cc | 4 ++-- storage/innobase/trx/trx0rec.cc | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 846d8ecfd7e..9efa2d8f8bd 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -4158,7 +4158,7 @@ void btr_cur_upd_rec_in_place(rec_t *rec, const dict_index_t *index, } ulint l = rec_get_1byte_offs_flag(rec) ? (n + 1) : (n + 1) * 2; - byte* b = &rec[-REC_N_OLD_EXTRA_BYTES - l]; + byte* b = rec - REC_N_OLD_EXTRA_BYTES - l; compile_time_assert(REC_1BYTE_SQL_NULL_MASK << 8 == REC_2BYTE_SQL_NULL_MASK); mtr->write<1>(*block, b, @@ -4181,7 +4181,7 @@ void btr_cur_upd_rec_in_place(rec_t *rec, const dict_index_t *index, ut_ad(len == rec_get_nth_field_size(rec, n)); ulint l = rec_get_1byte_offs_flag(rec) ? (n + 1) : (n + 1) * 2; - byte* b = &rec[-REC_N_OLD_EXTRA_BYTES - l]; + byte* b = rec - REC_N_OLD_EXTRA_BYTES - l; compile_time_assert(REC_1BYTE_SQL_NULL_MASK << 8 == REC_2BYTE_SQL_NULL_MASK); mtr->write<1>(*block, b, diff --git a/storage/innobase/include/rw_lock.h b/storage/innobase/include/rw_lock.h index 9fcafacc426..b50a76fa779 100644 --- a/storage/innobase/include/rw_lock.h +++ b/storage/innobase/include/rw_lock.h @@ -30,9 +30,9 @@ protected: /** Available lock */ static constexpr uint32_t UNLOCKED= 0; /** Flag to indicate that write_lock() is being held */ - static constexpr uint32_t WRITER= 1 << 31; + static constexpr uint32_t WRITER= 1U << 31; /** Flag to indicate that write_lock_wait() is pending */ - static constexpr uint32_t WRITER_WAITING= 1 << 30; + static constexpr uint32_t WRITER_WAITING= 1U << 30; /** Flag to indicate that write_lock() or write_lock_wait() is pending */ static constexpr uint32_t WRITER_PENDING= WRITER | WRITER_WAITING; diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 5ca0d120a10..781884842ef 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -2683,7 +2683,7 @@ corrupted: data_len-= enc_hdr_l >> 3; data= &static_cast(data)[enc_hdr_l >> 3]; - memcpy(buf, &prev_rec[-REC_N_NEW_EXTRA_BYTES - hdr_c], hdr_c); + memcpy(buf, prev_rec - REC_N_NEW_EXTRA_BYTES - hdr_c, hdr_c); buf+= hdr_c; *buf++= static_cast((enc_hdr_l & 3) << 4); /* info_bits; n_owned=0 */ *buf++= static_cast(h >> 5); /* MSB of heap number */ diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 558bf6d5a07..e306cb3429b 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1820,8 +1820,8 @@ row_merge_read_clustered_index( based on that. */ clust_index = dict_table_get_first_index(old_table); - const ulint old_trx_id_col = DATA_TRX_ID - DATA_N_SYS_COLS - + ulint(old_table->n_cols); + const ulint old_trx_id_col = ulint(old_table->n_cols) + - (DATA_N_SYS_COLS - DATA_TRX_ID); ut_ad(old_table->cols[old_trx_id_col].mtype == DATA_SYS); ut_ad(old_table->cols[old_trx_id_col].prtype == (DATA_TRX_ID | DATA_NOT_NULL)); diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 49b0a21330d..1df61ac5b56 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -2455,7 +2455,7 @@ trx_undo_prev_version_build( == rec_get_nth_field_size(rec, n)); ulint l = rec_get_1byte_offs_flag(*old_vers) ? (n + 1) : (n + 1) * 2; - (*old_vers)[-REC_N_OLD_EXTRA_BYTES - l] + *(*old_vers - REC_N_OLD_EXTRA_BYTES - l) &= byte(~REC_1BYTE_SQL_NULL_MASK); } } -- cgit v1.2.1