Fix CppDepends most useful warnings:

- Convert last old-style cast to reinterpret_cast<>
 - Statement::Ptr is now private, with a friend declaration for Column
 - noexcept should not be defined as the depreacted throw()
This commit is contained in:
Sébastien Rombauts 2015-06-01 22:05:24 +02:00
parent 8c7aced3fb
commit d36c39ccf3
3 changed files with 10 additions and 6 deletions

View File

@ -45,10 +45,14 @@ public:
#endif #endif
// Detect whether the compiler supports C++11 noexcept exception specifications. // Detect whether the compiler supports C++11 noexcept exception specifications.
#if (defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) #if ( defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)) \
&& defined(__GXX_EXPERIMENTAL_CXX0X__))
// GCC 4.7 and following have noexcept // GCC 4.7 and following have noexcept
#elif defined(__clang__) && __has_feature(cxx_noexcept) #elif defined(__clang__) && __has_feature(cxx_noexcept)
// Clang 3.0 and above have noexcept // Clang 3.0 and above have noexcept
#elif defined(_MSC_VER) && _MSC_VER > 1800
// Visual Studio 2015 and above have noexcept
#else #else
#define noexcept throw() // Visual Studio 2013 does not support noexcept, and "throw()" is deprecated by C++11
#define noexcept
#endif #endif

View File

@ -44,9 +44,9 @@ class Column;
*/ */
class Statement class Statement
{ {
public: friend class Column; // For access to Statement::Ptr inner class
class Ptr;
public:
/** /**
* @brief Compile and register the SQL query for the provided SQLite Database Connection * @brief Compile and register the SQL query for the provided SQLite Database Connection
* *
@ -400,7 +400,7 @@ public:
return sqlite3_errmsg(mStmtPtr); return sqlite3_errmsg(mStmtPtr);
} }
public: private:
/** /**
* @brief Shared pointer to the sqlite3_stmt SQLite Statement Object. * @brief Shared pointer to the sqlite3_stmt SQLite Statement Object.
* *

View File

@ -65,7 +65,7 @@ double Column::getDouble() const noexcept // nothrow
// Return a pointer to the text value (NULL terminated string) of the column specified by its index starting at 0 // Return a pointer to the text value (NULL terminated string) of the column specified by its index starting at 0
const char* Column::getText(const char* apDefaultValue /* = "" */) const noexcept // nothrow const char* Column::getText(const char* apDefaultValue /* = "" */) const noexcept // nothrow
{ {
const char* pText = (const char*)sqlite3_column_text(mStmtPtr, mIndex); const char* pText = reinterpret_cast<const char*>(sqlite3_column_text(mStmtPtr, mIndex));
return (pText?pText:apDefaultValue); return (pText?pText:apDefaultValue);
} }