summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
commit46a53191c1ad11a41c948594e972568e62d155b4 (patch)
tree7e57e6f7093fb0de766fe13a933d2f9231433e4d /src/core
parent1fe5acae909ea64a1de9ac9f58cae5a3c2d3ad1f (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')
-rw-r--r--src/core/miranda.cpp17
-rw-r--r--src/core/modules.cpp9
2 files changed, 11 insertions, 15 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));
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index c8d173f9a7..7c5c35b999 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -256,7 +256,7 @@ void DestroyModularEngine(void)
int i;
THook* p;
EnterCriticalSection( &csHooks );
- for( i=0; i < hooks.getCount(); i++ ) {
+ for ( i=0; i < hooks.getCount(); i++ ) {
p = hooks[i];
if ( p->subscriberCount )
mir_free( p->subscriber );
@@ -596,13 +596,8 @@ static __inline TService* FindServiceByName( const char *name )
static HANDLE CreateServiceInt( int type, const char *name, MIRANDASERVICE serviceProc, void* object, LPARAM lParam)
{
- if ( name == NULL ) {
-#ifdef _DEBUG
- MessageBoxA(0,"Someone tried to create a NULL'd service, see call stack for more info","",0);
- DebugBreak();
-#endif
+ if ( name == NULL )
return NULL;
- }
TService tmp;
tmp.nameHash = hashstr( name );