Code cleanup & cosmetic.

This commit is contained in:
spx
2010-09-17 08:47:22 +00:00
parent 5ab0192d41
commit df146e4eb4
22 changed files with 240 additions and 276 deletions

View File

@ -114,7 +114,7 @@ bool CheckProcess(CPUMeasure* measure, const std::wstring& name)
{
for (size_t i = 0; i < measure->excludes.size(); i++)
{
if (wcsicmp(measure->excludes[i].c_str(), name.c_str()) == 0)
if (_wcsicmp(measure->excludes[i].c_str(), name.c_str()) == 0)
{
return false; // Exclude
}
@ -125,7 +125,7 @@ bool CheckProcess(CPUMeasure* measure, const std::wstring& name)
{
for (size_t i = 0; i < measure->includes.size(); i++)
{
if (wcsicmp(measure->includes[i].c_str(), name.c_str()) == 0)
if (_wcsicmp(measure->includes[i].c_str(), name.c_str()) == 0)
{
return true; // Include
}
@ -303,7 +303,7 @@ void UpdateProcesses()
{
if(pObjInst->GetObjectInstanceName(name, 256))
{
if (wcsicmp(name, L"_Total") == 0)
if (_wcsicmp(name, L"_Total") == 0)
{
continue;
}

View File

@ -97,19 +97,19 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"PowerState", L"");
if(type)
{
if (wcsicmp(L"ACLINE", type) == 0)
if (_wcsicmp(L"ACLINE", type) == 0)
{
powerState = POWER_ACLINE;
}
else if (wcsicmp(L"STATUS", type) == 0)
else if (_wcsicmp(L"STATUS", type) == 0)
{
powerState = POWER_STATUS;
}
else if (wcsicmp(L"STATUS2", type) == 0)
else if (_wcsicmp(L"STATUS2", type) == 0)
{
powerState = POWER_STATUS2;
}
else if (wcsicmp(L"LIFETIME", type) == 0)
else if (_wcsicmp(L"LIFETIME", type) == 0)
{
powerState= POWER_LIFETIME;
@ -119,11 +119,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
g_Formats[id] = format;
}
}
else if (wcsicmp(L"MHZ", type) == 0)
else if (_wcsicmp(L"MHZ", type) == 0)
{
powerState= POWER_MHZ;
}
else if (wcsicmp(L"PERCENT", type) == 0)
else if (_wcsicmp(L"PERCENT", type) == 0)
{
powerState = POWER_PERCENT;
}

View File

@ -90,11 +90,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"RecycleType", L"COUNT");
if (type)
{
if (wcsicmp(L"COUNT", type) == 0)
if (_wcsicmp(L"COUNT", type) == 0)
{
dataType = NUMRECYCLE;
}
else if (wcsicmp(L"SIZE", type) == 0)
else if (_wcsicmp(L"SIZE", type) == 0)
{
dataType = SIZERECYCLE;
}
@ -152,7 +152,7 @@ double Update2(UINT id)
SHQUERYRBINFO RecycleBinInfo = { 0 };
RecycleBinInfo.cbSize = sizeof( RecycleBinInfo ); // Tell size of structure
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHQueryRecycleBin( NULL, &RecycleBinInfo ) == S_OK)
{
@ -224,9 +224,9 @@ void ExecuteBang(LPCTSTR args, UINT id)
std::wstring bang = args;
std::wstring driveSet = g_DriveList[id];
if (wcsicmp(bang.c_str(), L"EmptyBin") == 0)
if (_wcsicmp(bang.c_str(), L"EmptyBin") == 0)
{ //Empty the Recycle Bin
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHEmptyRecycleBin( NULL, NULL, NULL ) == S_OK)
{
@ -250,9 +250,9 @@ void ExecuteBang(LPCTSTR args, UINT id)
}
else
{
if (wcsicmp(bang.c_str(), L"EmptyBinSilent") == 0)
if (_wcsicmp(bang.c_str(), L"EmptyBinSilent") == 0)
{ //Empty the Recycle Bin (no prompt)
if(wcsicmp(driveSet.c_str(), L"ALL") == 0)
if(_wcsicmp(driveSet.c_str(), L"ALL") == 0)
{
if(SHEmptyRecycleBin( NULL, NULL, SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND ) == S_OK)
{
@ -274,7 +274,7 @@ void ExecuteBang(LPCTSTR args, UINT id)
}
return;
}
else if (wcsicmp(bang.c_str(), L"OpenBin") == 0)
else if (_wcsicmp(bang.c_str(), L"OpenBin") == 0)
{ //Open the Recycle Bin folder
//system("explorer.exe /N,::{645FF040-5081-101B-9F08-00AA002F954E}");
std::wstring szCmd = L"explorer.exe";

View File

@ -95,19 +95,19 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
/* Read our own settings from the ini-file */
if (type)
{
if ( wcsicmp ( L"GDI", type ) == 0 )
if ( _wcsicmp ( L"GDI", type ) == 0 )
{
g_Counters[id] = GDI_COUNT;
}
else if ( wcsicmp ( L"USER", type ) == 0 )
else if ( _wcsicmp ( L"USER", type ) == 0 )
{
g_Counters[id] = USER_COUNT;
}
else if ( wcsicmp ( L"HANDLE", type ) == 0 )
else if ( _wcsicmp ( L"HANDLE", type ) == 0 )
{
g_Counters[id] = HANDLE_COUNT;
}
else if ( wcsicmp ( L"WINDOW", type ) == 0 )
else if ( _wcsicmp ( L"WINDOW", type ) == 0 )
{
g_Counters[id] = WINDOW_COUNT;
}
@ -188,7 +188,7 @@ UINT Update(UINT id)
{
if (GetModuleBaseName(hProcess, hMod[0], buffer, sizeof(buffer)))
{
if (wcsicmp(buffer, processName) != 0)
if (_wcsicmp(buffer, processName) != 0)
{
CloseHandle ( hProcess );
continue;

View File

@ -90,22 +90,22 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"SpeedFanType", L"TEMPERATURE");
if (type)
{
if (wcsicmp(L"TEMPERATURE", type) == 0)
if (_wcsicmp(L"TEMPERATURE", type) == 0)
{
g_Types[id] = TYPE_TEMP;
LPCTSTR scale = ReadConfigString(section, L"SpeedFanScale", L"C");
if (scale)
{
if (wcsicmp(L"C", scale) == 0)
if (_wcsicmp(L"C", scale) == 0)
{
g_Scales[id] = SCALE_CENTIGRADE;
}
else if (wcsicmp(L"F", scale) == 0)
else if (_wcsicmp(L"F", scale) == 0)
{
g_Scales[id] = SCALE_FARENHEIT;
}
else if (wcsicmp(L"K", scale) == 0)
else if (_wcsicmp(L"K", scale) == 0)
{
g_Scales[id] = SCALE_KELVIN;
}
@ -117,11 +117,11 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
}
}
else if (wcsicmp(L"FAN", type) == 0)
else if (_wcsicmp(L"FAN", type) == 0)
{
g_Types[id] = TYPE_FAN;
}
else if (wcsicmp(L"VOLTAGE", type) == 0)
else if (_wcsicmp(L"VOLTAGE", type) == 0)
{
g_Types[id] = TYPE_VOLT;
}

View File

@ -104,104 +104,104 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
LPCTSTR type = ReadConfigString(section, L"SysInfoType", L"");
if(type)
{
if (wcsicmp(L"COMPUTER_NAME", type) == 0)
if (_wcsicmp(L"COMPUTER_NAME", type) == 0)
{
g_Types[id] = COMPUTER_NAME;
}
else if (wcsicmp(L"USER_NAME", type) == 0)
else if (_wcsicmp(L"USER_NAME", type) == 0)
{
g_Types[id] = USER_NAME;
}
else if (wcsicmp(L"WORK_AREA", type) == 0)
else if (_wcsicmp(L"WORK_AREA", type) == 0)
{
g_Types[id] = WORK_AREA;
}
else if (wcsicmp(L"SCREEN_SIZE", type) == 0)
else if (_wcsicmp(L"SCREEN_SIZE", type) == 0)
{
g_Types[id] = SCREEN_SIZE;
}
else if (wcsicmp(L"RAS_STATUS", type) == 0)
else if (_wcsicmp(L"RAS_STATUS", type) == 0)
{
g_Types[id] = RAS_STATUS;
}
else if (wcsicmp(L"OS_VERSION", type) == 0)
else if (_wcsicmp(L"OS_VERSION", type) == 0)
{
g_Types[id] = OS_VERSION;
}
else if (wcsicmp(L"OS_BITS", type) == 0)
else if (_wcsicmp(L"OS_BITS", type) == 0)
{
g_Types[id] = OS_BITS;
}
else if (wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
else if (_wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
{
g_Types[id] = ADAPTER_DESCRIPTION;
}
else if (wcsicmp(L"NET_MASK", type) == 0)
else if (_wcsicmp(L"NET_MASK", type) == 0)
{
g_Types[id] = NET_MASK;
}
else if (wcsicmp(L"IP_ADDRESS", type) == 0)
else if (_wcsicmp(L"IP_ADDRESS", type) == 0)
{
g_Types[id] = IP_ADDRESS;
}
else if (wcsicmp(L"GATEWAY_ADDRESS", type) == 0)
else if (_wcsicmp(L"GATEWAY_ADDRESS", type) == 0)
{
g_Types[id] = GATEWAY_ADDRESS;
}
else if (wcsicmp(L"HOST_NAME", type) == 0)
else if (_wcsicmp(L"HOST_NAME", type) == 0)
{
g_Types[id] = HOST_NAME;
}
else if (wcsicmp(L"DOMAIN_NAME", type) == 0)
else if (_wcsicmp(L"DOMAIN_NAME", type) == 0)
{
g_Types[id] = DOMAIN_NAME;
}
else if (wcsicmp(L"DNS_SERVER", type) == 0)
else if (_wcsicmp(L"DNS_SERVER", type) == 0)
{
g_Types[id] = DNS_SERVER;
}
else if (wcsicmp(L"WORK_AREA_TOP", type) == 0)
else if (_wcsicmp(L"WORK_AREA_TOP", type) == 0)
{
g_Types[id] = WORK_AREA_TOP;
}
else if (wcsicmp(L"WORK_AREA_LEFT", type) == 0)
else if (_wcsicmp(L"WORK_AREA_LEFT", type) == 0)
{
g_Types[id] = WORK_AREA_LEFT;
}
else if (wcsicmp(L"WORK_AREA_WIDTH", type) == 0)
else if (_wcsicmp(L"WORK_AREA_WIDTH", type) == 0)
{
g_Types[id] = WORK_AREA_WIDTH;
}
else if (wcsicmp(L"WORK_AREA_HEIGHT", type) == 0)
else if (_wcsicmp(L"WORK_AREA_HEIGHT", type) == 0)
{
g_Types[id] = WORK_AREA_HEIGHT;
}
else if (wcsicmp(L"SCREEN_WIDTH", type) == 0)
else if (_wcsicmp(L"SCREEN_WIDTH", type) == 0)
{
g_Types[id] = SCREEN_WIDTH;
}
else if (wcsicmp(L"SCREEN_HEIGHT", type) == 0)
else if (_wcsicmp(L"SCREEN_HEIGHT", type) == 0)
{
g_Types[id] = SCREEN_HEIGHT;
}
else if (wcsicmp(L"NUM_MONITORS", type) == 0)
else if (_wcsicmp(L"NUM_MONITORS", type) == 0)
{
g_Types[id] = NUM_MONITORS;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_TOP", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_TOP", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_TOP;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_LEFT", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_LEFT", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_LEFT;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_WIDTH", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_WIDTH", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_WIDTH;
}
else if (wcsicmp(L"VIRTUAL_SCREEN_HEIGHT", type) == 0)
else if (_wcsicmp(L"VIRTUAL_SCREEN_HEIGHT", type) == 0)
{
g_Types[id] = VIRTUAL_SCREEN_HEIGHT;
}

View File

@ -1536,7 +1536,7 @@ BYTE* DownloadUrl(std::wstring& url, DWORD* dwDataSize, bool forceReload)
hUrlDump = InternetOpenUrl(hRootHandle, url.c_str(), NULL, NULL, flags, 0);
if (hUrlDump == NULL)
{
if (wcsnicmp(url.c_str(), L"file://", 7) == 0) // file scheme
if (_wcsnicmp(url.c_str(), L"file://", 7) == 0) // file scheme
{
std::string urlACP = ConvertWideToAscii(url.c_str());
hUrlDump = InternetOpenUrlA(hRootHandle, urlACP.c_str(), NULL, NULL, flags, 0);

View File

@ -112,7 +112,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Select a WLAN interface, default 0.
LPCTSTR data = ReadConfigString(section, L"WifiIntfID", L"");
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if(_wtoi(data) < (int)pIntfList->dwNumberOfItems){
pInterface = &pIntfList->InterfaceInfo[_wtoi(data)];
} else {
@ -127,7 +127,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Select LIST style
data = ReadConfigString(section, L"WifiListStyle", L"");
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if ( (_wtoi(data) >= 0) && (_wtoi(data) <= 3)){
g_meas_data[id].listStyle = _wtoi(data);
} else {
@ -143,7 +143,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
//Set maxmimum number of list items
data = ReadConfigString(section, L"WifiListLimit", L"");
g_meas_data[id].listInit = false;
if ((data != NULL) && (wcsicmp(L"", data) != 0)){
if ((data != NULL) && (_wcsicmp(L"", data) != 0)){
if (_wtoi(data) > 0){
g_meas_data[id].listMax = _wtoi(data);
} else {
@ -159,22 +159,22 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
MEASURETYPE infoType = UNKNOWN;
LPCTSTR type = ReadConfigString(section, L"WifiInfoType", L"");
if(type){
if (wcsicmp(L"SSID", type) == 0){
if (_wcsicmp(L"SSID", type) == 0){
infoType=SSID;
}
else if (wcsicmp(L"QUALITY", type) == 0){
else if (_wcsicmp(L"QUALITY", type) == 0){
infoType=QUALITY;
}
else if (wcsicmp(L"ENCRYPTION", type) == 0){
else if (_wcsicmp(L"ENCRYPTION", type) == 0){
infoType=ENCRYPTION;
}
else if (wcsicmp(L"AUTH", type) == 0){
else if (_wcsicmp(L"AUTH", type) == 0){
infoType=AUTH;
}
else if (wcsicmp(L"LIST", type) == 0){
else if (_wcsicmp(L"LIST", type) == 0){
infoType=LIST;
}
else if (wcsicmp(L"PHY", type) == 0){
else if (_wcsicmp(L"PHY", type) == 0){
infoType=PHY;
} else {
WCHAR buffer[256];
@ -288,7 +288,7 @@ LPCTSTR GetString(UINT id, UINT flags)
mbstowcs(buffer,(char*)pwnl->Network[i].dot11Ssid.ucSSID,pwnl->Network[i].dot11Ssid.uSSIDLength);
//Prevent duplicates that result from profiles, check using SSID
if((wcsstr(g_meas_data[id].netlist,buffer)== NULL)&&(wcsicmp(L"", buffer) != 0)){
if((wcsstr(g_meas_data[id].netlist,buffer)== NULL)&&(_wcsicmp(L"", buffer) != 0)){
printed++;
if(listStyle > 0){
wsprintf(g_meas_data[id].netlist,L"%s%s",g_meas_data[id].netlist,buffer);

View File

@ -190,7 +190,7 @@ void ExecuteBang(LPCTSTR args, UINT id)
std::wstring bang = wholeBang.substr(0, pos);
wholeBang.erase(0, pos + 1);
if (wcsicmp(bang.c_str(), L"SendMessage") == 0)
if (_wcsicmp(bang.c_str(), L"SendMessage") == 0)
{
// Parse parameters
DWORD uMsg, wParam, lParam;

View File

@ -472,7 +472,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
const wchar_t* type = ReadConfigString(section, L"Command", L"");
for(int i = 0; i < COMMAND_COUNT; i++)
{
if (CommandName[i] && type && wcsicmp(CommandName[i], type) == 0)
if (CommandName[i] && type && _wcsicmp(CommandName[i], type) == 0)
{
CommandIdMap[id] = (COMMAND_TYPE)i;