Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netplay: Fix building on clang 17. #12270

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/Common/ENet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ENetEventType>(SKIPPABLE_EVENT);
return 1;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/ENet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Source/Core/Common/TraversalClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ENetEventType>(Common::ENet::SKIPPABLE_EVENT);
return 1;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/NetPlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(netEvent.type) == Common::ENet::SKIPPABLE_EVENT)
{
// ignore packets from traversal server
}
Expand Down Expand Up @@ -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<int>(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));
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/NetPlayServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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));
Expand Down