[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

yong.li at torchmobile.com yong.li at torchmobile.com
Thu Apr 8 00:54:34 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 46269e440c40b395e391e28c1075a5e5b19f2c61
Author: yong.li at torchmobile.com <yong.li at torchmobile.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 17:54:27 2010 +0000

    2010-01-05  Yong Li  <yoli at rim.com>
    
            Reviewed by Adam Roben.
    
            Fix  build warnings blindly
            https://bugs.webkit.org/show_bug.cgi?id=33178
    
            * platform/SharedBuffer.cpp:
            * platform/SharedBuffer.h:
            (WebCore::SharedBuffer::append):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52801 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d115064..769fd6f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,9 +1,19 @@
+2010-01-05  Yong Li  <yoli at rim.com>
+
+        Reviewed by Adam Roben.
+
+        Fix  build warnings blindly
+        https://bugs.webkit.org/show_bug.cgi?id=33178
+
+        * platform/SharedBuffer.cpp:
+        * platform/SharedBuffer.h:
+        (WebCore::SharedBuffer::append):
+
 2010-01-05  Dan Bernstein  <mitz at apple.com>
 
         Build fix
 
         * platform/SharedBuffer.cpp:
-        (WebCore::SharedBuffer::append):
 
 2010-01-05  Yong Li  <yong.li at torchmobile.com>
 
diff --git a/WebCore/platform/SharedBuffer.cpp b/WebCore/platform/SharedBuffer.cpp
index 00334e5..4a46c2c 100644
--- a/WebCore/platform/SharedBuffer.cpp
+++ b/WebCore/platform/SharedBuffer.cpp
@@ -29,6 +29,8 @@
 
 #include "PurgeableBuffer.h"
 
+using namespace std;
+
 namespace WebCore {
 
 static const unsigned segmentSize = 0x1000;
@@ -114,7 +116,7 @@ const char* SharedBuffer::data() const
     return buffer().data();
 }
 
-void SharedBuffer::append(const char* data, int length)
+void SharedBuffer::append(const char* data, unsigned length)
 {
     ASSERT(!m_purgeableBuffer);
 
@@ -137,7 +139,7 @@ void SharedBuffer::append(const char* data, int length)
         segment = m_segments.last() + positionInSegment;
 
     unsigned segmentFreeSpace = segmentSize - positionInSegment;
-    unsigned bytesToCopy = static_cast<unsigned>(length) < segmentFreeSpace ? static_cast<unsigned>(length) : segmentFreeSpace;
+    unsigned bytesToCopy = min(length, segmentFreeSpace);
 
     for (;;) {
         memcpy(segment, data, bytesToCopy);
@@ -148,7 +150,7 @@ void SharedBuffer::append(const char* data, int length)
         data += bytesToCopy;
         segment = allocateSegment();
         m_segments.append(segment);
-        bytesToCopy = static_cast<unsigned>(length) < segmentSize ? length : segmentSize;
+        bytesToCopy = min(length, segmentSize);
     }
 }
 
@@ -196,7 +198,7 @@ const Vector<char>& SharedBuffer::buffer() const
         char* destination = m_buffer.data() + bufferSize;
         unsigned bytesLeft = m_size - bufferSize;
         for (unsigned i = 0; i < m_segments.size(); ++i) {
-            unsigned bytesToCopy = bytesLeft < segmentSize ? bytesLeft : segmentSize;
+            unsigned bytesToCopy = min(bytesLeft, segmentSize);
             memcpy(destination, m_segments[i], bytesToCopy);
             destination += bytesToCopy;
             bytesLeft -= bytesToCopy;
diff --git a/WebCore/platform/SharedBuffer.h b/WebCore/platform/SharedBuffer.h
index d81a2f7..a5566f2 100644
--- a/WebCore/platform/SharedBuffer.h
+++ b/WebCore/platform/SharedBuffer.h
@@ -88,7 +88,7 @@ public:
 
     bool isEmpty() const { return !size(); }
 
-    void append(const char*, int);
+    void append(const char*, unsigned);
     void clear();
     const char* platformData() const;
     unsigned platformDataSize() const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list