Skip to content
Permalink
Browse files

Fix -Wterminate warning on GCC 6

Fixes #4137
  • Loading branch information...
est31 committed Jul 8, 2016
1 parent 795f1c7 commit 483cca78a1312aa3b9c01049b5ebf6842929ec7a
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/database-sqlite3.cpp
@@ -56,8 +56,14 @@ SQLite format specification:
SQLOK(sqlite3_prepare_v2(m_database, query, -1, &m_stmt_##name, NULL),\
"Failed to prepare query '" query "'")

#define FINALIZE_STATEMENT(statement) \
SQLOK(sqlite3_finalize(statement), "Failed to finalize " #statement)
#define SQLOK_ERRSTREAM(s, m) \
if ((s) != SQLITE_OK) { \
errorstream << (m) << ": " \
<< sqlite3_errmsg(m_database) << std::endl; \
}

#define FINALIZE_STATEMENT(statement) SQLOK_ERRSTREAM(sqlite3_finalize(statement), \
"Failed to finalize " #statement)

int Database_SQLite3::busyHandler(void *data, int count)
{
@@ -289,6 +295,6 @@ Database_SQLite3::~Database_SQLite3()
FINALIZE_STATEMENT(m_stmt_end)
FINALIZE_STATEMENT(m_stmt_delete)

SQLOK(sqlite3_close(m_database), "Failed to close database");
SQLOK_ERRSTREAM(sqlite3_close(m_database), "Failed to close database");
}

0 comments on commit 483cca7

Please sign in to comment.
You can’t perform that action at this time.