Title: [151357] branches/dfgFourthTier/Source
Revision
151357
Author
[email protected]
Date
2013-06-09 13:04:39 -0700 (Sun, 09 Jun 2013)

Log Message

Source/WebCore: Unreviewed, fix build. Use at() instead of operator[] because of ambiguity on some compilers.

* page/CaptionUserPreferencesMac.mm:
(WebCore::languageIdentifier):

Source/WTF: Unreviewed, fix build. On some compilers the automatic coercion from WTF::String to NSString*
causes operator[] to appear ambiguous. One way around this is to make WTF::String behave like
most of our other classes: at(unsigned) is always a valid synonym for operator[](unsigned).

* wtf/text/WTFString.h:
(WTF::String::at):
(WTF::String::operator[]):

Modified Paths

Diff

Modified: branches/dfgFourthTier/Source/WTF/ChangeLog (151356 => 151357)


--- branches/dfgFourthTier/Source/WTF/ChangeLog	2013-06-09 19:52:49 UTC (rev 151356)
+++ branches/dfgFourthTier/Source/WTF/ChangeLog	2013-06-09 20:04:39 UTC (rev 151357)
@@ -1,3 +1,13 @@
+2013-06-09  Filip Pizlo  <[email protected]>
+
+        Unreviewed, fix build. On some compilers the automatic coercion from WTF::String to NSString*
+        causes operator[] to appear ambiguous. One way around this is to make WTF::String behave like
+        most of our other classes: at(unsigned) is always a valid synonym for operator[](unsigned).
+
+        * wtf/text/WTFString.h:
+        (WTF::String::at):
+        (WTF::String::operator[]):
+
 2013-06-08  Filip Pizlo  <[email protected]>
 
         fourthTier: Recursive deadlock in DFG::ByteCodeParser

Modified: branches/dfgFourthTier/Source/WTF/wtf/text/WTFString.h (151356 => 151357)


--- branches/dfgFourthTier/Source/WTF/wtf/text/WTFString.h	2013-06-09 19:52:49 UTC (rev 151356)
+++ branches/dfgFourthTier/Source/WTF/wtf/text/WTFString.h	2013-06-09 20:04:39 UTC (rev 151357)
@@ -221,12 +221,13 @@
 
     WTF_EXPORT_STRING_API CString utf8(ConversionMode = LenientConversion) const;
 
-    UChar operator[](unsigned index) const
+    UChar at(unsigned index) const
     {
         if (!m_impl || index >= m_impl->length())
             return 0;
         return (*m_impl)[index];
     }
+    UChar operator[](unsigned index) const { return at(index); }
 
     WTF_EXPORT_STRING_API static String number(int);
     WTF_EXPORT_STRING_API static String number(unsigned int);

Modified: branches/dfgFourthTier/Source/WebCore/ChangeLog (151356 => 151357)


--- branches/dfgFourthTier/Source/WebCore/ChangeLog	2013-06-09 19:52:49 UTC (rev 151356)
+++ branches/dfgFourthTier/Source/WebCore/ChangeLog	2013-06-09 20:04:39 UTC (rev 151357)
@@ -1,3 +1,10 @@
+2013-06-09  Filip Pizlo  <[email protected]>
+
+        Unreviewed, fix build. Use at() instead of operator[] because of ambiguity on some compilers.
+
+        * page/CaptionUserPreferencesMac.mm:
+        (WebCore::languageIdentifier):
+
 2013-06-04  Mark Lam  <[email protected]>
 
         Merged from http://svn.webkit.org/repository/webkit/trunk

Modified: branches/dfgFourthTier/Source/WebCore/page/CaptionUserPreferencesMac.mm (151356 => 151357)


--- branches/dfgFourthTier/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-06-09 19:52:49 UTC (rev 151356)
+++ branches/dfgFourthTier/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-06-09 20:04:39 UTC (rev 151357)
@@ -591,7 +591,7 @@
 
     String lowercaseLanguageCode = languageCode.lower();
     
-    if (lowercaseLanguageCode.length() >= 3 && (lowercaseLanguageCode[2] == '_' || lowercaseLanguageCode[2] == '-'))
+    if (lowercaseLanguageCode.length() >= 3 && (lowercaseLanguageCode.at(2) == '_' || lowercaseLanguageCode.at(2) == '-'))
         lowercaseLanguageCode.truncate(2);
     
     return lowercaseLanguageCode;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to