From 5995bd64852aeaef3b59444b72229d7077575620 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 30 Mar 2019 11:43:42 +0000 Subject: Tidy fixes for latest clang --- libsqlitepp/sqlite-command.cpp | 20 ++++++++++---------- libsqlitepp/sqlite-selectcommand.cpp | 14 +++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'libsqlitepp') diff --git a/libsqlitepp/sqlite-command.cpp b/libsqlitepp/sqlite-command.cpp index 0ae59d1..0020679 100644 --- a/libsqlitepp/sqlite-command.cpp +++ b/libsqlitepp/sqlite-command.cpp @@ -21,56 +21,56 @@ SQLite::Command::~Command() void SQLite::Command::bindParamI(unsigned int n, int v) { - if (sqlite3_bind_int(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamI(unsigned int n, long int v) { - if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int64(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamI(unsigned int n, long long int v) { - if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int64(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamI(unsigned int n, unsigned int v) { - if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int64(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamI(unsigned int n, long unsigned int v) { - if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int64(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamI(unsigned int n, long long unsigned int v) { - if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_int64(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamF(unsigned int n, double v) { - if (sqlite3_bind_double(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_double(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } void SQLite::Command::bindParamF(unsigned int n, float v) { - if (sqlite3_bind_double(stmt, n + 1, v) != SQLITE_OK) { + if (sqlite3_bind_double(stmt, (int)n + 1, v) != SQLITE_OK) { throw Error(c->db); } } @@ -82,7 +82,7 @@ SQLite::Command::bindParamS(unsigned int n, const Glib::ustring & s) void SQLite::Command::bindParamS(unsigned int n, const std::string_view & s) { - if (sqlite3_bind_text(stmt, n + 1, s.data(), s.length(), SQLITE_STATIC) != SQLITE_OK) { + if (sqlite3_bind_text(stmt, (int)n + 1, s.data(), s.length(), SQLITE_STATIC) != SQLITE_OK) { throw Error(c->db); } } @@ -104,7 +104,7 @@ SQLite::Command::bindParamT(unsigned int, const boost::posix_time::ptime &) void SQLite::Command::bindNull(unsigned int n) { - if (sqlite3_bind_null(stmt, n + 1) != SQLITE_OK) { + if (sqlite3_bind_null(stmt, (int)n + 1) != SQLITE_OK) { throw Error(c->db); } } diff --git a/libsqlitepp/sqlite-selectcommand.cpp b/libsqlitepp/sqlite-selectcommand.cpp index 197356c..7ad8486 100644 --- a/libsqlitepp/sqlite-selectcommand.cpp +++ b/libsqlitepp/sqlite-selectcommand.cpp @@ -14,22 +14,22 @@ namespace SQLite { { } - bool isNull() const override { - return (SQLITE_NULL == sqlite3_column_type(stmt, colNo)); + [[nodiscard]] bool isNull() const override { + return (SQLITE_NULL == sqlite3_column_type(stmt, (int)colNo)); } void apply(DB::HandleField & h) const override { - switch (sqlite3_column_type(stmt, colNo)) { + switch (sqlite3_column_type(stmt, (int)colNo)) { case SQLITE_INTEGER: - h.integer(sqlite3_column_int64(stmt, colNo)); + h.integer(sqlite3_column_int64(stmt, (int)colNo)); return; case SQLITE_FLOAT: - h.floatingpoint(sqlite3_column_double(stmt, colNo)); + h.floatingpoint(sqlite3_column_double(stmt, (int)colNo)); return; case SQLITE_TEXT: { - auto t = sqlite3_column_text(stmt, colNo); - auto l = sqlite3_column_bytes(stmt, colNo); + auto t = sqlite3_column_text(stmt, (int)colNo); + auto l = sqlite3_column_bytes(stmt, (int)colNo); h.string({ reinterpret_cast(t), (std::size_t)l }); return; } -- cgit v1.2.3