[Cmake-commits] CMake branch, next, updated. v2.8.2-383-gc4663ab

Brad King brad.king at kitware.com
Mon Aug 9 10:47:04 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  c4663ab035bc4340cabdce3ee047d8c48fccbc90 (commit)
       via  aef672311aa8b802c4477a4d51f531f752a6a787 (commit)
      from  b0f287998b5b760a278adb7156aa57d69764dbd8 (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=c4663ab035bc4340cabdce3ee047d8c48fccbc90
commit c4663ab035bc4340cabdce3ee047d8c48fccbc90
Merge: b0f2879 aef6723
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 9 10:47:03 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 9 10:47:03 2010 -0400

    Merge topic 'libarchive-wrapper' into next
    
    aef6723 cmArchiveWrite: Fix signed/unsigned compare/convert


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aef672311aa8b802c4477a4d51f531f752a6a787
commit aef672311aa8b802c4477a4d51f531f752a6a787
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 9 10:30:41 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 9 10:43:03 2010 -0400

    cmArchiveWrite: Fix signed/unsigned compare/convert
    
    The libarchive interface accepts size_t but returns ssize_t.  The std
    streams interface wants streamsize, which is typically ssize_t.  Since
    no one type for our variable matches without conversions, make the
    conversions explicit to avoid -Wsign-conversion and -Wsign-compare
    warnings.

diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 0a44168..88874aa 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -12,6 +12,7 @@
 #include "cmArchiveWrite.h"
 
 #include "cmSystemTools.h"
+#include <cmsys/ios/iostream>
 #include <cmsys/Directory.hxx>
 #include <cm_libarchive.h>
 
@@ -33,7 +34,8 @@ struct cmArchiveWrite::Callback
                             const void *b, size_t n)
     {
     cmArchiveWrite* self = static_cast<cmArchiveWrite*>(cd);
-    if(self->Stream.write(static_cast<const char*>(b), n))
+    if(self->Stream.write(static_cast<const char*>(b),
+                          static_cast<cmsys_ios::streamsize>(n)))
       {
       return static_cast<__LA_SSIZE_T>(n);
       }
@@ -214,7 +216,8 @@ bool cmArchiveWrite::AddData(const char* file, size_t size)
   size_t nleft = size;
   while(nleft > 0)
     {
-    size_t nnext = nleft > sizeof(buffer)? sizeof(buffer) : nleft;
+    cmsys_ios::streamsize nnext = static_cast<cmsys_ios::streamsize>(
+      nleft > sizeof(buffer)? sizeof(buffer) : nleft);
     fin.read(buffer, nnext);
     // Some stream libraries (older HPUX) return failure at end of
     // file on the last read even if some data were read.  Check
@@ -223,13 +226,14 @@ bool cmArchiveWrite::AddData(const char* file, size_t size)
       {
       break;
       }
-    if(archive_write_data(this->Archive, buffer, nnext) != nnext)
+    if(archive_write_data(this->Archive, buffer,
+                          static_cast<size_t>(nnext)) != nnext)
       {
       this->Error = "archive_write_data: ";
       this->Error += archive_error_string(this->Archive);
       return false;
       }
-    nleft -= nnext;
+    nleft -= static_cast<size_t>(nnext);
     }
   if(nleft > 0)
     {

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

Summary of changes:
 Source/cmArchiveWrite.cxx |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list