diff --git a/Source/Core/Common/ENet.cpp b/Source/Core/Common/ENet.cpp index 6e27036175..f99c4476c5 100644 --- a/Source/Core/Common/ENet.cpp +++ b/Source/Core/Common/ENet.cpp @@ -31,7 +31,7 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event) // wakeup packet received if (host->receivedDataLength == 1 && host->receivedData[0] == 0) { - event->type = SKIPPABLE_EVENT; + event->type = static_cast(SKIPPABLE_EVENT); return 1; } return 0; diff --git a/Source/Core/Common/ENet.h b/Source/Core/Common/ENet.h index 920a7d5fbd..a79a59e4a7 100644 --- a/Source/Core/Common/ENet.h +++ b/Source/Core/Common/ENet.h @@ -23,5 +23,5 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event); bool SendPacket(ENetPeer* socket, const sf::Packet& packet, u8 channel_id); // used for traversal packets and wake-up packets -constexpr ENetEventType SKIPPABLE_EVENT = ENetEventType(42); +constexpr int SKIPPABLE_EVENT = 42; } // namespace Common::ENet diff --git a/Source/Core/Common/TraversalClient.cpp b/Source/Core/Common/TraversalClient.cpp index 50278a37e9..200166f69d 100644 --- a/Source/Core/Common/TraversalClient.cpp +++ b/Source/Core/Common/TraversalClient.cpp @@ -299,7 +299,7 @@ int ENET_CALLBACK TraversalClient::InterceptCallback(ENetHost* host, ENetEvent* &host->receivedAddress) || (host->receivedDataLength == 1 && host->receivedData[0] == 0)) { - event->type = Common::ENet::SKIPPABLE_EVENT; + event->type = static_cast(Common::ENet::SKIPPABLE_EVENT); return 1; } return 0; diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 0e561b51f1..55dea9b3d9 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -257,7 +257,7 @@ bool NetPlayClient::Connect() ENetEvent netEvent; int net; while ((net = enet_host_service(m_client, &netEvent, 5000)) > 0 && - netEvent.type == Common::ENet::SKIPPABLE_EVENT) + static_cast(netEvent.type) == Common::ENet::SKIPPABLE_EVENT) { // ignore packets from traversal server } @@ -1645,7 +1645,7 @@ void NetPlayClient::ThreadFunc() break; default: // not a valid switch case due to not technically being part of the enum - if (netEvent.type == Common::ENet::SKIPPABLE_EVENT) + if (static_cast(netEvent.type) == Common::ENet::SKIPPABLE_EVENT) INFO_LOG_FMT(NETPLAY, "enet_host_service: skippable packet event"); else ERROR_LOG_FMT(NETPLAY, "enet_host_service: unknown event type: {}", int(netEvent.type)); diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 7eb994a13c..4c06cfb103 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -387,7 +387,7 @@ void NetPlayServer::ThreadFunc() break; default: // not a valid switch case due to not technically being part of the enum - if (netEvent.type == Common::ENet::SKIPPABLE_EVENT) + if (static_cast(netEvent.type) == Common::ENet::SKIPPABLE_EVENT) INFO_LOG_FMT(NETPLAY, "enet_host_service: skippable packet event"); else ERROR_LOG_FMT(NETPLAY, "enet_host_service: unknown event type: {}", int(netEvent.type));