From 952b4b8de2311d85d2cbd814154d39455b0be903 Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 1 Aug 2007 07:49:43 +0000 Subject: [PATCH] branches/zip: lock_rec_print(), lock_table_print(), lock_rec_get_prev(): Add a const qualifier to lock_t*. --- include/lock0lock.h | 8 ++++---- lock/lock0lock.c | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/lock0lock.h b/include/lock0lock.h index 94489abf1be..d58f63970ca 100644 --- a/include/lock0lock.h +++ b/include/lock0lock.h @@ -615,16 +615,16 @@ Prints info of a table lock. */ void lock_table_print( /*=============*/ - FILE* file, /* in: file where to print */ - lock_t* lock); /* in: table type lock */ + FILE* file, /* in: file where to print */ + const lock_t* lock); /* in: table type lock */ /************************************************************************* Prints info of a record lock. */ void lock_rec_print( /*===========*/ - FILE* file, /* in: file where to print */ - lock_t* lock); /* in: record type lock */ + FILE* file, /* in: file where to print */ + const lock_t* lock); /* in: record type lock */ /************************************************************************* Prints info of locks for all transactions. */ diff --git a/lock/lock0lock.c b/lock/lock0lock.c index f2ee9ada1c9..fbbb91b030c 100644 --- a/lock/lock0lock.c +++ b/lock/lock0lock.c @@ -1360,18 +1360,18 @@ lock_rec_copy( /************************************************************************* Gets the previous record lock set on a record. */ static -lock_t* +const lock_t* lock_rec_get_prev( /*==============*/ - /* out: previous lock on the same record, NULL if - none exists */ - lock_t* in_lock,/* in: record lock */ - ulint heap_no)/* in: heap number of the record */ + /* out: previous lock on the same + record, NULL if none exists */ + const lock_t* in_lock,/* in: record lock */ + ulint heap_no)/* in: heap number of the record */ { - lock_t* lock; - ulint space; - ulint page_no; - lock_t* found_lock = NULL; + const lock_t* lock; + ulint space; + ulint page_no; + const lock_t* found_lock = NULL; ut_ad(mutex_own(&kernel_mutex)); ut_ad(lock_get_type(in_lock) == LOCK_REC); @@ -1394,7 +1394,7 @@ lock_rec_get_prev( found_lock = lock; } - lock = lock_rec_get_next_on_page(lock); + lock = lock_rec_get_next_on_page((lock_t*) lock); } } @@ -3439,7 +3439,7 @@ lock_deadlock_recursive( ut_ad(lock_get_type(lock) == LOCK_REC); ut_a(bit_no != ULINT_UNDEFINED); - lock = lock_rec_get_prev(lock, bit_no); + lock = (lock_t*) lock_rec_get_prev(lock, bit_no); } if (lock == NULL) { @@ -4191,8 +4191,8 @@ Prints info of a table lock. */ void lock_table_print( /*=============*/ - FILE* file, /* in: file where to print */ - lock_t* lock) /* in: table type lock */ + FILE* file, /* in: file where to print */ + const lock_t* lock) /* in: table type lock */ { ut_ad(mutex_own(&kernel_mutex)); ut_a(lock_get_type(lock) == LOCK_TABLE); @@ -4231,8 +4231,8 @@ Prints info of a record lock. */ void lock_rec_print( /*===========*/ - FILE* file, /* in: file where to print */ - lock_t* lock) /* in: record type lock */ + FILE* file, /* in: file where to print */ + const lock_t* lock) /* in: record type lock */ { buf_block_t* block; ulint space;