[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6272-gbcd0231
Brad King
brad.king at kitware.com
Thu Dec 19 11:10:55 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via bcd023168781e47df5edd1362e308637cb8abdb0 (commit)
via 2a943d9264c995f3d2c55b3da202b88f67329750 (commit)
via f788d9a1b27efc9b463b1174a93e780bef00a5d9 (commit)
from 67f344545c7131b585742a5c0ffdf4f60bc5e4ab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcd023168781e47df5edd1362e308637cb8abdb0
commit bcd023168781e47df5edd1362e308637cb8abdb0
Merge: 67f3445 2a943d9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 19 11:10:51 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Dec 19 11:10:51 2013 -0500
Merge topic 'update-kwsys' into next
2a943d9 Merge branch 'upstream-kwsys' into update-kwsys
f788d9a KWSys 2013-12-19 (88165c5e)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a943d9264c995f3d2c55b3da202b88f67329750
commit 2a943d9264c995f3d2c55b3da202b88f67329750
Merge: b375c18 f788d9a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 19 10:44:29 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Dec 19 10:44:29 2013 -0500
Merge branch 'upstream-kwsys' into update-kwsys
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f788d9a1b27efc9b463b1174a93e780bef00a5d9
commit f788d9a1b27efc9b463b1174a93e780bef00a5d9
Author: KWSys Robot <kwrobot at kitware.com>
AuthorDate: Thu Dec 19 09:39:26 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Dec 19 10:44:24 2013 -0500
KWSys 2013-12-19 (88165c5e)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ 88165c5e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 1010d0e3..88165c5e
Clinton Stimpson (2):
ab6f8c36 FStream: Fix rdbuf() return and use use of FStream in SystemTools.
88165c5e Encoding: Fix bug in kwsysEncoding_DupToNarrow.
Rolf Eike Beer (2):
d2bcbe11 SystemInformation: extract CPU information on Linux/Sparc
b2fd7da5 ProcessUNIX: close /proc entry before starting recursion
Ådne Hovda (1):
a02a1ad2 SystemInformation: Fix compilation on HP-UX 11.11 hppa
Change-Id: I225e0517379d88612f18215b43c7d6a9daad6326
diff --git a/EncodingC.c b/EncodingC.c
index a36eecc..cda78e2 100644
--- a/EncodingC.c
+++ b/EncodingC.c
@@ -68,7 +68,7 @@ size_t kwsysEncoding_wcstombs(char* dest, const wchar_t* str, size_t n)
char* kwsysEncoding_DupToNarrow(const wchar_t* str)
{
char* ret = NULL;
- size_t length = kwsysEncoding_wcstombs(0, str, 0);
+ size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
if(length > 0)
{
ret = malloc(length);
diff --git a/FStream.hxx.in b/FStream.hxx.in
index 8170fb3..c340c55 100644
--- a/FStream.hxx.in
+++ b/FStream.hxx.in
@@ -81,7 +81,7 @@ namespace @KWSYS_NAMESPACE@
internal_buffer_type *rdbuf() const
{
- return buf_.get();
+ return buf_;
}
~basic_ifstream()
diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index b9af2f1..faeb967 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -2449,6 +2449,7 @@ static void kwsysProcessKill(pid_t process_id)
if(f)
{
size_t nread = fread(buffer, 1, KWSYSPE_PIPE_BUFFER_SIZE, f);
+ fclose(f);
buffer[nread] = '\0';
if(nread > 0)
{
@@ -2463,7 +2464,6 @@ static void kwsysProcessKill(pid_t process_id)
}
}
}
- fclose(f);
}
}
}
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 2f6c949..5f20853 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -3162,8 +3162,17 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
kwsys_stl::string cores =
this->ExtractValueFromCpuInfoFile(buffer,"cpu cores");
int numberOfCoresPerCPU=atoi(cores.c_str());
- this->NumberOfPhysicalCPU=static_cast<unsigned int>(
- numberOfCoresPerCPU*(maxId+1));
+ if (maxId > 0)
+ {
+ this->NumberOfPhysicalCPU=static_cast<unsigned int>(
+ numberOfCoresPerCPU*(maxId+1));
+ }
+ else
+ {
+ // Linux Sparc: get cpu count
+ this->NumberOfPhysicalCPU=
+ atoi(this->ExtractValueFromCpuInfoFile(buffer,"ncpus active").c_str());
+ }
#else // __CYGWIN__
// does not have "physical id" entries, neither "cpu cores"
@@ -3185,7 +3194,19 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// CPU speed (checking only the first processor)
kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
- this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str()));
+ if(!CPUSpeed.empty())
+ {
+ this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str()));
+ }
+#ifdef __linux
+ else
+ {
+ // Linux Sparc: CPU speed is in Hz and encoded in hexadecimal
+ CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"Cpu0ClkTck");
+ this->CPUSpeedInMHz = static_cast<float>(
+ strtoull(CPUSpeed.c_str(),0,16))/1000000.0f;
+ }
+#endif
// Chip family
kwsys_stl::string familyStr =
@@ -4991,7 +5012,12 @@ bool SystemInformationImplementation::QueryHPUXProcessor()
case CPU_PA_RISC2_0:
this->ChipID.Vendor = "Hewlett-Packard";
this->ChipID.Family = 0x200;
+# ifdef CPU_HP_INTEL_EM_1_0
+ case CPU_HP_INTEL_EM_1_0:
+# endif
+# ifdef CPU_IA64_ARCHREV_0
case CPU_IA64_ARCHREV_0:
+# endif
this->ChipID.Vendor = "GenuineIntel";
this->Features.HasIA64 = true;
break;
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 4649f3b..f4a443f 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2115,10 +2115,10 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
SystemTools::RemoveFile(destination);
#if defined(_WIN32) || defined(__CYGWIN__)
- kwsys_ios::ofstream fout(destination,
+ kwsys::ofstream fout(destination,
kwsys_ios::ios::binary | kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#else
- kwsys_ios::ofstream fout(destination,
+ kwsys::ofstream fout(destination,
kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#endif
if(!fout)
diff --git a/testEncoding.cxx b/testEncoding.cxx
index 8e74a50..a65c430 100644
--- a/testEncoding.cxx
+++ b/testEncoding.cxx
@@ -16,14 +16,18 @@
#endif
#include KWSYS_HEADER(Encoding.hxx)
+#include KWSYS_HEADER(Encoding.h)
#include KWSYS_HEADER(ios/iostream)
#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Encoding.hxx.in"
+# include "Encoding.h.in"
# include "kwsys_ios_iostream.h.in"
#endif
@@ -68,11 +72,16 @@ static int testHelloWorldEncoding()
std::cout << str << std::endl;
std::wstring wstr = kwsys::Encoding::ToWide(str);
std::string str2 = kwsys::Encoding::ToNarrow(wstr);
- if(!wstr.empty() && str != str2)
+ wchar_t* c_wstr = kwsysEncoding_DupToWide(str.c_str());
+ char* c_str2 = kwsysEncoding_DupToNarrow(c_wstr);
+ if(!wstr.empty() && (str != str2 || strcmp(c_str2, str.c_str())))
{
std::cout << "converted string was different: " << str2 << std::endl;
+ std::cout << "converted string was different: " << c_str2 << std::endl;
ret++;
}
+ free(c_wstr);
+ free(c_str2);
}
return ret;
}
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/EncodingC.c | 2 +-
Source/kwsys/FStream.hxx.in | 2 +-
Source/kwsys/ProcessUNIX.c | 2 +-
Source/kwsys/SystemInformation.cxx | 32 +++++++++++++++++++++++++++++---
Source/kwsys/SystemTools.cxx | 4 ++--
Source/kwsys/testEncoding.cxx | 11 ++++++++++-
6 files changed, 44 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list