1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-13 20:03:16 +03:00

branches/zip: Silence most GCC 4.2.1 warnings about const pointers.

For some reason, GCC 4.2.1 ignores casts (for removing constness)
in calls to inline functions.

page_align(), ut_align_down(): Make the parameter const void*, but still
return a non-const pointer.  This is ugly, but these functions cannot be
replaced with a const-preserving macro in a portable way, given that
the pointer argument is not always pointing to bytes.

buf_block_get_page_zip(): Implement as a const-preserving macro.

buf_frame_get_page_zip(), buf_block_align(): Add const qualifiers.

lock_rec_get_prev(): Silence GCC 4.2.1 warnings.

mlog_write_initial_log_record(), mlog_write_initial_log_record_fast(),
mtr_memo_contains(): Add const qualifier to the pointer.

page_header_get_ptr(): Rewrite as page_header_get_offs(), and
implement as a macro that calls this function.
This commit is contained in:
marko
2007-10-03 12:22:29 +00:00
parent e9507ea69b
commit 2ddbc912e7
20 changed files with 146 additions and 149 deletions

View File

@@ -62,11 +62,11 @@ type and four-byte space and page numbers. */
void
mlog_write_initial_log_record(
/*==========================*/
byte* ptr, /* in: pointer to (inside) a buffer frame
holding the file page where modification
is made */
byte type, /* in: log item type: MLOG_1BYTE, ... */
mtr_t* mtr); /* in: mini-transaction handle */
const byte* ptr, /* in: pointer to (inside) a buffer
frame holding the file page where
modification is made */
byte type, /* in: log item type: MLOG_1BYTE, ... */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************
Writes a log record about an .ibd file create/delete/rename. */
UNIV_INLINE
@@ -140,12 +140,14 @@ UNIV_INLINE
byte*
mlog_write_initial_log_record_fast(
/*===============================*/
/* out: new value of log_ptr */
byte* ptr, /* in: pointer to (inside) a buffer frame holding the
file page where modification is made */
byte type, /* in: log item type: MLOG_1BYTE, ... */
byte* log_ptr,/* in: pointer to mtr log which has been opened */
mtr_t* mtr); /* in: mtr */
/* out: new value of log_ptr */
const byte* ptr, /* in: pointer to (inside) a buffer
frame holding the file page where
modification is made */
byte type, /* in: log item type: MLOG_1BYTE, ... */
byte* log_ptr,/* in: pointer to mtr log which has
been opened */
mtr_t* mtr); /* in: mtr */
/************************************************************
Parses an initial log record written by mlog_write_initial_log_record. */