Commit a8b6524b authored by marko's avatar marko

branches/zip: Use ut_dulint_zero and ut_dulint_is_zero whenever possible.

parent f88827d8
......@@ -238,7 +238,7 @@ dict_mem_index_create(
heap = mem_heap_create(DICT_HEAP_SIZE);
index = mem_heap_alloc(heap, sizeof(dict_index_t));
index->id = ut_dulint_create(0, 0);
index->id = ut_dulint_zero;
index->heap = heap;
index->type = type;
......@@ -257,7 +257,7 @@ dict_mem_index_create(
index->cached = FALSE;
index->to_be_dropped = FALSE;
index->trx_id = ut_dulint_create(0, 0);
index->trx_id = ut_dulint_zero;
memset(&index->lock, 0, sizeof index->lock);
#ifdef UNIV_DEBUG
index->magic_n = DICT_INDEX_MAGIC_N;
......
......@@ -1789,8 +1789,7 @@ fsp_seg_inode_page_find_used(
inode = fsp_seg_inode_page_get_nth_inode(
page, i, zip_size, mtr);
if (ut_dulint_cmp(mach_read_from_8(inode + FSEG_ID),
ut_dulint_zero) != 0) {
if (!ut_dulint_is_zero(mach_read_from_8(inode + FSEG_ID))) {
/* This is used */
return(i);
......@@ -1820,8 +1819,7 @@ fsp_seg_inode_page_find_free(
inode = fsp_seg_inode_page_get_nth_inode(
page, i, zip_size, mtr);
if (ut_dulint_cmp(mach_read_from_8(inode + FSEG_ID),
ut_dulint_zero) == 0) {
if (ut_dulint_is_zero(mach_read_from_8(inode + FSEG_ID))) {
/* This is unused */
return(i);
......@@ -2507,7 +2505,7 @@ fseg_alloc_free_page_low(
== FSEG_MAGIC_N_VALUE);
seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0);
ut_ad(!ut_dulint_is_zero(seg_id));
reserved = fseg_n_reserved_pages_low(seg_inode, &used, mtr);
......@@ -3955,9 +3953,8 @@ fsp_validate(
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr);
ut_a(ut_dulint_cmp(
mach_read_from_8(seg_inode + FSEG_ID),
ut_dulint_zero) != 0);
ut_a(!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID)));
fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FREE,
......@@ -4002,9 +3999,8 @@ fsp_validate(
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr);
if (ut_dulint_cmp(
mach_read_from_8(seg_inode + FSEG_ID),
ut_dulint_zero) != 0) {
if (!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID))) {
fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len(
......@@ -4142,9 +4138,8 @@ fsp_print(
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr);
ut_a(ut_dulint_cmp(
mach_read_from_8(seg_inode + FSEG_ID),
ut_dulint_zero) != 0);
ut_a(!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID)));
fseg_print_low(seg_inode, &mtr);
n_segs++;
......@@ -4181,9 +4176,8 @@ fsp_print(
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr);
if (ut_dulint_cmp(
mach_read_from_8(seg_inode + FSEG_ID),
ut_dulint_zero) != 0) {
if (!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID))) {
fseg_print_low(seg_inode, &mtr);
n_segs++;
......
......@@ -4054,8 +4054,7 @@ lock_release_off_kernel(
ut_ad(lock_get_type(lock) & LOCK_TABLE);
if (lock_get_mode(lock) != LOCK_IS
&& 0 != ut_dulint_cmp(trx->undo_no,
ut_dulint_zero)) {
&& !ut_dulint_is_zero(trx->undo_no)) {
/* The trx may have modified the table. We
block the use of the MySQL query cache for
......
......@@ -173,8 +173,7 @@ read_view_oldest_copy_or_open_new(
n = old_view->n_trx_ids;
if (ut_dulint_cmp(old_view->creator_trx_id,
ut_dulint_create(0,0)) != 0) {
if (!ut_dulint_is_zero(old_view->creator_trx_id)) {
n++;
} else {
needs_insert = FALSE;
......@@ -251,7 +250,7 @@ read_view_open_now(
view->creator_trx_id = cr_trx_id;
view->type = VIEW_NORMAL;
view->undo_no = ut_dulint_create(0, 0);
view->undo_no = ut_dulint_zero;
/* No future transactions should be visible in the view */
......
......@@ -526,7 +526,7 @@ row_undo_build_dict_undo_list(
}
/* We will do our own deletes */
trx->table_id = ut_dulint_create(0, 0);
trx->table_id = ut_dulint_zero;
if (trx->dict_undo_list == NULL) {
dict_undo_create_list(trx);
......
......@@ -561,7 +561,7 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t* heap = NULL;
byte* buf;
ulint err;
dulint rec_trx_id = ut_dulint_create(0, 0);
dulint rec_trx_id = ut_dulint_zero;
ut_ad(dict_index_is_clust(index));
ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
......
......@@ -541,7 +541,7 @@ trx_purge_truncate_history(void)
trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no,
&limit_undo_no);
if (ut_dulint_cmp(limit_trx_no, ut_dulint_zero) == 0) {
if (ut_dulint_is_zero(limit_trx_no)) {
limit_trx_no = purge_sys->purge_trx_no;
limit_undo_no = purge_sys->purge_undo_no;
......
......@@ -127,7 +127,7 @@ trx_create(
trx->must_flush_log_later = FALSE;
trx->dict_operation = FALSE;
trx->table_id = ut_dulint_create(0, 0);
trx->table_id = ut_dulint_zero;
trx->dict_undo_list = NULL;
trx->dict_redo_list = NULL;
trx->sync_cb = NULL;
......@@ -1774,7 +1774,7 @@ trx_print(
fputs(", holds adaptive hash latch", f);
}
if (ut_dulint_cmp(trx->undo_no, ut_dulint_zero) != 0) {
if (!ut_dulint_is_zero(trx->undo_no)) {
newline = TRUE;
fprintf(f, ", undo log entries %lu",
(ulong) ut_dulint_get_low(trx->undo_no));
......
......@@ -1120,7 +1120,7 @@ trx_undo_truncate_start(
ut_ad(mutex_own(&(rseg->mutex)));
if (0 == ut_dulint_cmp(limit, ut_dulint_zero)) {
if (ut_dulint_is_zero(limit)) {
return;
}
......
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