From b145a6eef251dcabfe47f45c69b3b9144115e495 Mon Sep 17 00:00:00 2001 From: whaffman Date: Wed, 24 Sep 2025 22:34:12 +0200 Subject: [PATCH] refactor: update includes to use cstdint and cstddef for consistency --- webserv/client/Client.cpp | 2 +- webserv/client/Client.hpp | 2 +- webserv/config/ConfigManager.cpp | 3 +-- webserv/config/ServerConfig.cpp | 3 +-- webserv/config/utils.hpp | 5 ++--- webserv/http/HttpHeaders.cpp | 2 +- webserv/http/HttpHeaders.hpp | 3 +-- webserv/log/Log.hpp | 2 +- webserv/server/Server.cpp | 2 +- webserv/server/Server.hpp | 2 +- webserv/socket/Socket.hpp | 6 +++--- 11 files changed, 14 insertions(+), 18 deletions(-) diff --git a/webserv/client/Client.cpp b/webserv/client/Client.cpp index b71633e..3e0e4ed 100644 --- a/webserv/client/Client.cpp +++ b/webserv/client/Client.cpp @@ -8,7 +8,7 @@ #include // for map #include // for pair, move -#include // for uint8_t +#include // for uint8_t #include // for ssize_t Client::Client(std::unique_ptr socket, Server &server, const ServerConfig &server_config) diff --git a/webserv/client/Client.hpp b/webserv/client/Client.hpp index 4a91b86..a342203 100644 --- a/webserv/client/Client.hpp +++ b/webserv/client/Client.hpp @@ -8,7 +8,7 @@ #include // for unique_ptr #include // for string -#include // for size_t +#include // for size_t class Server; class Socket; diff --git a/webserv/config/ConfigManager.cpp b/webserv/config/ConfigManager.cpp index 128cd5e..c6c0764 100644 --- a/webserv/config/ConfigManager.cpp +++ b/webserv/config/ConfigManager.cpp @@ -3,12 +3,11 @@ #include // for trim, findCorrespondingClosingBrace, trimSemi #include // for Log +#include // for size_t #include // for basic_ifstream, basic_istream, basic_filebuf, basic_ostream::operator<<, ifstream, istringstream, stringstream #include // for basic_stringstream, basic_istringstream #include // for runtime_error -#include // for size_t - ConfigManager::ConfigManager() : initialized_(false) {} ConfigManager::~ConfigManager() {} diff --git a/webserv/config/ServerConfig.cpp b/webserv/config/ServerConfig.cpp index 3cb62ba..22c4656 100644 --- a/webserv/config/ServerConfig.cpp +++ b/webserv/config/ServerConfig.cpp @@ -3,13 +3,12 @@ #include // for findCorrespondingClosingBrace, trim #include // for Log, LOCATION +#include // for size_t #include // for basic_istringstream, basic_istream, istringstream #include // for runtime_error #include // for basic_string, char_traits, operator+, allocator, string, operator==, operator>>, operator<=>, to_string, stoi, getline #include // for pair -#include // for size_t - ServerConfig::ServerConfig(std::string const &serverBlock) : port_(80) { parseServerBlock(serverBlock); diff --git a/webserv/config/utils.hpp b/webserv/config/utils.hpp index 34cf081..a1ec2b4 100644 --- a/webserv/config/utils.hpp +++ b/webserv/config/utils.hpp @@ -1,8 +1,7 @@ #pragma once -#include // for string - -#include // for size_t +#include // for size_t +#include // for string namespace utils { diff --git a/webserv/http/HttpHeaders.cpp b/webserv/http/HttpHeaders.cpp index 28d1c52..1456fcf 100644 --- a/webserv/http/HttpHeaders.cpp +++ b/webserv/http/HttpHeaders.cpp @@ -7,7 +7,7 @@ #include // for __transform_fn, transform #include // for pair -#include // for tolower +#include // for tolower std::optional HttpHeaders::getContentLength() const { diff --git a/webserv/http/HttpHeaders.hpp b/webserv/http/HttpHeaders.hpp index b9a538a..d1bdfbc 100644 --- a/webserv/http/HttpHeaders.hpp +++ b/webserv/http/HttpHeaders.hpp @@ -1,11 +1,10 @@ #pragma once +#include // for size_t #include // for optional #include // for basic_string, string, hash #include // for unordered_map -#include // for size_t - /** * @file HttpHeaders.hpp * @brief Declaration of the HttpHeaders class for managing HTTP headers. diff --git a/webserv/log/Log.hpp b/webserv/log/Log.hpp index bbdc871..ffb5ec2 100644 --- a/webserv/log/Log.hpp +++ b/webserv/log/Log.hpp @@ -9,7 +9,7 @@ #include // for string_view #include // for unordered_map -#include // for uint8_t +#include // for uint8_t class Channel; // Forward declaration diff --git a/webserv/server/Server.cpp b/webserv/server/Server.cpp index 841b70f..bfed7ea 100644 --- a/webserv/server/Server.cpp +++ b/webserv/server/Server.cpp @@ -12,7 +12,7 @@ #include // for move, pair #include // for vector -#include // for errno +#include // for errno #include // for epoll_event, epoll_ctl, EPOLLIN, EPOLLOUT, epoll_create1, epoll_wait, EPOLLERR, EPOLLHUP, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD #include // for send, SOMAXCONN #include // for ssize_t diff --git a/webserv/server/Server.hpp b/webserv/server/Server.hpp index 381f0f3..a4bd6e5 100644 --- a/webserv/server/Server.hpp +++ b/webserv/server/Server.hpp @@ -10,7 +10,7 @@ #include // for unordered_map #include // for vector -#include // for uint32_t +#include // for uint32_t class Client; class ConfigManager; diff --git a/webserv/socket/Socket.hpp b/webserv/socket/Socket.hpp index 3accc5e..11b0eba 100644 --- a/webserv/socket/Socket.hpp +++ b/webserv/socket/Socket.hpp @@ -1,9 +1,9 @@ #pragma once -#include // for unique_ptr -#include // for string +#include // for size_t +#include // for unique_ptr +#include // for string -#include // for size_t #include // for ssize_t class Socket