Core: Fix many "errors"/warnings and coding style (1)

Extractors, worldserver, authserver, shared and collision affected

Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
Nay
2012-08-30 19:07:59 +01:00
parent 902d48811e
commit 5f1977cb1d
23 changed files with 140 additions and 155 deletions

View File

@@ -52,8 +52,6 @@ typedef WINADVAPI BOOL (WINAPI *CSD_T)(SC_HANDLE, DWORD, LPCVOID);
bool WinServiceInstall()
{
CSD_T ChangeService_Config2;
HMODULE advapi32;
SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
if (serviceControlManager)
@@ -79,7 +77,7 @@ bool WinServiceInstall()
0); // no password
if (service)
{
advapi32 = GetModuleHandle("ADVAPI32.DLL");
HMODULE advapi32 = GetModuleHandle("ADVAPI32.DLL");
if (!advapi32)
{
CloseServiceHandle(service);
@@ -87,7 +85,7 @@ bool WinServiceInstall()
return false;
}
ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
CSD_T ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
if (!ChangeService_Config2)
{
CloseServiceHandle(service);