MDEV-28389 fixup: Fix compiler warnings

hex_to_ascii(): Add #if around the definition to avoid
clang -Wunused-function. Avoid GCC 5 -Wconversion with a cast.
This commit is contained in:
Marko Mäkelä 2022-06-27 14:50:00 +03:00
parent c86b1389de
commit a75ad73545

View file

@ -1223,10 +1223,13 @@ buf_madvise_do_dump()
}
#endif
#ifndef UNIV_DEBUG
static inline byte hex_to_ascii(byte hex_digit)
{
return hex_digit <= 9 ? '0' + hex_digit : ('a' - 10) + hex_digit;
const int offset= hex_digit <= 9 ? '0' : 'a' - 10;
return byte(hex_digit + offset);
}
#endif
/** Dump a page to stderr.
@param[in] read_buf database page