iis: fixies the Installer.cpp coding style

This commit is contained in:
Felipe \\\"Zimmerle\\\" Costa 2013-11-06 15:21:53 -06:00 committed by Felipe Zimmerle
parent 91738f93bc
commit 79875b1af8

View File

@ -5,7 +5,7 @@
#include <string>
#include <stdio.h>
#include <tchar.h>
#include "targetver.h"
#include "XUnzip.h"
// Logging level definition.
@ -58,7 +58,8 @@ class Iis7Config
WORD windows_event_type;
if (event_level == EVENT_ERROR) {
windows_event_type = EVENTLOG_ERROR_TYPE;
} else { // if (event_level == EVENT_CRITICAL)
}
else { // if (event_level == EVENT_CRITICAL)
windows_event_type = EVENTLOG_INFORMATION_TYPE;
}
@ -131,7 +132,8 @@ class Iis7Config
WORD windows_event_type;
if (event_level == EVENT_ERROR) {
windows_event_type = EVENTLOG_ERROR_TYPE;
} else { // if (event_level == EVENT_CRITICAL)
}
else { // if (event_level == EVENT_CRITICAL)
windows_event_type = EVENTLOG_INFORMATION_TYPE;
}
@ -296,9 +298,11 @@ if (FAILED(_hr)) { \
} \
}
#define CHECK_BOOL(expression, msg) \
{ \
if (!expression) {\
Log(EVENT_ERROR, msg); \
break; \
} \
}
bool Iis7Config::Load() {
@ -740,7 +744,8 @@ bool Iis7Config::AddToGlobalModules(IAppHostWritableAdminManager* manager,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access globalModules configuration.");
break;
} else if (&parent == NULL) {
}
else if (&parent == NULL) {
Log(EVENT_ERROR, "Unable to get globalModules configuration.");
break;
}
@ -750,7 +755,8 @@ bool Iis7Config::AddToGlobalModules(IAppHostWritableAdminManager* manager,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access globalModules child collection.");
break;
} else if (&collection == NULL) {
}
else if (&collection == NULL) {
Log(EVENT_ERROR, "Unable to get globalModules child collection.");
break;
}
@ -825,7 +831,8 @@ bool Iis7Config::AddToModules(IAppHostWritableAdminManager* manager) {
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access modules configuration.");
break;
} else if (&parent == NULL) {
}
else if (&parent == NULL) {
Log(EVENT_ERROR, "Unable to get modules configuration.");
break;
}
@ -835,7 +842,8 @@ bool Iis7Config::AddToModules(IAppHostWritableAdminManager* manager) {
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access modules child collection.");
break;
} else if (&collection == NULL) {
}
else if (&collection == NULL) {
Log(EVENT_ERROR, "Unable to get modules child collection.");
break;
}
@ -901,7 +909,8 @@ bool Iis7Config::RemoveFromCollection(IAppHostWritableAdminManager* manager,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access section to remove module.");
break;
} else if (&parent == NULL) {
}
else if (&parent == NULL) {
Log(EVENT_ERROR, "Unable to get section to remove module.");
break;
}
@ -911,7 +920,8 @@ bool Iis7Config::RemoveFromCollection(IAppHostWritableAdminManager* manager,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Unable to access collection to remove module.");
break;
} else if (&collection == NULL) {
}
else if (&collection == NULL) {
Log(EVENT_ERROR, "Unable to get collection to remove module.");
break;
}
@ -939,7 +949,8 @@ bool Iis7Config::RemoveFromCollection(IAppHostWritableAdminManager* manager,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Failed to remove ModSecurity module.");
}
} else {
}
else {
Log(EVENT_IMPORTANT, "No ModSecurity module is found.");
}
@ -1174,10 +1185,12 @@ bool Iis7Config::GetFromCollection(IAppHostElementCollection* collection,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Failed to get element from collection.");
return false;
} else {
}
else {
return true;
}
} else {
}
else {
*element = NULL;
return true;
}
@ -1278,12 +1291,14 @@ int Iis7Config::GetNativeSystemInfo(SYSTEM_INFO* system_info) {
if (proc == NULL) {
if (GetLastError() == ERROR_PROC_NOT_FOUND) {
return 0;
} else {
}
else {
Log(EVENT_ERROR, "Failed to GetProcAddress (%d).", GetLastError());
return -1;
}
return 0;
} else {
}
else {
proc(system_info);
return 1;
}
@ -1298,9 +1313,11 @@ Iis7Config::AppMode Iis7Config::GetAppMode() {
if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) {
return MODE_X86;
} else if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
}
else if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
return MODE_X64;
} else {
}
else {
return MODE_UNKNOWN;
}
}
@ -1672,10 +1689,12 @@ bool Iis7Config::GetFromChildren(IAppHostChildElementCollection* children,
if (FAILED(hresult)) {
Log(EVENT_ERROR, "Failed to get element from children.");
return false;
} else {
}
else {
return true;
}
} else {
}
else {
*element = NULL;
return true;
}