Browse Source

Use nullptr instead of NULL

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) {
91 91
 void Statement::bind(const int index, const std::string& value) {
92 92
   requireOpen();
93 93
   handleBindResult(index, sqlite3_bind_text(m_handle, index, value.c_str(),
94
-      value.size(), NULL));
94
+      value.size(), nullptr));
95 95
 }
96 96
 
97 97
 void Statement::bind(const std::string& name, const std::string& value) {
@@ -209,7 +209,7 @@ void Database::open(const std::string& file) {
209 209
   }
210 210
   int result = sqlite3_open(file.c_str(), &m_handle);
211 211
 
212
-  if (m_handle == NULL) {
212
+  if (m_handle == nullptr) {
213 213
     throw std::runtime_error("sqlitepp::Database::open(std::string&): "
214 214
                              "Can't allocate memory");
215 215
   }
@@ -227,11 +227,11 @@ std::shared_ptr<Statement> Database::prepare(const std::string& sql) {
227 227
   requireOpen();
228 228
   sqlite3_stmt* statementHandle;
229 229
   int result = sqlite3_prepare_v2(m_handle, sql.c_str(), sql.size(),
230
-                                  &statementHandle, NULL);
230
+                                  &statementHandle, nullptr);
231 231
   if (result != SQLITE_OK) {
232 232
     throw DatabaseError(result, sqlite3_errmsg(m_handle));
233 233
   }
234
-  if (statementHandle == NULL) {
234
+  if (statementHandle == nullptr) {
235 235
     throw std::runtime_error("Statement handle is NULL");
236 236
   }
237 237
   auto statement = std::shared_ptr<Statement>(new Statement(statementHandle));

Loading…
Cancel
Save