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:
@ -245,9 +245,7 @@ enum DurationUnit
|
||||
DURATION_IN_MILLISECONDS,
|
||||
DURATION_IN_DEFAULT
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
@ -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,7 +695,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:
|
||||
@ -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:
|
||||
@ -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,42 +1008,42 @@ 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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
@ -1236,7 +1243,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ private:
|
||||
, nextdue(time(0) + frequency)
|
||||
, id(0)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
std::string name;
|
||||
TASKFN func;
|
||||
@ -90,5 +90,4 @@ private:
|
||||
|
||||
std::map<std::string, Task> m_tasks_by_name;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public:
|
||||
public:
|
||||
std::string username; /**< Monitor username */
|
||||
std::string password; /**< Monitor password */
|
||||
int connect_timeout {1}; /**< Connect timeout in seconds for mysql_real_connect */
|
||||
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. */
|
||||
@ -836,7 +836,6 @@ private:
|
||||
|
||||
void pre_loop() final;
|
||||
void post_loop() final;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ struct MXS_PROTOCOL
|
||||
*
|
||||
* @return The name of the default authenticator
|
||||
*/
|
||||
char* (*auth_default)();
|
||||
char* (* auth_default)();
|
||||
|
||||
/**
|
||||
* Handle connection limits
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -656,8 +656,9 @@ private:
|
||||
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. */
|
||||
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. */
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -26,23 +26,23 @@ static const MXS_ENUM_VALUE mxs_monitor_event_default_enum = {"all", ~0ULL};
|
||||
static const MXS_ENUM_VALUE mxs_monitor_event_enum_values[] =
|
||||
{
|
||||
mxs_monitor_event_default_enum,
|
||||
{"master_down", MASTER_DOWN_EVENT},
|
||||
{"master_up", MASTER_UP_EVENT},
|
||||
{"slave_down", SLAVE_DOWN_EVENT},
|
||||
{"slave_up", SLAVE_UP_EVENT},
|
||||
{"server_down", SERVER_DOWN_EVENT},
|
||||
{"server_up", SERVER_UP_EVENT},
|
||||
{"synced_down", SYNCED_DOWN_EVENT},
|
||||
{"synced_up", SYNCED_UP_EVENT},
|
||||
{"donor_down", DONOR_DOWN_EVENT},
|
||||
{"donor_up", DONOR_UP_EVENT},
|
||||
{"lost_master", LOST_MASTER_EVENT},
|
||||
{"lost_slave", LOST_SLAVE_EVENT},
|
||||
{"lost_synced", LOST_SYNCED_EVENT},
|
||||
{"lost_donor", LOST_DONOR_EVENT},
|
||||
{"new_master", NEW_MASTER_EVENT},
|
||||
{"new_slave", NEW_SLAVE_EVENT},
|
||||
{"new_synced", NEW_SYNCED_EVENT},
|
||||
{"new_donor", NEW_DONOR_EVENT},
|
||||
{"master_down", MASTER_DOWN_EVENT },
|
||||
{"master_up", MASTER_UP_EVENT },
|
||||
{"slave_down", SLAVE_DOWN_EVENT },
|
||||
{"slave_up", SLAVE_UP_EVENT },
|
||||
{"server_down", SERVER_DOWN_EVENT },
|
||||
{"server_up", SERVER_UP_EVENT },
|
||||
{"synced_down", SYNCED_DOWN_EVENT },
|
||||
{"synced_up", SYNCED_UP_EVENT },
|
||||
{"donor_down", DONOR_DOWN_EVENT },
|
||||
{"donor_up", DONOR_UP_EVENT },
|
||||
{"lost_master", LOST_MASTER_EVENT },
|
||||
{"lost_slave", LOST_SLAVE_EVENT },
|
||||
{"lost_synced", LOST_SYNCED_EVENT },
|
||||
{"lost_donor", LOST_DONOR_EVENT },
|
||||
{"new_master", NEW_MASTER_EVENT },
|
||||
{"new_slave", NEW_SLAVE_EVENT },
|
||||
{"new_synced", NEW_SYNCED_EVENT },
|
||||
{"new_donor", NEW_DONOR_EVENT },
|
||||
{NULL}
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ public:
|
||||
mutable std::mutex lock;
|
||||
|
||||
// TODO: Make this private.
|
||||
mxs::Monitor* m_monitor { nullptr }; /**< A possibly associated monitor */
|
||||
mxs::Monitor* m_monitor {nullptr}; /**< A possibly associated monitor */
|
||||
|
||||
bool uses_cluster() const
|
||||
{
|
||||
|
@ -1229,7 +1229,7 @@ void Session::dump_statements() const
|
||||
const QueryInfo& info = *i;
|
||||
GWBUF* pBuffer = info.query().get();
|
||||
timespec ts = info.time_completed();
|
||||
struct tm *tm = localtime(&ts.tv_sec);
|
||||
struct tm* tm = localtime(&ts.tv_sec);
|
||||
char timestamp[20];
|
||||
strftime(timestamp, 20, "%Y-%m-%d %H:%M:%S", tm);
|
||||
|
||||
|
@ -44,7 +44,7 @@ int test_validity()
|
||||
{"p7", MXS_MODULE_PARAM_SERVICE, "my-service" },
|
||||
{"p8", MXS_MODULE_PARAM_ENUM, "a", MXS_MODULE_OPT_ENUM_UNIQUE, enum_values},
|
||||
{"p9", MXS_MODULE_PARAM_DURATION, "4711s" },
|
||||
{"p10", MXS_MODULE_PARAM_DURATION, "4711s", MXS_MODULE_OPT_DURATION_S },
|
||||
{"p10", MXS_MODULE_PARAM_DURATION, "4711s", MXS_MODULE_OPT_DURATION_S},
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
};
|
||||
|
||||
|
@ -22,13 +22,13 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
inline ostream& operator << (ostream& out, const std::chrono::seconds& x)
|
||||
inline ostream& operator<<(ostream& out, const std::chrono::seconds& x)
|
||||
{
|
||||
out << x.count();
|
||||
return out;
|
||||
}
|
||||
|
||||
inline ostream& operator << (ostream& out, const std::chrono::milliseconds& x)
|
||||
inline ostream& operator<<(ostream& out, const std::chrono::milliseconds& x)
|
||||
{
|
||||
out << x.count();
|
||||
return out;
|
||||
@ -37,17 +37,17 @@ inline ostream& operator << (ostream& out, const std::chrono::milliseconds& x)
|
||||
config::Specification specification("test_module", config::Specification::FILTER);
|
||||
|
||||
config::ParamBool
|
||||
param_bool(&specification,
|
||||
param_bool(&specification,
|
||||
"boolean_parameter",
|
||||
"Specifies whether something is enabled.");
|
||||
|
||||
config::ParamCount
|
||||
param_count(&specification,
|
||||
param_count(&specification,
|
||||
"count_parameter",
|
||||
"Specifies the cardinality of something.");
|
||||
|
||||
config::ParamInteger
|
||||
param_integer(&specification,
|
||||
param_integer(&specification,
|
||||
"integer_parameter",
|
||||
"Specifies a number.");
|
||||
|
||||
@ -73,24 +73,24 @@ config::ParamEnum<Enum>
|
||||
param_enum(&specification,
|
||||
"enum_parameter",
|
||||
"Specifies a range of values.",
|
||||
{
|
||||
{ ENUM_ONE, "one" },
|
||||
{ ENUM_TWO, "two" }
|
||||
});
|
||||
{
|
||||
{ENUM_ONE, "one"},
|
||||
{ENUM_TWO, "two"}
|
||||
});
|
||||
|
||||
config::ParamPath
|
||||
param_path(&specification,
|
||||
param_path(&specification,
|
||||
"path_parameter",
|
||||
"Specifies the path of something.",
|
||||
config::ParamPath::F);
|
||||
|
||||
config::ParamSize
|
||||
param_size(&specification,
|
||||
param_size(&specification,
|
||||
"size_parameter",
|
||||
"Specifies the size of something.");
|
||||
|
||||
config::ParamString
|
||||
param_string(&specification,
|
||||
param_string(&specification,
|
||||
"string_parameter",
|
||||
"Specifies the name of something.");
|
||||
|
||||
@ -102,7 +102,7 @@ struct TestEntry
|
||||
T value;
|
||||
};
|
||||
|
||||
#define elements_in_array(x) (sizeof(x)/sizeof(x[0]))
|
||||
#define elements_in_array(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
template<class T>
|
||||
int test(T& value, const TestEntry<typename T::value_type>* pEntries, int nEntries)
|
||||
@ -151,17 +151,17 @@ int test_bool(config::Bool& value)
|
||||
{
|
||||
static const TestEntry<config::Bool::value_type> entries[] =
|
||||
{
|
||||
{ "1", true, true },
|
||||
{ "0", true, false },
|
||||
{ "true", true, true },
|
||||
{ "false", true, false },
|
||||
{ "on", true, true },
|
||||
{ "off", true, false },
|
||||
{"1", true, true },
|
||||
{"0", true, false},
|
||||
{"true", true, true },
|
||||
{"false", true, false},
|
||||
{"on", true, true },
|
||||
{"off", true, false},
|
||||
|
||||
{ "2", false },
|
||||
{ "truth", false },
|
||||
{ "%&", false },
|
||||
{ "-1", false },
|
||||
{"2", false},
|
||||
{"truth", false},
|
||||
{"%&", false},
|
||||
{"-1", false},
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -171,13 +171,13 @@ int test_count(config::Count& value)
|
||||
{
|
||||
static const TestEntry<config::Count::value_type> entries[] =
|
||||
{
|
||||
{ "1", true, 1 },
|
||||
{ "9999", true, 9999 },
|
||||
{ "0", true, 0 },
|
||||
{"1", true, 1 },
|
||||
{"9999", true, 9999},
|
||||
{"0", true, 0 },
|
||||
|
||||
{ "0x45", false },
|
||||
{ "blah", false },
|
||||
{ "-1", false },
|
||||
{"0x45", false},
|
||||
{"blah", false},
|
||||
{"-1", false},
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -187,16 +187,16 @@ int test_duration(config::Duration<std::chrono::seconds>& value)
|
||||
{
|
||||
static const TestEntry<config::Duration<std::chrono::seconds>::value_type> entries[] =
|
||||
{
|
||||
{ "1", true, std::chrono::seconds { 1 } },
|
||||
{ "1ms", true, std::chrono::seconds { 0 } },
|
||||
{ "1s", true, std::chrono::seconds { 1 } },
|
||||
{ "1m", true, std::chrono::seconds { 60 } },
|
||||
{ "1h", true, std::chrono::seconds { 3600 } },
|
||||
{"1", true, std::chrono::seconds {1 }},
|
||||
{"1ms", true, std::chrono::seconds {0 }},
|
||||
{"1s", true, std::chrono::seconds {1 }},
|
||||
{"1m", true, std::chrono::seconds {60 }},
|
||||
{"1h", true, std::chrono::seconds {3600}},
|
||||
|
||||
{ "1x", false },
|
||||
{ "a", false },
|
||||
{ "-", false },
|
||||
{ "second", false }
|
||||
{"1x", false},
|
||||
{"a", false},
|
||||
{"-", false},
|
||||
{"second", false}
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -206,16 +206,16 @@ int test_duration(config::Duration<std::chrono::milliseconds>& value)
|
||||
{
|
||||
static const TestEntry<config::Duration<std::chrono::milliseconds>::value_type> entries[] =
|
||||
{
|
||||
{ "1", true, std::chrono::milliseconds { 1 } },
|
||||
{ "1ms", true, std::chrono::milliseconds { 1 } },
|
||||
{ "1s", true, std::chrono::milliseconds { 1000 } },
|
||||
{ "1m", true, std::chrono::milliseconds { 60000 } },
|
||||
{ "1h", true, std::chrono::milliseconds { 3600000 } },
|
||||
{"1", true, std::chrono::milliseconds {1 }},
|
||||
{"1ms", true, std::chrono::milliseconds {1 }},
|
||||
{"1s", true, std::chrono::milliseconds {1000 }},
|
||||
{"1m", true, std::chrono::milliseconds {60000 }},
|
||||
{"1h", true, std::chrono::milliseconds {3600000}},
|
||||
|
||||
{ "1x", false },
|
||||
{ "a", false },
|
||||
{ "-", false },
|
||||
{ "second", false }
|
||||
{"1x", false},
|
||||
{"a", false},
|
||||
{"-", false},
|
||||
{"second", false}
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -225,12 +225,12 @@ int test_enum(config::Enum<Enum>& value)
|
||||
{
|
||||
static const TestEntry<Enum> entries[] =
|
||||
{
|
||||
{ "one", true, ENUM_ONE },
|
||||
{ "two", true, ENUM_TWO },
|
||||
{"one", true, ENUM_ONE},
|
||||
{"two", true, ENUM_TWO},
|
||||
|
||||
{ "blah", false },
|
||||
{ "1", false },
|
||||
{ "ones", false }
|
||||
{"blah", false},
|
||||
{"1", false},
|
||||
{"ones", false}
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -244,7 +244,7 @@ int test_path(config::Path& value)
|
||||
static const TestEntry<config::Path::value_type> entries[] =
|
||||
{
|
||||
{strpath, true, strpath},
|
||||
{"/tmp", true, "/tmp"},
|
||||
{"/tmp", true, "/tmp" },
|
||||
|
||||
{"non-existent", false}
|
||||
};
|
||||
@ -256,11 +256,11 @@ int test_size(config::Size& value)
|
||||
{
|
||||
static const TestEntry<config::Size::value_type> entries[] =
|
||||
{
|
||||
{ "0", true, 0 },
|
||||
{ "100", true, 100 },
|
||||
{"0", true, 0 },
|
||||
{"100", true, 100},
|
||||
|
||||
{ "-100", false },
|
||||
{ "0x100", false },
|
||||
{"-100", false},
|
||||
{"0x100", false},
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -270,13 +270,13 @@ int test_string(config::String& value)
|
||||
{
|
||||
static const TestEntry<config::String::value_type> entries[] =
|
||||
{
|
||||
{ "blah", true, "blah" },
|
||||
{ "\"blah\"", true, "blah" },
|
||||
{ "'blah'", true, "blah" },
|
||||
{ "123", true, "123" },
|
||||
{ "`blah`", true, "`blah`" },
|
||||
{"blah", true, "blah" },
|
||||
{"\"blah\"", true, "blah" },
|
||||
{"'blah'", true, "blah" },
|
||||
{"123", true, "123" },
|
||||
{"`blah`", true, "`blah`"},
|
||||
|
||||
{ "'blah\"", false }
|
||||
{"'blah\"", false}
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -286,15 +286,15 @@ int test_integer(config::Integer& value)
|
||||
{
|
||||
static const TestEntry<config::Integer::value_type> entries[] =
|
||||
{
|
||||
{ "0", true, 0 },
|
||||
{ "-1", true, -1 },
|
||||
{ "1", true, 1 },
|
||||
{ "-2147483648", true, -2147483648 },
|
||||
{ "2147483647", true, 2147483647 },
|
||||
{"0", true, 0 },
|
||||
{"-1", true, -1 },
|
||||
{"1", true, 1 },
|
||||
{"-2147483648", true, -2147483648},
|
||||
{"2147483647", true, 2147483647 },
|
||||
|
||||
{ "-2147483649", false },
|
||||
{ "2147483648", false },
|
||||
{ "0x10" , false },
|
||||
{"-2147483649", false},
|
||||
{"2147483648", false},
|
||||
{"0x10", false},
|
||||
};
|
||||
|
||||
return test(value, entries, elements_in_array(entries));
|
||||
@ -304,7 +304,7 @@ int main()
|
||||
{
|
||||
mxb::Log log;
|
||||
|
||||
for_each(specification.cbegin(), specification.cend(),[](const config::Specification::value_type& p) {
|
||||
for_each(specification.cbegin(), specification.cend(), [](const config::Specification::value_type& p) {
|
||||
cout << p.second->documentation() << endl;
|
||||
});
|
||||
|
||||
|
@ -42,7 +42,6 @@ namespace
|
||||
{
|
||||
|
||||
MXS_CONFIG_PARAMETER empty;
|
||||
|
||||
}
|
||||
/**
|
||||
* test1 Filter creation, finding and deletion
|
||||
|
@ -84,7 +84,6 @@ int test()
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -72,7 +72,6 @@ int test_checksums()
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
@ -40,7 +40,7 @@ void preload_module(const char* name, const char* path, const char* type)
|
||||
set_libdir(MXS_STRDUP(old_libdir.c_str()));
|
||||
}
|
||||
|
||||
void init_test_env(char* __attribute((unused)) path = nullptr, uint32_t init_type = QC_INIT_BOTH)
|
||||
void init_test_env(char* __attribute((unused))path = nullptr, uint32_t init_type = QC_INIT_BOTH)
|
||||
{
|
||||
config_get_global_options()->n_threads = 1;
|
||||
|
||||
|
@ -1055,11 +1055,11 @@ nl_constr_init_args = add # ignore/add/remove/force
|
||||
nl_enum_own_lines = ignore # ignore/add/remove/force
|
||||
|
||||
# Add or remove newline between return type and function name in a function definition.
|
||||
nl_func_type_name = remove # ignore/add/remove/force
|
||||
nl_func_type_name = ignore # ignore/add/remove/force
|
||||
|
||||
# Add or remove newline between return type and function name inside a class {}
|
||||
# Uses nl_func_type_name or nl_func_proto_type_name if set to ignore.
|
||||
nl_func_type_name_class = remove # ignore/add/remove/force
|
||||
nl_func_type_name_class = ignore # ignore/add/remove/force
|
||||
|
||||
# Add or remove newline between class specification and '::' in 'void A::f() { }'
|
||||
# Only appears in separate member implementation (does not appear with in-line implmementation).
|
||||
@ -1070,7 +1070,7 @@ nl_func_class_scope = remove # ignore/add/remove/force
|
||||
nl_func_scope_name = remove # ignore/add/remove/force
|
||||
|
||||
# Add or remove newline between return type and function name in a prototype.
|
||||
nl_func_proto_type_name = remove # ignore/add/remove/force
|
||||
nl_func_proto_type_name = ignore # ignore/add/remove/force
|
||||
|
||||
# Add or remove newline between a function name and the opening '(' in the declaration.
|
||||
nl_func_paren = remove # ignore/add/remove/force
|
||||
|
Reference in New Issue
Block a user