diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-06 13:58:20 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-06 13:58:20 +0000 |
commit | 46a53191c1ad11a41c948594e972568e62d155b4 (patch) | |
tree | 7e57e6f7093fb0de766fe13a933d2f9231433e4d /src/core/miranda.cpp | |
parent | 1fe5acae909ea64a1de9ac9f58cae5a3c2d3ad1f (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/miranda.cpp')
-rw-r--r-- | src/core/miranda.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp index 3ed03f8a2c..fe2dcaed32 100644 --- a/src/core/miranda.cpp +++ b/src/core/miranda.cpp @@ -365,17 +365,17 @@ void* GetCurrentThreadEntryPoint() DWORD_PTR dwStartAddress;
pNtQIT NtQueryInformationThread = (pNtQIT)GetProcAddress(GetModuleHandle(_T("ntdll.dll")), "NtQueryInformationThread" );
- if(NtQueryInformationThread == NULL) return 0;
+ if (NtQueryInformationThread == NULL) return 0;
hCurrentProcess = GetCurrentProcess();
- if(!DuplicateHandle(hCurrentProcess, GetCurrentThread(), hCurrentProcess, &hDupHandle, THREAD_QUERY_INFORMATION, FALSE, 0)) {
+ if (!DuplicateHandle(hCurrentProcess, GetCurrentThread(), hCurrentProcess, &hDupHandle, THREAD_QUERY_INFORMATION, FALSE, 0)) {
SetLastError(ERROR_ACCESS_DENIED);
return NULL;
}
ntStatus = NtQueryInformationThread(hDupHandle, ThreadQuerySetWin32StartAddress, &dwStartAddress, sizeof(DWORD_PTR), NULL);
CloseHandle(hDupHandle);
- if(ntStatus != ERROR_SUCCESS) return 0;
+ if (ntStatus != ERROR_SUCCESS) return 0;
return ( void* )dwStartAddress;
}
@@ -664,7 +664,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle);
dwEventTime=GetTickCount();
myPid=GetCurrentProcessId();
- for(;messageloop;) {
+ while (messageloop) {
MSG msg;
DWORD rc;
BOOL dying=FALSE;
@@ -781,7 +781,7 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam,LPARAM lParam) INT_PTR WaitOnHandle(WPARAM wParam,LPARAM lParam)
{
- if(waitObjectCount>=MAXIMUM_WAIT_OBJECTS-1) return 1;
+ if (waitObjectCount>=MAXIMUM_WAIT_OBJECTS-1) return 1;
hWaitObjects[waitObjectCount]=(HANDLE)wParam;
pszWaitServices[waitObjectCount]=(char*)lParam;
waitObjectCount++;
@@ -792,9 +792,10 @@ static INT_PTR RemoveWait(WPARAM wParam, LPARAM) {
int i;
- for(i=0;i<waitObjectCount;i++)
- if(hWaitObjects[i]==(HANDLE)wParam) break;
- if(i==waitObjectCount) return 1;
+ for (i=0;i<waitObjectCount;i++)
+ if (hWaitObjects[i] == (HANDLE)wParam)
+ break;
+ if (i == waitObjectCount) return 1;
waitObjectCount--;
MoveMemory(&hWaitObjects[i],&hWaitObjects[i+1],sizeof(HANDLE)*(waitObjectCount-i));
MoveMemory(&pszWaitServices[i],&pszWaitServices[i+1],sizeof(char*)*(waitObjectCount-i));
|