diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sqlitepp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sqlitepp.cpp b/src/sqlitepp.cpp index 272284b..51bad8d 100644 --- a/src/sqlitepp.cpp +++ b/src/sqlitepp.cpp @@ -91,7 +91,7 @@ void Statement::bind(const std::string& name, const int value) { void Statement::bind(const int index, const std::string& value) { requireOpen(); handleBindResult(index, sqlite3_bind_text(m_handle, index, value.c_str(), - value.size(), NULL)); + value.size(), nullptr)); } void Statement::bind(const std::string& name, const std::string& value) { @@ -209,7 +209,7 @@ void Database::open(const std::string& file) { } int result = sqlite3_open(file.c_str(), &m_handle); - if (m_handle == NULL) { + if (m_handle == nullptr) { throw std::runtime_error("sqlitepp::Database::open(std::string&): " "Can't allocate memory"); } @@ -227,11 +227,11 @@ std::shared_ptr<Statement> Database::prepare(const std::string& sql) { requireOpen(); sqlite3_stmt* statementHandle; int result = sqlite3_prepare_v2(m_handle, sql.c_str(), sql.size(), - &statementHandle, NULL); + &statementHandle, nullptr); if (result != SQLITE_OK) { throw DatabaseError(result, sqlite3_errmsg(m_handle)); } - if (statementHandle == NULL) { + if (statementHandle == nullptr) { throw std::runtime_error("Statement handle is NULL"); } auto statement = std::shared_ptr<Statement>(new Statement(statementHandle)); |