[Cmake-commits] CMake branch, next, updated. v2.8.1-1518-g437d589

David Cole david.cole at kitware.com
Sun Jun 27 11:33:05 EDT 2010


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  437d58926dcd18ef08af924fa2c7145910071143 (commit)
       via  415900ba77648c2472bb2022c46136830a627562 (commit)
       via  4745f4996b73a778f6bdd25669c59b6a6c115fe4 (commit)
      from  0d87744a6951eca9d964fd981ce2ebc4746131c7 (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=437d58926dcd18ef08af924fa2c7145910071143
commit 437d58926dcd18ef08af924fa2c7145910071143
Merge: 0d87744 415900b
Author: David Cole <david.cole at kitware.com>
Date:   Sun Jun 27 11:29:01 2010 -0400

    Merge branch 'fix-warnings' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=415900ba77648c2472bb2022c46136830a627562
commit 415900ba77648c2472bb2022c46136830a627562
Author: David Cole <david.cole at kitware.com>
Date:   Sun Jun 27 11:22:05 2010 -0400

    Eliminate -Wconversion warnings.
    
    Change types of local variables, or casting, or re-arrange
    expressions to get rid of "conversion may alter value" warnings
    as seen on recent dashboard submissions from londinium.kitware.

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/Utilities/cmcompress/cmcompress.c b/Utilities/cmcompress/cmcompress.c
index 59978f6..ea845ed 100644
--- a/Utilities/cmcompress/cmcompress.c
+++ b/Utilities/cmcompress/cmcompress.c
@@ -454,7 +454,7 @@ int cmcompress_compress(struct cmcompress_stream* cdata, void* buff, size_t n)
       {
       goto nomatch;
       }
-    disp = cdata->hsize_reg - i;    /* secondary hash (after G. Knott) */
+    disp = (int)(cdata->hsize_reg - i);    /* secondary hash (after G. Knott) */
     if ( i == 0 )
       {
       disp = 1;

-----------------------------------------------------------------------

Summary of changes:
 Source/CPack/cmCPackDebGenerator.cxx        |    6 +++---
 Source/CPack/cmCPackNSISGenerator.cxx       |    2 +-
 Source/CTest/cmCTestBuildHandler.cxx        |    4 ++--
 Source/CTest/cmCTestMultiProcessHandler.cxx |    5 +++--
 Source/CTest/cmCTestRunTest.cxx             |   12 +++++++-----
 Source/CTest/cmCTestTestHandler.cxx         |    8 +++++---
 Source/kwsys/kwsysDateStamp.cmake           |    2 +-
 Utilities/cmcompress/cmcompress.c           |    2 +-
 8 files changed, 23 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list