You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/11/10 01:01:22 UTC

[2/2] snappy commit: updated refs/heads/master to ce24944

Fix signed-vs.-unsigned comparison warnings

This includes:
- https://github.com/google/snappy/commit/d80342922
- https://github.com/google/snappy/pull/11


Project: http://git-wip-us.apache.org/repos/asf/couchdb-snappy/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-snappy/commit/ce249447
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-snappy/tree/ce249447
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-snappy/diff/ce249447

Branch: refs/heads/master
Commit: ce24944752ff3a60ad2710f61d4cf709a1b31863
Parents: 4f05d84
Author: Alexander Shorin <kx...@apache.org>
Authored: Mon Oct 26 18:51:00 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Nov 10 02:58:48 2015 +0300

----------------------------------------------------------------------
 c_src/snappy/snappy.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-snappy/blob/ce249447/c_src/snappy/snappy.cc
----------------------------------------------------------------------
diff --git a/c_src/snappy/snappy.cc b/c_src/snappy/snappy.cc
index b6ca7ec..09eab49 100644
--- a/c_src/snappy/snappy.cc
+++ b/c_src/snappy/snappy.cc
@@ -966,7 +966,7 @@ class SnappyIOVecWriter {
   const size_t output_iov_count_;
 
   // We are currently writing into output_iov_[curr_iov_index_].
-  int curr_iov_index_;
+  size_t curr_iov_index_;
 
   // Bytes written to output_iov_[curr_iov_index_] so far.
   size_t curr_iov_written_;
@@ -977,7 +977,7 @@ class SnappyIOVecWriter {
   // Maximum number of bytes that will be decompressed into output_iov_.
   size_t output_limit_;
 
-  inline char* GetIOVecPointer(int index, size_t offset) {
+  inline char* GetIOVecPointer(size_t index, size_t offset) {
     return reinterpret_cast<char*>(output_iov_[index].iov_base) +
         offset;
   }
@@ -1058,7 +1058,7 @@ class SnappyIOVecWriter {
     }
 
     // Locate the iovec from which we need to start the copy.
-    int from_iov_index = curr_iov_index_;
+    size_t from_iov_index = curr_iov_index_;
     size_t from_iov_offset = curr_iov_written_;
     while (offset > 0) {
       if (from_iov_offset >= offset) {
@@ -1067,8 +1067,8 @@ class SnappyIOVecWriter {
       }
 
       offset -= from_iov_offset;
+      assert(from_iov_index > 0);
       --from_iov_index;
-      assert(from_iov_index >= 0);
       from_iov_offset = output_iov_[from_iov_index].iov_len;
     }
 
@@ -1489,7 +1489,7 @@ class SnappySinkAllocator {
   void Flush(size_t size) {
     size_t size_written = 0;
     size_t block_size;
-    for (int i = 0; i < blocks_.size(); ++i) {
+    for (size_t i = 0; i < blocks_.size(); ++i) {
       block_size = min<size_t>(blocks_[i].size, size - size_written);
       dest_->AppendAndTakeOwnership(blocks_[i].data, block_size,
                                     &SnappySinkAllocator::Deleter, NULL);