From 90768b07f7feb55a9bd70cfaacb5543bfd074022 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Thu, 14 Apr 2022 23:57:23 +0200 Subject: [PATCH] Format. --- .../pqxx/internal/ignore-deprecated-post.hxx | 2 +- .../pqxx/internal/ignore-deprecated-pre.hxx | 2 +- include/pqxx/transaction_base.hxx | 37 ++++++++----------- src/connection.cxx | 3 +- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/include/pqxx/internal/ignore-deprecated-post.hxx b/include/pqxx/internal/ignore-deprecated-post.hxx index 9d860d3de..cebcf0594 100644 --- a/include/pqxx/internal/ignore-deprecated-post.hxx +++ b/include/pqxx/internal/ignore-deprecated-post.hxx @@ -1,7 +1,7 @@ /// End a code block started by "ignore-deprecated-pre.hxx". #if !defined(PQXX_IGNORING_DEPRECATED) -#error "Ended an 'ignore-deprecated' block while none was active." +# error "Ended an 'ignore-deprecated' block while none was active." #endif #if defined(__GNUC__) diff --git a/include/pqxx/internal/ignore-deprecated-pre.hxx b/include/pqxx/internal/ignore-deprecated-pre.hxx index 5ced53e3c..8ac57afaa 100644 --- a/include/pqxx/internal/ignore-deprecated-pre.hxx +++ b/include/pqxx/internal/ignore-deprecated-pre.hxx @@ -12,7 +12,7 @@ * small as possible. */ #if defined(PQXX_IGNORING_DEPRECATED) -#error "Started an 'ignore-deprecated' block inside another." +# error "Started an 'ignore-deprecated' block inside another." #endif #define PQXX_IGNORING_DEPRECATED diff --git a/include/pqxx/transaction_base.hxx b/include/pqxx/transaction_base.hxx index 471a614ed..4363cc56a 100644 --- a/include/pqxx/transaction_base.hxx +++ b/include/pqxx/transaction_base.hxx @@ -270,8 +270,7 @@ public: * @param query Query or command to execute. * @return A result set describing the query's or command's result. */ - result - exec(std::string_view query) + result exec(std::string_view query) { #include "pqxx/internal/ignore-deprecated-pre.hxx" return exec(query, std::string_view{}); @@ -284,8 +283,9 @@ public: * @param desc Optional identifier for query, to help pinpoint SQL errors. * @return A result set describing the query's or command's result. */ - [[deprecated("Pass your query as a std::string_view, not stringstream.")]] - result exec(std::stringstream const &query, std::string_view desc) + [[deprecated( + "Pass your query as a std::string_view, not stringstream.")]] result + exec(std::stringstream const &query, std::string_view desc) { #include "pqxx/internal/ignore-deprecated-pre.hxx" return exec(query.str(), desc); @@ -298,8 +298,8 @@ public: * * @throw unexpected_rows If the query returned the wrong number of rows. */ - [[deprecated("The desc parameter is going away.")]] - result exec0(zview query, std::string_view desc) + [[deprecated("The desc parameter is going away.")]] result + exec0(zview query, std::string_view desc) { #include "pqxx/internal/ignore-deprecated-pre.hxx" return exec_n(0, query, desc); @@ -312,10 +312,7 @@ public: * * @throw unexpected_rows If the query returned the wrong number of rows. */ - result exec0(zview query) - { - return exec_n(0, query); - } + result exec0(zview query) { return exec_n(0, query); } /// Execute command returning a single row of data. /** Works like @ref exec, but requires the result to contain exactly one row. @@ -324,8 +321,8 @@ public: * * @throw unexpected_rows If the query returned the wrong number of rows. */ - [[deprecated("The desc parameter is going away.")]] - row exec1(zview query, std::string_view desc) + [[deprecated("The desc parameter is going away.")]] row + exec1(zview query, std::string_view desc) { #include "pqxx/internal/ignore-deprecated-pre.hxx" return exec_n(1, query, desc).front(); @@ -339,10 +336,7 @@ public: * * @throw unexpected_rows If the query returned the wrong number of rows. */ - row exec1(zview query) - { - return exec_n(1, query).front(); - } + row exec1(zview query) { return exec_n(1, query).front(); } /// Execute command, expect given number of rows. /** Works like @ref exec, but checks that the result has exactly the expected @@ -350,8 +344,8 @@ public: * * @throw unexpected_rows If the query returned the wrong number of rows. */ - [[deprecated("The desc parameter is going away.")]] - result exec_n(result::size_type rows, zview query, std::string_view desc); + [[deprecated("The desc parameter is going away.")]] result + exec_n(result::size_type rows, zview query, std::string_view desc); /// Execute command, expect given number of rows. /** Works like @ref exec, but checks that the result has exactly the expected @@ -371,8 +365,8 @@ public: * database. It returns that value, converted to the type you specify. */ template - [[deprecated("The desc parameter is going away.")]] - TYPE query_value(zview query, std::string_view desc) + [[deprecated("The desc parameter is going away.")]] TYPE + query_value(zview query, std::string_view desc) { #include "pqxx/internal/ignore-deprecated-pre.hxx" row const r{exec1(query, desc)}; @@ -387,8 +381,7 @@ public: /** This is convenience shorthand for querying exactly one value from the * database. It returns that value, converted to the type you specify. */ - template - TYPE query_value(zview query) + template TYPE query_value(zview query) { row const r{exec1(query)}; if (std::size(r) != 1) diff --git a/src/connection.cxx b/src/connection.cxx index 8772be5fd..bef8c79aa 100644 --- a/src/connection.cxx +++ b/src/connection.cxx @@ -1248,8 +1248,7 @@ std::string pqxx::connection::connection_string() const #if defined(_WIN32) || __has_include() pqxx::connecting::connecting(zview connection_string) : m_conn{connection::connect_nonblocking, connection_string} -{ -} +{} #endif // defined(_WIN32) || __has_include(