Title: [242538] releases/WebKitGTK/webkit-2.24/Source/WebCore
Revision
242538
Author
[email protected]
Date
2019-03-06 05:30:09 -0800 (Wed, 06 Mar 2019)

Log Message

Merge r242327 - -Wformat error in SharedBuffer::tryCreateArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=195004

Reviewed by Darin Adler.

Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
with char larger than one byte, but perhaps it didn't realize sizeof always returns
multiples of char and so sizeof(char) is always one even on such mythical systems.

Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
would actually be more readable.

* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::tryCreateArrayBuffer const):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (242537 => 242538)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-06 13:30:04 UTC (rev 242537)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-06 13:30:09 UTC (rev 242538)
@@ -1,3 +1,22 @@
+2019-03-03  Michael Catanzaro  <[email protected]>
+
+        -Wformat error in SharedBuffer::tryCreateArrayBuffer
+        https://bugs.webkit.org/show_bug.cgi?id=195004
+
+        Reviewed by Darin Adler.
+
+        Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
+        just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
+        guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
+        with char larger than one byte, but perhaps it didn't realize sizeof always returns
+        multiples of char and so sizeof(char) is always one even on such mythical systems.
+
+        Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
+        would actually be more readable.
+
+        * platform/SharedBuffer.cpp:
+        (WebCore::SharedBuffer::tryCreateArrayBuffer const):
+
 2019-02-27  Darin Adler  <[email protected]>
 
         Fixed makeString(float) to do shortest-form serialization without first converting to double

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/SharedBuffer.cpp (242537 => 242538)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/SharedBuffer.cpp	2019-03-06 13:30:04 UTC (rev 242537)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/SharedBuffer.cpp	2019-03-06 13:30:09 UTC (rev 242538)
@@ -135,7 +135,7 @@
 {
     auto arrayBuffer = ArrayBuffer::tryCreateUninitialized(static_cast<unsigned>(size()), sizeof(char));
     if (!arrayBuffer) {
-        WTFLogAlways("SharedBuffer::tryCreateArrayBuffer Unable to create buffer. Requested size was %zu x %lu\n", size(), sizeof(char));
+        WTFLogAlways("SharedBuffer::tryCreateArrayBuffer Unable to create buffer. Requested size was %zu\n", size());
         return nullptr;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to