mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Merge pull request #119 from timrae/fix-warnings
Fix some warnings and increase safety checking on gcc
This commit is contained in:
commit
c6dc1c7cdf
@ -32,7 +32,7 @@ else (MSVC)
|
|||||||
set(CPPLINT_ARG_OUTPUT "--output=eclipse")
|
set(CPPLINT_ARG_OUTPUT "--output=eclipse")
|
||||||
set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
|
set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
|
||||||
# Useful compile flags and extra warnings
|
# Useful compile flags and extra warnings
|
||||||
add_compile_options(-fstack-protector -Wall -Winit-self -Wswitch-enum -Wshadow -Winline)
|
add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline)
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# GCC flags
|
# GCC flags
|
||||||
if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX)
|
if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
@ -412,7 +412,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @throw SQLite::Exception in case of error
|
* @throw SQLite::Exception in case of error
|
||||||
*/
|
*/
|
||||||
static const bool isUnencrypted(const std::string& aFilename);
|
static bool isUnencrypted(const std::string& aFilename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// @{ Database must be non-copyable
|
/// @{ Database must be non-copyable
|
||||||
|
@ -259,13 +259,14 @@ void Database::rekey(const std::string& aNewKey) const
|
|||||||
check(ret);
|
check(ret);
|
||||||
}
|
}
|
||||||
#else // SQLITE_HAS_CODEC
|
#else // SQLITE_HAS_CODEC
|
||||||
|
static_cast<void>(aNewKey); // silence unused parameter warning
|
||||||
const SQLite::Exception exception("No encryption support, recompile with SQLITE_HAS_CODEC to enable.");
|
const SQLite::Exception exception("No encryption support, recompile with SQLITE_HAS_CODEC to enable.");
|
||||||
throw exception;
|
throw exception;
|
||||||
#endif // SQLITE_HAS_CODEC
|
#endif // SQLITE_HAS_CODEC
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test if a file contains an unencrypted database.
|
// Test if a file contains an unencrypted database.
|
||||||
const bool Database::isUnencrypted(const std::string& aFilename)
|
bool Database::isUnencrypted(const std::string& aFilename)
|
||||||
{
|
{
|
||||||
if (aFilename.length() > 0) {
|
if (aFilename.length() > 0) {
|
||||||
std::ifstream fileBuffer(aFilename.c_str(), std::ios::in | std::ios::binary);
|
std::ifstream fileBuffer(aFilename.c_str(), std::ios::in | std::ios::binary);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user