Commit e9760189 authored by marko's avatar marko

branches/zip: Add const qualifiers or in/out comments to some function

parameters in log0log.
parent 184ee488
2009-03-20 The InnoDB Team
* include/log0log.h, include/log0log.ic, log/log0log.c:
Add in/out comments or const qualifiers to some function
parameters as appropriate.
2009-03-20 The InnoDB Team
* dict/dict0boot.c, dict/dict0dict.c, fsp/fsp0fsp.c,
......
......@@ -261,10 +261,10 @@ UNIV_INTERN
void
log_checkpoint_get_nth_group_info(
/*==============================*/
byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */
ulint* offset);/* out: archived file offset */
const byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */
ulint* offset);/* out: archived file offset */
/**********************************************************
Writes checkpoint info to groups. */
UNIV_INTERN
......@@ -382,7 +382,7 @@ UNIV_INTERN
void
log_group_set_fields(
/*=================*/
log_group_t* group, /* in: group */
log_group_t* group, /* in/out: group */
ib_uint64_t lsn); /* in: lsn for which the values should be
set */
/**********************************************************
......@@ -392,42 +392,44 @@ UNIV_INTERN
ulint
log_group_get_capacity(
/*===================*/
/* out: capacity in bytes */
log_group_t* group); /* in: log group */
/* out: capacity in bytes */
const log_group_t* group); /* in: log group */
/****************************************************************
Gets a log block flush bit. */
UNIV_INLINE
ibool
log_block_get_flush_bit(
/*====================*/
/* out: TRUE if this block was the first
to be written in a log flush */
byte* log_block); /* in: log block */
/* out: TRUE if this block was
the first to be written in a
log flush */
const byte* log_block); /* in: log block */
/****************************************************************
Gets a log block number stored in the header. */
UNIV_INLINE
ulint
log_block_get_hdr_no(
/*=================*/
/* out: log block number stored in the block
header */
byte* log_block); /* in: log block */
/* out: log block number
stored in the block header */
const byte* log_block); /* in: log block */
/****************************************************************
Gets a log block data length. */
UNIV_INLINE
ulint
log_block_get_data_len(
/*===================*/
/* out: log block data length measured as a
byte offset from the block start */
byte* log_block); /* in: log block */
/* out: log block data length
measured as a byte offset from
the block start */
const byte* log_block); /* in: log block */
/****************************************************************
Sets the log block data length. */
UNIV_INLINE
void
log_block_set_data_len(
/*===================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint len); /* in: data length */
/****************************************************************
Calculates the checksum for a log block. */
......@@ -451,7 +453,7 @@ UNIV_INLINE
void
log_block_set_checksum(
/*===================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint checksum); /* in: checksum */
/****************************************************************
Gets a log block first mtr log record group offset. */
......@@ -459,16 +461,17 @@ UNIV_INLINE
ulint
log_block_get_first_rec_group(
/*==========================*/
/* out: first mtr log record group byte offset
from the block start, 0 if none */
byte* log_block); /* in: log block */
/* out: first mtr log record
group byte offset from the
block start, 0 if none */
const byte* log_block); /* in: log block */
/****************************************************************
Sets the log block first mtr log record group offset. */
UNIV_INLINE
void
log_block_set_first_rec_group(
/*==========================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint offset); /* in: offset, 0 if none */
/****************************************************************
Gets a log block checkpoint number field (4 lowest bytes). */
......@@ -476,8 +479,9 @@ UNIV_INLINE
ulint
log_block_get_checkpoint_no(
/*========================*/
/* out: checkpoint no (4 lowest bytes) */
byte* log_block); /* in: log block */
/* out: checkpoint no (4
lowest bytes) */
const byte* log_block); /* in: log block */
/****************************************************************
Initializes a log block in the log buffer. */
UNIV_INLINE
......
......@@ -45,9 +45,10 @@ UNIV_INLINE
ibool
log_block_get_flush_bit(
/*====================*/
/* out: TRUE if this block was the first
to be written in a log flush */
byte* log_block) /* in: log block */
/* out: TRUE if this block was
the first to be written in a
log flush */
const byte* log_block) /* in: log block */
{
if (LOG_BLOCK_FLUSH_BIT_MASK
& mach_read_from_4(log_block + LOG_BLOCK_HDR_NO)) {
......@@ -64,7 +65,7 @@ UNIV_INLINE
void
log_block_set_flush_bit(
/*====================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ibool val) /* in: value to set */
{
ulint field;
......@@ -86,9 +87,9 @@ UNIV_INLINE
ulint
log_block_get_hdr_no(
/*=================*/
/* out: log block number stored in the block
header */
byte* log_block) /* in: log block */
/* out: log block number
stored in the block header */
const byte* log_block) /* in: log block */
{
return(~LOG_BLOCK_FLUSH_BIT_MASK
& mach_read_from_4(log_block + LOG_BLOCK_HDR_NO));
......@@ -101,7 +102,7 @@ UNIV_INLINE
void
log_block_set_hdr_no(
/*=================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint n) /* in: log block number: must be > 0 and
< LOG_BLOCK_FLUSH_BIT_MASK */
{
......@@ -117,9 +118,10 @@ UNIV_INLINE
ulint
log_block_get_data_len(
/*===================*/
/* out: log block data length measured as a
byte offset from the block start */
byte* log_block) /* in: log block */
/* out: log block data length
measured as a byte offset from
the block start */
const byte* log_block) /* in: log block */
{
return(mach_read_from_2(log_block + LOG_BLOCK_HDR_DATA_LEN));
}
......@@ -130,7 +132,7 @@ UNIV_INLINE
void
log_block_set_data_len(
/*===================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint len) /* in: data length */
{
mach_write_to_2(log_block + LOG_BLOCK_HDR_DATA_LEN, len);
......@@ -142,9 +144,10 @@ UNIV_INLINE
ulint
log_block_get_first_rec_group(
/*==========================*/
/* out: first mtr log record group byte offset
from the block start, 0 if none */
byte* log_block) /* in: log block */
/* out: first mtr log record
group byte offset from the
block start, 0 if none */
const byte* log_block) /* in: log block */
{
return(mach_read_from_2(log_block + LOG_BLOCK_FIRST_REC_GROUP));
}
......@@ -155,7 +158,7 @@ UNIV_INLINE
void
log_block_set_first_rec_group(
/*==========================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint offset) /* in: offset, 0 if none */
{
mach_write_to_2(log_block + LOG_BLOCK_FIRST_REC_GROUP, offset);
......@@ -167,8 +170,9 @@ UNIV_INLINE
ulint
log_block_get_checkpoint_no(
/*========================*/
/* out: checkpoint no (4 lowest bytes) */
byte* log_block) /* in: log block */
/* out: checkpoint no (4
lowest bytes) */
const byte* log_block) /* in: log block */
{
return(mach_read_from_4(log_block + LOG_BLOCK_CHECKPOINT_NO));
}
......@@ -179,7 +183,7 @@ UNIV_INLINE
void
log_block_set_checkpoint_no(
/*========================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ib_uint64_t no) /* in: checkpoint no */
{
mach_write_to_4(log_block + LOG_BLOCK_CHECKPOINT_NO, (ulint) no);
......@@ -247,7 +251,7 @@ UNIV_INLINE
void
log_block_set_checksum(
/*===================*/
byte* log_block, /* in: log block */
byte* log_block, /* in/out: log block */
ulint checksum) /* in: checksum */
{
mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE
......
......@@ -468,8 +468,8 @@ UNIV_INTERN
ulint
log_group_get_capacity(
/*===================*/
/* out: capacity in bytes */
log_group_t* group) /* in: log group */
/* out: capacity in bytes */
const log_group_t* group) /* in: log group */
{
ut_ad(mutex_own(&(log_sys->mutex)));
......@@ -483,9 +483,10 @@ UNIV_INLINE
ulint
log_group_calc_size_offset(
/*=======================*/
/* out: size offset (<= offset) */
ulint offset, /* in: real offset within the log group */
log_group_t* group) /* in: log group */
/* out: size offset (<= offset) */
ulint offset, /* in: real offset within the
log group */
const log_group_t* group) /* in: log group */
{
ut_ad(mutex_own(&(log_sys->mutex)));
......@@ -499,9 +500,10 @@ UNIV_INLINE
ulint
log_group_calc_real_offset(
/*=======================*/
/* out: real offset (>= offset) */
ulint offset, /* in: size offset within the log group */
log_group_t* group) /* in: log group */
/* out: real offset (>= offset) */
ulint offset, /* in: size offset within the
log group */
const log_group_t* group) /* in: log group */
{
ut_ad(mutex_own(&(log_sys->mutex)));
......@@ -515,10 +517,10 @@ static
ulint
log_group_calc_lsn_offset(
/*======================*/
/* out: offset within the log group */
ib_uint64_t lsn, /* in: lsn, must be within 4 GB of
group->lsn */
log_group_t* group) /* in: log group */
/* out: offset within the log group */
ib_uint64_t lsn, /* in: lsn, must be within 4 GB of
group->lsn */
const log_group_t* group) /* in: log group */
{
ib_uint64_t gr_lsn;
ib_int64_t gr_lsn_size_offset;
......@@ -1665,10 +1667,10 @@ UNIV_INTERN
void
log_checkpoint_get_nth_group_info(
/*==============================*/
byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */
ulint* offset) /* out: archived file offset */
const byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */
ulint* offset) /* out: archived file offset */
{
ut_ad(n < LOG_MAX_N_GROUPS);
......
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