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:
@@ -226,9 +226,9 @@ UNIV_INLINE
|
||||
void*
|
||||
ut_align_down(
|
||||
/*==========*/
|
||||
/* out: aligned pointer */
|
||||
void* ptr, /* in: pointer */
|
||||
ulint align_no) /* in: align by this number */
|
||||
/* out: aligned pointer */
|
||||
const void* ptr, /* in: pointer */
|
||||
ulint align_no) /* in: align by this number */
|
||||
__attribute__((const));
|
||||
/*************************************************************
|
||||
The following function computes the offset of a pointer from the nearest
|
||||
|
||||
Reference in New Issue
Block a user