diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2011-12-08 20:32:54 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2011-12-08 20:32:54 +0000 |
commit | 712c68c8aabf33cdcdf036b194807db62e837acc (patch) | |
tree | 080d3e587e026bf9142f34dee0815750069e2c2f /windows | |
parent | 8cea10ac4fb30ffcc8d932bcb5d98a874185a27b (diff) | |
download | jack2-712c68c8aabf33cdcdf036b194807db62e837acc.tar.gz |
Cleanup.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4638 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'windows')
-rw-r--r-- | windows/JackNetWinSocket.h | 2 | ||||
-rw-r--r-- | windows/JackShmMem_os.h | 21 | ||||
-rw-r--r-- | windows/JackWinNamedPipe.cpp | 46 | ||||
-rw-r--r-- | windows/JackWinSemaphore.cpp | 6 |
4 files changed, 16 insertions, 59 deletions
diff --git a/windows/JackNetWinSocket.h b/windows/JackNetWinSocket.h index a96f1b0e..153f65bb 100644 --- a/windows/JackNetWinSocket.h +++ b/windows/JackNetWinSocket.h @@ -27,9 +27,9 @@ #include <stdint.h> #endif - namespace Jack { + #define E(code, s) { code, s } #define NET_ERROR_CODE WSAGetLastError() #define StrError PrintError diff --git a/windows/JackShmMem_os.h b/windows/JackShmMem_os.h index ba8e87f9..9f1891f9 100644 --- a/windows/JackShmMem_os.h +++ b/windows/JackShmMem_os.h @@ -24,27 +24,27 @@ inline bool CHECK_MLOCK(void* ptr, size_t size) { - if (!VirtualLock((ptr), (size))) {
+ if (!VirtualLock((ptr), (size))) { SIZE_T minWSS, maxWSS; HANDLE hProc = GetCurrentProcess(); - if (GetProcessWorkingSetSize(hProc, &minWSS, &maxWSS)) {
+ if (GetProcessWorkingSetSize(hProc, &minWSS, &maxWSS)) { const size_t increase = size + (10 * 4096); - maxWSS += increase;
+ maxWSS += increase; minWSS += increase; if (!SetProcessWorkingSetSize(hProc, minWSS, maxWSS)) { - jack_error("SetProcessWorkingSetSize error = %d", GetLastError());
+ jack_error("SetProcessWorkingSetSize error = %d", GetLastError()); return false; } else if (!VirtualLock((ptr), (size))) { - jack_error("VirtualLock error = %d", GetLastError());
+ jack_error("VirtualLock error = %d", GetLastError()); return false; - } else {
+ } else { return true; } - } else {
- return false;
+ } else { + return false; } - } else {
- return true;
+ } else { + return true; } } @@ -53,3 +53,4 @@ inline bool CHECK_MLOCK(void* ptr, size_t size) #define CHECK_MUNLOCKALL()(false) #endif + diff --git a/windows/JackWinNamedPipe.cpp b/windows/JackWinNamedPipe.cpp index 3b2d8440..8d277673 100644 --- a/windows/JackWinNamedPipe.cpp +++ b/windows/JackWinNamedPipe.cpp @@ -370,52 +370,6 @@ int JackWinAsyncNamedPipeServer::Bind(const char* dir, const char* name, int whi return BindAux(); } -/* -int JackWinAsyncNamedPipeServer::Bind(const char* dir, int which) -{ - snprintf(fName, sizeof(fName), "\\\\.\\pipe\\%s_jack_%d", dir, which); - jack_log("Bind: fName %s", fName); - - if ((fNamedPipe = CreateNamedPipe(fName, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode - PIPE_WAIT, // blocking mode - PIPE_UNLIMITED_INSTANCES, // max. instances - BUFSIZE, // output buffer size - BUFSIZE, // input buffer size - INFINITE, // client time-out - NULL)) == INVALID_HANDLE_VALUE) { // no security a - jack_error("Cannot bind server to pipe err = %ld", GetLastError()); - return -1; - } else { - return 0; - } -} - -int JackWinAsyncNamedPipeServer::Bind(const char* dir, const char* name, int which) -{ - snprintf(fName, sizeof(fName), "\\\\.\\pipe\\%s_jack_%s_%d", dir, name, which); - jack_log("Bind: fName %s", fName); - - if ((fNamedPipe = CreateNamedPipe(fName, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode - PIPE_WAIT, // blocking mode - PIPE_UNLIMITED_INSTANCES, // max. instances - BUFSIZE, // output buffer size - BUFSIZE, // input buffer size - INFINITE, // client time-out - NULL)) == INVALID_HANDLE_VALUE) { // no security a - jack_error("Cannot bind server to pipe err = %ld", GetLastError()); - return -1; - } else { - return 0; - } -} -*/ - bool JackWinAsyncNamedPipeServer::Accept() { return false; diff --git a/windows/JackWinSemaphore.cpp b/windows/JackWinSemaphore.cpp index 884d9f00..d347f605 100644 --- a/windows/JackWinSemaphore.cpp +++ b/windows/JackWinSemaphore.cpp @@ -38,8 +38,9 @@ bool JackWinSemaphore::Signal() BOOL res; assert(fSemaphore); - if (fFlush) + if (fFlush) { return true; + } if (!(res = ReleaseSemaphore(fSemaphore, 1, NULL))) { jack_error("JackWinSemaphore::Signal name = %s err = %ld", fName, GetLastError()); @@ -53,8 +54,9 @@ bool JackWinSemaphore::SignalAll() BOOL res; assert(fSemaphore); - if (fFlush) + if (fFlush) { return true; + } if (!(res = ReleaseSemaphore(fSemaphore, 1, NULL))) { jack_error("JackWinSemaphore::SignalAll name = %s err = %ld", fName, GetLastError()); |