Modified: trunk/Source/WTF/ChangeLog (262813 => 262814)
--- trunk/Source/WTF/ChangeLog 2020-06-09 21:47:45 UTC (rev 262813)
+++ trunk/Source/WTF/ChangeLog 2020-06-09 22:04:49 UTC (rev 262814)
@@ -1,3 +1,16 @@
+2020-06-09 Chris Dumez <[email protected]>
+
+ Use bridge cast in String(NSString *) constructor
+ https://bugs.webkit.org/show_bug.cgi?id=212989
+
+ Reviewed by Darin Adler.
+
+ Use bridge cast in String(NSString *) constructor instead of a reinterpret_cast as this
+ is the preferred way of converting a NS Type to a CF one.
+
+ * wtf/text/cocoa/StringCocoa.mm:
+ (WTF::String::String):
+
2020-06-09 Per Arne Vollan <[email protected]>
All platforms should enable CFPrefs read only mode in the WebContent process
Modified: trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm (262813 => 262814)
--- trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm 2020-06-09 21:47:45 UTC (rev 262813)
+++ trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm 2020-06-09 22:04:49 UTC (rev 262814)
@@ -30,13 +30,13 @@
if (!str)
return;
- CFIndex size = CFStringGetLength(reinterpret_cast<CFStringRef>(str));
+ CFIndex size = CFStringGetLength((__bridge CFStringRef)str);
if (!size)
m_impl = StringImpl::empty();
else {
Vector<LChar, 1024> lcharBuffer(size);
CFIndex usedBufLen;
- CFIndex convertedsize = CFStringGetBytes(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen);
+ CFIndex convertedsize = CFStringGetBytes((__bridge CFStringRef)str, CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen);
if ((convertedsize == size) && (usedBufLen == size)) {
m_impl = StringImpl::create(lcharBuffer.data(), size);
return;
@@ -43,7 +43,7 @@
}
Vector<UChar, 1024> ucharBuffer(size);
- CFStringGetCharacters(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), reinterpret_cast<UniChar*>(ucharBuffer.data()));
+ CFStringGetCharacters((__bridge CFStringRef)str, CFRangeMake(0, size), reinterpret_cast<UniChar*>(ucharBuffer.data()));
m_impl = StringImpl::create(ucharBuffer.data(), size);
}
}