diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-03-01 08:27:39 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-03-07 19:07:27 +0200 |
commit | 89d80c1b0be94639d0913dee7b6a284c32787b09 (patch) | |
tree | a08340d45a09b067df4490259f68b5a3f9d2fa03 /storage/innobase/btr/btr0cur.cc | |
parent | d2f5e624223fe502ddf4c6f42062c29edb988627 (diff) | |
download | mariadb-git-89d80c1b0be94639d0913dee7b6a284c32787b09.tar.gz |
Fix many -Wconversion warnings.
Define my_thread_id as an unsigned type, to avoid mismatch with
ulonglong. Change some parameters to this type.
Use size_t in a few more places.
Declare many flag constants as unsigned to avoid sign mismatch
when shifting bits or applying the unary ~ operator.
When applying the unary ~ operator to enum constants, explictly
cast the result to an unsigned type, because enum constants can
be treated as signed.
In InnoDB, change the source code line number parameters from
ulint to unsigned type. Also, make some InnoDB functions return
a narrower type (unsigned or uint32_t instead of ulint;
bool instead of ibool).
Diffstat (limited to 'storage/innobase/btr/btr0cur.cc')
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 0abc930c11d..06b5b66c2aa 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -148,7 +148,7 @@ can be released by page reorganize, then it is reorganized */ @param not_empty table not empty @return estimated table wide stats from sampled value */ #define BTR_TABLE_STATS_FROM_SAMPLE(value, index, sample, ext_size, not_empty) \ - (((value) * static_cast<int64_t>(index->stat_n_leaf_pages) \ + (((value) * static_cast<ib_uint64_t>(index->stat_n_leaf_pages) \ + (sample) - 1 + (ext_size) + (not_empty)) / ((sample) + (ext_size))) /* @} */ @@ -414,7 +414,7 @@ btr_cur_optimistic_latch_leaves( ulint* latch_mode, btr_cur_t* cursor, const char* file, - ulint line, + unsigned line, mtr_t* mtr) { ulint mode; @@ -747,7 +747,7 @@ btr_cur_search_to_nth_level( caller currently has on search system: RW_S_LATCH, or 0 */ const char* file, /*!< in: file name */ - ulint line, /*!< in: line where called */ + unsigned line, /*!< in: line where called */ mtr_t* mtr, /*!< in: mtr */ ib_uint64_t autoinc)/*!< in: PAGE_ROOT_AUTO_INC to be written (0 if none) */ @@ -2042,7 +2042,7 @@ btr_cur_open_at_index_side_func( ulint level, /*!< in: level to search for (0=leaf). */ const char* file, /*!< in: file name */ - ulint line, /*!< in: line where called */ + unsigned line, /*!< in: line where called */ mtr_t* mtr) /*!< in/out: mini-transaction */ { page_cur_t* page_cursor; @@ -2414,7 +2414,7 @@ btr_cur_open_at_rnd_pos_func( ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */ btr_cur_t* cursor, /*!< in/out: B-tree cursor */ const char* file, /*!< in: file name */ - ulint line, /*!< in: line where called */ + unsigned line, /*!< in: line where called */ mtr_t* mtr) /*!< in: mtr */ { page_cur_t* page_cursor; @@ -3623,7 +3623,7 @@ btr_cur_update_in_place( ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id - || (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)) + || (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))) == (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG | BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG)); ut_ad(fil_page_index_page_check(btr_cur_get_page(cursor))); @@ -3790,7 +3790,7 @@ btr_cur_optimistic_update( ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id - || (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)) + || (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))) == (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG | BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG)); ut_ad(fil_page_index_page_check(page)); @@ -4123,7 +4123,7 @@ btr_cur_pessimistic_update( ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id - || (flags & ~BTR_KEEP_POS_FLAG) + || (flags & ulint(~BTR_KEEP_POS_FLAG)) == (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG | BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG)); @@ -6231,12 +6231,12 @@ btr_cur_set_ownership_of_extern_field( byte_val = mach_read_from_1(data + local_len + BTR_EXTERN_LEN); if (val) { - byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG); + byte_val &= ~BTR_EXTERN_OWNER_FLAG; } else { #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG ut_a(!(byte_val & BTR_EXTERN_OWNER_FLAG)); #endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */ - byte_val = byte_val | BTR_EXTERN_OWNER_FLAG; + byte_val |= BTR_EXTERN_OWNER_FLAG; } if (page_zip) { |