Format core sources again

Formatted with nl_func_type_name and related options set to ignore. This
keeps the formatting intact for long return types in declarations and
definitions.
This commit is contained in:
Markus Mäkelä
2019-05-09 10:43:09 +03:00
parent 50b5fe76ef
commit b4e8f79c5f
30 changed files with 331 additions and 334 deletions

View File

@ -36,9 +36,9 @@ class Buffer;
*/
struct BUF_PROPERTY
{
char* name;
char* value;
BUF_PROPERTY* next;
char* name;
char* value;
BUF_PROPERTY* next;
};
enum gwbuf_type_t
@ -60,7 +60,7 @@ enum gwbuf_type_t
#define GWBUF_IS_REPLY_OK(b) ((b)->gwbuf_type & GWBUF_TYPE_REPLY_OK)
// True if the query is not initiated by the client but an internal replaying mechanism
#define GWBUF_IS_REPLAYED(b) ((b)->gwbuf_type & GWBUF_TYPE_REPLAYED)
#define GWBUF_IS_REPLAYED(b) ((b)->gwbuf_type & GWBUF_TYPE_REPLAYED)
// Track session state change response
#define GWBUF_SHOULD_TRACK_STATE(b) ((b)->gwbuf_type & GWBUF_TYPE_TRACK_STATE)
@ -115,15 +115,15 @@ struct SHARED_BUF
*/
struct GWBUF
{
GWBUF* next; /*< Next buffer in a linked chain of buffers */
GWBUF* tail; /*< Last buffer in a linked chain of buffers */
void* start; /*< Start of the valid data */
void* end; /*< First byte after the valid data */
SHARED_BUF* sbuf; /*< The shared buffer with the real data */
HINT* hint; /*< Hint data for this buffer */
BUF_PROPERTY* properties; /*< Buffer properties */
SERVER* server; /*< The target server where the buffer is executed */
uint32_t gwbuf_type; /*< buffer's data type information */
GWBUF* next; /*< Next buffer in a linked chain of buffers */
GWBUF* tail; /*< Last buffer in a linked chain of buffers */
void* start; /*< Start of the valid data */
void* end; /*< First byte after the valid data */
SHARED_BUF* sbuf; /*< The shared buffer with the real data */
HINT* hint; /*< Hint data for this buffer */
BUF_PROPERTY* properties; /*< Buffer properties */
SERVER* server; /*< The target server where the buffer is executed */
uint32_t gwbuf_type; /*< buffer's data type information */
#ifdef SS_DEBUG
int owner; /*< Owner of the thread, only for debugging */
#endif

View File

@ -245,9 +245,7 @@ enum DurationUnit
DURATION_IN_MILLISECONDS,
DURATION_IN_DEFAULT
};
}
}
/**
@ -485,10 +483,10 @@ class CONFIG_CONTEXT
public:
CONFIG_CONTEXT(const std::string& section = "");
std::string m_name; /**< The name of the object being configured */
MXS_CONFIG_PARAMETER m_parameters; /**< The list of parameter values */
bool m_was_persisted; /**< True if this object was persisted */
CONFIG_CONTEXT* m_next; /**< Next pointer in the linked list */
std::string m_name; /**< The name of the object being configured */
MXS_CONFIG_PARAMETER m_parameters; /**< The list of parameter values */
bool m_was_persisted; /**< True if this object was persisted */
CONFIG_CONTEXT* m_next; /**< Next pointer in the linked list */
const char* name() const
{
@ -514,11 +512,11 @@ struct MXS_CONFIG
int maxlog; /**< Log to MaxScale's own logs */
time_t auth_conn_timeout; /**< Connection timeout for the user
* authentication */
time_t auth_read_timeout; /**< Read timeout for the user authentication */
time_t auth_write_timeout; /**< Write timeout for the user authentication */
bool skip_permission_checks; /**< Skip service and monitor permission checks */
int32_t passive; /**< True if MaxScale is in passive mode */
int64_t promoted_at; /**< Time when this Maxscale instance was
time_t auth_read_timeout; /**< Read timeout for the user authentication */
time_t auth_write_timeout; /**< Write timeout for the user authentication */
bool skip_permission_checks; /**< Skip service and monitor permission checks */
int32_t passive; /**< True if MaxScale is in passive mode */
int64_t promoted_at; /**< Time when this Maxscale instance was
* promoted from a passive to an active */
char qc_name[PATH_MAX]; /**< The name of the query classifier to load */
char* qc_args; /**< Arguments for the query classifier */

View File

@ -44,9 +44,9 @@ public:
FILTER
};
using ParamsByName = std::map<std::string, Param*>;
using ParamsByName = std::map<std::string, Param*>;
using const_iterator = ParamsByName::const_iterator;
using value_type = ParamsByName::value_type;
using value_type = ParamsByName::value_type;
/**
* Constructor
@ -291,7 +291,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(value_type value) const;
private:
@ -320,7 +321,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(value_type value) const;
protected:
@ -403,8 +405,8 @@ private:
: ParamNumber(pSpecification, zName, zDescription, kind, MXS_MODULE_PARAM_COUNT,
default_value,
min_value >= 0 ? min_value : 0,
max_value <= std::numeric_limits<uint32_t>::max()
? max_value : std::numeric_limits<uint32_t>::max())
max_value <= std::numeric_limits<uint32_t>::max() ?
max_value : std::numeric_limits<uint32_t>::max())
{
mxb_assert(min_value >= 0);
mxb_assert(max_value <= std::numeric_limits<uint32_t>::max());
@ -473,10 +475,10 @@ private:
value_type max_value)
: ParamNumber(pSpecification, zName, zDescription, kind, MXS_MODULE_PARAM_INT,
default_value,
min_value >= std::numeric_limits<int32_t>::min()
? min_value : std::numeric_limits<int32_t>::min(),
max_value <= std::numeric_limits<int32_t>::max()
? max_value : std::numeric_limits<int32_t>::max())
min_value >= std::numeric_limits<int32_t>::min() ?
min_value : std::numeric_limits<int32_t>::min(),
max_value <= std::numeric_limits<int32_t>::max() ?
max_value : std::numeric_limits<int32_t>::max())
{
mxb_assert(min_value >= std::numeric_limits<int32_t>::min());
mxb_assert(max_value <= std::numeric_limits<int32_t>::max());
@ -517,7 +519,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(const value_type& value) const;
private:
@ -572,7 +575,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(value_type value) const;
void populate(MXS_MODULE_PARAM& param) const;
@ -601,11 +605,11 @@ public:
enum Options
{
X = MXS_MODULE_OPT_PATH_X_OK, // Execute permission required.
R = MXS_MODULE_OPT_PATH_R_OK, // Read permission required.
W = MXS_MODULE_OPT_PATH_W_OK, // Write permission required.
F = MXS_MODULE_OPT_PATH_F_OK, // File existence required.
C = MXS_MODULE_OPT_PATH_CREAT // Create path if does not exist.
X = MXS_MODULE_OPT_PATH_X_OK, // Execute permission required.
R = MXS_MODULE_OPT_PATH_R_OK, // Read permission required.
W = MXS_MODULE_OPT_PATH_W_OK, // Write permission required.
F = MXS_MODULE_OPT_PATH_F_OK, // File existence required.
C = MXS_MODULE_OPT_PATH_CREAT // Create path if does not exist.
};
const uint32_t MASK = X | R | W | F | C;
@ -636,7 +640,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(const value_type& value) const;
void populate(MXS_MODULE_PARAM& param) const;
@ -690,15 +695,16 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(value_type value) const;
private:
ParamSize(Specification* pSpecification,
const char* zName,
const char* zDescription,
Kind kind,
value_type default_value)
const char* zName,
const char* zDescription,
Kind kind,
value_type default_value)
: Param(pSpecification, zName, zDescription, kind, MXS_MODULE_PARAM_SIZE)
, m_default_value(default_value)
{
@ -739,7 +745,8 @@ public:
bool set(Type& value, const std::string& value_as_string) const override;
bool from_string(const std::string& value, value_type* pValue, std::string* pMessage = nullptr) const;
bool from_string(const std::string& value, value_type* pValue,
std::string* pMessage = nullptr) const;
std::string to_string(value_type value) const;
private:
@ -771,9 +778,9 @@ using ParamBitMask = ParamCount;
class Configuration
{
public:
using ValuesByName = std::map<std::string, Type*>;
using ValuesByName = std::map<std::string, Type*>;
using const_iterator = ValuesByName::const_iterator;
using value_type = ValuesByName::value_type;
using value_type = ValuesByName::value_type;
/**
* Constructor
@ -792,7 +799,7 @@ public:
*
* @return The corresponding @c Value or NULL if @c name is unknown.
*/
Type* find_value(const std::string& name);
Type* find_value(const std::string& name);
const Type* find_value(const std::string& name) const;
/**
@ -818,7 +825,7 @@ public:
*/
size_t size() const;
/**
/**
* @return Const iterator to first parameter.
*/
const_iterator cbegin() const
@ -856,7 +863,7 @@ class Type
{
public:
Type(const Type& rhs) = delete;
Type& operator = (const Type&) = delete;
Type& operator=(const Type&) = delete;
~Type();
@ -921,7 +928,7 @@ public:
{
}
This& operator = (const ConcreteType<This, ParamType>& rhs)
This& operator=(const ConcreteType<This, ParamType>& rhs)
{
// Only the value is copied, the parameter and the configuration
// remains the same.
@ -954,43 +961,43 @@ protected:
* ConcreteType <-> ConcreteType
*/
template<class This, class ParamType>
inline bool operator == (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator==(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs.get() == rhs.get();
}
template<class This, class ParamType>
inline bool operator != (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator!=(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs.get() != rhs.get();
}
template<class This, class ParamType>
inline bool operator < (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator<(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs.get() < rhs.get();
}
template<class This, class ParamType>
inline bool operator > (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator>(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs.get() > rhs.get();
}
template<class This, class ParamType>
inline bool operator <= (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator<=(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return (lhs.get() < rhs.get()) || (lhs == rhs);
}
template<class This, class ParamType>
inline bool operator >= (const ConcreteType<This,ParamType>& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator>=(const ConcreteType<This, ParamType>& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return (lhs.get() > rhs.get()) || (lhs == rhs);
}
@ -1001,43 +1008,43 @@ inline bool operator >= (const ConcreteType<This,ParamType>& lhs,
* ConcreteType <-> ParamType::value_type
*/
template<class This, class ParamType>
inline bool operator == (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator==(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return lhs.get() == rhs;
}
template<class This, class ParamType>
inline bool operator != (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator!=(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return lhs.get() != rhs;
}
template<class This, class ParamType>
inline bool operator < (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator<(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return lhs.get() < rhs;
}
template<class This, class ParamType>
inline bool operator > (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator>(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return lhs.get() > rhs;
}
template<class This, class ParamType>
inline bool operator <= (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator<=(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return (lhs.get() < rhs) || (lhs.get() == rhs);
}
template<class This, class ParamType>
inline bool operator >= (const ConcreteType<This,ParamType>& lhs,
const typename ParamType::value_type& rhs)
inline bool operator>=(const ConcreteType<This, ParamType>& lhs,
const typename ParamType::value_type& rhs)
{
return (lhs.get() > rhs) || (lhs.get() == rhs);
}
@ -1048,43 +1055,43 @@ inline bool operator >= (const ConcreteType<This,ParamType>& lhs,
* ParamType::value_type <-> ConcreteType
*/
template<class This, class ParamType>
inline bool operator == (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator==(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs == rhs.get();
}
template<class This, class ParamType>
inline bool operator != (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator!=(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs != rhs.get();
}
template<class This, class ParamType>
inline bool operator < (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator<(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs < rhs.get();
}
template<class This, class ParamType>
inline bool operator > (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator>(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return lhs > rhs.get();
}
template<class This, class ParamType>
inline bool operator <= (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator<=(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return (lhs < rhs.get()) || (lhs == rhs.get());
}
template<class This, class ParamType>
inline bool operator >= (const typename ParamType::value_type& lhs,
const ConcreteType<This,ParamType>& rhs)
inline bool operator>=(const typename ParamType::value_type& lhs,
const ConcreteType<This, ParamType>& rhs)
{
return (lhs > rhs.get()) || (lhs == rhs.get());
}
@ -1147,11 +1154,11 @@ class Bool : public ConcreteType<Bool, ParamBool>
{
public:
Bool(Configuration* pConfiguration, const ParamBool* pParam)
: ConcreteType<Bool,ParamBool>(pConfiguration, pParam)
: ConcreteType<Bool, ParamBool>(pConfiguration, pParam)
{
}
explicit operator bool () const
explicit operator bool() const
{
return m_value;
}
@ -1176,18 +1183,18 @@ public:
};
/*
template<class T>
inline bool operator < (const Duration<T>& lhs, const Duration<T>& rhs)
{
return lhs.get() < rhs.get();
}
template<class T>
inline bool operator > (const Duration<T>& lhs, const Duration<T>& rhs)
{
return lhs.get() > rhs.get();
}
*/
* template<class T>
* inline bool operator < (const Duration<T>& lhs, const Duration<T>& rhs)
* {
* return lhs.get() < rhs.get();
* }
*
* template<class T>
* inline bool operator > (const Duration<T>& lhs, const Duration<T>& rhs)
* {
* return lhs.get() > rhs.get();
* }
*/
/**
* Enum
@ -1230,13 +1237,13 @@ public:
class Size : public ConcreteType<Size, ParamSize>
{
public:
Size(Configuration* pConfiguration, const ParamSize* pParam)
Size(Configuration* pConfiguration, const ParamSize* pParam)
: ConcreteType(pConfiguration, pParam)
{
}
};
inline Size::value_type operator / (const Size& lhs, Size::value_type rhs)
inline Size::value_type operator/(const Size& lhs, Size::value_type rhs)
{
return lhs.get() / rhs;
}
@ -1380,7 +1387,7 @@ ParamEnum<T>::ParamEnum(Specification* pSpecification,
m_enum_values.emplace_back(x);
}
MXS_ENUM_VALUE end { NULL };
MXS_ENUM_VALUE end {NULL};
m_enum_values.emplace_back(end);
}
@ -1446,7 +1453,7 @@ bool ParamEnum<T>::from_string(const std::string& value_as_string,
std::string* pMessage) const
{
auto it = std::find_if(m_enumeration.begin(), m_enumeration.end(),
[value_as_string](const std::pair<T,const char*>& elem) {
[value_as_string](const std::pair<T, const char*>& elem) {
return value_as_string == elem.second;
});
@ -1487,7 +1494,7 @@ template<class T>
std::string ParamEnum<T>::to_string(value_type value) const
{
auto it = std::find_if(m_enumeration.begin(), m_enumeration.end(),
[value] (const std::pair<T, const char*>& entry) {
[value](const std::pair<T, const char*>& entry) {
return entry.first == value;
});
@ -1501,6 +1508,4 @@ void ParamEnum<T>::populate(MXS_MODULE_PARAM& param) const
param.accepted_values = &m_enum_values[0];
}
}

View File

@ -207,8 +207,8 @@ struct DCB : public MXB_POLL_DATA
DCB* next = nullptr; /**< Next DCB in owning thread's list */
DCB* tail = nullptr; /**< Last DCB in owning thread's list */
} thread;
uint32_t n_close = 0; /** How many times dcb_close has been called. */
uint64_t m_uid; /**< Unique identifier for this DCB */
uint32_t n_close = 0; /** How many times dcb_close has been called. */
uint64_t m_uid; /**< Unique identifier for this DCB */
};
/**

View File

@ -54,7 +54,7 @@ public:
void add_task(const std::string& name, TASKFN func, void* pData, int frequency);
void remove_task(const std::string& name);
void show_tasks(DCB* pDcb) const;
void show_tasks(DCB* pDcb) const;
json_t* tasks_to_json(const char* zhost) const;
static int64_t ticks();
@ -75,7 +75,7 @@ private:
, nextdue(time(0) + frequency)
, id(0)
{
};
}
std::string name;
TASKFN func;
@ -85,10 +85,9 @@ private:
uint32_t id;
};
bool call_task(Worker::Call::action_t action, Task* pTask);
bool call_task(Worker::Call::action_t action, Task* pTask);
static bool inc_ticks(Worker::Call::action_t action);
std::map<std::string, Task> m_tasks_by_name;
};
}

View File

@ -158,26 +158,26 @@ public:
class ConnectionSettings
{
public:
std::string username; /**< Monitor username */
std::string password; /**< Monitor password */
int connect_timeout {1}; /**< Connect timeout in seconds for mysql_real_connect */
int write_timeout {1}; /**< Timeout in seconds for each attempt to write to the server.
* There are retries and the total effective timeout value is two
* times the option value. */
int read_timeout {1}; /**< Timeout in seconds to read from the server. There are retries
* and the total effective timeout value is three times the
* option value. */
int connect_attempts {1}; /**< How many times a connection is attempted */
std::string username; /**< Monitor username */
std::string password; /**< Monitor password */
int connect_timeout {1};/**< Connect timeout in seconds for mysql_real_connect */
int write_timeout {1}; /**< Timeout in seconds for each attempt to write to the server.
* There are retries and the total effective timeout value is two
* times the option value. */
int read_timeout {1}; /**< Timeout in seconds to read from the server. There are retries
* and the total effective timeout value is three times the
* option value. */
int connect_attempts {1}; /**< How many times a connection is attempted */
};
/**
* Maintenance mode request constants.
*/
static const int NO_CHANGE = 0;
static const int MAINT_OFF = 1;
static const int MAINT_ON = 2;
static const int NO_CHANGE = 0;
static const int MAINT_OFF = 1;
static const int MAINT_ON = 2;
static const int BEING_DRAINED_OFF = 3;
static const int BEING_DRAINED_ON = 4;
static const int BEING_DRAINED_ON = 4;
MonitorServer(SERVER* server, const SERVER::DiskSpaceLimits& monitor_limits);
@ -255,20 +255,20 @@ public:
*/
void update_disk_space_status();
SERVER* server = nullptr; /**< The server being monitored */
MYSQL* con = nullptr; /**< The MySQL connection */
bool log_version_err = true;
int mon_err_count = 0;
SERVER* server = nullptr; /**< The server being monitored */
MYSQL* con = nullptr; /**< The MySQL connection */
bool log_version_err = true;
int mon_err_count = 0;
uint64_t mon_prev_status = -1; /**< Status before starting the current monitor loop */
uint64_t pending_status = 0; /**< Status during current monitor loop */
uint64_t mon_prev_status = -1; /**< Status before starting the current monitor loop */
uint64_t pending_status = 0; /**< Status during current monitor loop */
int status_request = NO_CHANGE; /**< Is admin requesting Maintenance=ON/OFF on the
* server? */
int status_request = NO_CHANGE; /**< Is admin requesting Maintenance=ON/OFF on the
* server? */
private:
const SERVER::DiskSpaceLimits& monitor_limits; /**< Monitor-level disk-space limits */
const SERVER::DiskSpaceLimits& monitor_limits; /**< Monitor-level disk-space limits */
bool ok_to_check_disk_space {true}; /**< Set to false if check fails */
bool ok_to_check_disk_space {true}; /**< Set to false if check fails */
};
/**
@ -281,7 +281,7 @@ public:
virtual ~Monitor();
static const int STATUS_FLAG_NOCHECK = 0;
static const int STATUS_FLAG_CHECK = -1;
static const int STATUS_FLAG_CHECK = -1;
/**
* Ping or connect to a database. If connection does not exist or ping fails, a new connection
@ -419,11 +419,11 @@ public:
/** Set when admin requests a maintenance status change. */
int check_status_flag = STATUS_FLAG_NOCHECK;
uint64_t m_ticks {0}; /**< Number of performed monitoring intervals */
uint8_t m_journal_hash[SHA_DIGEST_LENGTH]; /**< SHA1 hash of the latest written journal */
uint64_t m_ticks {0}; /**< Number of performed monitoring intervals */
uint8_t m_journal_hash[SHA_DIGEST_LENGTH]; /**< SHA1 hash of the latest written journal */
MXS_CONFIG_PARAMETER parameters; /**< Configuration parameters */
std::vector<MonitorServer*> m_servers; /**< Monitored servers */
MXS_CONFIG_PARAMETER parameters; /**< Configuration parameters */
std::vector<MonitorServer*> m_servers; /**< Monitored servers */
protected:
/**
@ -536,15 +536,15 @@ protected:
class Settings
{
public:
int64_t interval {0}; /**< Monitor interval in milliseconds */
int64_t interval {0}; /**< Monitor interval in milliseconds */
std::string script; /**< Script triggered by events */
int script_timeout {0}; /**< Timeout in seconds for the monitor scripts */
uint64_t events {0}; /**< Bitfield of events which trigger the script */
std::string script; /**< Script triggered by events */
int script_timeout {0}; /**< Timeout in seconds for the monitor scripts */
uint64_t events {0}; /**< Bitfield of events which trigger the script */
time_t journal_max_age {0}; /**< Maximum age of journal file */
time_t journal_max_age {0}; /**< Maximum age of journal file */
SERVER::DiskSpaceLimits disk_space_limits; /**< Disk space thresholds */
SERVER::DiskSpaceLimits disk_space_limits; /**< Disk space thresholds */
// How often should a disk space check be made at most. Negative values imply disabling.
maxbase::Duration disk_space_check_interval {-1};
@ -580,7 +580,7 @@ private:
int launch_command(MonitorServer* ptr, EXTERNCMD* cmd);
FILE* open_data_file(Monitor* monitor, char* path);
int get_data_file_path(char* path) const;
int get_data_file_path(char* path) const;
mxb::StopWatch m_disk_space_checked; /**< When was disk space checked the last time */
};
@ -806,7 +806,7 @@ protected:
*/
virtual void post_tick();
MonitorServer* m_master {nullptr}; /**< Master server */
MonitorServer* m_master {nullptr}; /**< Master server */
private:
/**
@ -836,7 +836,6 @@ private:
void pre_loop() final;
void post_loop() final;
};
/**

View File

@ -138,7 +138,6 @@ namespace maxscale
*/
std::unique_ptr<mxq::QueryResult> execute_query(MYSQL* conn, const std::string& query,
std::string* errmsg_out = NULL);
}
MXS_END_DECLS

View File

@ -67,7 +67,8 @@ struct CloserTraits<pcre2_match_data*>
namespace std
{
template<> class default_delete<pcre2_code>
template<>
class default_delete<pcre2_code>
{
public:
void operator()(pcre2_code* p)
@ -78,6 +79,4 @@ public:
}
}
};
}

View File

@ -137,7 +137,7 @@ struct MXS_PROTOCOL
*
* @return The name of the default authenticator
*/
char* (*auth_default)();
char* (* auth_default)();
/**
* Handle connection limits

View File

@ -34,8 +34,8 @@ enum qc_init_kind_t
*/
enum qc_option_t
{
QC_OPTION_STRING_ARG_AS_FIELD = (1 << 0), /*< Report a string argument to a function as a field. */
QC_OPTION_STRING_AS_FIELD = (1 << 1), /*< Report strings as fields. */
QC_OPTION_STRING_ARG_AS_FIELD = (1 << 0), /*< Report a string argument to a function as a field. */
QC_OPTION_STRING_AS_FIELD = (1 << 1), /*< Report strings as fields. */
};
const uint32_t QC_OPTION_MASK = QC_OPTION_STRING_ARG_AS_FIELD | QC_OPTION_STRING_AS_FIELD;
@ -144,16 +144,16 @@ enum qc_parse_result_t
*/
typedef enum qc_field_context
{
QC_FIELD_UNION = 1, /** The field appears on the right hand side in a UNION. */
QC_FIELD_SUBQUERY = 2 /** The field appears in a subquery. */
QC_FIELD_UNION = 1, /** The field appears on the right hand side in a UNION. */
QC_FIELD_SUBQUERY = 2 /** The field appears in a subquery. */
} qc_field_context_t;
struct QC_FIELD_INFO
{
char* database; /** Present if the field is of the form "a.b.c", NULL otherwise. */
char* table; /** Present if the field is of the form "a.b", NULL otherwise. */
char* column; /** Always present. */
uint32_t context; /** The context in which the field appears. */
char* database; /** Present if the field is of the form "a.b.c", NULL otherwise. */
char* table; /** Present if the field is of the form "a.b", NULL otherwise. */
char* column; /** Always present. */
uint32_t context; /** The context in which the field appears. */
};
/**
@ -453,7 +453,7 @@ struct QUERY_CLASSIFIER
*
* @return The same info that was provided as argument.
*/
QC_STMT_INFO* (*qc_info_dup)(QC_STMT_INFO * info);
QC_STMT_INFO* (* qc_info_dup)(QC_STMT_INFO* info);
/**
* Closes a dupped info object. After the info object has been closed, it must
@ -486,7 +486,7 @@ struct QUERY_CLASSIFIER
*
* @return The result of the provided info.
*/
QC_STMT_RESULT (*qc_get_result_from_info)(const QC_STMT_INFO* info);
QC_STMT_RESULT (* qc_get_result_from_info)(const QC_STMT_INFO* info);
};
/**
@ -531,8 +531,8 @@ struct QC_CACHE_STATS
*/
bool qc_setup(const QC_CACHE_PROPERTIES* cache_properties,
qc_sql_mode_t sql_mode,
const char* plugin_name,
const char* plugin_args);
const char* plugin_name,
const char* plugin_args);
/**
* Loads and setups the default query classifier, and performs
@ -554,8 +554,8 @@ bool qc_setup(const QC_CACHE_PROPERTIES* cache_properties,
*/
bool qc_init(const QC_CACHE_PROPERTIES* cache_properties,
qc_sql_mode_t sql_mode,
const char* plugin_name,
const char* plugin_args);
const char* plugin_name,
const char* plugin_args);
/**
* Performs thread and process finalization.

View File

@ -35,7 +35,7 @@ public:
public:
RouteInfo();
RouteInfo(uint32_t target,
uint8_t command,
uint8_t command,
uint32_t type_mask,
uint32_t stmt_id);
@ -348,7 +348,7 @@ private:
*/
bool query_type_is_read_only(uint32_t qtype) const;
void process_routing_hints(HINT* pHints, uint32_t* target);
void process_routing_hints(HINT* pHints, uint32_t* target);
uint32_t get_route_target(uint8_t command, uint32_t qtype);
MXS_SESSION* session() const

View File

@ -172,7 +172,7 @@ typedef struct mxs_router_object
void (* clientReply)(MXS_ROUTER* instance,
MXS_ROUTER_SESSION* router_session,
GWBUF* queue,
DCB* backend_dcb);
DCB* backend_dcb);
/**
* @brief Called when a backend DCB has failed
@ -188,7 +188,7 @@ typedef struct mxs_router_object
void (* handleError)(MXS_ROUTER* instance,
MXS_ROUTER_SESSION* router_session,
GWBUF* errmsgbuf,
DCB* backend_dcb,
DCB* backend_dcb,
mxs_error_action_t action,
bool* succp);
@ -338,7 +338,7 @@ public:
* @param pSuccess On output, if false, the session will be terminated.
*/
void handleError(GWBUF* pMessage,
DCB* pProblem,
DCB* pProblem,
mxs_error_action_t action,
bool* pSuccess);
@ -479,7 +479,7 @@ public:
static void handleError(MXS_ROUTER* pInstance,
MXS_ROUTER_SESSION* pData,
GWBUF* pMessage,
DCB* pProblem,
DCB* pProblem,
mxs_error_action_t action,
bool* pSuccess)
{

View File

@ -655,10 +655,11 @@ private:
static uint32_t epoll_instance_handler(MXB_POLL_DATA* data, MXB_WORKER* worker, uint32_t events);
uint32_t handle_epoll_events(uint32_t events);
static maxbase::Duration s_watchdog_interval; /*< Duration between notifications, if any. */
static maxbase::TimePoint s_watchdog_next_check; /*< Next time to notify systemd. */
std::atomic<bool> m_alive; /*< Set to true in epoll_tick(), false on notification. */
WatchdogNotifier* m_pWatchdog_notifier; /*< Watchdog notifier, if systemd enabled. */
static maxbase::Duration s_watchdog_interval; /*< Duration between notifications, if any. */
static maxbase::TimePoint s_watchdog_next_check;/*< Next time to notify systemd. */
std::atomic<bool> m_alive; /*< Set to true in epoll_tick(), false on
* notification. */
WatchdogNotifier* m_pWatchdog_notifier; /*< Watchdog notifier, if systemd enabled. */
};
using WatchdogWorkaround = RoutingWorker::WatchdogWorkaround;

View File

@ -202,7 +202,7 @@ public:
// Misc fields
bool master_err_is_logged = false; /**< If node failed, this indicates whether it is logged. Only
* used by rwsplit. TODO: Move to rwsplit */
bool warn_ssl_not_enabled = true; /**< SSL not used for an SSL enabled server */
bool warn_ssl_not_enabled = true; /**< SSL not used for an SSL enabled server */
RLagState rlag_state = RLagState::NONE; /**< Is replication lag above or under limit? Used by rwsplit. */
virtual ~SERVER() = default;
@ -520,13 +520,13 @@ public:
protected:
SERVER()
: m_response_time(maxbase::EMAverage {0.04, 0.35, 500})
: m_response_time(maxbase::EMAverage {0.04, 0.35, 500})
{
}
private:
static const int DEFAULT_CHARSET = 0x08; /**< The latin1 charset */
maxbase::EMAverage m_response_time; /**< Response time calculations for this server */
std::mutex m_average_write_mutex; /**< Protects response time from concurrent writing */
static const int DEFAULT_CHARSET = 0x08; /**< The latin1 charset */
maxbase::EMAverage m_response_time; /**< Response time calculations for this server */
std::mutex m_average_write_mutex; /**< Protects response time from concurrent writing */
};
namespace maxscale
@ -550,5 +550,4 @@ bool server_set_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
* @param errmsg_out Error output
*/
bool server_clear_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
}

View File

@ -113,7 +113,7 @@ public:
bool localhost_match_wildcard_host; /**< Match localhost against wildcard
* */
MXS_CONFIG_PARAMETER svc_config_param; /**< list of config params and values */
int svc_config_version; /**< Version number of configuration
int svc_config_version; /**< Version number of configuration
* */
bool svc_do_shutdown; /**< tells the service to exit loops
* etc. */
@ -155,8 +155,8 @@ public:
protected:
SERVICE(const std::string& name,
const std::string& router_name)
: m_name(name) /** Service name. */
, m_router_name(router_name) /** Router module. */
: m_name(name)
, m_router_name(router_name)
{
}

View File

@ -504,7 +504,7 @@ uint64_t session_get_current_id();
* @return True, if the variable could be added, false otherwise.
*/
bool session_add_variable(MXS_SESSION* session,
const char* name,
const char* name,
session_variable_handler_t handler,
void* context);
@ -524,7 +524,7 @@ bool session_add_variable(MXS_SESSION* session,
* @return True, if the variable existed, false otherwise.
*/
bool session_remove_variable(MXS_SESSION* session,
const char* name,
const char* name,
void** context);
/**
* @brief Set value of maxscale session variable.
@ -542,10 +542,10 @@ bool session_remove_variable(MXS_SESSION* session,
* incoming statements.
*/
char* session_set_variable_value(MXS_SESSION* session,
const char* name_begin,
const char* name_end,
const char* value_begin,
const char* value_end);
const char* name_begin,
const char* name_end,
const char* value_begin,
const char* value_end);
/**
* @brief Specify how many statements each session should retain for

View File

@ -312,7 +312,8 @@ template<typename T>
class EqualPointees : public std::unary_function<T, bool>
{
public:
EqualPointees(const T& lhs) : m_ppLhs(&lhs)
EqualPointees(const T& lhs)
: m_ppLhs(&lhs)
{
}
bool operator()(const T& pRhs)