From 980243414e6d093d0efd23b863fd2cd49dcb59f3 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Thu, 2 Nov 2023 12:19:43 +0100 Subject: [PATCH] Fixed as many clang-tidy include warnings as possible --- fineftp-server/include/fineftp/server.h | 3 ++- fineftp-server/src/filesystem.cpp | 27 ++++++++++--------- fineftp-server/src/filesystem.h | 4 +-- fineftp-server/src/ftp_session.cpp | 26 +++++++++++------- fineftp-server/src/ftp_session.h | 13 +++++---- fineftp-server/src/server_impl.h | 14 +++++----- fineftp-server/src/unix/file_man.cpp | 4 ++- fineftp-server/src/unix/file_man.h | 2 ++ samples/fineftp_example/src/main.cpp | 4 +-- tests/fineftp_test/src/fineftp_stresstest.cpp | 12 +++++++-- tests/fineftp_test/src/permission_test.cpp | 10 ++++--- 11 files changed, 73 insertions(+), 46 deletions(-) diff --git a/fineftp-server/include/fineftp/server.h b/fineftp-server/include/fineftp/server.h index cefbddc..9e8f074 100644 --- a/fineftp-server/include/fineftp/server.h +++ b/fineftp-server/include/fineftp/server.h @@ -1,8 +1,9 @@ #pragma once +#include +#include #include #include -#include // IWYU pragma: begin_exports #include diff --git a/fineftp-server/src/filesystem.cpp b/fineftp-server/src/filesystem.cpp index 22c96da..f92de86 100644 --- a/fineftp-server/src/filesystem.cpp +++ b/fineftp-server/src/filesystem.cpp @@ -1,32 +1,35 @@ #include "filesystem.h" +#include +#include +#include #include +#include // IWYU pragma: keep #include -#include -#include -#include #include -#include +#include #include #include -#include #include -#include +#include #include #ifdef WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#define WIN32_LEAN_AND_MEAN -#include -#include + #ifndef NOMINMAX + #define NOMINMAX + #endif + + #define WIN32_LEAN_AND_MEAN + + #include + #include #else // WIN32 +#include #include #include diff --git a/fineftp-server/src/filesystem.h b/fineftp-server/src/filesystem.h index b9a98cf..14710d2 100644 --- a/fineftp-server/src/filesystem.h +++ b/fineftp-server/src/filesystem.h @@ -1,8 +1,6 @@ #pragma once -#include -#include -#include +#include #include #include diff --git a/fineftp-server/src/ftp_session.cpp b/fineftp-server/src/ftp_session.cpp index 1a28d03..abc8757 100755 --- a/fineftp-server/src/ftp_session.cpp +++ b/fineftp-server/src/ftp_session.cpp @@ -1,25 +1,31 @@ #include "ftp_session.h" -#include -#include #include -#include -#include +#include // assert +#include // std::iscntrl, toupper +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include -#include -#include -#include -#include // assert -#include // std::iscntrl, toupper #include #include "filesystem.h" -#include #include "ftp_message.h" +#include "user_database.h" +#include + +#include #ifdef WIN32 #include "win_str_convert.h" diff --git a/fineftp-server/src/ftp_session.h b/fineftp-server/src/ftp_session.h index 7b8eb9d..233a553 100755 --- a/fineftp-server/src/ftp_session.h +++ b/fineftp-server/src/ftp_session.h @@ -1,12 +1,13 @@ #pragma once -#include +#include // IWYU pragma: keep #include -#include -#include #include - +#include +#include +#include +#include #include "ftp_message.h" @@ -14,7 +15,9 @@ #include "user_database.h" #include "ftp_user.h" -#include "win_str_convert.h" +#ifdef WIN32 + #include "win_str_convert.h" +#endif // WIN32 namespace fineftp { diff --git a/fineftp-server/src/server_impl.h b/fineftp-server/src/server_impl.h index bbb7cfd..0a3a90d 100644 --- a/fineftp-server/src/server_impl.h +++ b/fineftp-server/src/server_impl.h @@ -1,18 +1,18 @@ #pragma once -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include -#include +#include // IWYU pragma: keep -#include #include +#include -#include #include namespace fineftp diff --git a/fineftp-server/src/unix/file_man.cpp b/fineftp-server/src/unix/file_man.cpp index 80be685..4ae6d4c 100644 --- a/fineftp-server/src/unix/file_man.cpp +++ b/fineftp-server/src/unix/file_man.cpp @@ -2,12 +2,14 @@ #include "file_man.h" +#include #include #include +#include #include +#include #include #include -#include #include namespace fineftp diff --git a/fineftp-server/src/unix/file_man.h b/fineftp-server/src/unix/file_man.h index 6cc7d50..f7bf93b 100644 --- a/fineftp-server/src/unix/file_man.h +++ b/fineftp-server/src/unix/file_man.h @@ -3,8 +3,10 @@ #ifndef FINEFTP_SERVER_SRC_UNIX_FILE_MAN_H_ #define FINEFTP_SERVER_SRC_UNIX_FILE_MAN_H_ +#include #include #include +#include #include #include #include diff --git a/samples/fineftp_example/src/main.cpp b/samples/fineftp_example/src/main.cpp index 203fb8f..cb9fe6b 100644 --- a/samples/fineftp_example/src/main.cpp +++ b/samples/fineftp_example/src/main.cpp @@ -1,8 +1,8 @@ +#include #include -#include -#include #include +#include int main() { diff --git a/tests/fineftp_test/src/fineftp_stresstest.cpp b/tests/fineftp_test/src/fineftp_stresstest.cpp index a34e863..471f105 100644 --- a/tests/fineftp_test/src/fineftp_stresstest.cpp +++ b/tests/fineftp_test/src/fineftp_stresstest.cpp @@ -1,12 +1,20 @@ +#include +#include +#include #include #include +#include #include -#include #include +#include +#include +#include +#include +#include #include -#include +#include #ifdef WIN32 #include diff --git a/tests/fineftp_test/src/permission_test.cpp b/tests/fineftp_test/src/permission_test.cpp index 38810be..d2321b0 100644 --- a/tests/fineftp_test/src/permission_test.cpp +++ b/tests/fineftp_test/src/permission_test.cpp @@ -1,12 +1,16 @@ +#include +#include #include #include #include -#include #include -#include -#include +#include +#include +#include +#include +#include #ifdef WIN32 #include