diff options
author | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:46:58 +0300 |
---|---|---|
committer | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:46:58 +0300 |
commit | 806e7e5a3edf4fdf2b9c48469a7bc23307b200b0 (patch) | |
tree | cb73c1bd3d8a2cfaba3809b6a6f7fb134732118a /include/tgbot/net | |
parent | d1c6a8062577f5ce58105afff2d0a1887bfff957 (diff) |
fix: use C++ fixed-width types instead of C types
- C++ standard doesn't guarantee that C-types without std namespace are available in global namespace. So the proper solution (since it's C++ library) is using C++ types instead of C
Tested:
- Local build
- By unit-tests
Diffstat (limited to 'include/tgbot/net')
-rw-r--r-- | include/tgbot/net/TgLongPoll.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/tgbot/net/TgLongPoll.h b/include/tgbot/net/TgLongPoll.h index 8e62cd1..2de9810 100644 --- a/include/tgbot/net/TgLongPoll.h +++ b/include/tgbot/net/TgLongPoll.h @@ -1,6 +1,8 @@ #ifndef TGBOT_TGLONGPOLL_H #define TGBOT_TGLONGPOLL_H +#include <cstdint> + #include "tgbot/Bot.h" #include "tgbot/Api.h" #include "tgbot/EventHandler.h" @@ -15,8 +17,8 @@ namespace TgBot { class TgLongPoll { public: - TgLongPoll(const Api* api, const EventHandler* eventHandler, int32_t, int32_t, const std::shared_ptr<std::vector<std::string>>&); - TgLongPoll(const Bot& bot, int32_t = 100, int32_t = 10, const std::shared_ptr<std::vector<std::string>>& = nullptr); + TgLongPoll(const Api* api, const EventHandler* eventHandler, std::int32_t, std::int32_t, const std::shared_ptr<std::vector<std::string>>&); + TgLongPoll(const Bot& bot, std::int32_t = 100, std::int32_t = 10, const std::shared_ptr<std::vector<std::string>>& = nullptr); /** * @brief Starts long poll. After new update will come, this method will parse it and send to EventHandler which invokes your listeners. Designed to be executed in a loop. @@ -26,9 +28,9 @@ public: private: const Api* _api; const EventHandler* _eventHandler; - int32_t _lastUpdateId = 0; - int32_t _limit; - int32_t _timeout; + std::int32_t _lastUpdateId = 0; + std::int32_t _limit; + std::int32_t _timeout; std::shared_ptr<std::vector<std::string>> _allowupdates; }; |