Skip to content

Commit

Permalink
Merge pull request #2953 from lioncash/macro
Browse files Browse the repository at this point in the history
CommonFuncs: Remove SLEEP macro
  • Loading branch information
degasus committed Sep 4, 2015
2 parents 4218fb4 + a11ae2c commit 39ab0eb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
7 changes: 0 additions & 7 deletions Source/Core/Common/CommonFuncs.h
Expand Up @@ -4,13 +4,6 @@

#pragma once

#ifdef _WIN32
#define SLEEP(x) Sleep(x)
#else
#include <unistd.h>
#define SLEEP(x) usleep(x*1000)
#endif

#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#endif
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/HW/EXI_DeviceGecko.cpp
Expand Up @@ -74,7 +74,8 @@ void GeckoSockServer::GeckoConnectionWaiter()

new_client = std::make_unique<sf::TcpSocket>();
}
SLEEP(1);

Common::SleepCurrentThread(1);
}
}

Expand Down
9 changes: 3 additions & 6 deletions Source/Core/Core/HW/WiimoteReal/IOWin.cpp
Expand Up @@ -17,6 +17,7 @@

#include "Common/Common.h"
#include "Common/StringUtil.h"
#include "Common/Thread.h"

#include "Core/HW/WiimoteReal/WiimoteReal.h"

Expand Down Expand Up @@ -250,7 +251,7 @@ void WiimoteScanner::Update()
// Some hacks that allows disconnects to be detected before connections are handled
// workaround for Wiimote 1 moving to slot 2 on temporary disconnect
if (forgot_some)
SLEEP(100);
Common::SleepCurrentThread(100);
}

// Find and connect Wiimotes.
Expand Down Expand Up @@ -313,12 +314,8 @@ void WiimoteScanner::FindWiimotes(std::vector<Wiimote*> & found_wiimotes, Wiimot
}

SetupDiDestroyDeviceInfoList(device_info);

// Don't mind me, just a random sleep to fix stuff on Windows
//if (!wiimotes.empty())
// SLEEP(2000);

}

int CheckDeviceType_Write(HANDLE &dev_handle, const u8* buf, size_t size, int attempts)
{
OVERLAPPED hid_overlap_write = OVERLAPPED();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
Expand Up @@ -359,7 +359,7 @@ bool Wiimote::PrepareOnThread()

return (IOWrite(mode_report, sizeof(mode_report)) &&
IOWrite(led_report, sizeof(led_report)) &&
(SLEEP(200), IOWrite(rumble_report, sizeof(rumble_report))) &&
(Common::SleepCurrentThread(200), IOWrite(rumble_report, sizeof(rumble_report))) &&
IOWrite(req_status_report, sizeof(req_status_report)));
}

Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/MainNoGUI.cpp
Expand Up @@ -7,6 +7,7 @@
#include <cstring>
#include <getopt.h>
#include <string>
#include <unistd.h>

#include "Common/CommonTypes.h"
#include "Common/Event.h"
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/VideoCommon/Debugger.cpp
Expand Up @@ -6,6 +6,7 @@

#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/Thread.h"

#include "VideoCommon/Debugger.h"
#include "VideoCommon/NativeVertexFormat.h"
Expand Down Expand Up @@ -56,7 +57,7 @@ void GFXDebuggerCheckAndPause(bool update)
while ( GFXDebuggerPauseFlag )
{
if (update) GFXDebuggerUpdateScreen();
SLEEP(5);
Common::SleepCurrentThread(5);
}
g_pdebugger->OnContinue();
}
Expand Down

0 comments on commit 39ab0eb

Please sign in to comment.