Skip to content

Commit

Permalink
Cleanup clang-tidy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Nov 16, 2024
1 parent bbc14c7 commit 115cbda
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 13 deletions.
13 changes: 13 additions & 0 deletions src/lib/pq/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,31 @@

#include <algorithm>
#include <cctype>
#include <chrono>
#include <cstring>
#include <exception>
#include <format>
#include <functional>
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>

#include <libpq-fe.h>

#include <tao/pq/access_mode.hpp>
#include <tao/pq/connection_status.hpp>
#include <tao/pq/exception.hpp>
#include <tao/pq/internal/poll.hpp>
#include <tao/pq/internal/unreachable.hpp>
#include <tao/pq/isolation_level.hpp>
#include <tao/pq/notification.hpp>
#include <tao/pq/oid.hpp>
#include <tao/pq/poll.hpp>
#include <tao/pq/result.hpp>
#include <tao/pq/transaction_status.hpp>

namespace tao::pq
{
Expand Down
11 changes: 11 additions & 0 deletions src/lib/pq/connection_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

#include <tao/pq/connection_pool.hpp>

#include <chrono>
#include <functional>
#include <memory>
#include <optional>
#include <string_view>
#include <utility>

#include <tao/pq/connection.hpp>
#include <tao/pq/internal/poll.hpp>
#include <tao/pq/poll.hpp>

namespace tao::pq
{
auto connection_pool::v_create() const -> std::unique_ptr< pq::connection >
Expand Down
5 changes: 5 additions & 0 deletions src/lib/pq/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#include <tao/pq/exception.hpp>

#include <stdexcept>
#include <string_view>

#include <libpq-fe.h>

namespace tao::pq
{
sql_error::sql_error( const char* what, const std::string_view in_sqlstate )
Expand Down
4 changes: 4 additions & 0 deletions src/lib/pq/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/field.hpp>

#include <cstddef>
#include <string>

#include <tao/pq/row.hpp>

namespace tao::pq
Expand Down
6 changes: 4 additions & 2 deletions src/lib/pq/internal/demangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/internal/demangle.hpp>

#include <string>

#if !defined( _WIN32 )
#include <cstdlib>
#include <cxxabi.h>
#include <memory>
#endif

#include <tao/pq/internal/demangle.hpp>

namespace tao::pq::internal
{
auto demangle( const char* const symbol ) -> std::string
Expand Down
2 changes: 2 additions & 0 deletions src/lib/pq/internal/poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cerrno>
#include <cstring>
#include <format>
#include <string.h>
#include <string>

#if defined( _WIN32 )
Expand All @@ -18,6 +19,7 @@

#include <tao/pq/exception.hpp>
#include <tao/pq/internal/unreachable.hpp>
#include <tao/pq/poll.hpp>

namespace tao::pq::internal
{
Expand Down
7 changes: 7 additions & 0 deletions src/lib/pq/large_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
#include <tao/pq/large_object.hpp>

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <ios>
#include <memory>
#include <stdexcept>
#include <string>
#include <utility>

#include <libpq/libpq-fs.h>

#include <tao/pq/binary.hpp>
#include <tao/pq/connection.hpp>
#include <tao/pq/internal/resize_uninitialized.hpp>
#include <tao/pq/transaction.hpp>
Expand Down
3 changes: 3 additions & 0 deletions src/lib/pq/parameter_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include <tao/pq/parameter_traits.hpp>

#include <string>
#include <string_view>

namespace tao::pq::internal
{
void array_append( std::string& buffer, std::string_view data )
Expand Down
11 changes: 8 additions & 3 deletions src/lib/pq/result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/result.hpp>

#include <cassert>
#include <charconv>
#include <cstddef>
#include <format>
#include <stdexcept>
#include <string>

#include <tao/pq/exception.hpp>
#include <tao/pq/result.hpp>
#include <libpq-fe.h>

#include <tao/pq/exception.hpp>
#include <tao/pq/internal/from_chars.hpp>
#include <tao/pq/internal/unreachable.hpp>
#include <tao/pq/internal/zsv.hpp>

namespace tao::pq
{
Expand Down
2 changes: 2 additions & 0 deletions src/lib/pq/result_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

#include <tao/pq/result_traits.hpp>

#include <cstddef>
#include <cstring>
#include <stdexcept>
#include <string>

#include <tao/pq/binary.hpp>
#include <tao/pq/internal/from_chars.hpp>
#include <tao/pq/internal/resize_uninitialized.hpp>
#include <tao/pq/internal/strtox.hpp>
Expand Down
7 changes: 6 additions & 1 deletion src/lib/pq/row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/result.hpp>
#include <tao/pq/row.hpp>

#include <cassert>
#include <cstddef>
#include <format>
#include <stdexcept>
#include <string>

#include <tao/pq/internal/zsv.hpp>
#include <tao/pq/result.hpp>

namespace tao::pq
{
Expand Down
3 changes: 3 additions & 0 deletions src/lib/pq/table_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/table_field.hpp>

#include <cstddef>

#include <tao/pq/table_row.hpp>

namespace tao::pq
Expand Down
5 changes: 5 additions & 0 deletions src/lib/pq/table_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

#include <tao/pq/table_reader.hpp>

#include <cassert>
#include <chrono>
#include <cstring>
#include <stdexcept>
#include <string_view>
#include <tuple>

#include <libpq-fe.h>

#include <tao/pq/connection.hpp>
#include <tao/pq/exception.hpp>
#include <tao/pq/internal/unreachable.hpp>
Expand Down
5 changes: 4 additions & 1 deletion src/lib/pq/table_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <tao/pq/table_reader.hpp>
#include <tao/pq/table_row.hpp>

#include <cstddef>
#include <format>
#include <stdexcept>

#include <tao/pq/table_reader.hpp>

namespace tao::pq
{
Expand Down
3 changes: 3 additions & 0 deletions src/lib/pq/table_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <tao/pq/table_writer.hpp>

#include <chrono>
#include <cstddef>
#include <memory>
#include <string_view>
#include <tuple>

#include <libpq-fe.h>
Expand Down
12 changes: 10 additions & 2 deletions src/lib/pq/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <stdexcept>
#include <tao/pq/transaction.hpp>

#include <chrono>
#include <cstdio>
#include <exception>
#include <memory>
#include <utility>

#include <libpq-fe.h>

#include <tao/pq/connection.hpp>
#include <tao/pq/oid.hpp>
#include <tao/pq/transaction.hpp>
#include <tao/pq/result.hpp>

namespace tao::pq
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/compare.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace tao::pq::internal
{
template< typename T, typename U >
[[nodiscard]] bool compare( const T& lhs, const U& rhs ) noexcept
[[nodiscard]] auto compare( const T& lhs, const U& rhs ) noexcept -> bool
{
if( lhs.size() != rhs.size() ) {
return false;
Expand Down
8 changes: 5 additions & 3 deletions src/test/pq/basic_datatypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <array>
#include <chrono>
#include <cmath>
#include <exception>
#include <iostream>
#include <limits>
#include <stdexcept>
#include <vector>
#include <memory>
#include <string>

#include "../compare.hpp"
#include "../getenv.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/test/pq/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <exception>
#include <iostream>

#include "../getenv.hpp"
#include "../macros.hpp"

Expand Down
5 changes: 5 additions & 0 deletions src/test/pq/table_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#include <cstddef>
#include <exception>
#include <iostream>
#include <memory>

#include "../getenv.hpp"
#include "../macros.hpp"

Expand Down

0 comments on commit 115cbda

Please sign in to comment.