Title: [200559] trunk/Source
Revision
200559
Author
[email protected]
Date
2016-05-08 12:00:40 -0700 (Sun, 08 May 2016)

Log Message

WTF:

Follow-up to that last patch (missed review comments).

* wtf/text/WTFString.h: Use nullptr instead of 0 as needed. Also use pragma once.

WebCore:

Follow-up to that last patch (missed review comments).

* page/EventSource.cpp:
(WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
(WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (200558 => 200559)


--- trunk/Source/WTF/ChangeLog	2016-05-08 18:46:53 UTC (rev 200558)
+++ trunk/Source/WTF/ChangeLog	2016-05-08 19:00:40 UTC (rev 200559)
@@ -1,5 +1,11 @@
 2016-05-08  Darin Adler  <[email protected]>
 
+        Follow-up to that last patch (missed review comments).
+
+        * wtf/text/WTFString.h: Use nullptr instead of 0 as needed. Also use pragma once.
+
+2016-05-08  Darin Adler  <[email protected]>
+
         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
         https://bugs.webkit.org/show_bug.cgi?id=157459
 

Modified: trunk/Source/WTF/wtf/text/WTFString.h (200558 => 200559)


--- trunk/Source/WTF/wtf/text/WTFString.h	2016-05-08 18:46:53 UTC (rev 200558)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2016-05-08 19:00:40 UTC (rev 200559)
@@ -19,8 +19,7 @@
  *
  */
 
-#ifndef WTFString_h
-#define WTFString_h
+#pragma once
 
 // This file would be called String.h, but that conflicts with <string.h>
 // on systems without case-sensitive file systems.
@@ -38,35 +37,35 @@
 
 // Declarations of string operations
 
-WTF_EXPORT_STRING_API int charactersToIntStrict(const LChar*, size_t, bool* ok = 0, int base = 10);
-WTF_EXPORT_STRING_API int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
-WTF_EXPORT_STRING_API unsigned charactersToUIntStrict(const LChar*, size_t, bool* ok = 0, int base = 10);
-WTF_EXPORT_STRING_API unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
-int64_t charactersToInt64Strict(const LChar*, size_t, bool* ok = 0, int base = 10);
-int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
-uint64_t charactersToUInt64Strict(const LChar*, size_t, bool* ok = 0, int base = 10);
-uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
-intptr_t charactersToIntPtrStrict(const LChar*, size_t, bool* ok = 0, int base = 10);
-intptr_t charactersToIntPtrStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+WTF_EXPORT_STRING_API int charactersToIntStrict(const LChar*, size_t, bool* ok = nullptr, int base = 10);
+WTF_EXPORT_STRING_API int charactersToIntStrict(const UChar*, size_t, bool* ok = nullptr, int base = 10);
+WTF_EXPORT_STRING_API unsigned charactersToUIntStrict(const LChar*, size_t, bool* ok = nullptr, int base = 10);
+WTF_EXPORT_STRING_API unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = nullptr, int base = 10);
+int64_t charactersToInt64Strict(const LChar*, size_t, bool* ok = nullptr, int base = 10);
+int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = nullptr, int base = 10);
+uint64_t charactersToUInt64Strict(const LChar*, size_t, bool* ok = nullptr, int base = 10);
+uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = nullptr, int base = 10);
+intptr_t charactersToIntPtrStrict(const LChar*, size_t, bool* ok = nullptr, int base = 10);
+intptr_t charactersToIntPtrStrict(const UChar*, size_t, bool* ok = nullptr, int base = 10);
 
