diff --git a/aslp-cpp/.gitignore b/aslp-cpp/.gitignore index b033b8d2..4a7cf188 100644 --- a/aslp-cpp/.gitignore +++ b/aslp-cpp/.gitignore @@ -11,3 +11,4 @@ CMakeUserPresets.json compile_commands.json env.bat env.ps1 +.cache diff --git a/aslp-cpp/include/aslp-cpp/aslp-cpp.hpp b/aslp-cpp/include/aslp-cpp/aslp-cpp.hpp index 7f367d4e..08feb239 100644 --- a/aslp-cpp/include/aslp-cpp/aslp-cpp.hpp +++ b/aslp-cpp/include/aslp-cpp/aslp-cpp.hpp @@ -14,7 +14,7 @@ class aslp_connection public: aslp_connection(const std::string& server_addr, int server_port); aslp_connection(aslp_connection&&) noexcept; - auto get_opcode(int opcode) -> std::string; + auto get_opcode(uint32_t opcode) -> std::string; void wait_active(); ~aslp_connection(); }; @@ -54,7 +54,7 @@ class aslp_client { auto static start(const std::string& addr, int server_port) -> std::unique_ptr; /** Returns the semantics for the given opcode, as a newline-separated string. */ - auto get_opcode(int opcode) -> std::string; + auto get_opcode(uint32_t opcode) -> std::string; /** Destroys the aslp_client and terminates the managed server as well. */ virtual ~aslp_client() { diff --git a/aslp-cpp/source/aslp-cpp.cpp b/aslp-cpp/source/aslp-cpp.cpp index 03f51416..57cf5e75 100644 --- a/aslp-cpp/source/aslp-cpp.cpp +++ b/aslp-cpp/source/aslp-cpp.cpp @@ -147,7 +147,7 @@ void aslp_connection::wait_active() std::cout << "\n"; } -std::string aslp_connection::get_opcode(int opcode) +std::string aslp_connection::get_opcode(uint32_t opcode) { auto codestr = std::format("{:#x}", opcode); std::cout << codestr << "\n"; @@ -165,7 +165,7 @@ std::string aslp_connection::get_opcode(int opcode) throw std::runtime_error(result["error"]); } if (!result.contains("semantics")) { - throw std::runtime_error(result["semantics missing"]); + throw std::runtime_error("semantics missing"); } return result["semantics"]; } @@ -179,7 +179,7 @@ aslp_connection::aslp_connection(const std::string& server_addr, aslp_connection::aslp_connection(aslp_connection&&) noexcept = default; aslp_connection::~aslp_connection() = default; -std::string aslp_client::get_opcode(int opcode) +std::string aslp_client::get_opcode(uint32_t opcode) { aslp_connection conn {server_addr, server_port}; conn.wait_active();