[Cmake-commits] CMake branch, next, updated. v2.8.2-141-g582d3ab

Brad King brad.king at kitware.com
Tue Jun 29 10:06:11 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  582d3abd16a38a6d89ca02f2aaa7bf96ca522962 (commit)
       via  ff1f8d0b53c37336645d4d53fc30134540d17ddd (commit)
      from  f73ec0b955012dc1c5b7e61ebb8001f99f2088b7 (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=582d3abd16a38a6d89ca02f2aaa7bf96ca522962
commit 582d3abd16a38a6d89ca02f2aaa7bf96ca522962
Merge: f73ec0b ff1f8d0
Author: Brad King <brad.king at kitware.com>
Date:   Tue Jun 29 10:06:10 2010 -0400

    Merge branch 'fix-cmake-conversion-warnings' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff1f8d0b53c37336645d4d53fc30134540d17ddd
commit ff1f8d0b53c37336645d4d53fc30134540d17ddd
Author: Brad King <brad.king at kitware.com>
Date:   Tue Jun 29 09:52:12 2010 -0400

    Fix or cast more integer conversions in cmake
    
    These were revealed by GCC's -Wconversion option.  Fix types where it is
    easy to do so.  Cast in cases we know the integer will not be truncated.

diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index c66147b..1c48d8c 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -53,13 +53,13 @@ void cmCursesLongMessageForm::UpdateStatusBar()
   getmaxyx(stdscr, y, x);
 
   char bar[cmCursesMainForm::MAX_WIDTH];
-  int size = strlen(this->Title.c_str());
+  size_t size = strlen(this->Title.c_str());
   if ( size >= cmCursesMainForm::MAX_WIDTH )
     {
     size = cmCursesMainForm::MAX_WIDTH-1;
     }
   strncpy(bar, this->Title.c_str(), size);
-  for(int i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
+  for(size_t i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
 
   int width;
   if (x < cmCursesMainForm::MAX_WIDTH )
@@ -76,8 +76,8 @@ void cmCursesLongMessageForm::UpdateStatusBar()
   char version[cmCursesMainForm::MAX_WIDTH];
   char vertmp[128];
   sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
-  int sideSpace = (width-strlen(vertmp));
-  for(int i=0; i<sideSpace; i++) { version[i] = ' '; }
+  size_t sideSpace = (width-strlen(vertmp));
+  for(size_t i=0; i<sideSpace; i++) { version[i] = ' '; }
   sprintf(version+sideSpace, "%s", vertmp);
   version[width] = '\0';
 
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index cd231ad..805d5ec 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -454,7 +454,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
   if (cw)
     {
     sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
-    curses_move(0,65-strlen(firstLine)-1);
+    curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1);
     printw(firstLine);
     }
 //    }
@@ -526,8 +526,8 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
   // Join the key, help string and pad with spaces
   // (or truncate) as necessary
   char bar[cmCursesMainForm::MAX_WIDTH];
-  int i, curFieldLen = strlen(curField);
-  int helpLen = strlen(help);
+  size_t i, curFieldLen = strlen(curField);
+  size_t helpLen = strlen(help);
 
   int width;
   if (x < cmCursesMainForm::MAX_WIDTH )
@@ -592,7 +592,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
   char version[cmCursesMainForm::MAX_WIDTH];
   char vertmp[128];
   sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
-  int sideSpace = (width-strlen(vertmp));
+  size_t sideSpace = (width-strlen(vertmp));
   for(i=0; i<sideSpace; i++) { version[i] = ' '; }
   sprintf(version+sideSpace, "%s", vertmp);
   version[width] = '\0';
@@ -795,7 +795,7 @@ void cmCursesMainForm::RemoveEntry(const char* value)
 // copy from the list box to the cache manager
 void cmCursesMainForm::FillCacheManagerFromUI()
 {   
-  int size = this->Entries->size();
+  size_t size = this->Entries->size();
   for(int i=0; i < size; i++)
     {
     cmCacheManager::CacheIterator it = 
@@ -866,7 +866,7 @@ void cmCursesMainForm::HandleInput()
       std::string searchstr = "Search: " + this->SearchString;
       this->UpdateStatusBar( searchstr.c_str() );
       this->PrintKeys(1);
-      curses_move(y-5,searchstr.size());
+      curses_move(y-5,static_cast<unsigned int>(searchstr.size()));
       //curses_move(1,1);
       touchwin(stdscr); 
       refresh();
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 9751999..4084415 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -147,7 +147,7 @@ protected:
   // Where is cmake executable
   std::string WhereCMake;
   // Number of entries shown (depends on mode -normal or advanced-)
-  int NumberOfVisibleEntries;
+  size_t NumberOfVisibleEntries;
   bool AdvancedMode;
   // Did the iteration converge (no new entries) ?
   bool OkToGenerate;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index bd69d6c..4d56257 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1169,7 +1169,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
         if ( tick % tick_line_len == 0 && tick > 0 )
           {
           cmCTestLog(this, HANDLER_OUTPUT, "  Size: "
-            << int((output->size() / 1024.0) + 1) << "K" << std::endl
+            << int((double(output->size()) / 1024.0) + 1) << "K" << std::endl
             << "    " << std::flush);
           }
         }
@@ -1181,7 +1181,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
       }
     }
   cmCTestLog(this, OUTPUT, " Size of output: "
-    << int(output->size() / 1024.0) << "K" << std::endl);
+    << int(double(output->size()) / 1024.0) << "K" << std::endl);
 
   cmsysProcess_WaitForExit(cp, 0);
 
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5be53c2..0badbba 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1989,9 +1989,9 @@ namespace{
 # pragma warn -8066 /* unreachable code */
 #endif
   
-int copy_data(struct archive *ar, struct archive *aw)
+long copy_data(struct archive *ar, struct archive *aw)
 {
-  int r;
+  long r;
   const void *buff;
   size_t size;
   off_t offset;
@@ -2136,7 +2136,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
         }
       else if(*outiter == '\n' || *outiter == '\0')
         {
-        int length = outiter-out.begin();
+        std::vector<char>::size_type length = outiter-out.begin();
         if(length > 1 && *(outiter-1) == '\r')
           {
           --length;
@@ -2159,7 +2159,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
         }
       else if(*erriter == '\n' || *erriter == '\0')
         {
-        int length = erriter-err.begin();
+        std::vector<char>::size_type length = erriter-err.begin();
         if(length > 1 && *(erriter-1) == '\r')
           {
           --length;
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c
index 9c11f2b..c9bf259 100644
--- a/Source/cm_utf8.c
+++ b/Source/cm_utf8.c
@@ -62,7 +62,7 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
   /* Extract bits from this multi-byte character.  */
   {
   unsigned int uc = c & cm_utf8_mask[ones];
-  unsigned char left;
+  int left;
   for(left = ones-1; left && first != last; --left)
     {
     c = (unsigned char)*first++;

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

Summary of changes:
 Source/CursesDialog/cmCursesLongMessageForm.cxx |    8 ++++----
 Source/CursesDialog/cmCursesMainForm.cxx        |   12 ++++++------
 Source/CursesDialog/cmCursesMainForm.h          |    2 +-
 Source/cmCTest.cxx                              |    4 ++--
 Source/cmSystemTools.cxx                        |    8 ++++----
 Source/cm_utf8.c                                |    2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list