diff options
author | Brad King <brad.king@kitware.com> | 2008-05-02 13:14:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-05-02 13:14:37 (GMT) |
commit | ab0c2757d5b0a74f98047921fc8384e2a78dbabe (patch) | |
tree | 18b19fc3c36e7905d17d85ec96e43c9fe4d6c221 /Source | |
parent | cfc425c1346e037d06553d49abb7943eb68f576b (diff) | |
download | CMake-ab0c2757d5b0a74f98047921fc8384e2a78dbabe.zip CMake-ab0c2757d5b0a74f98047921fc8384e2a78dbabe.tar.gz CMake-ab0c2757d5b0a74f98047921fc8384e2a78dbabe.tar.bz2 |
COMP: Fix warnings in KWSys SystemInformation on Borland compiler.
- Remove two unused variables.
- Replace dynamically allocated array with static.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 2d9fee6..5437a1f 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -799,8 +799,6 @@ void SystemInformationImplementation::Delay(unsigned int uiMS) bool SystemInformationImplementation::DoesCPUSupportCPUID() { - int CPUIDPresent = 0; - #if USE_ASM_INSTRUCTIONS // Use SEH to determine CPUID presence __try { @@ -829,15 +827,15 @@ bool SystemInformationImplementation::DoesCPUSupportCPUID() __except(1) { // Stop the class from trying to use CPUID again! - CPUIDPresent = false; return false; } + + // The cpuid instruction succeeded. + return true; #else - CPUIDPresent = false; + // Assume no cpuid instruction. + return false; #endif - - // Return true to indicate support or false to indicate lack. - return (CPUIDPresent == 0) ? true : false; } bool SystemInformationImplementation::RetrieveCPUFeatures() @@ -2586,13 +2584,13 @@ int SystemInformationImplementation::CPUCount() // number of logical processors. unsigned int i = 1; unsigned char PHY_ID_MASK = 0xFF; - unsigned char PHY_ID_SHIFT = 0; + //unsigned char PHY_ID_SHIFT = 0; while (i < this->NumberOfLogicalCPU) { i *= 2; PHY_ID_MASK <<= 1; - PHY_ID_SHIFT++; + // PHY_ID_SHIFT++; } hCurrentProcessHandle = GetCurrentProcess(); @@ -2922,7 +2920,7 @@ bool SystemInformationImplementation::QueryOSInformation() OSVERSIONINFOEX osvi; BOOL bIsWindows64Bit; BOOL bOsVersionInfoEx; - char * operatingSystem = new char [256]; + char operatingSystem[256]; // Try calling GetVersionEx using the OSVERSIONINFOEX structure. ZeroMemory (&osvi, sizeof (OSVERSIONINFOEX)); @@ -3117,8 +3115,6 @@ bool SystemInformationImplementation::QueryOSInformation() this->OSRelease = "Unknown"; break; } - delete [] operatingSystem; - operatingSystem = 0; // Get the hostname WORD wVersionRequested; |