diff --git a/src/build.cpp b/src/build.cpp index c1b425f..5f3d88f 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -5,9 +5,9 @@ #include "fs.hpp" #include -#include +#include #include -#include +#include #include namespace cmkr { @@ -94,4 +94,4 @@ int cmkr_build_install(void) { } catch (...) { return cmkr::error::Status(cmkr::error::Status::Code::InstallError); } -} \ No newline at end of file +} diff --git a/src/error.cpp b/src/error.cpp index a8d2552..1415bbe 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -1,6 +1,6 @@ #include "error.hpp" -#include +#include namespace cmkr { namespace error { @@ -14,11 +14,12 @@ Status::Code Status::code() const noexcept { return ec_; } } // namespace error } // namespace cmkr -const char *err_string[] = { - "Success", "Runtime error", "Initialization error", "CMake generation error", "Build error", +// strings for cmkr::error::Status::Code +static const char *err_string[] = { + "Success", "Runtime error", "Initialization error", "CMake generation error", "Build error", "Clean error", "Install error", }; const char *cmkr_error_status(int i) { - assert(i >= 0 && i < 5); + assert(i >= 0 && i < (sizeof(err_string) / sizeof(*(err_string)))); return err_string[i]; -} \ No newline at end of file +}