[cmake-commits] hoffman committed CMakeLists.txt 1.132 1.133
SystemInformation.cxx 1.1 1.2 SystemInformation.hxx.in 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Jan 8 14:59:59 EST 2008
Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv11621
Modified Files:
CMakeLists.txt SystemInformation.cxx SystemInformation.hxx.in
Log Message:
ENH: fix leaks and turn on by default
Index: SystemInformation.hxx.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemInformation.hxx.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- SystemInformation.hxx.in 8 Jan 2008 16:38:28 -0000 1.1
+++ SystemInformation.hxx.in 8 Jan 2008 19:59:57 -0000 1.2
@@ -113,10 +113,10 @@
const char * GetVendorString();
const char * GetVendorID();
- const char * GetTypeID();
- const char * GetFamilyID();
- const char * GetModelID();
- const char * GetSteppingCode();
+ kwsys_stl::string GetTypeID();
+ kwsys_stl::string GetFamilyID();
+ kwsys_stl::string GetModelID();
+ kwsys_stl::string GetSteppingCode();
const char * GetExtendedProcessorName();
const char * GetProcessorSerialNumber();
int GetProcessorCacheSize();
Index: SystemInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemInformation.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- SystemInformation.cxx 8 Jan 2008 16:38:28 -0000 1.1
+++ SystemInformation.cxx 8 Jan 2008 19:59:57 -0000 1.2
@@ -17,6 +17,7 @@
#include KWSYS_HEADER(SystemInformation.hxx)
#include KWSYS_HEADER(Process.h)
#include KWSYS_HEADER(ios/iostream)
+#include KWSYS_HEADER(ios/sstream)
#ifndef WIN32
#include <sys/utsname.h> // int uname(struct utsname *buf);
#endif
@@ -171,35 +172,35 @@
}
/** Return the type ID of the CPU */
-const char * SystemInformation::GetTypeID()
+kwsys_stl::string SystemInformation::GetTypeID()
{
- char * temp = new char[32];
- sprintf(temp,"%d",this->ChipID.Type);
- return temp;
+ kwsys_ios::ostringstream str;
+ str << this->ChipID.Type;
+ return str.str();
}
/** Return the family of the CPU present */
-const char * SystemInformation::GetFamilyID()
+kwsys_stl::string SystemInformation::GetFamilyID()
{
- char * temp = new char[32];
- sprintf(temp,"%d",this->ChipID.Family);
- return temp;
+ kwsys_ios::ostringstream str;
+ str << this->ChipID.Family;
+ return str.str();
}
// Return the model of CPU present */
-const char * SystemInformation::GetModelID()
+kwsys_stl::string SystemInformation::GetModelID()
{
- char * temp = new char[32];
- sprintf(temp,"%d",this->ChipID.Model);
- return temp;
+ kwsys_ios::ostringstream str;
+ str << this->ChipID.Model;
+ return str.str();
}
/** Return the stepping code of the CPU present. */
-const char * SystemInformation::GetSteppingCode()
-{
- char * temp = new char[32];
- sprintf(temp,"%d",this->ChipID.Revision);
- return temp;
+kwsys_stl::string SystemInformation::GetSteppingCode()
+{
+ kwsys_ios::ostringstream str;
+ str << this->ChipID.Revision;
+ return str.str();
}
/** Return the stepping code of the CPU present. */
@@ -2649,7 +2650,8 @@
this->OSRelease = "Unknown";
break;
}
-
+ delete [] operatingSystem;
+ operatingSystem = 0;
// Get the hostname
WORD wVersionRequested;
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/CMakeLists.txt,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- CMakeLists.txt 8 Jan 2008 16:43:07 -0000 1.132
+++ CMakeLists.txt 8 Jan 2008 19:59:57 -0000 1.133
@@ -137,7 +137,7 @@
SET(KWSYS_USE_IOStream 1)
SET(KWSYS_USE_DateStamp 1)
SET(KWSYS_USE_String 1)
-# SET(KWSYS_USE_SystemInformation 1)
+ SET(KWSYS_USE_SystemInformation 1)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
# Setup the large file support default.
More information about the Cmake-commits
mailing list