[Cmake-commits] CMake branch, next, updated. v2.8.2-402-gd08a37e

Brad King brad.king at kitware.com
Wed Aug 11 09:47:44 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  d08a37ee2450c68eb410f4795ed5bc85c1dcd92e (commit)
       via  4663356079da1c578ab0f7762b4c9d87327b80c3 (commit)
      from  d000782534aadcddd0d64ba773eef7420e0e09aa (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=d08a37ee2450c68eb410f4795ed5bc85c1dcd92e
commit d08a37ee2450c68eb410f4795ed5bc85c1dcd92e
Merge: d000782 4663356
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 11 09:47:43 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 11 09:47:43 2010 -0400

    Merge topic 'libarchive-wrapper' into next
    
    4663356 cmArchiveWrite: Fix signed/unsigned again


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4663356079da1c578ab0f7762b4c9d87327b80c3
commit 4663356079da1c578ab0f7762b4c9d87327b80c3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 11 09:47:04 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Aug 11 09:47:04 2010 -0400

    cmArchiveWrite: Fix signed/unsigned again
    
    Some stream libraries return size_t from gcount() and some return
    ssize_t.  Add an explicit cast to ios::streamsize for its return value.
    Also refactor use of nnext to reduce the use of casts.

diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 88874aa..94c97e6 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -216,24 +216,24 @@ bool cmArchiveWrite::AddData(const char* file, size_t size)
   size_t nleft = size;
   while(nleft > 0)
     {
-    cmsys_ios::streamsize nnext = static_cast<cmsys_ios::streamsize>(
-      nleft > sizeof(buffer)? sizeof(buffer) : nleft);
-    fin.read(buffer, nnext);
+    typedef cmsys_ios::streamsize ssize_type;
+    size_t const nnext = nleft > sizeof(buffer)? sizeof(buffer) : nleft;
+    ssize_type const nnext_s = static_cast<ssize_type>(nnext);
+    fin.read(buffer, nnext_s);
     // Some stream libraries (older HPUX) return failure at end of
     // file on the last read even if some data were read.  Check
     // gcount instead of trusting the stream error status.
-    if(fin.gcount() != nnext)
+    if(static_cast<size_t>(fin.gcount()) != nnext)
       {
       break;
       }
-    if(archive_write_data(this->Archive, buffer,
-                          static_cast<size_t>(nnext)) != nnext)
+    if(archive_write_data(this->Archive, buffer, nnext) != nnext_s)
       {
       this->Error = "archive_write_data: ";
       this->Error += archive_error_string(this->Archive);
       return false;
       }
-    nleft -= static_cast<size_t>(nnext);
+    nleft -= nnext;
     }
   if(nleft > 0)
     {

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

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


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list