COMP: Fix warnings in KWSys SystemInformation on Borland compiler.

- Remove two unused variables.
  - Replace dynamically allocated array with static.
This commit is contained in:
Brad King 2008-05-02 09:14:37 -04:00
parent cfc425c134
commit ab0c2757d5

View File

@ -799,8 +799,6 @@ void SystemInformationImplementation::Delay(unsigned int uiMS)
bool SystemInformationImplementation::DoesCPUSupportCPUID() bool SystemInformationImplementation::DoesCPUSupportCPUID()
{ {
int CPUIDPresent = 0;
#if USE_ASM_INSTRUCTIONS #if USE_ASM_INSTRUCTIONS
// Use SEH to determine CPUID presence // Use SEH to determine CPUID presence
__try { __try {
@ -829,15 +827,15 @@ bool SystemInformationImplementation::DoesCPUSupportCPUID()
__except(1) __except(1)
{ {
// Stop the class from trying to use CPUID again! // Stop the class from trying to use CPUID again!
CPUIDPresent = false;
return false; return false;
} }
#else
CPUIDPresent = false;
#endif
// Return true to indicate support or false to indicate lack. // The cpuid instruction succeeded.
return (CPUIDPresent == 0) ? true : false; return true;
#else
// Assume no cpuid instruction.
return false;
#endif
} }
bool SystemInformationImplementation::RetrieveCPUFeatures() bool SystemInformationImplementation::RetrieveCPUFeatures()
@ -2586,13 +2584,13 @@ int SystemInformationImplementation::CPUCount()
// number of logical processors. // number of logical processors.
unsigned int i = 1; unsigned int i = 1;
unsigned char PHY_ID_MASK = 0xFF; unsigned char PHY_ID_MASK = 0xFF;
unsigned char PHY_ID_SHIFT = 0; //unsigned char PHY_ID_SHIFT = 0;
while (i < this->NumberOfLogicalCPU) while (i < this->NumberOfLogicalCPU)
{ {
i *= 2; i *= 2;
PHY_ID_MASK <<= 1; PHY_ID_MASK <<= 1;
PHY_ID_SHIFT++; // PHY_ID_SHIFT++;
} }
hCurrentProcessHandle = GetCurrentProcess(); hCurrentProcessHandle = GetCurrentProcess();
@ -2922,7 +2920,7 @@ bool SystemInformationImplementation::QueryOSInformation()
OSVERSIONINFOEX osvi; OSVERSIONINFOEX osvi;
BOOL bIsWindows64Bit; BOOL bIsWindows64Bit;
BOOL bOsVersionInfoEx; BOOL bOsVersionInfoEx;
char * operatingSystem = new char [256]; char operatingSystem[256];
// Try calling GetVersionEx using the OSVERSIONINFOEX structure. // Try calling GetVersionEx using the OSVERSIONINFOEX structure.
ZeroMemory (&osvi, sizeof (OSVERSIONINFOEX)); ZeroMemory (&osvi, sizeof (OSVERSIONINFOEX));
@ -3117,8 +3115,6 @@ bool SystemInformationImplementation::QueryOSInformation()
this->OSRelease = "Unknown"; this->OSRelease = "Unknown";
break; break;
} }
delete [] operatingSystem;
operatingSystem = 0;
// Get the hostname // Get the hostname
WORD wVersionRequested; WORD wVersionRequested;