Skip to content

Commit

Permalink
Fixed as many clang-tidy include warnings as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianReimold committed Nov 2, 2023
1 parent c148060 commit 9802434
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 46 deletions.
3 changes: 2 additions & 1 deletion fineftp-server/include/fineftp/server.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <cstdint>

// IWYU pragma: begin_exports
#include <fineftp/permissions.h>
Expand Down
27 changes: 15 additions & 12 deletions fineftp-server/src/filesystem.cpp
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
#include "filesystem.h"

#include <array>
#include <cstdint>
#include <iomanip>
#include <list>
#include <mutex> // IWYU pragma: keep
#include <sstream>
#include <mutex>
#include <iomanip>
#include <array>

#include <chrono>
#include <string>
#include <ctime>
#include <iostream>
#include <map>
#include <algorithm>
#include <regex>
#include <ctime>
#include <string>

#include <sys/stat.h>

#ifdef WIN32

#ifndef NOMINMAX
#define NOMINMAX
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <win_str_convert.h>
#ifndef NOMINMAX
#define NOMINMAX
#endif

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <win_str_convert.h>

#else // WIN32

#include <cerrno>
#include <cstring>
#include <dirent.h>

Expand Down
4 changes: 1 addition & 3 deletions fineftp-server/src/filesystem.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#pragma once

#include <chrono>
#include <regex>
#include <iostream>
#include <cstdint>
#include <map>
#include <string>

Expand Down
26 changes: 16 additions & 10 deletions fineftp-server/src/ftp_session.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
#include "ftp_session.h"

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <functional>
#include <cassert> // assert
#include <cctype> // std::iscntrl, toupper
#include <cstddef>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include <vector>
#include <memory>
#include <cstddef>
#include <iterator>
#include <cassert> // assert
#include <cctype> // std::iscntrl, toupper

#include <file_man.h>

#include "filesystem.h"
#include <fineftp/permissions.h>
#include "ftp_message.h"
#include "user_database.h"
#include <fineftp/permissions.h>

#include <sys/stat.h>

#ifdef WIN32
#include "win_str_convert.h"
Expand Down
13 changes: 8 additions & 5 deletions fineftp-server/src/ftp_session.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#pragma once

#include <asio.hpp>
#include <asio.hpp> // IWYU pragma: keep

#include <deque>
#include <string>
#include <memory>
#include <functional>

#include <map>
#include <memory>
#include <string>
#include <vector>

#include "ftp_message.h"

#include "filesystem.h"
#include "user_database.h"
#include "ftp_user.h"

#include "win_str_convert.h"
#ifdef WIN32
#include "win_str_convert.h"
#endif // WIN32

namespace fineftp
{
Expand Down
14 changes: 7 additions & 7 deletions fineftp-server/src/server_impl.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#pragma once

#include <vector>
#include <string>
#include <thread>
#include <atomic>
#include <cstdint>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <thread>
#include <vector>

#include <asio.hpp>
#include <asio.hpp> // IWYU pragma: keep

#include <ftp_session.h>
#include <fineftp/permissions.h>
#include <ftp_session.h>

#include <ftp_user.h>
#include <user_database.h>

namespace fineftp
Expand Down
4 changes: 3 additions & 1 deletion fineftp-server/src/unix/file_man.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

#include "file_man.h"

#include <cstdint>
#include <fcntl.h>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sstream>
#include <unistd.h>

namespace fineftp
Expand Down
2 changes: 2 additions & 0 deletions fineftp-server/src/unix/file_man.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#ifndef FINEFTP_SERVER_SRC_UNIX_FILE_MAN_H_
#define FINEFTP_SERVER_SRC_UNIX_FILE_MAN_H_

#include <cstddef>
#include <cstdint>
#include <fstream>
#include <ios>
#include <memory>
#include <string>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions samples/fineftp_example/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <chrono>
#include <fineftp/server.h>

#include <iostream>
#include <thread>
#include <string>
#include <thread>

int main() {

Expand Down
12 changes: 10 additions & 2 deletions tests/fineftp_test/src/fineftp_stresstest.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#include <chrono>
#include <cstdlib>
#include <functional>
#include <gtest/gtest.h>

#include <fineftp/server.h>

#include <algorithm>
#include <filesystem>
#include <string>
#include <fstream>
#include <ios>
#include <iostream>
#include <iterator>
#include <string>
#include <system_error>
#include <thread>
#include <algorithm>
#include <vector>

#ifdef WIN32
#include <win_str_convert.h>
Expand Down
10 changes: 7 additions & 3 deletions tests/fineftp_test/src/permission_test.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#include <cstdint>
#include <cstdlib>
#include <gtest/gtest.h>

#include <fineftp/server.h>

#include <filesystem>
#include <string>
#include <fstream>
#include <thread>
#include <algorithm>
#include <iterator>
#include <string>
#include <system_error>
#include <utility>
#include <vector>

#ifdef WIN32
#include <win_str_convert.h>
Expand Down

0 comments on commit 9802434

Please sign in to comment.