Title: [219660] trunk/Source/WebCore
Revision
219660
Author
[email protected]
Date
2017-07-19 11:16:35 -0700 (Wed, 19 Jul 2017)

Log Message

Use a cast to work around clang's false -Wobjc-literal-conversion warnings
https://bugs.webkit.org/show_bug.cgi?id=174631

Reviewed by Dan Bernstein.

Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219659 => 219660)


--- trunk/Source/WebCore/ChangeLog	2017-07-19 18:16:21 UTC (rev 219659)
+++ trunk/Source/WebCore/ChangeLog	2017-07-19 18:16:35 UTC (rev 219660)
@@ -1,3 +1,15 @@
+2017-07-19  Andy Estes  <[email protected]>
+
+        Use a cast to work around clang's false -Wobjc-literal-conversion warnings
+        https://bugs.webkit.org/show_bug.cgi?id=174631
+
+        Reviewed by Dan Bernstein.
+
+        Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.
+
+        * platform/ios/PlatformPasteboardIOS.mm:
+        (WebCore::PlatformPasteboard::write):
+
 2017-07-19  Chris Dumez  <[email protected]>
 
         Make cross-origin properties enumerable

Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (219659 => 219660)


--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2017-07-19 18:16:21 UTC (rev 219659)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2017-07-19 18:16:35 UTC (rev 219660)
@@ -276,11 +276,9 @@
     // and instead set data for concrete plain text types. See <https://bugs.webkit.org/show_bug.cgi?id=173317>.
     [representations setValue:textAsString forKey:(NSString *)kUTTypeText];
 
-    // FIXME: This pragma can be removed once rdar://problem/33383354 is resolved.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wobjc-literal-conversion"
-    [m_pasteboard setItems:@[representations.get()]];
-#pragma clang diagnostic pop
+    // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
+    ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
+    [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
 }
 
 void PlatformPasteboard::writeObjectRepresentations(const PasteboardImage& pasteboardImage)
@@ -330,11 +328,9 @@
         [representations setObject:(NSURL *)pasteboardImage.url.url forKey:(NSString *)kUTTypeURL];
     }
 
-    // FIXME: This pragma can be removed once rdar://problem/33383354 is resolved.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wobjc-literal-conversion"
-    [m_pasteboard setItems:@[representations.get()]];
-#pragma clang diagnostic pop
+    // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
+    ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
+    [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
 }
 
 void PlatformPasteboard::writeObjectRepresentations(const String& pasteboardType, const String& text)
@@ -377,11 +373,9 @@
         [representations setValue:[textAsString dataUsingEncoding:NSUTF16StringEncoding] forKey:(NSString *)kUTTypeUTF16PlainText];
     }
 
-    // FIXME: This pragma can be removed once rdar://problem/33383354 is resolved.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wobjc-literal-conversion"
-    [m_pasteboard setItems:@[representations.get()]];
-#pragma clang diagnostic pop
+    // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
+    ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
+    [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
 }
 
 void PlatformPasteboard::writeObjectRepresentations(const PasteboardURL& url)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to