-WTF_EXPORT_STRING_API int charactersToInt(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-WTF_EXPORT_STRING_API int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-unsigned charactersToUInt(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-unsigned charactersToUInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-int64_t charactersToInt64(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-int64_t charactersToInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-uint64_t charactersToUInt64(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-WTF_EXPORT_STRING_API uint64_t charactersToUInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-intptr_t charactersToIntPtr(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+WTF_EXPORT_STRING_API int charactersToInt(const LChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+WTF_EXPORT_STRING_API int charactersToInt(const UChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+unsigned charactersToUInt(const LChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+unsigned charactersToUInt(const UChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+int64_t charactersToInt64(const LChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+int64_t charactersToInt64(const UChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+uint64_t charactersToUInt64(const LChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+WTF_EXPORT_STRING_API uint64_t charactersToUInt64(const UChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+intptr_t charactersToIntPtr(const LChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
+intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = nullptr); // ignores trailing garbage
 
 // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage.
 // Like the non-strict functions above, these return the value when there is trailing garbage.
 // It would be better if these were more consistent with the above functions instead.
-WTF_EXPORT_STRING_API double charactersToDouble(const LChar*, size_t, bool* ok = 0);
-WTF_EXPORT_STRING_API double charactersToDouble(const UChar*, size_t, bool* ok = 0);
-WTF_EXPORT_STRING_API float charactersToFloat(const LChar*, size_t, bool* ok = 0);
-WTF_EXPORT_STRING_API float charactersToFloat(const UChar*, size_t, bool* ok = 0);
+WTF_EXPORT_STRING_API double charactersToDouble(const LChar*, size_t, bool* ok = nullptr);
+WTF_EXPORT_STRING_API double charactersToDouble(const UChar*, size_t, bool* ok = nullptr);
+WTF_EXPORT_STRING_API float charactersToFloat(const LChar*, size_t, bool* ok = nullptr);
+WTF_EXPORT_STRING_API float charactersToFloat(const UChar*, size_t, bool* ok = nullptr);
 WTF_EXPORT_STRING_API float charactersToFloat(const LChar*, size_t, size_t& parsedLength);
 WTF_EXPORT_STRING_API float charactersToFloat(const UChar*, size_t, size_t& parsedLength);
 
@@ -365,23 +364,23 @@
         split(separator, false, result);
     }
 
-    WTF_EXPORT_STRING_API int toIntStrict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_STRING_API unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_STRING_API int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_STRING_API uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_STRING_API intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
+    WTF_EXPORT_STRING_API int toIntStrict(bool* ok = nullptr, int base = 10) const;
+    WTF_EXPORT_STRING_API unsigned toUIntStrict(bool* ok = nullptr, int base = 10) const;
+    WTF_EXPORT_STRING_API int64_t toInt64Strict(bool* ok = nullptr, int base = 10) const;
+    WTF_EXPORT_STRING_API uint64_t toUInt64Strict(bool* ok = nullptr, int base = 10) const;
+    WTF_EXPORT_STRING_API intptr_t toIntPtrStrict(bool* ok = nullptr, int base = 10) const;
 
-    WTF_EXPORT_STRING_API int toInt(bool* ok = 0) const;
-    WTF_EXPORT_STRING_API unsigned toUInt(bool* ok = 0) const;
-    WTF_EXPORT_STRING_API int64_t toInt64(bool* ok = 0) const;
-    WTF_EXPORT_STRING_API uint64_t toUInt64(bool* ok = 0) const;
-    WTF_EXPORT_STRING_API intptr_t toIntPtr(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API int toInt(bool* ok = nullptr) const;
+    WTF_EXPORT_STRING_API unsigned toUInt(bool* ok = nullptr) const;
+    WTF_EXPORT_STRING_API int64_t toInt64(bool* ok = nullptr) const;
+    WTF_EXPORT_STRING_API uint64_t toUInt64(bool* ok = nullptr) const;
+    WTF_EXPORT_STRING_API intptr_t toIntPtr(bool* ok = nullptr) const;
 
     // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage.
     // Like the non-strict functions above, these return the value when there is trailing garbage.
     // It would be better if these were more consistent with the above functions instead.
-    WTF_EXPORT_STRING_API double toDouble(bool* ok = 0) const;
-    WTF_EXPORT_STRING_API float toFloat(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API double toDouble(bool* ok = nullptr) const;
+    WTF_EXPORT_STRING_API float toFloat(bool* ok = nullptr) const;
 
     bool percentage(int& percentage) const;
 
@@ -757,5 +756,3 @@
 using WTF::StringCapture;
 
 #include <wtf/text/AtomicString.h>
-
-#endif

Modified: trunk/Source/WebCore/ChangeLog (200558 => 200559)


--- trunk/Source/WebCore/ChangeLog	2016-05-08 18:46:53 UTC (rev 200558)
+++ trunk/Source/WebCore/ChangeLog	2016-05-08 19:00:40 UTC (rev 200559)
@@ -1,5 +1,13 @@
 2016-05-08  Darin Adler  <[email protected]>
 
+        Follow-up to that last patch (missed review comments).
+
+        * page/EventSource.cpp:
+        (WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
+        (WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.
+
+2016-05-08  Darin Adler  <[email protected]>
+
         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
         https://bugs.webkit.org/show_bug.cgi?id=157459
 
@@ -64,8 +72,6 @@
         * page/EventSource.idl: Define EventSourceInit dictionary and use it.
         Other small cleanup.
 
-        * page/EventSource.idl: U
-
 2016-05-07  Darin Adler  <[email protected]>
 
         Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary

Modified: trunk/Source/WebCore/page/EventSource.cpp (200558 => 200559)


--- trunk/Source/WebCore/page/EventSource.cpp	2016-05-08 18:46:53 UTC (rev 200558)
+++ trunk/Source/WebCore/page/EventSource.cpp	2016-05-08 19:00:40 UTC (rev 200559)
@@ -286,13 +286,13 @@
     while (position < size) {
         if (m_discardTrailingNewline) {
             if (m_receiveBuffer[position] == '\n')
-                position++;
+                ++position;
             m_discardTrailingNewline = false;
         }
 
         Optional<unsigned> lineLength;
         Optional<unsigned> fieldLength;
-        for (unsigned i = position; !lineLength && i < size; i++) {
+        for (unsigned i = position; !lineLength && i < size; ++i) {
             switch (m_receiveBuffer[i]) {
             case ':':
                 if (!fieldLength)
@@ -398,7 +398,7 @@
     // Omit the trailing "\n" character.
     ASSERT(!m_data.isEmpty());
     unsigned size = m_data.size() - 1;
-    auto data = "" { m_data.data(), size });
+    auto data = "" m_data.data(), size });
     m_data = { };
 
     dispatchEvent(MessageEvent::create(name, WTFMove(data), m_eventStreamOrigin, m_lastEventId));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to