Skip to content

Commit

Permalink
Merge pull request #32 from pmeerw/cleanup
Browse files Browse the repository at this point in the history
Some cleanup
  • Loading branch information
mrexodia authored Dec 10, 2021
2 parents 1c23469 + 31cc1c9 commit a28e63f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include "fs.hpp"
#include <sstream>
#include <stddef.h>
#include <cstddef>
#include <stdexcept>
#include <stdlib.h>
#include <cstdlib>
#include <system_error>

namespace cmkr {
Expand Down Expand Up @@ -94,4 +94,4 @@ int cmkr_build_install(void) {
} catch (...) {
return cmkr::error::Status(cmkr::error::Status::Code::InstallError);
}
}
}
11 changes: 6 additions & 5 deletions src/error.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "error.hpp"

#include <assert.h>
#include <cassert>

namespace cmkr {
namespace error {
Expand All @@ -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];
}
}

0 comments on commit a28e63f

Please sign in to comment.