summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2017-01-26 17:59:25 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-01-26 18:37:42 +0200
commita8225b8fffd2aa2f0b0d8a2ebc2e15905485dc93 (patch)
treeeb7ad450e59a843c7861b18678cf2e6ef130fb25
parent68440ee6c27a8c1cdd3e179794862e59d3eb5344 (diff)
downloadqtlocation-mapboxgl-a8225b8fffd2aa2f0b0d8a2ebc2e15905485dc93.tar.gz
[Qt] Make datatypes compatible with the default implementation
On the default all integers map to `sqlite3_bind_int64`.
-rw-r--r--platform/qt/src/sqlite3.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp
index 367b51811d..85de73e6fc 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 <typename T>
void Statement::bind(int offset, T value) {
@@ -211,11 +208,26 @@ void Statement::bind(int offset, std::nullptr_t) {
}
template <>
+void Statement::bind(int offset, int32_t value) {
+ bind(offset, static_cast<int64_t>(value));
+}
+
+template <>
void Statement::bind(int offset, bool value) {
bind(offset, static_cast<int>(value));
}
template <>
+void Statement::bind(int offset, int8_t value) {
+ bind(offset, static_cast<int64_t>(value));
+}
+
+template <>
+void Statement::bind(int offset, uint8_t value) {
+ bind(offset, static_cast<int64_t>(value));
+}
+
+template <>
void Statement::bind(int offset, mbgl::Timestamp value) {
bind(offset, std::chrono::system_clock::to_time_t(value));
}