diff --git a/Makefile b/Makefile index 572cacd..04a4b99 100644 --- a/Makefile +++ b/Makefile @@ -19,12 +19,12 @@ # -CXX := -g++ +CXX := -clang++ DEBUG := -g -O0 -DUNITTEST RELEASE := -s -O3 -fno-rtti -CXXFLAGS := $(DEBUG) -Wno-unknown-warning-option -Wno-address-of-packed-member -pedantic-errors -Wall -Wextra -Werror -Wfatal-errors -std=c++17 -m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +CXXFLAGS := $(RELEASE) -Wno-unknown-warning-option -Wno-address-of-packed-member -pedantic-errors -Wall -Wextra -Werror -Wfatal-errors -std=c++17 -m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE LDFLAGS := -L/usr/lib BUILD := build OBJ_DIR := $(BUILD)/objects diff --git a/src/izaro-storage.cpp b/src/izaro-storage.cpp index 484b53a..d9a7507 100644 --- a/src/izaro-storage.cpp +++ b/src/izaro-storage.cpp @@ -52,34 +52,33 @@ int main( } - size_t utest_size = 4096; + size_t db_port = 20450; - if(cmd_args.isFlagSet("-utest-count")) + if(cmd_args.isFlagSet("-port")) { try{ - utest_size = std::stoll(cmd_args.getFlagValue("-utest-count")); + db_port = std::stoi(cmd_args.getFlagValue("-port")); + if(db_port>std::numeric_limits::max()) throw std::runtime_error("invalid_port"); } catch (...) { - std::cerr << "Invalid utest-count value" << std::endl; + std::cerr << "Invalid port value" << std::endl; return 1; } } - size_t db_port = 20450; +#ifdef UNITTEST + size_t utest_size = 4096; - if(cmd_args.isFlagSet("-port")) + if(cmd_args.isFlagSet("-utest-count")) { try{ - db_port = std::stoi(cmd_args.getFlagValue("-port")); - if(db_port>std::numeric_limits::max()) throw std::runtime_error("invalid_port"); + utest_size = std::stoll(cmd_args.getFlagValue("-utest-count")); } catch (...) { - std::cerr << "Invalid port value" << std::endl; + std::cerr << "Invalid utest-count value" << std::endl; return 1; } - } -#ifdef UNITTEST { database db(database::create(utest_str, utest_size*2));