From 46a53191c1ad11a41c948594e972568e62d155b4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Jun 2012 13:58:20 +0000 Subject: minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/miranda.cpp | 17 +++++++++-------- src/core/modules.cpp | 9 ++------- 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'src/core') 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;isubscriberCount ) 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 ); -- cgit v1.2.3