Bug 188919 - [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
Summary: [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-24 06:10 PDT by Adrian Perez
Modified: 2018-08-24 12:14 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.79 KB, patch)
2018-08-24 06:13 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch (1.86 KB, patch)
2018-08-24 07:13 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2018-08-24 06:10:46 PDT
As por Don's comment in bug #185462 (comment 8)

> Noticed this issue while rebasing. GCallback shouldn't be in freetype files.
>
> > Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:51
> > +        reinterpret_cast<cairo_destroy_func_t>(reinterpret_cast<GCallback>(FT_Done_Face)));
>
> This casts assumes USE(GLIB)
Comment 1 Adrian Perez 2018-08-24 06:13:00 PDT
Created attachment 348003 [details]
Patch
Comment 2 Michael Catanzaro 2018-08-24 06:49:50 PDT
Comment on attachment 348003 [details]
Patch

The double cast is probably needed to silence -Wcast-function-type. Are you certain this doesn't introduce any new warnings when building with GCC 8?

Instead of casting through GCallback, you can instead cast through void (*) (void). That's the documented way to avoid -Wcast-function-type. GCallback is just a typedef for that.
Comment 3 Michael Catanzaro 2018-08-24 06:52:44 PDT
Comment on attachment 348003 [details]
Patch

This blames to r231565

So you'll need to use void (*) (void) instead.
Comment 4 Adrian Perez 2018-08-24 07:13:18 PDT
Created attachment 348005 [details]
Patch
Comment 5 Don Olmstead 2018-08-24 09:08:09 PDT
Clang is happy with the change. So informally I would r+ this as long as GCC is happy.
Comment 6 WebKit Commit Bot 2018-08-24 12:13:09 PDT
Comment on attachment 348005 [details]
Patch

Clearing flags on attachment: 348005

Committed r235325: <https://trac.webkit.org/changeset/235325>
Comment 7 WebKit Commit Bot 2018-08-24 12:13:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-08-24 12:14:22 PDT
<rdar://problem/43693002>