mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
Correct an 'unresolved identifier' problem caused by an "inline"
function being used before it was defined - "forward" declaration
was insufficient.
innobase/lock/lock0lock.c:
Compile problem on 'build', solved by moving the definition of
'lock_rec_get_nth_bit' to the place of the ("forward") declaration.
It is "inline", and now the body really appears before the first use.
This commit is contained in:
parent
0129f32bfc
commit
3743df6e8e
1 changed files with 23 additions and 31 deletions
|
|
@ -373,7 +373,29 @@ lock_rec_get_nth_bit(
|
|||
/*=================*/
|
||||
/* out: TRUE if bit set */
|
||||
lock_t* lock, /* in: record lock */
|
||||
ulint i); /* in: index of the bit */
|
||||
ulint i) /* in: index of the bit */
|
||||
{
|
||||
ulint byte_index;
|
||||
ulint bit_index;
|
||||
ulint b;
|
||||
|
||||
ut_ad(lock);
|
||||
ut_ad(lock_get_type(lock) == LOCK_REC);
|
||||
|
||||
if (i >= lock->un_member.rec_lock.n_bits) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
byte_index = i / 8;
|
||||
bit_index = i % 8;
|
||||
|
||||
b = (ulint)*((byte*)lock + sizeof(lock_t) + byte_index);
|
||||
|
||||
return(ut_bit_get_nth(b, bit_index));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
|
||||
#define lock_mutex_exit_kernel() mutex_exit(&kernel_mutex)
|
||||
|
|
@ -883,36 +905,6 @@ lock_rec_get_n_bits(
|
|||
return(lock->un_member.rec_lock.n_bits);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the nth bit of a record lock. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
lock_rec_get_nth_bit(
|
||||
/*=================*/
|
||||
/* out: TRUE if bit set */
|
||||
lock_t* lock, /* in: record lock */
|
||||
ulint i) /* in: index of the bit */
|
||||
{
|
||||
ulint byte_index;
|
||||
ulint bit_index;
|
||||
ulint b;
|
||||
|
||||
ut_ad(lock);
|
||||
ut_ad(lock_get_type(lock) == LOCK_REC);
|
||||
|
||||
if (i >= lock->un_member.rec_lock.n_bits) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
byte_index = i / 8;
|
||||
bit_index = i % 8;
|
||||
|
||||
b = (ulint)*((byte*)lock + sizeof(lock_t) + byte_index);
|
||||
|
||||
return(ut_bit_get_nth(b, bit_index));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Sets the nth bit of a record lock to TRUE. */
|
||||
UNIV_INLINE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue