Title: [187805] trunk/Source
Revision
187805
Author
mmaxfi...@apple.com
Date
2015-08-03 20:32:27 -0700 (Mon, 03 Aug 2015)

Log Message

Clean up casts between NSFont*s and CTFontRefs
https://bugs.webkit.org/show_bug.cgi?id=147618

Source/WebCore:

Reviewed by Mitz Pettel.

For toll free bridged types, it makes more sense to do a C-style cast, than jump
through hoops for older compilers.

No new tests because there is no behavior change.

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::nsFont):
(WebCore::FontPlatformData::hash):

Source/WebKit/mac:

Reviewed by Mitz Pettel

For toll free bridged types, it makes more sense to do a C-style cast, than jump
through hoops for older compilers.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _updateFontPanel]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187804 => 187805)


--- trunk/Source/WebCore/ChangeLog	2015-08-04 03:21:43 UTC (rev 187804)
+++ trunk/Source/WebCore/ChangeLog	2015-08-04 03:32:27 UTC (rev 187805)
@@ -1,3 +1,19 @@
+2015-08-03  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Clean up casts between NSFont*s and CTFontRefs
+        https://bugs.webkit.org/show_bug.cgi?id=147618
+
+        Reviewed by Mitz Pettel.
+
+        For toll free bridged types, it makes more sense to do a C-style cast, than jump
+        through hoops for older compilers.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/FontPlatformData.h:
+        (WebCore::FontPlatformData::nsFont):
+        (WebCore::FontPlatformData::hash):
+
 2015-08-03  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r187707, r187709, r187724, and

Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (187804 => 187805)


--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h	2015-08-04 03:21:43 UTC (rev 187804)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h	2015-08-04 03:32:27 UTC (rev 187805)
@@ -119,7 +119,7 @@
 
 #if USE(APPKIT)
     // FIXME: Remove this when all NSFont usage is removed.
-    NSFont *nsFont() const { return reinterpret_cast<NSFont *>(const_cast<__CTFont*>(m_font.get())); }
+    NSFont *nsFont() const { return (NSFont *)m_font.get(); }
     void setNSFont(NSFont *font) { setFont(reinterpret_cast<CTFontRef>(font)); }
 #endif
 #endif
@@ -153,7 +153,7 @@
         ASSERT(m_font || !m_cgFont || isEmoji());
         uintptr_t flags = static_cast<uintptr_t>(m_isHashTableDeletedValue << 4 | isEmoji() << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique);
 #if USE(APPKIT)
-        uintptr_t fontHash = reinterpret_cast<uintptr_t>(const_cast<__CTFont*>(m_font.get()));
+        uintptr_t fontHash = (uintptr_t)m_font.get();
 #else
         uintptr_t fontHash = reinterpret_cast<uintptr_t>(CFHash(m_font.get()));
 #endif

Modified: trunk/Source/WebKit/mac/ChangeLog (187804 => 187805)


--- trunk/Source/WebKit/mac/ChangeLog	2015-08-04 03:21:43 UTC (rev 187804)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-08-04 03:32:27 UTC (rev 187805)
@@ -1,5 +1,18 @@
 2015-08-03  Myles C. Maxfield  <mmaxfi...@apple.com>
 
+        Clean up casts between NSFont*s and CTFontRefs
+        https://bugs.webkit.org/show_bug.cgi?id=147618
+
+        Reviewed by Mitz Pettel
+
+        For toll free bridged types, it makes more sense to do a C-style cast, than jump
+        through hoops for older compilers.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _updateFontPanel]):
+
+2015-08-03  Myles C. Maxfield  <mmaxfi...@apple.com>
+
         Fix the Yosemite build after r187797
 
         Unreviewed.

Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (187804 => 187805)


--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2015-08-04 03:21:43 UTC (rev 187804)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2015-08-04 03:32:27 UTC (rev 187805)
@@ -5485,7 +5485,7 @@
     NSDictionary *attributes = nil;
     if (Frame* coreFrame = core([self _frame])) {
         if (const Font* fd = coreFrame->editor().fontForSelection(multipleFonts))
-            font = reinterpret_cast<NSFont *>(const_cast<__CTFont*>(fd->platformData().activatedFont()));
+            font = (NSFont *)fd->platformData().activatedFont();
         attributes = coreFrame->editor().fontAttributesForSelectionStart();
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to