Commit 1703834d authored by Marko Mäkelä's avatar Marko Mäkelä

mach_ull_parse_compressed(): Move to .ic file to silence a GCC warning

about trx_id being possibly uninitialized in trx_undo_parse_page_header().
The warning remains when UNIV_DEBUG or UNIV_MUST_NOT_INLINE is enabled.
parent bdf60d16
......@@ -283,7 +283,7 @@ mach_parse_compressed(
Reads a 64-bit integer in a compressed form
if the log record fully contains it.
@return pointer to end of the stored field, NULL if not complete */
UNIV_INTERN
UNIV_INLINE
byte*
mach_ull_parse_compressed(
/*======================*/
......
......@@ -496,6 +496,46 @@ mach_ull_read_much_compressed(
return(n);
}
/*********************************************************//**
Reads a 64-bit integer in a compressed form
if the log record fully contains it.
@return pointer to end of the stored field, NULL if not complete */
UNIV_INLINE
byte*
mach_ull_parse_compressed(
/*======================*/
byte* ptr, /* in: pointer to buffer from where to read */
byte* end_ptr,/* in: pointer to end of the buffer */
ib_uint64_t* val) /* out: read value */
{
ulint size;
ut_ad(ptr);
ut_ad(end_ptr);
ut_ad(val);
if (end_ptr < ptr + 5) {
return(NULL);
}
*val = mach_read_compressed(ptr);
size = mach_get_compressed_size((ulint) *val);
ptr += size;
if (end_ptr < ptr + 4) {
return(NULL);
}
*val <<= 32;
*val |= mach_read_from_4(ptr);
return(ptr + 4);
}
#ifndef UNIV_HOTBACKUP
/*********************************************************//**
Reads a double. It is stored in a little-endian format.
......
......@@ -92,43 +92,3 @@ mach_parse_compressed(
return(ptr + 5);
}
}
/*********************************************************//**
Reads a 64-bit integer in a compressed form
if the log record fully contains it.
@return pointer to end of the stored field, NULL if not complete */
UNIV_INTERN
byte*
mach_ull_parse_compressed(
/*======================*/
byte* ptr, /* in: pointer to buffer from where to read */
byte* end_ptr,/* in: pointer to end of the buffer */
ib_uint64_t* val) /* out: read value */
{
ulint size;
ut_ad(ptr);
ut_ad(end_ptr);
ut_ad(val);
if (end_ptr < ptr + 5) {
return(NULL);
}
*val = mach_read_compressed(ptr);
size = mach_get_compressed_size((ulint) *val);
ptr += size;
if (end_ptr < ptr + 4) {
return(NULL);
}
*val <<= 32;
*val |= mach_read_from_4(ptr);
return(ptr + 4);
}
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