From 5a2c4a89fa0b1db5f4d0d45087521fda7a89a5f6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 21 Sep 2021 20:18:49 +0100 Subject: Tidy up IWYU --- iwyu.json | 50 +++++++++++++++++++++++++++++++++++- libdbpp/column.h | 5 +--- libdbpp/command.h | 5 +--- libdbpp/selectcommand.cpp | 4 +-- libdbpp/testCore.cpp | 6 +---- libdbpp/testCore.h | 3 +-- libdbpp/unittests/libdbpp-mysql | 2 +- libdbpp/unittests/libdbpp-odbc | 2 +- libdbpp/unittests/libdbpp-postgresql | 2 +- libdbpp/unittests/libdbpp-sqlite | 2 +- libdbpp/unittests/testUtils.cpp | 11 ++------ 11 files changed, 61 insertions(+), 31 deletions(-) diff --git a/iwyu.json b/iwyu.json index 321a158..81bbc04 100644 --- a/iwyu.json +++ b/iwyu.json @@ -19,7 +19,7 @@ "symbol": [ "boost::posix_time::time_duration", "private", - "", + "", "public" ] }, @@ -31,6 +31,22 @@ "public" ] }, + { + "include": [ + "@.field_types.h.", + "private", + "", + "public" + ] + }, + { + "include": [ + "@.mysql_time.h.", + "private", + "", + "public" + ] + }, { "symbol": [ "free", @@ -119,6 +135,38 @@ "public" ] }, + { + "include": [ + "@", + "private", + "", + "public" + ] + }, + { + "include": [ + "@", + "private", + "", + "public" + ] + }, + { + "include": [ + "@", + "private", + "", + "public" + ] + }, + { + "include": [ + "@", + "private", + "", + "public" + ] + }, { "include": [ "@", diff --git a/libdbpp/column.h b/libdbpp/column.h index 11a4658..2924d77 100644 --- a/libdbpp/column.h +++ b/libdbpp/column.h @@ -11,7 +11,7 @@ #endif #include #pragma GCC diagnostic pop -#include +#include #include #include #include @@ -21,9 +21,6 @@ #include #include -namespace boost::posix_time { - class time_duration; -} namespace DB { class Blob; /// Abstract class for something that can handle field data. See Column::apply. diff --git a/libdbpp/command.h b/libdbpp/command.h index 8c3262b..2c3e9ee 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -3,7 +3,7 @@ #include "command_fwd.h" #include "error.h" -#include +#include #include #include #include @@ -22,9 +22,6 @@ #include #include -namespace boost::posix_time { - class time_duration; -} namespace DB { class Blob; /// Exception thrown when binding a parameter of type the connector doesn't support. diff --git a/libdbpp/selectcommand.cpp b/libdbpp/selectcommand.cpp index f67fca0..3217f3b 100644 --- a/libdbpp/selectcommand.cpp +++ b/libdbpp/selectcommand.cpp @@ -1,14 +1,14 @@ #include "selectcommand.h" #include "error.h" #include -#include // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include #include #include #include #include #include +// IWYU pragma: no_forward_declare boost::multi_index::member namespace DB { ColumnIndexOutOfRange::ColumnIndexOutOfRange(unsigned int n) : colNo(n) { } diff --git a/libdbpp/testCore.cpp b/libdbpp/testCore.cpp index bb92cf4..94e1cbf 100644 --- a/libdbpp/testCore.cpp +++ b/libdbpp/testCore.cpp @@ -1,7 +1,6 @@ #include "testCore.h" #include "column.h" -#include -#include // IWYU pragma: keep +#include #include #include #include @@ -9,9 +8,6 @@ #include #include -namespace boost::posix_time { - class time_duration; -} namespace DB { TestCore::TestCore() : testString("Some C String"), testDateTime(boost::posix_time::from_time_t(1430530593)), diff --git a/libdbpp/testCore.h b/libdbpp/testCore.h index a7a261a..32c033d 100644 --- a/libdbpp/testCore.h +++ b/libdbpp/testCore.h @@ -2,8 +2,7 @@ #define DB_TESTCORE_H #include "dbTypes.h" -#include -#include +#include #include #include #include diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql index a863051..b8d2747 160000 --- a/libdbpp/unittests/libdbpp-mysql +++ b/libdbpp/unittests/libdbpp-mysql @@ -1 +1 @@ -Subproject commit a8630518c10667ff88f0e0846de98337743a5808 +Subproject commit b8d27474eb1dbf54977364377c138f5a3fce4020 diff --git a/libdbpp/unittests/libdbpp-odbc b/libdbpp/unittests/libdbpp-odbc index b7f71b7..a32c420 160000 --- a/libdbpp/unittests/libdbpp-odbc +++ b/libdbpp/unittests/libdbpp-odbc @@ -1 +1 @@ -Subproject commit b7f71b71224238a8b7bdb76b6feb98db9bac7aa9 +Subproject commit a32c4204fa9d99ab3dd6c1b1bcfbeee3a5318bf3 diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql index 465ea24..d629a24 160000 --- a/libdbpp/unittests/libdbpp-postgresql +++ b/libdbpp/unittests/libdbpp-postgresql @@ -1 +1 @@ -Subproject commit 465ea24362ee267cf83909efa0b5cdee689ff1f7 +Subproject commit d629a2404592fbf73f8378d1e010fbab9cfe2dbf diff --git a/libdbpp/unittests/libdbpp-sqlite b/libdbpp/unittests/libdbpp-sqlite index f036fb3..1aed242 160000 --- a/libdbpp/unittests/libdbpp-sqlite +++ b/libdbpp/unittests/libdbpp-sqlite @@ -1 +1 @@ -Subproject commit f036fb38fb75c1298f6729ffc2f7d411b5478854 +Subproject commit 1aed242983a48d7f06562d4aba5be287be59a0d4 diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index 043fc30..e95b572 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -7,10 +7,8 @@ #include "mockDatabase.h" #include // IWYU pragma: keep #include -#include -#include -#include -#include +#include +#include #include #include #include @@ -40,13 +38,8 @@ namespace DB { class InvalidConversion; -} -namespace DB { class UnexpectedNullValue; } -namespace boost::posix_time { - class time_duration; -} class StandardMockDatabase : public DB::PluginMock { public: -- cgit v1.2.3