diff --git a/Makefile b/Makefile index c5cf81a..06d7346 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CXX = g++ # flags for C++ -CXXFLAGS ?= -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +CXXFLAGS ?= -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn # [Debug,Release] BUILD ?= Debug diff --git a/src/SQLiteC++/Database.cpp b/src/SQLiteC++/Database.cpp index 76fb4ae..bfa0f6d 100644 --- a/src/SQLiteC++/Database.cpp +++ b/src/SQLiteC++/Database.cpp @@ -56,6 +56,7 @@ int Database::exec(const char* apQueries) // throw(SQLite::Exception); // make a COPY OF THE result, else it will be destroy before the next line // (when the underlying temporary Statement and Column objects are destroyed) // this is an issue only for pointer type result (ie. char* and blob) +// (use the Column copy-constructor) Column Database::execAndGet(const char* apQuery) // throw(SQLite::Exception) { Statement query(*this, apQuery); diff --git a/src/SQLiteC++/Database.h b/src/SQLiteC++/Database.h index 27b8e79..49de0c9 100644 --- a/src/SQLiteC++/Database.h +++ b/src/SQLiteC++/Database.h @@ -28,7 +28,7 @@ namespace SQLite */ class Database { - friend class Statement; + friend class Statement; // Give Statement constructor access to the mpSQLite Connection Handle public: /** diff --git a/src/SQLiteC++/Statement.cpp b/src/SQLiteC++/Statement.cpp index 739eaa5..e1123c9 100644 --- a/src/SQLiteC++/Statement.cpp +++ b/src/SQLiteC++/Statement.cpp @@ -20,8 +20,9 @@ namespace SQLite Statement::Statement(Database &aDatabase, const char* apQuery) : // throw(SQLite::Exception) mpStmt(NULL), mpStmtRefCount(NULL), - mpSQLite(aDatabase.mpSQLite), + mpSQLite(aDatabase.mpSQLite), // need Database friendship mQuery(apQuery), + mColumnCount(0), mbOk(false), mbDone(false) { @@ -186,6 +187,7 @@ bool Statement::executeStep(void) // throw(SQLite::Exception) } // Return a copy of the column data specified by its index starting at 0 +// (use the Column copy-constructor) Column Statement::getColumn(const int aIndex) const // throw(SQLite::Exception) { if (false == mbOk)