Ignore some deprecation warnings encountered when compiling with newer versions of ICU
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2018 23:46:06 +0000 (23:46 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2018 23:46:06 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183584
<rdar://problem/38395317>

Reviewed by Daniel Bates.

Ignore new deprecation warnings. Where a function has more than one
deprecation warning, mark out the entire function so it remains readable.

* editing/TextIterator.cpp:
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
* platform/text/TextEncoding.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229564 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
Source/WebCore/platform/text/TextEncoding.cpp

index 5f735aa..05caa1c 100644 (file)
@@ -1,3 +1,19 @@
+2018-03-12  Brian Burg  <bburg@apple.com>
+
+        Ignore some deprecation warnings encountered when compiling with newer versions of ICU
+        https://bugs.webkit.org/show_bug.cgi?id=183584
+        <rdar://problem/38395317>
+
+        Reviewed by Daniel Bates.
+
+        Ignore new deprecation warnings. Where a function has more than one
+        deprecation warning, mark out the entire function so it remains readable.
+
+        * editing/TextIterator.cpp:
+        * platform/graphics/SurrogatePairAwareTextIterator.cpp:
+        (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
+        * platform/text/TextEncoding.cpp:
+
 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
 
         Runtime flag for link prefetch and remove link subresource.
index 003e0b2..6574f1e 100644 (file)
@@ -1999,6 +1999,12 @@ static inline bool containsKanaLetters(const String& pattern)
     return false;
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+// NOTE: ICU's unorm_normalize function is deprecated in some SDKs.
+
 static void normalizeCharacters(const UChar* characters, unsigned length, Vector<UChar>& buffer)
 {
     ASSERT(length);
@@ -2020,6 +2026,10 @@ static void normalizeCharacters(const UChar* characters, unsigned length, Vector
     ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
 static bool isNonLatin1Separator(UChar32 character)
 {
     ASSERT_ARG(character, character >= 256);
index 682d98e..3aae7ed 100644 (file)
@@ -69,6 +69,12 @@ bool SurrogatePairAwareTextIterator::consumeSlowCase(UChar32& character, unsigne
     return true;
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+// NOTE: ICU's unorm_normalize function is deprecated in some SDKs.
+
 UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks()
 {
     // According to http://www.unicode.org/Public/UNIDATA/UCD.html#Canonical_Combining_Class_Values
@@ -89,4 +95,8 @@ UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks()
     return 0;
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
 }
index 52d1794..1792f87 100644 (file)
@@ -69,6 +69,12 @@ String TextEncoding::decode(const char* data, size_t length, bool stopOnError, b
     return newTextCodec(*this)->decode(data, length, true, stopOnError, sawError);
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+// NOTE: ICU's unorm_quickCheck and unorm_normalize functions are deprecated in some SDKs.
+
 Vector<uint8_t> TextEncoding::encode(StringView text, UnencodableHandling handling) const
 {
     if (!m_name || text.isEmpty())
@@ -106,6 +112,10 @@ Vector<uint8_t> TextEncoding::encode(StringView text, UnencodableHandling handli
     return newTextCodec(*this)->encode(StringView { source, sourceLength }, handling);
 }
 
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
 const char* TextEncoding::domName() const
 {
     if (noExtendedTextEncodingNameUsed())