diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2011-01-31 08:19:27 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2011-01-31 08:19:27 +0000 |
| commit | 1de40588acd0bfa6d49e3d94fef2cbd6dc09f6e5 (patch) | |
| tree | 93472097d7916eb4680f3b032286f729abdffd46 /Source/Core/InputCommon | |
| parent | 67a4ac0bf67d9299fb19575ccf5fc2034a8da9fd (diff) | |
Eliminate some trampoline functions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7015 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon')
| -rw-r--r-- | Source/Core/InputCommon/Src/UDPWiimote.cpp | 11 | ||||
| -rw-r--r-- | Source/Core/InputCommon/Src/UDPWiimote.h | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/Src/UDPWiimote.cpp b/Source/Core/InputCommon/Src/UDPWiimote.cpp index 558e4d902d..d31b5ad047 100644 --- a/Source/Core/InputCommon/Src/UDPWiimote.cpp +++ b/Source/Core/InputCommon/Src/UDPWiimote.cpp @@ -39,11 +39,13 @@ #include "Thread.h" #include "Timer.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <list> +#include <functional> struct UDPWiimote::_d { @@ -54,12 +56,7 @@ struct UDPWiimote::_d sock_t bipv4_fd,bipv6_fd; }; -int UDPWiimote::noinst=0; - -void UDPWiiThread(UDPWiimote* arg) -{ - arg->mainThread(); -} +int UDPWiimote::noinst = 0; UDPWiimote::UDPWiimote(const char *_port, const char * name, int _index) : port(_port), displayName(name), @@ -135,7 +132,7 @@ UDPWiimote::UDPWiimote(const char *_port, const char * name, int _index) : initBroadcastIPv4(); initBroadcastIPv6(); d->termLock.Enter(); - d->thread = std::thread(UDPWiiThread, this); + d->thread = std::thread(std::mem_fun(&UDPWiimote::mainThread), this); d->termLock.Leave(); return; } diff --git a/Source/Core/InputCommon/Src/UDPWiimote.h b/Source/Core/InputCommon/Src/UDPWiimote.h index 02fa4f66bc..1be83dbf74 100644 --- a/Source/Core/InputCommon/Src/UDPWiimote.h +++ b/Source/Core/InputCommon/Src/UDPWiimote.h @@ -21,7 +21,6 @@ class UDPWiimote { - friend void UDPWiiThread(UDPWiimote* arg); public: UDPWiimote(const char * port, const char * name, int index); virtual ~UDPWiimote(); @@ -33,10 +32,11 @@ public: int getErrNo() {return err;}; const char * getPort(); void changeName(const char * name); + + void mainThread(); private: std::string port,displayName; int pharsePacket(u8 * data, size_t size); - void mainThread(); struct _d; //using pimpl because Winsock2.h doesen't have include guards -_- _d *d; double x,y,z; |
