Skip to content

Commit

Permalink
Ignore SFML Return Values
Browse files Browse the repository at this point in the history
I'm not sure if this is the best way to proceed
  • Loading branch information
JoshuaVandaele committed Jan 15, 2025
1 parent 47cd20d commit 6e3e106
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <bit>
#include <optional>
#include "SFML/Network/IpAddress.hpp"
#include "SFML/Network/Socket.hpp"

#ifdef _WIN32
#include <ws2ipdef.h>
Expand Down Expand Up @@ -95,7 +97,7 @@ bool CEXIETHERNET::BuiltInBBAInterface::Activate()

m_network_ref.Clear();

m_upnp_httpd.listen(Common::SSDP_PORT, sf::IpAddress(ip));
(void)m_upnp_httpd.listen(Common::SSDP_PORT, sf::IpAddress(ip));
m_upnp_httpd.setBlocking(false);

return RecvInit();
Expand Down Expand Up @@ -259,7 +261,7 @@ CEXIETHERNET::BuiltInBBAInterface::TryGetDataFromSocket(StackRef* ref)
case IPPROTO_UDP:
{
std::array<u8, MAX_UDP_LENGTH> buffer;
ref->udp_socket.receive(buffer.data(), MAX_UDP_LENGTH, datasize, ref->target, remote_port);
(void)ref->udp_socket.receive(buffer.data(), MAX_UDP_LENGTH, datasize, ref->target, remote_port);
if (datasize > 0)
{
ref->from.sin_port = htons(remote_port);
Expand Down Expand Up @@ -357,7 +359,7 @@ void CEXIETHERNET::BuiltInBBAInterface::HandleTCPFrame(const Common::TCPPacket&
WriteToQueue(BuildFINFrame(ref));
ref->ip = 0;
if (!data.empty())
ref->tcp_socket.send(data.data(), data.size());
(void)ref->tcp_socket.send(data.data(), data.size());
ref->tcp_socket.disconnect();
}
else if (flags == (TCP_FLAG_SIN | TCP_FLAG_ACK))
Expand Down Expand Up @@ -417,7 +419,7 @@ void CEXIETHERNET::BuiltInBBAInterface::HandleTCPFrame(const Common::TCPPacket&
if (static_cast<int>(this_seq - ref->ack_num) >= 0 &&
data.size() >= static_cast<std::size_t>(size))
{
ref->tcp_socket.send(data.data(), size);
(void)ref->tcp_socket.send(data.data(), size);
ref->ack_num += size;
}

Expand Down Expand Up @@ -535,7 +537,7 @@ void CEXIETHERNET::BuiltInBBAInterface::HandleUDPFrame(const Common::UDPPacket&
target = sf::IpAddress::resolve(m_dns_ip.c_str()); // dns server ip
else
target = sf::IpAddress(ntohl(std::bit_cast<u32>(ip_header.destination_addr)));
ref->udp_socket.send(data.data(), data.size(), target.value(), ntohs(udp_header.destination_port));
(void)ref->udp_socket.send(data.data(), data.size(), target.value(), ntohs(udp_header.destination_port));
}

void CEXIETHERNET::BuiltInBBAInterface::HandleUPnPClient()
Expand Down Expand Up @@ -798,7 +800,7 @@ sf::Socket::Status BbaTcpSocket::Connect(const sf::IpAddress& dest, u16 port, u3
addr.sin_addr.s_addr = net_ip;
addr.sin_family = AF_INET;
addr.sin_port = 0;
::bind(getNativeHandle(), reinterpret_cast<sockaddr*>(&addr), sizeof(addr));
(void)::bind(getNativeHandle(), reinterpret_cast<sockaddr*>(&addr), sizeof(addr));
m_connecting_state = ConnectingState::Connecting;
return this->connect(dest, port);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/SI/SI_DeviceGBA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int GBASockServer::Receive(u8* si_buffer, u8 bytes)
{
sf::SocketSelector selector;
selector.add(*m_client);
selector.wait(sf::milliseconds(1000));
(void)selector.wait(sf::milliseconds(1000));
}

size_t num_received = 0;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void Wiimote::Read()
if (m_balance_board_dump_port > 0 && m_index == WIIMOTE_BALANCE_BOARD)
{
static sf::UdpSocket Socket;
Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost,
(void)Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost,
m_balance_board_dump_port);
}

Expand All @@ -339,7 +339,7 @@ bool Wiimote::Write()
if (m_balance_board_dump_port > 0 && m_index == WIIMOTE_BALANCE_BOARD)
{
static sf::UdpSocket Socket;
Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost, m_balance_board_dump_port);
(void)Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost, m_balance_board_dump_port);
}
int ret = IOWrite(rpt.data(), rpt.size());

Expand Down

0 comments on commit 6e3e106

Please sign in to comment.