Skip to content
Snippets Groups Projects
Commit 53cd6338 authored by Benny Baumann's avatar Benny Baumann
Browse files

fix: Use size_t for counts of objects

parent dd63cf5f
Branches master
No related tags found
No related merge requests found
Pipeline #10686 failed
......@@ -353,7 +353,7 @@ static constexpr int inet6_aton(const char (&str)[N], struct in6_addr &in6)
return -1;
}
for (unsigned i = 0; i < comps.size(); i++) {
for (size_t i = 0; i < comps.size(); i++) {
// We have reached the end of the string before parsing all the components.
// That is possible only if we have previously encountered a shortener token.
if (idx == N - 1) {
......
......@@ -31,8 +31,8 @@ public:
private:
auto_fd socket;
std::atomic_uint32_t number_of_connected_clients;
unsigned int max_number_of_simulataneusly_allowed_clients;
std::atomic_size_t number_of_connected_clients;
size_t max_number_of_simulataneusly_allowed_clients;
accept_handler_type on_accept;
accept_handler_type on_overflow;
......@@ -103,7 +103,7 @@ public:
* @brief Get the current number of connected clients.
* @return The number of connected clients
*/
[[nodiscard]] inline unsigned int get_number_of_connected_clients() const {
[[nodiscard]] inline size_t get_number_of_connected_clients() const {
return this->number_of_connected_clients;
}
......@@ -114,7 +114,7 @@ public:
* @brief Set the maximum allowed simultaneus connections.
* @param max_connections The maximum number of allowed connections.
*/
inline void set_maximum_concurrent_connections(unsigned int max_connections) {
inline void set_maximum_concurrent_connections(size_t max_connections) {
this->max_number_of_simulataneusly_allowed_clients = max_connections;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment