From: John Spray Date: Fri, 21 Jul 2017 12:06:47 +0000 (-0400) Subject: common: remove config opt conversion utility X-Git-Tag: v12.1.2~168^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16480%2Fhead;p=ceph.git common: remove config opt conversion utility Now that the new options.cc stuff has landed, this is no longer needed. Signed-off-by: John Spray --- diff --git a/src/convert.cc b/src/convert.cc deleted file mode 100644 index 94a715539be..00000000000 --- a/src/convert.cc +++ /dev/null @@ -1,55 +0,0 @@ - -#include -//#include "include/acconfig.h" -using namespace std; -#define _STR(x) #x -#define STRINGIFY(x) _STR(x) - -#define OPTION_OPT_LONGLONG(name, def_val) name((1LL) * def_val), -#define OPTION_OPT_STR(name, def_val) name(def_val), -#define OPTION_OPT_DOUBLE(name, def_val) name(def_val), -#define OPTION_OPT_FLOAT(name, def_val) name(def_val), -#define OPTION_OPT_BOOL(name, def_val) name(def_val), -#define OPTION_OPT_ADDR(name, def_val) name(def_val), -#define OPTION_OPT_U32(name, def_val) name(def_val), -#define OPTION_OPT_U64(name, def_val) name(((uint64_t)1) * def_val), -#define OPTION_OPT_UUID(name, def_val) name(def_val), - -string convert_type(string t) { - if (t == "OPT_STR") - return "TYPE_STR"; - if (t == "OPT_DOUBLE" || t == "OPT_FLOAT") - return "TYPE_FLOAT"; - if (t == "OPT_BOOL") - return "TYPE_BOOL"; - if (t == "OPT_INT" || - t == "OPT_LONGLONG") - return "TYPE_INT"; - if (t == "OPT_U32" || - t == "OPT_U64") - return "TYPE_UINT"; - if (t == "OPT_UUID") - return "TYPE_UUID"; - if (t == "OPT_ADDR") - return "TYPE_ADDR"; - return "ERROR"; -} - -#define OPTION(name, type, def_val) \ - cout << " Option(\"" << STRINGIFY(name) << "\", Option::" << convert_type(STRINGIFY(type)) \ - << ", Option::LEVEL_ADVANCED)\n" \ - << " .set_default(" << STRINGIFY(def_val) << ")\n" \ - << " .set_description(\"\"),\n\n"; - -#define OPTION_VALIDATOR(name) -#define SAFE_OPTION(name, type, def_val) \ - cout << " Option(\"" << STRINGIFY(name) << "\", Option::" << convert_type(STRINGIFY(type)) \ - << ", Option::LEVEL_ADVANCED)\n" \ - << " .set_default(" << STRINGIFY(def_val) << ")\n" \ - << " .set_description(\"\")\n" \ - << " .set_safe(),\n\n"; - -int main(int argc, char **argv) -{ - #include "common/legacy_config_opts.h" -}