diff --git a/test/config.cc b/test/config.cc index 1f1d94d4..c17c0d71 100644 --- a/test/config.cc +++ b/test/config.cc @@ -232,7 +232,7 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option, 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) { - uint64_t proxy = (size_t)value; + uint64_t proxy = (uint64_t)value; if (parse_option(argc, argv, narg, option, proxy, config::binary, (uint64_t)minval, (uint64_t)maxval, (uint64_t)default_value)) { @@ -245,7 +245,7 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option, 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) { - uint64_t proxy = (size_t)value; + uint64_t proxy = (uint64_t)value; if (parse_option(argc, argv, narg, option, proxy, config::binary, (uint64_t)minval, (uint64_t)maxval, (uint64_t)default_value)) { @@ -357,11 +357,12 @@ void dump(const char *title) { : i->params.pathname_log.c_str()); } - log_info( - "database: %s, size %" PRIu64 "[%" PRIi64 "..%" PRIi64 ", %i %i, %i]\n", - i->params.pathname_db.c_str(), i->params.size_now, i->params.size_lower, - i->params.size_upper, i->params.shrink_threshold, i->params.growth_step, - i->params.pagesize); + log_info("database: %s, size %" PRIuPTR "[%" PRIiPTR "..%" PRIiPTR + ", %i %i, %i]\n", + i->params.pathname_db.c_str(), i->params.size_now, + i->params.size_lower, i->params.size_upper, + i->params.shrink_threshold, i->params.growth_step, + i->params.pagesize); dump_verbs("mode", i->params.mode_flags, mode_bits); dump_verbs("table", i->params.table_flags, table_bits); diff --git a/test/config.h b/test/config.h index cbd9889b..e8dc8757 100644 --- a/test/config.h +++ b/test/config.h @@ -216,12 +216,12 @@ struct actor_params_pod { unsigned mode_flags; unsigned table_flags; - int64_t size_lower; - int64_t size_now; - int64_t size_upper; - int32_t shrink_threshold; - int32_t growth_step; - int32_t pagesize; + intptr_t size_lower; + intptr_t size_now; + intptr_t size_upper; + int shrink_threshold; + int growth_step; + int pagesize; unsigned test_duration; unsigned test_nops; diff --git a/test/main.cc b/test/main.cc index b79333a5..1cac3506 100644 --- a/test/main.cc +++ b/test/main.cc @@ -173,15 +173,17 @@ int main(int argc, char *const argv[]) { mdbx_limits_dbsize_min(params.pagesize), mdbx_limits_dbsize_max(params.pagesize))) continue; - if (config::parse_option(argc, argv, narg, "shrink-threshold", - params.shrink_threshold, 0, - mdbx_limits_dbsize_max(params.pagesize) - - mdbx_limits_dbsize_min(params.pagesize))) + if (config::parse_option( + argc, argv, narg, "shrink-threshold", params.shrink_threshold, 0, + (int)std::min((intptr_t)INT_MAX, + mdbx_limits_dbsize_max(params.pagesize) - + mdbx_limits_dbsize_min(params.pagesize)))) continue; - if (config::parse_option(argc, argv, narg, "growth-step", - params.growth_step, 0, - mdbx_limits_dbsize_max(params.pagesize) - - mdbx_limits_dbsize_min(params.pagesize))) + if (config::parse_option( + argc, argv, narg, "growth-step", params.growth_step, 0, + (int)std::min((intptr_t)INT_MAX, + mdbx_limits_dbsize_max(params.pagesize) - + mdbx_limits_dbsize_min(params.pagesize)))) continue; if (config::parse_option(argc, argv, narg, "keygen.width",