From 4233cf64179db008c72eac0b9641e03e590d9229 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Wed, 4 Jun 2025 13:24:56 +0500 Subject: [PATCH] several warning fixed --- .gitignore | 1 + dev/conditions.h | 2 +- dev/function.h | 3 --- dev/storage_base.h | 2 +- include/sqlite_orm/sqlite_orm.h | 7 ++----- tests/tests3.cpp | 4 +++- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0f11172d2..129aed371 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,6 @@ cmake-build-debug/ /compile build/ build-xcode/ +build-code-edit/ *.sqlite *.db \ No newline at end of file diff --git a/dev/conditions.h b/dev/conditions.h index 4a2196f0c..f565912d0 100644 --- a/dev/conditions.h +++ b/dev/conditions.h @@ -35,7 +35,7 @@ namespace sqlite_orm { * Collated something */ template - struct collate_t : public condition_t { + struct collate_t : condition_t { T expr; collate_argument argument; diff --git a/dev/function.h b/dev/function.h index 7ba8cf97e..c2b66dd2b 100644 --- a/dev/function.h +++ b/dev/function.h @@ -445,7 +445,6 @@ namespace sqlite_orm { [[nodiscard]] consteval auto quote(F callable) const { using Sig = function_signature_type_t; // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::move(callable)}; } @@ -456,7 +455,6 @@ namespace sqlite_orm { requires ((stateless || std::copy_constructible)) [[nodiscard]] consteval auto quote(F callable) const { // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::move(callable)}; } @@ -477,7 +475,6 @@ namespace sqlite_orm { requires ((stateless || std::copy_constructible)) [[nodiscard]] consteval auto quote(Args&&... constructorArgs) const { // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::forward(constructorArgs)...}; } }; diff --git a/dev/storage_base.h b/dev/storage_base.h index 120e3846a..c352c74b5 100644 --- a/dev/storage_base.h +++ b/dev/storage_base.h @@ -765,7 +765,7 @@ namespace sqlite_orm { this->executor.perform_exec( connection.get(), ss.str(), - [](void* data, int argc, orm_gsl::zstring* argv, orm_gsl::zstring* /*columnName*/) -> int { + [](void* data, int /*argc*/, orm_gsl::zstring* argv, orm_gsl::zstring* /*columnName*/) -> int { auto& objectNames_ = *(data_t*)data; objectNames_.emplace_back(argv[0]); return 0; diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 59754dec0..eba7cffe2 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -5159,7 +5159,7 @@ namespace sqlite_orm { * Collated something */ template - struct collate_t : public condition_t { + struct collate_t : condition_t { T expr; collate_argument argument; @@ -11515,7 +11515,6 @@ namespace sqlite_orm { [[nodiscard]] consteval auto quote(F callable) const { using Sig = function_signature_type_t; // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::move(callable)}; } @@ -11526,7 +11525,6 @@ namespace sqlite_orm { requires ((stateless || std::copy_constructible)) [[nodiscard]] consteval auto quote(F callable) const { // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::move(callable)}; } @@ -11547,7 +11545,6 @@ namespace sqlite_orm { requires ((stateless || std::copy_constructible)) [[nodiscard]] consteval auto quote(Args&&... constructorArgs) const { // detect whether overloaded call operator can be picked using `Sig` - using call_operator_type = decltype(static_cast(&F::operator())); return quoted_scalar_function{this->cstr, std::forward(constructorArgs)...}; } }; @@ -18813,7 +18810,7 @@ namespace sqlite_orm { this->executor.perform_exec( connection.get(), ss.str(), - [](void* data, int argc, orm_gsl::zstring* argv, orm_gsl::zstring* /*columnName*/) -> int { + [](void* data, int /*argc*/, orm_gsl::zstring* argv, orm_gsl::zstring* /*columnName*/) -> int { auto& objectNames_ = *(data_t*)data; objectNames_.emplace_back(argv[0]); return 0; diff --git a/tests/tests3.cpp b/tests/tests3.cpp index 8fb2959c3..66ca9b22f 100644 --- a/tests/tests3.cpp +++ b/tests/tests3.cpp @@ -297,7 +297,8 @@ TEST_CASE("Blob") { return data; }; - auto storage = make_storage("blob.db", make_table("blob", make_column("data", &BlobData::data))); + auto filename = "blob.db"; + auto storage = make_storage(filename, make_table("blob", make_column("data", &BlobData::data))); storage.sync_schema(); storage.remove_all(); @@ -340,6 +341,7 @@ TEST_CASE("Blob") { storage.insert(BlobData{}); free(data); + std::remove(filename); } /**