From cec02b1c9b14ef2217a285433da50aa17f67d0df Mon Sep 17 00:00:00 2001 From: Karol Szuster Date: Mon, 23 Mar 2020 23:51:57 +0100 Subject: [PATCH] Fix build Signed-off-by: Karol Szuster --- src/CmdSystem.cpp | 2 ++ src/MenuSystem.cpp | 6 +++--- subprojects/sourcepawn/ExtMain.hpp | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/CmdSystem.cpp b/src/CmdSystem.cpp index 78e03cca..49a9b68c 100644 --- a/src/CmdSystem.cpp +++ b/src/CmdSystem.cpp @@ -92,6 +92,8 @@ Command *CommandMngr::registerCommand(ICommand::Type type, return registerCommandInternal(cmd, info, flags, cb, data).get(); case ICommand::Type::Server: return registerCommandInternal(cmd, info, cb, data).get(); + default: + return nullptr; } } diff --git a/src/MenuSystem.cpp b/src/MenuSystem.cpp index 4a7fd5bb..1f3bd17c 100644 --- a/src/MenuSystem.cpp +++ b/src/MenuSystem.cpp @@ -89,7 +89,7 @@ void Menu::display(IPlayer *player, std::uint32_t page, std::uint32_t time) if (m_style == IMenu::Style::Item) { // format and show menu - std::int32_t keys = 0; + std::uint32_t keys = 0; // cache this? // cache to m_text if all items without callback @@ -280,7 +280,7 @@ Menu::Item *Menu::keyToItem(std::uint32_t key) const Menu::Item *Menu::appendItem(std::string_view name, Item::Callback callback, std::any cbData, std::any data) { - return _addItem(-1, name, callback, cbData, data); + return _addItem(static_cast(-1), name, callback, cbData, data); } Menu::Item *Menu::insertItem(std::size_t position, @@ -451,7 +451,7 @@ void MenuMngr::clearMenus() META_RES MenuMngr::ClientCommand(edict_t *pEntity) { std::string_view pressedKeyText(CMD_ARGV(1)); - std::int32_t pressedKey; + std::uint32_t pressedKey; if (const auto &[ptr, ec] = std::from_chars(pressedKeyText.data(), pressedKeyText.data() + pressedKeyText.length(), pressedKey); ec != std::errc()) diff --git a/subprojects/sourcepawn/ExtMain.hpp b/subprojects/sourcepawn/ExtMain.hpp index 36472e59..dc21020e 100644 --- a/subprojects/sourcepawn/ExtMain.hpp +++ b/subprojects/sourcepawn/ExtMain.hpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #if defined SP_POSIX #include