Title: [148884] trunk/Source/WTF
Revision
148884
Author
[email protected]
Date
2013-04-22 08:31:30 -0700 (Mon, 22 Apr 2013)

Log Message

WTF::AtomicString::find() should take unsigned 'start' argument
<http://webkit.org/b/114958>

Reviewed by Darin Adler.

Fixes the following warnings with -Wshorten-64-to-32:

    AtomicString.h:113:76: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
        size_t find(UChar c, size_t start = 0) const { return m_string.find(c, start); }
                                                              ~~~~~~~~         ^~~~~
    AtomicString.h:115:35: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
            { return m_string.find(s, start, caseSentitive); }
                     ~~~~~~~~         ^~~~~
    AtomicString.h:117:35: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
            { return m_string.find(s, start, caseSentitive); }
                     ~~~~~~~~         ^~~~~

* wtf/text/AtomicString.h:
(WTF::AtomicString::find): Change type of 'start' argument from
size_t to unsigned.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (148883 => 148884)


--- trunk/Source/WTF/ChangeLog	2013-04-22 15:20:07 UTC (rev 148883)
+++ trunk/Source/WTF/ChangeLog	2013-04-22 15:31:30 UTC (rev 148884)
@@ -1,3 +1,26 @@
+2013-04-22  David Kilzer  <[email protected]>
+
+        WTF::AtomicString::find() should take unsigned 'start' argument
+        <http://webkit.org/b/114958>
+
+        Reviewed by Darin Adler.
+
+        Fixes the following warnings with -Wshorten-64-to-32:
+
+            AtomicString.h:113:76: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
+                size_t find(UChar c, size_t start = 0) const { return m_string.find(c, start); }
+                                                                      ~~~~~~~~         ^~~~~
+            AtomicString.h:115:35: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
+                    { return m_string.find(s, start, caseSentitive); }
+                             ~~~~~~~~         ^~~~~
+            AtomicString.h:117:35: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32]
+                    { return m_string.find(s, start, caseSentitive); }
+                             ~~~~~~~~         ^~~~~
+
+        * wtf/text/AtomicString.h:
+        (WTF::AtomicString::find): Change type of 'start' argument from
+        size_t to unsigned.
+
 2013-04-21  Benjamin Poulain  <[email protected]>
 
         Improve StringImpl code density for older ARM hardware

Modified: trunk/Source/WTF/wtf/text/AtomicString.h (148883 => 148884)


--- trunk/Source/WTF/wtf/text/AtomicString.h	2013-04-22 15:20:07 UTC (rev 148883)
+++ trunk/Source/WTF/wtf/text/AtomicString.h	2013-04-22 15:31:30 UTC (rev 148884)
@@ -110,10 +110,10 @@
     bool contains(const String& s, bool caseSensitive = true) const
         { return m_string.contains(s, caseSensitive); }
 
-    size_t find(UChar c, size_t start = 0) const { return m_string.find(c, start); }
-    size_t find(const LChar* s, size_t start = 0, bool caseSentitive = true) const
+    size_t find(UChar c, unsigned start = 0) const { return m_string.find(c, start); }
+    size_t find(const LChar* s, unsigned start = 0, bool caseSentitive = true) const
         { return m_string.find(s, start, caseSentitive); }
-    size_t find(const String& s, size_t start = 0, bool caseSentitive = true) const
+    size_t find(const String& s, unsigned start = 0, bool caseSentitive = true) const
         { return m_string.find(s, start, caseSentitive); }
     
     bool startsWith(const String& s, bool caseSensitive = true) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to