From 78ea5b254f7a895617e6ef85399d01e0af4c4330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Thu, 13 Mar 2014 21:56:28 +0100 Subject: [PATCH] Removed all meaningless (void) from method definitions --- examples/example1/main.cpp | 6 +++--- include/SQLiteCpp/Column.h | 32 ++++++++++++++++---------------- include/SQLiteCpp/Database.h | 8 ++++---- include/SQLiteCpp/Statement.h | 20 ++++++++++---------- include/SQLiteCpp/Transaction.h | 4 ++-- src/Column.cpp | 18 +++++++++--------- src/Database.cpp | 2 +- src/Statement.cpp | 10 +++++----- src/Transaction.cpp | 4 ++-- 9 files changed, 52 insertions(+), 52 deletions(-) diff --git a/examples/example1/main.cpp b/examples/example1/main.cpp index 034a788..c73c66a 100644 --- a/examples/example1/main.cpp +++ b/examples/example1/main.cpp @@ -42,12 +42,12 @@ class Example { public: // Constructor - Example(void) : + Example() : mDb(filename_example_db3), // Open a database file in readonly mode mQuery(mDb, "SELECT * FROM test WHERE weight > :min_weight")// Compile a SQL query, containing one parameter (index 1) { } - virtual ~Example(void) + virtual ~Example() { } @@ -75,7 +75,7 @@ private: }; -int main (void) +int main () { // Basic example (1/6) : try diff --git a/include/SQLiteCpp/Column.h b/include/SQLiteCpp/Column.h index 8f3c2c2..93ce278 100644 --- a/include/SQLiteCpp/Column.h +++ b/include/SQLiteCpp/Column.h @@ -51,7 +51,7 @@ public: */ Column(Statement::Ptr& aStmtPtr, int aIndex) noexcept; // nothrow /// @brief Simple destructor - virtual ~Column(void) noexcept; // nothrow + virtual ~Column() noexcept; // nothrow // default copy constructor and assignment operator are perfectly suited : // they copy the Statement::Ptr which in turn increments the reference counter. @@ -59,7 +59,7 @@ public: /** * @brief Return a pointer to the named assigned to a result column (potentially aliased) */ - const char* getName(void) const noexcept; // nothrow + const char* getName() const noexcept; // nothrow #ifdef SQLITE_ENABLE_COLUMN_METADATA /** @@ -69,15 +69,15 @@ public: * - when building the SQLite library itself (which is the case for the Debian libsqlite3 binary for instance), * - and also when compiling this wrapper. */ - const char* getOriginName(void) const noexcept; // nothrow + const char* getOriginName() const noexcept; // nothrow #endif /// @brief Return the integer value of the column. - int getInt(void) const noexcept; // nothrow + int getInt() const noexcept; // nothrow /// @brief Return the 64bits integer value of the column. - sqlite3_int64 getInt64(void) const noexcept; // nothrow + sqlite3_int64 getInt64() const noexcept; // nothrow /// @brief Return the double (64bits float) value of the column. - double getDouble(void) const noexcept; // nothrow + double getDouble() const noexcept; // nothrow /** * @brief Return a pointer to the text value (NULL terminated string) of the column. * @@ -91,7 +91,7 @@ public: * @warning The value pointed at is only valid while the statement is valid (ie. not finalized), * thus you must copy it before using it beyond its scope (to a std::string for instance). */ - const void* getBlob(void) const noexcept; // nothrow + const void* getBlob() const noexcept; // nothrow /** * @brief Return the type of the value of the column @@ -101,30 +101,30 @@ public: * @warning After a type conversion (by a call to a getXxx on a Column of a Yyy type), * the value returned by sqlite3_column_type() is undefined. */ - int getType(void) const noexcept; // nothrow + int getType() const noexcept; // nothrow /// @brief Test if the column is an integer type value (meaningful only before any conversion) - inline bool isInteger(void) const noexcept // nothrow + inline bool isInteger() const noexcept // nothrow { return (SQLITE_INTEGER == getType()); } /// @brief Test if the column is a floating point type value (meaningful only before any conversion) - inline bool isFloat(void) const noexcept // nothrow + inline bool isFloat() const noexcept // nothrow { return (SQLITE_FLOAT == getType()); } /// @brief Test if the column is a text type value (meaningful only before any conversion) - inline bool isText(void) const noexcept // nothrow + inline bool isText() const noexcept // nothrow { return (SQLITE_TEXT == getType()); } /// @brief Test if the column is a binary blob type value (meaningful only before any conversion) - inline bool isBlob(void) const noexcept // nothrow + inline bool isBlob() const noexcept // nothrow { return (SQLITE_BLOB == getType()); } /// @brief Test if the column is NULL (meaningful only before any conversion) - inline bool isNull(void) const noexcept // nothrow + inline bool isNull() const noexcept // nothrow { return (SQLITE_NULL == getType()); } @@ -138,10 +138,10 @@ public: * - size in bytes of the binary blob returned by getBlob() * - 0 for a NULL value */ - int getBytes(void) const noexcept; + int getBytes() const noexcept; /// @brief Alias returning the number of bytes used by the text (or blob) value of the column - inline int size(void) const noexcept + inline int size() const noexcept { return getBytes (); } @@ -193,7 +193,7 @@ public: #endif /// @brief Return UTF-8 encoded English language explanation of the most recent error. - inline const char* errmsg(void) const + inline const char* errmsg() const { return sqlite3_errmsg(mStmtPtr); } diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index 3bf57e5..ed90bcf 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -87,7 +87,7 @@ public: * * @warning assert in case of error */ - virtual ~Database(void) noexcept; // nothrow + virtual ~Database() noexcept; // nothrow /** * @brief Shortcut to execute one or multiple statements without results. @@ -224,7 +224,7 @@ public: * * @return Rowid of the most recent successful INSERT into the database, or 0 if there was none. */ - inline sqlite3_int64 getLastInsertRowid(void) const noexcept // nothrow + inline sqlite3_int64 getLastInsertRowid() const noexcept // nothrow { return sqlite3_last_insert_rowid(mpSQLite); } @@ -232,7 +232,7 @@ public: /** * @brief Return the filename used to open the database */ - inline const std::string& getFilename(void) const noexcept // nothrow + inline const std::string& getFilename() const noexcept // nothrow { return mFilename; } @@ -240,7 +240,7 @@ public: /** * @brief Return UTF-8 encoded English language explanation of the most recent error. */ - inline const char* errmsg(void) const noexcept // nothrow + inline const char* errmsg() const noexcept // nothrow { return sqlite3_errmsg(mpSQLite); } diff --git a/include/SQLiteCpp/Statement.h b/include/SQLiteCpp/Statement.h index 6563eeb..0734481 100644 --- a/include/SQLiteCpp/Statement.h +++ b/include/SQLiteCpp/Statement.h @@ -69,12 +69,12 @@ public: /** * @brief Finalize and unregister the SQL query from the SQLite Database Connection. */ - virtual ~Statement(void) noexcept; // nothrow + virtual ~Statement() noexcept; // nothrow /** * @brief Reset the statement to make it ready for a new execution. */ - void reset(void); + void reset(); //////////////////////////////////////////////////////////////////////////// // Bind a value to a parameter of the SQL statement, @@ -238,7 +238,7 @@ public: * * @throw SQLite::Exception in case of error */ - bool executeStep(void); + bool executeStep(); /** * @brief Execute a one-step query with no expected result. @@ -259,7 +259,7 @@ public: * * @throw SQLite::Exception in case of error, or if row of results are returned ! */ - int exec(void); + int exec(); //////////////////////////////////////////////////////////////////////////// @@ -302,27 +302,27 @@ public: //////////////////////////////////////////////////////////////////////////// /// @brief Return the UTF-8 SQL Query. - inline const std::string& getQuery(void) const + inline const std::string& getQuery() const { return mQuery; } /// @brief Return the number of columns in the result set returned by the prepared statement - inline int getColumnCount(void) const + inline int getColumnCount() const { return mColumnCount; } /// @brief true when a row has been fetched with executeStep() - inline bool isOk(void) const + inline bool isOk() const { return mbOk; } /// @brief true when the last executeStep() had no more row to fetch - inline bool isDone(void) const + inline bool isDone() const { return mbDone; } /// @brief Return UTF-8 encoded English language explanation of the most recent error. - inline const char* errmsg(void) const + inline const char* errmsg() const { return sqlite3_errmsg(mStmtPtr); } @@ -343,7 +343,7 @@ public: // Copy constructor increments the ref counter Ptr(const Ptr& aPtr); // Decrement the ref counter and finalize the sqlite3_stmt when it reaches 0 - ~Ptr(void) noexcept; // nothrow (no virtual destructor needed here) + ~Ptr() noexcept; // nothrow (no virtual destructor needed here) /// @brief Inline cast operator returning the pointer to SQLite Database Connection Handle inline operator sqlite3*() const diff --git a/include/SQLiteCpp/Transaction.h b/include/SQLiteCpp/Transaction.h index a5b493f..70e7e99 100644 --- a/include/SQLiteCpp/Transaction.h +++ b/include/SQLiteCpp/Transaction.h @@ -55,12 +55,12 @@ public: /** * @brief Safely rollback the transaction if it has not been committed. */ - virtual ~Transaction(void) noexcept; // nothrow + virtual ~Transaction() noexcept; // nothrow /** * @brief Commit the transaction. */ - void commit(void); + void commit(); private: // Transaction must be non-copyable diff --git a/src/Column.cpp b/src/Column.cpp index cec87b2..a679d15 100644 --- a/src/Column.cpp +++ b/src/Column.cpp @@ -25,39 +25,39 @@ Column::Column(Statement::Ptr& aStmtPtr, int aIndex) noexcept : // nothrow } // Finalize and unregister the SQL query from the SQLite Database Connection. -Column::~Column(void) noexcept // nothrow +Column::~Column() noexcept // nothrow { // the finalization will be done by the destructor of the last shared pointer } // Return the named assigned to this result column (potentially aliased) -const char * Column::getName(void) const noexcept // nothrow +const char * Column::getName() const noexcept // nothrow { return sqlite3_column_name(mStmtPtr, mIndex); } #ifdef SQLITE_ENABLE_COLUMN_METADATA // Return the name of the table column that is the origin of this result column -const char * Column::getOriginName(void) const noexcept // nothrow +const char * Column::getOriginName() const noexcept // nothrow { return sqlite3_column_origin_name(mStmtPtr, mIndex); } #endif // Return the integer value of the column specified by its index starting at 0 -int Column::getInt(void) const noexcept // nothrow +int Column::getInt() const noexcept // nothrow { return sqlite3_column_int(mStmtPtr, mIndex); } // Return the 64bits integer value of the column specified by its index starting at 0 -sqlite3_int64 Column::getInt64(void) const noexcept // nothrow +sqlite3_int64 Column::getInt64() const noexcept // nothrow { return sqlite3_column_int64(mStmtPtr, mIndex); } // Return the double value of the column specified by its index starting at 0 -double Column::getDouble(void) const noexcept // nothrow +double Column::getDouble() const noexcept // nothrow { return sqlite3_column_double(mStmtPtr, mIndex); } @@ -70,19 +70,19 @@ const char* Column::getText(const char* apDefaultValue /* = "" */) const noexcep } // Return a pointer to the text value (NULL terminated string) of the column specified by its index starting at 0 -const void* Column::getBlob(void) const noexcept // nothrow +const void* Column::getBlob() const noexcept // nothrow { return sqlite3_column_blob(mStmtPtr, mIndex); } // Return the type of the value of the column -int Column::getType(void) const noexcept // nothrow +int Column::getType() const noexcept // nothrow { return sqlite3_column_type(mStmtPtr, mIndex); } // Return the number of bytes used by the text value of the column -int Column::getBytes(void) const noexcept // nothrow +int Column::getBytes() const noexcept // nothrow { return sqlite3_column_bytes(mStmtPtr, mIndex); } diff --git a/src/Database.cpp b/src/Database.cpp index c92b2a9..11fcc8d 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -54,7 +54,7 @@ Database::Database(const std::string& aFilename, const int aFlags /*= SQLITE_OPE } // Close the SQLite database connection. -Database::~Database(void) noexcept // nothrow +Database::~Database() noexcept // nothrow { int ret = sqlite3_close(mpSQLite); // Never throw an exception in a destructor diff --git a/src/Statement.cpp b/src/Statement.cpp index 8630280..838a6c6 100644 --- a/src/Statement.cpp +++ b/src/Statement.cpp @@ -44,13 +44,13 @@ Statement::Statement(Database &aDatabase, const std::string& aQuery) : } // Finalize and unregister the SQL query from the SQLite Database Connection. -Statement::~Statement(void) noexcept // nothrow +Statement::~Statement() noexcept // nothrow { // the finalization will be done by the destructor of the last shared pointer } // Reset the statement to make it ready for a new execution -void Statement::reset(void) +void Statement::reset() { mbOk = false; mbDone = false; @@ -166,7 +166,7 @@ void Statement::bind(const char* apName) // Execute a step of the query to fetch one row of results -bool Statement::executeStep(void) +bool Statement::executeStep() { if (false == mbDone) { @@ -196,7 +196,7 @@ bool Statement::executeStep(void) } // Execute a one-step query with no expected result -int Statement::exec(void) +int Statement::exec() { if (false == mbDone) { @@ -317,7 +317,7 @@ Statement::Ptr::Ptr(const Statement::Ptr& aPtr) : /** * @brief Decrement the ref counter and finalize the sqlite3_stmt when it reaches 0 */ -Statement::Ptr::~Ptr(void) noexcept // nothrow +Statement::Ptr::~Ptr() noexcept // nothrow { assert(NULL != mpRefCount); assert(0 != *mpRefCount); diff --git a/src/Transaction.cpp b/src/Transaction.cpp index eb38ceb..5971d97 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -27,7 +27,7 @@ Transaction::Transaction(Database& aDatabase) : } // Safely rollback the transaction if it has not been committed. -Transaction::~Transaction(void) noexcept // nothrow +Transaction::~Transaction() noexcept // nothrow { if (false == mbCommited) { @@ -44,7 +44,7 @@ Transaction::~Transaction(void) noexcept // nothrow } // Commit the transaction. -void Transaction::commit(void) +void Transaction::commit() { if (false == mbCommited) {