Skip to content

Commit

Permalink
Modernise some parameters.
Browse files Browse the repository at this point in the history
Following suggestions from clant-tidy.
  • Loading branch information
jtv committed Dec 22, 2024
1 parent 289ce9a commit f61e851
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/pqxx/except.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class PQXX_LIBEXPORT sql_error : public failure

public:
explicit sql_error(
std::string whatarg = "", std::string const &Q = "",
char const sqlstate[] = nullptr
std::string const &whatarg = "", std::string Q = "",
char const *sqlstate = nullptr
#if defined(PQXX_HAVE_SOURCE_LOCATION)
,
std::source_location = std::source_location::current()
Expand Down
2 changes: 1 addition & 1 deletion include/pqxx/row.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public:
protected:
friend class const_row_iterator;
friend class result;
row(result const &r, result_size_type index, size_type cols) noexcept;
row(result r, result_size_type index, size_type cols) noexcept;

/// Throw @ref usage_error if row size is not `expected`.
void check_size(size_type expected) const
Expand Down
7 changes: 3 additions & 4 deletions src/except.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,19 @@ pqxx::variable_set_to_null::variable_set_to_null(


pqxx::sql_error::sql_error(
std::string whatarg, std::string const &Q, char const sqlstate[]
std::string const &whatarg, std::string Q, char const *sqlstate
#if defined(PQXX_HAVE_SOURCE_LOCATION)
,
std::source_location loc
#endif
) :
failure{
std::move(whatarg)
failure{whatarg
#if defined(PQXX_HAVE_SOURCE_LOCATION)
,
loc
#endif
},
m_query{Q},
m_query{std::move(Q)},
m_sqlstate{sqlstate ? sqlstate : ""}
{}

Expand Down
4 changes: 2 additions & 2 deletions src/row.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ extern "C"


pqxx::row::row(
result const &r, result::size_type index, size_type cols) noexcept :
m_result{r}, m_index{index}, m_end{cols}
result r, result::size_type index, size_type cols) noexcept :
m_result{std::move(r)}, m_index{index}, m_end{cols}
{}


Expand Down

0 comments on commit f61e851

Please sign in to comment.