Commit 44f9d069 authored by marko's avatar marko

branches/zip: Define buf_block_get_frame() as a const-preserving macro.

parent 14b70068
......@@ -774,16 +774,19 @@ buf_page_set_accessed(
/*==================*/
buf_page_t* bpage, /* in/out: control block */
ibool accessed); /* in: accessed */
#ifdef UNIV_DEBUG
/*************************************************************************
Gets a pointer to the memory frame of a block. */
UNIV_INLINE
buf_frame_t*
buf_block_get_frame(
/*================*/
/* out: pointer to the frame */
buf_block_t* block) /* in: pointer to the control block */
/* out: pointer to the frame */
const buf_block_t* block) /* in: pointer to the control block */
__attribute__((pure));
#else /* UNIV_DEBUG */
# define buf_block_get_frame(block) block->frame
#endif /* UNIV_DEBUG */
/*************************************************************************
Gets the space id of a block. */
UNIV_INLINE
......
......@@ -460,17 +460,18 @@ buf_page_set_accessed(
bpage->accessed = accessed;
}
#ifdef UNIV_DEBUG
/*************************************************************************
Gets a pointer to the memory frame of a block. */
UNIV_INLINE
buf_frame_t*
buf_block_get_frame(
/*================*/
/* out: pointer to the frame */
buf_block_t* block) /* in: pointer to the control block */
/* out: pointer to the frame */
const buf_block_t* block) /* in: pointer to the control block */
{
ut_ad(block);
#ifdef UNIV_DEBUG
switch (buf_block_get_state(block)) {
case BUF_BLOCK_ZIP_FREE:
case BUF_BLOCK_ZIP_PAGE:
......@@ -488,9 +489,9 @@ buf_block_get_frame(
}
ut_error;
ok:
#endif /* UNIV_DEBUG */
return(block->frame);
return((buf_frame_t*) block->frame);
}
#endif /* UNIV_DEBUG */
/*************************************************************************
Gets the space id of a block. */
......
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