diff options
author | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:56:35 +0300 |
---|---|---|
committer | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:56:35 +0300 |
commit | 26fac5bf7e87dd5704a967ee4c744228b93d20b7 (patch) | |
tree | 74e5daa9a58f3a97b417925a212ac2cd31487a5e /include | |
parent | 806e7e5a3edf4fdf2b9c48469a7bc23307b200b0 (diff) |
fix: use std::size_t instead of size_t
- use C++ size_t from std namespace instead of a version from global namespace
Tested:
- Local build
- Unit-tests
Diffstat (limited to 'include')
-rw-r--r-- | include/tgbot/net/HttpServer.h | 9 | ||||
-rw-r--r-- | include/tgbot/tools/StringTools.h | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/tgbot/net/HttpServer.h b/include/tgbot/net/HttpServer.h index 28ea5a3..ccee077 100644 --- a/include/tgbot/net/HttpServer.h +++ b/include/tgbot/net/HttpServer.h @@ -1,6 +1,7 @@ #ifndef TGBOT_HTTPSERVER_H #define TGBOT_HTTPSERVER_H +#include <cstddef> #include <iostream> #include <string> #include <utility> @@ -73,7 +74,7 @@ protected: _socket, *data, "\r\n\r\n", - [self, data](const boost::system::error_code& e, size_t n) { + [self, data](const boost::system::error_code& e, std::size_t n) { if (e) { std::cout << "error in HttpServer::Connection#_readHeader: " << e << std::endl; return; @@ -97,7 +98,7 @@ protected: boost::asio::async_write( self->_socket, boost::asio::buffer(answer), - [](const boost::system::error_code& e, size_t n) { }); + [](const boost::system::error_code& e, std::size_t n) { }); return; } @@ -114,7 +115,7 @@ protected: boost::asio::async_read(_socket, *data, boost::asio::transfer_exactly(size - data->size()), - [self, data, size, headers](const boost::system::error_code& e, size_t n) { + [self, data, size, headers](const boost::system::error_code& e, std::size_t n) { if (e) { std::cout << "error in HttpServer::Connection#_readBody: " << e << std::endl; return; @@ -133,7 +134,7 @@ protected: boost::asio::async_write( self->_socket, boost::asio::buffer(answer), - [](const boost::system::error_code& e, size_t n) { }); + [](const boost::system::error_code& e, std::size_t n) { }); self->_socket.close(); }); diff --git a/include/tgbot/tools/StringTools.h b/include/tgbot/tools/StringTools.h index d1bc094..cb26bb5 100644 --- a/include/tgbot/tools/StringTools.h +++ b/include/tgbot/tools/StringTools.h @@ -1,6 +1,7 @@ #ifndef TGBOT_CPP_STRINGTOOLS_H #define TGBOT_CPP_STRINGTOOLS_H +#include <cstddef> #include <vector> #include <string> #include <sstream> @@ -36,7 +37,7 @@ void split(const std::string& str, char delimiter, std::vector<std::string>& des * Generates pseudo random string. It's recommended to call srand before this method. * @param length Length of resulting string. */ -std::string generateRandomString(size_t length); +std::string generateRandomString(std::size_t length); /** * Performs url encode. |