From a8225b8fffd2aa2f0b0d8a2ebc2e15905485dc93 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Thu, 26 Jan 2017 17:59:25 +0200 Subject: [PATCH] [Qt] Make datatypes compatible with the default implementation On the default all integers map to `sqlite3_bind_int64`. --- platform/qt/src/sqlite3.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp index 367b51811..85de73e6f 100644 --- a/platform/qt/src/sqlite3.cpp +++ b/platform/qt/src/sqlite3.cpp @@ -189,10 +189,7 @@ Statement::operator bool() const { return impl.operator bool(); } -template void Statement::bind(int, int8_t); -template void Statement::bind(int, int32_t); template void Statement::bind(int, int64_t); -template void Statement::bind(int, uint8_t); template void Statement::bind(int offset, T value) { @@ -210,11 +207,26 @@ void Statement::bind(int offset, std::nullptr_t) { checkQueryError(impl->query); } +template <> +void Statement::bind(int offset, int32_t value) { + bind(offset, static_cast(value)); +} + template <> void Statement::bind(int offset, bool value) { bind(offset, static_cast(value)); } +template <> +void Statement::bind(int offset, int8_t value) { + bind(offset, static_cast(value)); +} + +template <> +void Statement::bind(int offset, uint8_t value) { + bind(offset, static_cast(value)); +} + template <> void Statement::bind(int offset, mbgl::Timestamp value) { bind(offset, std::chrono::system_clock::to_time_t(value));