diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-10-08 17:47:15 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-10-08 17:47:15 +0100 |
commit | 4eb8889cfdec6ea3ea8e430b8939a4f3d8918623 (patch) | |
tree | 5aacf15e72a481ef7c3bdfece5dab383952c9489 | |
parent | Simplify checkResult (diff) | |
download | libdbpp-postgresql-4eb8889cfdec6ea3ea8e430b8939a4f3d8918623.tar.bz2 libdbpp-postgresql-4eb8889cfdec6ea3ea8e430b8939a4f3d8918623.tar.xz libdbpp-postgresql-4eb8889cfdec6ea3ea8e430b8939a4f3d8918623.zip |
Fix the trivial clang-tidy warnings
-rw-r--r-- | libpqpp/pq-column.cpp | 2 | ||||
-rw-r--r-- | libpqpp/pq-cursorselectcommand.h | 6 | ||||
-rw-r--r-- | libpqpp/pq-mock.cpp | 2 | ||||
-rw-r--r-- | libpqpp/pq-prepared.h | 6 |
4 files changed, 10 insertions, 6 deletions
diff --git a/libpqpp/pq-column.cpp b/libpqpp/pq-column.cpp index 3ed8e20..5a5f6b6 100644 --- a/libpqpp/pq-column.cpp +++ b/libpqpp/pq-column.cpp @@ -52,7 +52,7 @@ PQ::Column::apply(DB::HandleField & h) const h.string({value(), length()}); break; case BOOLOID: - h.boolean(value()[0] == 't'); + h.boolean(*value() == 't'); break; case INT2OID: case INT4OID: diff --git a/libpqpp/pq-cursorselectcommand.h b/libpqpp/pq-cursorselectcommand.h index 2b3418b..bd46547 100644 --- a/libpqpp/pq-cursorselectcommand.h +++ b/libpqpp/pq-cursorselectcommand.h @@ -1,10 +1,11 @@ #ifndef PQ_CURSORSELECTCOMMAND_H #define PQ_CURSORSELECTCOMMAND_H -#include "command_fwd.h" // for CommandOptionsCPtr +#include "command_fwd.h" #include "pq-command.h" #include "pq-selectbase.h" -#include <string> // for string +#include <c++11Helpers.h> +#include <string> namespace PQ { class Connection; @@ -14,6 +15,7 @@ namespace PQ { CursorSelectCommand( Connection *, const std::string & sql, const PQ::CommandOptionsCPtr &, const DB::CommandOptionsCPtr &); ~CursorSelectCommand() override; + SPECIAL_MEMBERS_DELETE(CursorSelectCommand); bool fetch() override; void execute() override; diff --git a/libpqpp/pq-mock.cpp b/libpqpp/pq-mock.cpp index b96fcdb..883403c 100644 --- a/libpqpp/pq-mock.cpp +++ b/libpqpp/pq-mock.cpp @@ -1,5 +1,4 @@ #include "pq-mock.h" -#include "connection.h" #include "mockDatabase.h" #include "pq-connection.h" #include <boost/algorithm/string/case_conv.hpp> @@ -126,5 +125,4 @@ ORDER BY 1, 2)SQL"); master->execute(MockDropTablespaceDir::get(tablespacePath)); } } - } diff --git a/libpqpp/pq-prepared.h b/libpqpp/pq-prepared.h index ddddf01..4da04ea 100644 --- a/libpqpp/pq-prepared.h +++ b/libpqpp/pq-prepared.h @@ -3,15 +3,19 @@ #include "command_fwd.h" #include "pq-command.h" +#include <c++11Helpers.h> #include <string> namespace PQ { class Connection; class PreparedStatement : public Command { + public: + ~PreparedStatement() override = default; + SPECIAL_MEMBERS_DELETE(PreparedStatement); + protected: PreparedStatement(Connection *, const std::string &, const DB::CommandOptionsCPtr &); - ~PreparedStatement() override = default; const char * prepare() const; mutable const char * pstmt; |