aboutsummaryrefslogtreecommitdiff
path: root/src/headless
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-08 01:34:47 +0200
committer Hop311 <hop3114@gmail.com>2023-09-08 01:34:47 +0200
commit7f9a9a8241ba81be9213e6606b8be4a48f1cbaab (patch)
tree26b67f150ec1b43593343344eabdc7deca47d0d8 /src/headless
parent3cd1d62ec00690a1b29070dd4903754e8f089a21 (diff)
Remove return_t, use & instead of if(x != SUCCESS)
Diffstat (limited to 'src/headless')
-rw-r--r--src/headless/main.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/headless/main.cpp b/src/headless/main.cpp
index 9366f12..a5bfc03 100644
--- a/src/headless/main.cpp
+++ b/src/headless/main.cpp
@@ -20,8 +20,8 @@ static char const* get_program_name(char const* name) {
return last_separator;
}
-static return_t headless_load(std::vector<std::filesystem::path> const& roots) {
- return_t ret = SUCCESS;
+static bool headless_load(std::vector<std::filesystem::path> const& roots) {
+ bool ret = true;
Logger::set_info_func([](std::string&& str) { std::cout << str; });
Logger::set_error_func([](std::string&& str) { std::cerr << str; });
@@ -31,17 +31,17 @@ static return_t headless_load(std::vector<std::filesystem::path> const& roots) {
} };
Dataloader dataloader;
- if (dataloader.set_roots(roots) != SUCCESS) {
+ if (!dataloader.set_roots(roots)) {
Logger::error("Failed to set dataloader roots!");
- ret = FAILURE;
+ ret = false;
}
- if (dataloader.load_defines(game_manager) != SUCCESS) {
+ if (!dataloader.load_defines(game_manager)) {
Logger::error("Failed to load defines!");
- ret = FAILURE;
+ ret = false;
}
- if (game_manager.load_hardcoded_defines() != SUCCESS) {
+ if (!game_manager.load_hardcoded_defines()) {
Logger::error("Failed to load hardcoded defines!");
- ret = FAILURE;
+ ret = false;
}
return ret;
@@ -66,12 +66,12 @@ int main(int argc, char const* argv[]) {
std::cout << "!!! HEADLESS SIMULATION START !!!" << std::endl;
- const return_t ret = headless_load(roots);
+ const bool ret = headless_load(roots);
std::cout << "!!! HEADLESS SIMULATION END !!!" << std::endl;
- std::cout << "\nLoad returned: " << (ret == SUCCESS ? "SUCCESS" : "FAILURE") << std::endl;
+ std::cout << "\nLoad returned: " << (ret ? "true" : "false") << std::endl;
- return ret == SUCCESS ? 0 : -1;
+ return ret ? 0 : -1;
}
#endif