Title: [134544] trunk/Source/WebCore
Revision
134544
Author
commit-qu...@webkit.org
Date
2012-11-13 22:15:12 -0800 (Tue, 13 Nov 2012)

Log Message

Fix compile warning [-Wsign-compare]
https://bugs.webkit.org/show_bug.cgi?id=101458

Patch by KyungTae Kim <ktf....@samsung.com> on 2012-11-13
Reviewed by Alexey Proskuryakov.

Currently, lossy check has been done by comparing file size(posix signed integral value) with conversioned(standard c++ unsigned integral value).
However, it leads -Wsign-compare compile warning.
Therefore, this patch assigns the file size to the biggest possible unsigned variable, then does the lossy check.

* platform/posix/SharedBufferPOSIX.cpp:
(WebCore::SharedBuffer::createWithContentsOfFile):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134543 => 134544)


--- trunk/Source/WebCore/ChangeLog	2012-11-14 06:13:52 UTC (rev 134543)
+++ trunk/Source/WebCore/ChangeLog	2012-11-14 06:15:12 UTC (rev 134544)
@@ -1,3 +1,17 @@
+2012-11-13  KyungTae Kim  <ktf....@samsung.com>
+
+        Fix compile warning [-Wsign-compare]
+        https://bugs.webkit.org/show_bug.cgi?id=101458
+
+        Reviewed by Alexey Proskuryakov.
+
+        Currently, lossy check has been done by comparing file size(posix signed integral value) with conversioned(standard c++ unsigned integral value).
+        However, it leads -Wsign-compare compile warning.
+        Therefore, this patch assigns the file size to the biggest possible unsigned variable, then does the lossy check.
+
+        * platform/posix/SharedBufferPOSIX.cpp:
+        (WebCore::SharedBuffer::createWithContentsOfFile):
+
 2012-11-13  Keishi Hattori  <kei...@webkit.org>
 
         Enable datalist UI for input types week and month

Modified: trunk/Source/WebCore/platform/posix/SharedBufferPOSIX.cpp (134543 => 134544)


--- trunk/Source/WebCore/platform/posix/SharedBufferPOSIX.cpp	2012-11-14 06:13:52 UTC (rev 134543)
+++ trunk/Source/WebCore/platform/posix/SharedBufferPOSIX.cpp	2012-11-14 06:15:12 UTC (rev 134544)
@@ -52,7 +52,7 @@
     }
 
     size_t bytesToRead = fileStat.st_size;
-    if (bytesToRead != fileStat.st_size) {
+    if (fileStat.st_size < 0 || bytesToRead != static_cast<unsigned long long>(fileStat.st_size)) {
         close(fd);
         return 0;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to