mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-25 21:54:28 +08:00
mdbx: новые настройки clang-format (косметика).
This commit is contained in:
@@ -54,18 +54,16 @@ namespace config {
|
||||
|
||||
enum scale_mode { no_scale, decimal, binary, duration, intkey, entropy };
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
const char **value, const char *default_value = nullptr);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, const char **value,
|
||||
const char *default_value = nullptr);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
std::string &value, bool allow_empty = false);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, std::string &value,
|
||||
bool allow_empty = false);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
std::string &value, bool allow_empty,
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, std::string &value, bool allow_empty,
|
||||
const char *default_value);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
bool &value);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, bool &value);
|
||||
|
||||
struct option_verb {
|
||||
const char *const verb;
|
||||
@@ -73,8 +71,7 @@ struct option_verb {
|
||||
};
|
||||
|
||||
template <typename MASK>
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
MASK &mask, const option_verb *verbs) {
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, MASK &mask, const option_verb *verbs) {
|
||||
static_assert(sizeof(MASK) <= sizeof(unsigned), "WTF?");
|
||||
unsigned u = unsigned(mask);
|
||||
if (parse_option<unsigned>(argc, argv, narg, option, u, verbs)) {
|
||||
@@ -85,49 +82,36 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
}
|
||||
|
||||
template <>
|
||||
bool parse_option<unsigned>(int argc, char *const argv[], int &narg,
|
||||
const char *option, unsigned &mask,
|
||||
bool parse_option<unsigned>(int argc, char *const argv[], int &narg, const char *option, unsigned &mask,
|
||||
const option_verb *verbs);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
uint64_t &value, const scale_mode scale,
|
||||
const uint64_t minval = 0, const uint64_t maxval = INT64_MAX,
|
||||
const uint64_t default_value = 0);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, uint64_t &value, const scale_mode scale,
|
||||
const uint64_t minval = 0, const uint64_t maxval = INT64_MAX, const uint64_t default_value = 0);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
unsigned &value, const scale_mode scale,
|
||||
const unsigned minval = 0, const unsigned maxval = INT32_MAX,
|
||||
const unsigned default_value = 0);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, unsigned &value, const scale_mode scale,
|
||||
const unsigned minval = 0, const unsigned maxval = INT32_MAX, const unsigned default_value = 0);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
uint8_t &value, const uint8_t minval = 0,
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, uint8_t &value, const uint8_t minval = 0,
|
||||
const uint8_t maxval = 255, const uint8_t default_value = 0);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
int64_t &value, const int64_t minval, const int64_t maxval,
|
||||
const int64_t default_value = -1);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, int64_t &value, const int64_t minval,
|
||||
const int64_t maxval, const int64_t default_value = -1);
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
int32_t &value, const int32_t minval, const int32_t maxval,
|
||||
const int32_t default_value = -1);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, int32_t &value, const int32_t minval,
|
||||
const int32_t maxval, const int32_t default_value = -1);
|
||||
|
||||
inline bool parse_option_intptr(int argc, char *const argv[], int &narg,
|
||||
const char *option, intptr_t &value,
|
||||
const intptr_t minval, const intptr_t maxval,
|
||||
const intptr_t default_value = -1) {
|
||||
inline bool parse_option_intptr(int argc, char *const argv[], int &narg, const char *option, intptr_t &value,
|
||||
const intptr_t minval, const intptr_t maxval, const intptr_t default_value = -1) {
|
||||
static_assert(sizeof(intptr_t) == 4 || sizeof(intptr_t) == 8, "WTF?");
|
||||
if (sizeof(intptr_t) == 8)
|
||||
return parse_option(argc, argv, narg, option,
|
||||
*reinterpret_cast<int64_t *>(&value), int64_t(minval),
|
||||
return parse_option(argc, argv, narg, option, *reinterpret_cast<int64_t *>(&value), int64_t(minval),
|
||||
int64_t(maxval), int64_t(default_value));
|
||||
else
|
||||
return parse_option(argc, argv, narg, option,
|
||||
*reinterpret_cast<int32_t *>(&value), int32_t(minval),
|
||||
return parse_option(argc, argv, narg, option, *reinterpret_cast<int32_t *>(&value), int32_t(minval),
|
||||
int32_t(maxval), int32_t(default_value));
|
||||
}
|
||||
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
logging::loglevel &);
|
||||
bool parse_option(int argc, char *const argv[], int &narg, const char *option, logging::loglevel &);
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct keygen_params_pod {
|
||||
@@ -295,10 +279,8 @@ struct actor_config_pod {
|
||||
unsigned signal_nops{0};
|
||||
|
||||
actor_config_pod() = default;
|
||||
actor_config_pod(unsigned actor_id, actor_testcase testcase,
|
||||
unsigned space_id, unsigned wait4id)
|
||||
: actor_id(actor_id), space_id(space_id), testcase(testcase),
|
||||
wait4id(wait4id) {}
|
||||
actor_config_pod(unsigned actor_id, actor_testcase testcase, unsigned space_id, unsigned wait4id)
|
||||
: actor_id(actor_id), space_id(space_id), testcase(testcase), wait4id(wait4id) {}
|
||||
};
|
||||
|
||||
extern const struct option_verb mode_bits[];
|
||||
@@ -326,8 +308,7 @@ struct actor_config : public config::actor_config_pod {
|
||||
bool wanna_event4signalling() const { return true /* TODO ? */; }
|
||||
|
||||
actor_config() = default;
|
||||
actor_config(actor_testcase testcase, const actor_params ¶ms,
|
||||
unsigned space_id, unsigned wait4id);
|
||||
actor_config(actor_testcase testcase, const actor_params ¶ms, unsigned space_id, unsigned wait4id);
|
||||
|
||||
actor_config(const char *str) : actor_config() {
|
||||
if (!deserialize(str, *this))
|
||||
|
Reference in New Issue
Block a user