enable -Wenum-compare -Wenum-conversion
to make the all headers -std=c++20 clean for those, who need c++20 (some plugins)
This commit is contained in:
parent
16cebed540
commit
29c07643a1
@ -22,6 +22,8 @@ ENDIF()
|
|||||||
SET(MY_WARNING_FLAGS
|
SET(MY_WARNING_FLAGS
|
||||||
-Wall
|
-Wall
|
||||||
-Wdeclaration-after-statement
|
-Wdeclaration-after-statement
|
||||||
|
-Wenum-compare
|
||||||
|
-Wenum-conversion
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wformat-security
|
-Wformat-security
|
||||||
-Wno-format-truncation
|
-Wno-format-truncation
|
||||||
|
@ -132,7 +132,7 @@ int Gcalc_function::count_internal(const char *cur_func, uint set_type,
|
|||||||
int mask= (c_op & op_not) ? 1:0;
|
int mask= (c_op & op_not) ? 1:0;
|
||||||
uint n_ops= c_op & ~(op_any | op_not | v_mask);
|
uint n_ops= c_op & ~(op_any | op_not | v_mask);
|
||||||
uint n_shape= c_op & ~(op_any | op_not | v_mask); /* same as n_ops */
|
uint n_shape= c_op & ~(op_any | op_not | v_mask); /* same as n_ops */
|
||||||
value v_state= (value) (c_op & v_mask);
|
op_type v_state= (op_type) (c_op & v_mask);
|
||||||
int result= 0;
|
int result= 0;
|
||||||
const char *sav_cur_func= cur_func;
|
const char *sav_cur_func= cur_func;
|
||||||
|
|
||||||
|
@ -52,17 +52,15 @@ private:
|
|||||||
int count_internal(const char *cur_func, uint set_type,
|
int count_internal(const char *cur_func, uint set_type,
|
||||||
const char **end);
|
const char **end);
|
||||||
public:
|
public:
|
||||||
enum value
|
|
||||||
{
|
|
||||||
v_empty= 0x0000000,
|
|
||||||
v_find_t= 0x1000000,
|
|
||||||
v_find_f= 0x2000000,
|
|
||||||
v_t_found= 0x3000000,
|
|
||||||
v_f_found= 0x4000000,
|
|
||||||
v_mask= 0x7000000
|
|
||||||
};
|
|
||||||
enum op_type
|
enum op_type
|
||||||
{
|
{
|
||||||
|
v_empty= 0x00000000,
|
||||||
|
v_find_t= 0x01000000,
|
||||||
|
v_find_f= 0x02000000,
|
||||||
|
v_t_found= 0x03000000,
|
||||||
|
v_f_found= 0x04000000,
|
||||||
|
v_mask= 0x07000000,
|
||||||
|
|
||||||
op_not= 0x80000000,
|
op_not= 0x80000000,
|
||||||
op_shape= 0x00000000,
|
op_shape= 0x00000000,
|
||||||
op_union= 0x10000000,
|
op_union= 0x10000000,
|
||||||
|
@ -2636,10 +2636,10 @@ public:
|
|||||||
double import_cost; /* cost of remote operations */
|
double import_cost; /* cost of remote operations */
|
||||||
double mem_cost; /* cost of used memory */
|
double mem_cost; /* cost of used memory */
|
||||||
|
|
||||||
enum { IO_COEFF=1 };
|
static const int IO_COEFF=1;
|
||||||
enum { CPU_COEFF=1 };
|
static const int CPU_COEFF=1;
|
||||||
enum { MEM_COEFF=1 };
|
static const int MEM_COEFF=1;
|
||||||
enum { IMPORT_COEFF=1 };
|
static const int IMPORT_COEFF=1;
|
||||||
|
|
||||||
Cost_estimate()
|
Cost_estimate()
|
||||||
{
|
{
|
||||||
|
@ -5133,8 +5133,8 @@ my_eof(THD *thd)
|
|||||||
|
|
||||||
inline date_conv_mode_t sql_mode_for_dates(THD *thd)
|
inline date_conv_mode_t sql_mode_for_dates(THD *thd)
|
||||||
{
|
{
|
||||||
static_assert((date_conv_mode_t::KNOWN_MODES &
|
static_assert((ulonglong(date_conv_mode_t::KNOWN_MODES) &
|
||||||
time_round_mode_t::KNOWN_MODES) == 0,
|
ulonglong(time_round_mode_t::KNOWN_MODES)) == 0,
|
||||||
"date_conv_mode_t and time_round_mode_t must use different "
|
"date_conv_mode_t and time_round_mode_t must use different "
|
||||||
"bit values");
|
"bit values");
|
||||||
static_assert(MODE_NO_ZERO_DATE == date_mode_t::NO_ZERO_DATE &&
|
static_assert(MODE_NO_ZERO_DATE == date_mode_t::NO_ZERO_DATE &&
|
||||||
|
@ -1995,8 +1995,7 @@ public:
|
|||||||
@retval nonzero if the statement is a row injection
|
@retval nonzero if the statement is a row injection
|
||||||
*/
|
*/
|
||||||
inline bool is_stmt_row_injection() const {
|
inline bool is_stmt_row_injection() const {
|
||||||
return binlog_stmt_flags &
|
return binlog_stmt_flags & (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
|
||||||
(1U << (BINLOG_STMT_UNSAFE_COUNT + BINLOG_STMT_TYPE_ROW_INJECTION));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2006,8 +2005,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline void set_stmt_row_injection() {
|
inline void set_stmt_row_injection() {
|
||||||
DBUG_ENTER("set_stmt_row_injection");
|
DBUG_ENTER("set_stmt_row_injection");
|
||||||
binlog_stmt_flags|=
|
binlog_stmt_flags|= (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
|
||||||
(1U << (BINLOG_STMT_UNSAFE_COUNT + BINLOG_STMT_TYPE_ROW_INJECTION));
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2283,7 +2281,7 @@ private:
|
|||||||
The statement is a row injection (i.e., either a BINLOG
|
The statement is a row injection (i.e., either a BINLOG
|
||||||
statement or a row event executed by the slave SQL thread).
|
statement or a row event executed by the slave SQL thread).
|
||||||
*/
|
*/
|
||||||
BINLOG_STMT_TYPE_ROW_INJECTION = 0,
|
BINLOG_STMT_TYPE_ROW_INJECTION = BINLOG_STMT_UNSAFE_COUNT,
|
||||||
|
|
||||||
/** The last element of this enumeration type. */
|
/** The last element of this enumeration type. */
|
||||||
BINLOG_STMT_TYPE_COUNT
|
BINLOG_STMT_TYPE_COUNT
|
||||||
@ -2297,8 +2295,8 @@ private:
|
|||||||
- The low BINLOG_STMT_UNSAFE_COUNT bits indicate the types of
|
- The low BINLOG_STMT_UNSAFE_COUNT bits indicate the types of
|
||||||
unsafeness that the current statement has.
|
unsafeness that the current statement has.
|
||||||
|
|
||||||
- The next BINLOG_STMT_TYPE_COUNT bits indicate if the statement
|
- The next BINLOG_STMT_TYPE_COUNT-BINLOG_STMT_TYPE_COUNT bits indicate if
|
||||||
is of some special type.
|
the statement is of some special type.
|
||||||
|
|
||||||
This must be a member of LEX, not of THD: each stored procedure
|
This must be a member of LEX, not of THD: each stored procedure
|
||||||
needs to remember its unsafeness state between calls and each
|
needs to remember its unsafeness state between calls and each
|
||||||
|
Loading…
x
Reference in New Issue
Block a user