From aa9d554d736604a0716698e803bcd01165ed0773 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 15 Feb 2018 23:04:59 +0100 Subject: Use nullptr instead of NULL --- src/sqlitepp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sqlitepp.cpp') 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 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(new Statement(statementHandle)); -- cgit v1.2.1