[Pkg-owncloud-commits] [owncloud-client] 85/211: ownsql: Cleanups: In modern C++, we use 0 instead of NULL

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 336c95ce5bfe3d1e7adf5e9822a787c876c9cf9f
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Oct 15 16:46:39 2014 +0200

    ownsql: Cleanups: In modern C++, we use 0 instead of NULL
---
 src/mirall/ownsql.cpp | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/mirall/ownsql.cpp b/src/mirall/ownsql.cpp
index c61f3d3..d9a795b 100644
--- a/src/mirall/ownsql.cpp
+++ b/src/mirall/ownsql.cpp
@@ -25,14 +25,14 @@
 namespace Mirall {
 
 SqlDatabase::SqlDatabase()
-    :_db(NULL)
+    :_db(0)
 {
 
 }
 
 bool SqlDatabase::isOpen()
 {
-    return _db != NULL;
+    return _db != 0;
 }
 
 bool SqlDatabase::open( const QString& filename )
@@ -42,11 +42,11 @@ bool SqlDatabase::open( const QString& filename )
     }
 
     int flag = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_NOMUTEX;
-    SQLITE_DO( sqlite3_open_v2(filename.toUtf8().constData(), &_db, flag, NULL) );
+    SQLITE_DO( sqlite3_open_v2(filename.toUtf8().constData(), &_db, flag, 0) );
 
     if( _errId != SQLITE_OK ) {
         close(); // FIXME: Correct?
-        _db = NULL;
+        _db = 0;
     }
     return isOpen();
 }
@@ -62,7 +62,7 @@ void SqlDatabase::close()
 {
     if( _db ) {
         SQLITE_DO(sqlite3_close_v2(_db) );
-        _db = NULL;
+        _db = 0;
     }
 }
 
@@ -81,14 +81,6 @@ sqlite3* SqlDatabase::sqliteDb()
     return _db;
 }
 
-#if 0
-QStringList tableColumns(const QString& table)
-{
-    QStringList re;
-    if( !_db ) return re;
-
-}
-#endif
 /* =========================================================================================== */
 
 SqlQuery::SqlQuery( SqlDatabase db )
@@ -120,7 +112,7 @@ int SqlQuery::prepare( const QString& sql)
         finish();
     }
     if(!_sql.isEmpty() ) {
-        SQLITE_DO(sqlite3_prepare_v2(_db, _sql.toUtf8().constData(), -1, &_stmt, NULL));
+        SQLITE_DO(sqlite3_prepare_v2(_db, _sql.toUtf8().constData(), -1, &_stmt, 0));
         if( _errId != SQLITE_OK ) {
             qDebug() << "XXXXXXXXXXXXXXXXXXXX " << _error << "in"<<_sql;
         }
@@ -241,7 +233,7 @@ int SqlQuery::numRowsAffected()
 void SqlQuery::finish()
 {
     SQLITE_DO(sqlite3_finalize(_stmt));
-    _stmt = NULL;
+    _stmt = 0;
 }
 
 void SqlQuery::reset()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list