diff --git a/TriviaBot/bot/GatewayHandler.cpp b/TriviaBot/bot/GatewayHandler.cpp index d14792e..a31b6ad 100644 --- a/TriviaBot/bot/GatewayHandler.cpp +++ b/TriviaBot/bot/GatewayHandler.cpp @@ -100,7 +100,7 @@ void GatewayHandler::on_hello(json decoded, client &c, websocketpp::connection_h send_identify(c, hdl); } -void GatewayHandler::on_dispatch(json decoded, client &c, websocketpp::connection_hdl &hdl) { +void GatewayHandler::on_dispatch(json decoded, client &, websocketpp::connection_hdl &) { last_seq = decoded["s"]; std::string event_name = decoded["t"]; json data = decoded["d"]; @@ -382,7 +382,6 @@ void GatewayHandler::on_event_guild_role_delete(json data) { auto it = roles.find(role_id); if (it != roles.end()) { - DiscordObjects::Role &role = roles[role_id]; DiscordObjects::Guild &guild = guilds[data["guild_id"]]; auto check_lambda = [role_id](const DiscordObjects::Role *r) { diff --git a/TriviaBot/bot/Logger.cpp b/TriviaBot/bot/Logger.cpp index e42b5ad..6d2a626 100644 --- a/TriviaBot/bot/Logger.cpp +++ b/TriviaBot/bot/Logger.cpp @@ -28,6 +28,8 @@ namespace Logger { case LogLevel::Warning: return std::cerr; } + + return std::cerr; } void write(std::string text, LogLevel log_level) { diff --git a/TriviaBot/bot/TriviaGame.cpp b/TriviaBot/bot/TriviaGame.cpp index 7d62884..a9914ca 100644 --- a/TriviaBot/bot/TriviaGame.cpp +++ b/TriviaBot/bot/TriviaGame.cpp @@ -105,7 +105,7 @@ TriviaGame::~TriviaGame() { std::string update_sql; if (data.size() < scores.size()) { // some users dont have entries yet - std::string sql = "INSERT INTO TotalScores (User, TotalScore, AverageTime) VALUES "; + sql = "INSERT INTO TotalScores (User, TotalScore, AverageTime) VALUES "; for (auto &i : scores) { if (data.find(i.first) == data.end()) { sql += "(?, ?, ?),"; @@ -252,8 +252,8 @@ void TriviaGame::give_hint(int hints_given, std::string hint) { // count number of *s int length = 0; - for (unsigned int i = 0; i < word.length(); i++) { - if (word[i] == hide_char) { + for (unsigned int j = 0; j < word.length(); j++) { + if (word[j] == hide_char) { length++; } } diff --git a/TriviaBot/bot/js/V8Instance.cpp b/TriviaBot/bot/js/V8Instance.cpp index 6a6f9b1..d372c6b 100644 --- a/TriviaBot/bot/js/V8Instance.cpp +++ b/TriviaBot/bot/js/V8Instance.cpp @@ -504,13 +504,6 @@ Local V8Instance::wrap_role(DiscordObjects::Role *role) { } void V8Instance::js_get_role(Local property, const PropertyCallbackInfo &info) { - void *self_v = info.Data().As()->Value(); - if (!self_v) { - Logger::write("[v8] [js_get_role] Class pointer empty", Logger::LogLevel::Warning); - return; - } - V8Instance *self = static_cast(self_v); - void *role_v = info.Holder()->GetInternalField(0).As()->Value(); if (!role_v) { Logger::write("[v8] [js_get_role] Role pointer empty", Logger::LogLevel::Warning); diff --git a/TriviaBot/data_management/LoadDB.cpp b/TriviaBot/data_management/LoadDB.cpp index bd4fca6..dcc790f 100644 --- a/TriviaBot/data_management/LoadDB.cpp +++ b/TriviaBot/data_management/LoadDB.cpp @@ -16,17 +16,8 @@ / Hideous code, but only needs to be run one time. **/ -static int callback(void *x, int argc, char **argv, char **azColName) { - int i; - for (i = 0; i