1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-21907: Fix some -Wconversion outside InnoDB

Some .c and .cc files are compiled as part of Mariabackup.
Enabling -Wconversion for InnoDB would also enable it for
Mariabackup. The .h files are being included during
InnoDB or Mariabackup compilation.

Notably, GCC 5 (but not GCC 4 or 6 or later versions)
would report -Wconversion for x|=y when the type is
unsigned char. So, we will either write x=(uchar)(x|y)
or disable the -Wconversion warning for GCC 5.

bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit(), bitmap_is_set():
Always implement as inline functions.
This commit is contained in:
Marko Mäkelä
2020-03-12 19:44:52 +02:00
parent c7920fa8ff
commit d82ac8d374
13 changed files with 137 additions and 156 deletions

View File

@ -721,7 +721,7 @@ public:
if (m_error)
return true;
to_hh24mmssff(ltime, MYSQL_TIMESTAMP_TIME);
ltime->hour+= to_days_abs() * 24;
ltime->hour+= static_cast<unsigned>(to_days_abs() * 24);
return adjust_time_range_with_warn(thd, ltime, decimals);
}
bool to_datetime(MYSQL_TIME *ltime) const
@ -906,7 +906,8 @@ protected:
my_decimal *to_decimal(my_decimal *to) const;
static double to_double(bool negate, ulonglong num, ulong frac)
{
double d= (double) num + frac / (double) TIME_SECOND_PART_FACTOR;
double d= static_cast<double>(num) + static_cast<double>(frac) /
TIME_SECOND_PART_FACTOR;
return negate ? -d : d;
}
longlong to_packed() const { return ::pack_time(this); }
@ -1034,7 +1035,7 @@ protected:
{
return ::check_date(this, flags, warn);
}
void time_hhmmssff_set_max(ulong max_hour)
void time_hhmmssff_set_max(uint max_hour)
{
hour= max_hour;
minute= TIME_MAX_MINUTE;
@ -3201,7 +3202,7 @@ public:
{ }
uchar *ptr() const { return m_ptr; }
uchar offs() const { return m_offs; }
uchar bit() const { return m_ptr ? ((uchar) 1) << m_offs : 0; }
uchar bit() const { return static_cast<uchar>(m_ptr ? 1U << m_offs : 0); }
void inc()
{
DBUG_ASSERT(m_ptr);