summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-07-13 13:46:52 (GMT)
committerBrad King <brad.king@kitware.com>2010-07-13 13:46:52 (GMT)
commit7739d786a42a2bbbab87df0c4f869ef8aecae767 (patch)
tree19c1e0625accfe324b2e634e8a79cd481b3b042b /Source
parent9203e9187ec3c0ada49af953c3ec1a1f9190cf45 (diff)
parentdbe7525c6e623c3be1dad7dae5948e71b5ac2b6b (diff)
downloadCMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.zip
CMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.tar.gz
CMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.tar.bz2
Merge CPackRPM changes into doc-spelling
Conflicts: Modules/CPackRPM.cmake
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx5
-rw-r--r--Source/CTest/cmCTestRunTest.cxx12
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx8
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx13
-rw-r--r--Source/kwsys/CMakeLists.txt39
-rw-r--r--Source/kwsys/Configure.hxx.in9
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
-rw-r--r--Source/kwsys/testProcess.c5
11 files changed, 55 insertions, 52 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 9c77cc1..c254dbb 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -135,7 +135,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
// now add all directories which have to be compressed
// collect all top level install dirs for that
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
- int topLevelLength = strlen(toplevel);
+ size_t topLevelLength = strlen(toplevel);
std::set<std::string> installDirs;
for (std::vector<std::string>::const_iterator fileIt = files.begin();
fileIt != files.end(); ++ fileIt )
@@ -431,7 +431,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
/* If not truncating names and the name is too long or contains
* a space, use extended format 1. */
- unsigned int lname = strlen(name);
+ size_t lname = strlen(name);
uid_t uid = sb->st_uid;
gid_t gid = sb->st_gid;
if (uid > USHRT_MAX) {
@@ -441,7 +441,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
gid = USHRT_MAX;
}
if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
- (void)sprintf(ar_hb, HDR1, AR_EFMT1, lname,
+ (void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname,
(long int)sb->st_mtime, uid, gid, sb->st_mode,
(long long)sb->st_size + lname, ARFMAG);
else {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index ad77386..8329546 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -758,7 +758,7 @@ CreateComponentDescription(cmCPackComponent *component,
}
// Create the NSIS code to download this file on-the-fly.
- unsigned totalSizeInKbytes = (totalSize + 512) / 1024;
+ unsigned long totalSizeInKbytes = (totalSize + 512) / 1024;
if (totalSizeInKbytes == 0)
{
totalSizeInKbytes = 1;
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index bc02fbc..3fd19a5 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -959,7 +959,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
this->ProcessBuffer(0, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue);
cmCTestLog(this->CTest, OUTPUT, " Size of output: "
- << int(this->BuildOutputLogSize / 1024.0) << "K" << std::endl);
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl);
// Properly handle output of the build command
cmsysProcess_WaitForExit(cp, 0);
@@ -1171,7 +1171,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Size: "
- << int((this->BuildOutputLogSize / 1024.0) + 1) << "K" << std::endl
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl
<< " ");
}
}
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 1eb84e8..4d39367 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -484,8 +484,9 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
}
else //we ignore their cost
{
- this->TestCosts[this->Tests.size()
- - this->Properties[i->first]->Index].insert(i->first);
+ size_t index = this->Tests.size()
+ - static_cast<size_t>(this->Properties[i->first]->Index);
+ this->TestCosts[index].insert(i->first);
}
}
}
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 3719d45..ce44097 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -83,7 +83,8 @@ void cmCTestRunTest::CompressOutput()
reinterpret_cast<unsigned char*>(
const_cast<char*>(this->ProcessOutput.c_str()));
//zlib makes the guarantee that this is the maximum output size
- int outSize = static_cast<int>(this->ProcessOutput.size() * 1.001 + 13);
+ int outSize = static_cast<int>(
+ static_cast<double>(this->ProcessOutput.size()) * 1.001 + 13.0);
unsigned char* out = new unsigned char[outSize];
strm.zalloc = Z_NULL;
@@ -342,13 +343,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
//----------------------------------------------------------------------
void cmCTestRunTest::ComputeWeightedCost()
{
- int prev = this->TestProperties->PreviousRuns;
- float avgcost = this->TestProperties->Cost;
+ double prev = static_cast<double>(this->TestProperties->PreviousRuns);
+ double avgcost = static_cast<double>(this->TestProperties->Cost);
double current = this->TestResult.ExecutionTime;
if(this->TestResult.Status == cmCTestTestHandler::COMPLETED)
{
- this->TestProperties->Cost = ((prev * avgcost) + current) / (prev + 1);
+ this->TestProperties->Cost =
+ static_cast<float>(((prev * avgcost) + current) / (prev + 1.0));
this->TestProperties->PreviousRuns++;
}
}
@@ -569,7 +571,7 @@ double cmCTestRunTest::ResolveTimeout()
{
stop_time += 24*60*60;
}
- int stop_timeout = (stop_time - current_time) % (24*60*60);
+ int stop_timeout = static_cast<int>(stop_time - current_time) % (24*60*60);
this->CTest->LastStopTimeout = stop_timeout;
if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index d2742ec..a4a4863 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1048,7 +1048,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
if(randomSchedule)
{
- p.Cost = rand();
+ p.Cost = static_cast<float>(rand());
}
if(p.Timeout == 0 && this->CTest->GetGlobalTimeout() != 0)
@@ -1309,7 +1309,8 @@ std::string cmCTestTestHandler::EncodeFile(std::string file)
cmSystemTools::RemoveFile(tarFile.c_str());
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
@@ -1881,7 +1882,8 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
unsigned char *file_buffer = new unsigned char [ len + 1 ];
ifs.read(reinterpret_cast<char*>(file_buffer), len);
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 051cc1f..972af95 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -183,7 +183,7 @@ cmVisualStudioGeneratorOptions
{
fout << prefix << "PreprocessorDefinitions=\"";
}
- const char* comma = "";
+ const char* sep = "";
for(std::vector<std::string>::const_iterator di = this->Defines.begin();
di != this->Defines.end(); ++di)
{
@@ -208,15 +208,8 @@ cmVisualStudioGeneratorOptions
define = cmVisualStudioGeneratorOptionsEscapeForXML(define.c_str());
}
// Store the flag in the project file.
- fout << comma << define;
- if(this->Version == 10)
- {
- comma = ";";
- }
- else
- {
- comma = ",";
- }
+ fout << sep << define;
+ sep = ";";
}
if(this->Version == 10)
{
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index f440ff9..bcc7a96 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY)
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
ENDIF(COMMAND SET_PROPERTY)
-# add option to disable memory cleanup at exit of putenv memory
-IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 1)
-ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 0)
-ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
@@ -605,6 +599,23 @@ ELSE(KWSYS_BUILD_SHARED)
ENDIF(KWSYS_BUILD_SHARED)
#-----------------------------------------------------------------------------
+# Configure some implementation details.
+
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
+ "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
+ "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
+SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
+ COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
+ )
+
+IF(KWSYS_DO_NOT_CLEAN_PUTENV)
+ # Disable cleanup of putenv memory for issues with GCOV.
+ SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
+ COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1)
+ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV)
+
+#-----------------------------------------------------------------------------
# Choose a directory for the generated headers.
IF(NOT KWSYS_HEADER_ROOT)
SET(KWSYS_HEADER_ROOT "${PROJECT_BINARY_DIR}")
@@ -782,15 +793,6 @@ IF(KWSYS_USE_Process)
ELSE(NOT UNIX)
# Use the UNIX implementation.
SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ProcessUNIX.c)
-
- # Help ProcessUNIX.c compile properly on all platforms.
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
- "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
- "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
- SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c PROPERTIES
- COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
- )
ENDIF(NOT UNIX)
ENDIF(KWSYS_USE_Process)
@@ -1095,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7})
ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
+ SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
ENDFOREACH(n)
# Some Apple compilers produce bad optimizations in this source.
@@ -1122,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE)
+
+ # Suppress known consistent failures on buggy systems.
+ IF(KWSYS_TEST_BOGUS_FAILURES)
+ SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
+ ENDIF()
+
ENDIF(BUILD_TESTING)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in
index 9310d94..716b84f 100644
--- a/Source/kwsys/Configure.hxx.in
+++ b/Source/kwsys/Configure.hxx.in
@@ -15,15 +15,6 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>
-/* Disable cleanup of putenv memory for issues with GCOV */
-#if @KWSYS_DO_NOT_CLEAN_PUTENV@
-#define KWSYS_DO_NOT_CLEAN_PUTENV
-#else
-#undef KWSYS_DO_NOT_CLEAN_PUTENV
-#endif
-
-
-
/* Whether ANSI C++ stream headers are to be used. */
#define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 043f0d0..6ec7305 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2010)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 06)
+SET(KWSYS_DATE_STAMP_MONTH 07)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 28)
+SET(KWSYS_DATE_STAMP_DAY 04)
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 0060c4d..6044917 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -94,7 +94,12 @@ int test4(int argc, const char* argv[])
fprintf(stderr, "Output before crash on stderr from crash test.\n");
fflush(stdout);
fflush(stderr);
+#if defined(__APPLE__) && defined(__x86_64__) && defined(__OPTIMIZE__) \
+ && defined(__clang__)
+ *(int*)1 = 0; /* Clang's optimizer produces bad code for 0-ptr. */
+#else
*(int*)0 = 0;
+#endif
fprintf(stdout, "Output after crash on stdout from crash test.\n");
fprintf(stderr, "Output after crash on stderr from crash test.\n");
return 0;