Commit 45714576 authored by ddkilzer@apple.com's avatar ddkilzer@apple.com

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 29fdaffe
2013-04-22 David Kilzer <ddkilzer@apple.com>
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 <benjamin@webkit.org>
Improve StringImpl code density for older ARM hardware
......
......@@ -110,10 +110,10 @@ public:
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment