diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-10-28 04:19:05 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-10-28 04:19:05 -0400 |
commit | d950460e149d78962508f221c5e81717798cb228 (patch) | |
tree | 496c478e4b65a070eefe5e985b246e4c0a08af59 | |
parent | 2c2686946d3a9364399fb9c24733ed31383cd94f (diff) | |
download | abaddon-portaudio-d950460e149d78962508f221c5e81717798cb228.tar.gz abaddon-portaudio-d950460e149d78962508f221c5e81717798cb228.zip |
try to fix some more compilation errors/warnings
-rw-r--r-- | discord/store.cpp | 8 | ||||
-rw-r--r-- | discord/store.hpp | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/discord/store.cpp b/discord/store.cpp index e7715b4..159e3dd 100644 --- a/discord/store.cpp +++ b/discord/store.cpp @@ -261,7 +261,7 @@ void Store::SetGuildMember(Snowflake guild_id, Snowflake user_id, const GuildMem s->Bind(9, data.IsPending); if (!s->Insert()) - fprintf(stderr, "member insert failed for %" PRIu64 "/% " PRIu64 ": %s\n", static_cast<uint64_t>(user_id), static_cast<uint64_t>(guild_id), m_db.ErrStr()); + fprintf(stderr, "member insert failed for %" PRIu64 "/%" PRIu64 ": %s\n", static_cast<uint64_t>(user_id), static_cast<uint64_t>(guild_id), m_db.ErrStr()); s->Reset(); @@ -661,7 +661,7 @@ std::optional<ChannelData> Store::GetChannel(Snowflake id) const { s->Get(0, r); } s->Reset(); - if (recipients.size() > 0) + if (!recipients.empty()) r.RecipientIDs = std::move(recipients); } @@ -2173,6 +2173,10 @@ int Store::Statement::Bind(int index, size_t num) { return m_db->SetError(sqlite3_bind_int64(m_stmt, index, num)); } +int Store::Statement::Bind(int index, Snowflake id) { + return m_db->SetError(sqlite3_bind_int64(m_stmt, index, static_cast<sqlite3_int64>(id))); +} + int Store::Statement::Bind(int index, const char *str, size_t len) { if (len == -1) len = strlen(str); return m_db->SetError(sqlite3_bind_blob(m_stmt, index, str, len, SQLITE_TRANSIENT)); diff --git a/discord/store.hpp b/discord/store.hpp index 7bb1af1..b30d4f4 100644 --- a/discord/store.hpp +++ b/discord/store.hpp @@ -103,6 +103,7 @@ private: int Bind(int index, int32_t num); int Bind(int index, uint32_t num); int Bind(int index, size_t num); + int Bind(int index, Snowflake id); int Bind(int index, const char *str, size_t len = -1); int Bind(int index, const std::string &str); int Bind(int index, bool val); |