summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-01-28 14:10:14 +0100
committerlouiz’ <louiz@louiz.org>2018-01-28 14:10:14 +0100
commit9bf81a2c04eddabd0f09ea9157e6e7c97bea88f5 (patch)
treea44bc9ca7e53cba40dbcc37a90d2fa79a0171bd5 /src
parent6e7ee320bc1256793bc11c4b00a8f4f89f407af4 (diff)
downloadbiboumi-9bf81a2c04eddabd0f09ea9157e6e7c97bea88f5.tar.gz
biboumi-9bf81a2c04eddabd0f09ea9157e6e7c97bea88f5.tar.bz2
biboumi-9bf81a2c04eddabd0f09ea9157e6e7c97bea88f5.tar.xz
biboumi-9bf81a2c04eddabd0f09ea9157e6e7c97bea88f5.zip
This should fix the int conversion warning on 32bits arch
Diffstat (limited to 'src')
-rw-r--r--src/database/query.cpp2
-rw-r--r--src/database/query.hpp2
-rw-r--r--src/database/row.hpp3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/database/query.cpp b/src/database/query.cpp
index 4054007..d27dc59 100644
--- a/src/database/query.cpp
+++ b/src/database/query.cpp
@@ -6,7 +6,7 @@ void actual_bind(Statement& statement, const std::string& value, int index)
statement.bind_text(index, value);
}
-void actual_bind(Statement& statement, const std::size_t value, int index)
+void actual_bind(Statement& statement, const std::int64_t value, int index)
{
statement.bind_int64(index, value);
}
diff --git a/src/database/query.hpp b/src/database/query.hpp
index 547138f..8434944 100644
--- a/src/database/query.hpp
+++ b/src/database/query.hpp
@@ -12,7 +12,7 @@
#include <string>
void actual_bind(Statement& statement, const std::string& value, int index);
-void actual_bind(Statement& statement, const std::size_t value, int index);
+void actual_bind(Statement& statement, const std::int64_t value, int index);
void actual_bind(Statement& statement, const OptionalBool& value, int index);
#ifdef DEBUG_SQL_QUERIES
diff --git a/src/database/row.hpp b/src/database/row.hpp
index 130863a..4dc98be 100644
--- a/src/database/row.hpp
+++ b/src/database/row.hpp
@@ -42,7 +42,8 @@ struct Row
if (id.value == Id::unset_value)
{
this->insert(*db);
- std::get<Id>(this->columns).value = db->last_inserted_rowid;
+ if (db->last_inserted_rowid >= 0)
+ std::get<Id>(this->columns).value = static_cast<Id::real_type>(db->last_inserted_rowid);
}
else
this->update(*db);