summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-25 11:32:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-25 11:32:49 +0200
commit3dfeae0e221c7ced19372383df5eef1bafc7fe6e (patch)
tree15a22fcbeee0d9cf4fc0cb1a182895db85373561
parent4a22056c975762891db11eff1bcda157d65cb0b0 (diff)
downloadmariadb-git-3dfeae0e221c7ced19372383df5eef1bafc7fe6e.tar.gz
Cleanup: Fix Intel compiler warnings about sign conversions
-rw-r--r--storage/innobase/btr/btr0cur.cc4
-rw-r--r--storage/innobase/include/rw_lock.h4
-rw-r--r--storage/innobase/page/page0cur.cc2
-rw-r--r--storage/innobase/row/row0merge.cc4
-rw-r--r--storage/innobase/trx/trx0rec.cc2
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<const byte*>(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<byte>((enc_hdr_l & 3) << 4); /* info_bits; n_owned=0 */
*buf++= static_cast<byte>(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);
}
}