Browse Source

Use nullptr instead of NULL

master
Robin Krahl 1 year ago
parent
commit
aa9d554d73
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      src/sqlitepp.cpp

+ 4
- 4
src/sqlitepp.cpp View File

@@ -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));

Loading…
Cancel
Save