Skip to content

Commit

Permalink
Core/IOS/Network/Socket: Avoid global system accessor.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Jan 12, 2024
1 parent 6725c25 commit 8fabff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Core/Core/IOS/Network/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ s32 WiiSocket::FCntl(u32 cmd, u32 arg)

void WiiSocket::Update(bool read, bool write, bool except)
{
auto& system = Core::System::GetInstance();
auto& system = m_socket_manager.GetIOS().GetSystem();
auto& memory = system.GetMemory();

auto it = pending_sockops.begin();
Expand Down Expand Up @@ -878,7 +878,7 @@ s32 WiiSockMan::AddSocket(s32 fd, bool is_rw)
WiiSocket& sock = WiiSockets.emplace(wii_fd, *this).first->second;
sock.SetFd(fd);
sock.SetWiiFd(wii_fd);
Core::System::GetInstance().GetPowerPC().GetDebugInterface().NetworkLogger()->OnNewSocket(fd);
m_ios.GetSystem().GetPowerPC().GetDebugInterface().NetworkLogger()->OnNewSocket(fd);

#ifdef __APPLE__
int opt_no_sigpipe = 1;
Expand Down Expand Up @@ -1050,7 +1050,7 @@ void WiiSockMan::UpdatePollCommands()
pcmd.timeout = std::max<s64>(0, pcmd.timeout - elapsed);
}

auto& system = Core::System::GetInstance();
auto& system = m_ios.GetSystem();
auto& memory = system.GetMemory();

std::erase_if(pending_polls, [&system, &memory, this](PollCommand& pcmd) {
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/IOS/Network/Socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ class WiiSockMan

void UpdateWantDeterminism(bool want);

EmulationKernel& GetIOS() const { return m_ios; }

private:
void UpdatePollCommands();

Expand Down

0 comments on commit 8fabff9

Please sign in to comment.