Correction of the last warning for gcc -Weffc++ (a member to init in the constructor initialization list)

This commit is contained in:
Sébastien Rombauts 2012-12-05 17:40:03 +01:00
parent 554a79b64d
commit b6a86ab467
4 changed files with 6 additions and 3 deletions

View File

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

View File

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

View File

@ -28,7 +28,7 @@ namespace SQLite
*/
class Database
{
friend class Statement;
friend class Statement; // Give Statement constructor access to the mpSQLite Connection Handle
public:
/**

View File

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