[Webkit-unassigned] [Bug 93255] [GTK] Webkit 1.8.2 fails to build with MinGW with spellchecking enabled
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Sep 24 08:17:34 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=93255
--- Comment #8 from Martin Robinson <mrobinson at webkit.org> 2012-09-24 08:18:02 PST ---
(In reply to comment #7)
> (In reply to comment #6)
> > > Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp:64
> > > - GOwnPtr<gchar> utf8Text(g_utf16_to_utf8(const_cast<gunichar2*>(text), length, 0, 0, 0));
> > > + GOwnPtr<gchar> utf8Text(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(text), length, 0, 0, 0));
> >
> > I mentioned this to pfor via IRC, but I'll leave it here for posterity: I think it might be necessary here to use g_ucs4_to_utf8 instead of simply casting 32-bit characters to 16-bit.
>
> I don't think the cast actually loses precision. It is from UChar* to gunichar2*; I believe these are both always defined as 16 bit types.
>
> From Source/JavaScriptCore/icu/unicode/umachine.h, which defines UChar for the ICU backend:
>
> #if U_SIZEOF_WCHAR_T==2
> typedef wchar_t UChar;
> #elif U_GNUC_UTF16_STRING
> #if defined _GCC_
> typedef __CHAR16_TYPE__ char16_t;
> #endif
> typedef char16_t UChar;
> #else
> typedef uint16_t UChar;
> #endif
Okay. This sounds reasonable. I'm a bit surprised that pointers of the same size require a reinterpet_cast to switch between them though. Do you understand why it's necessary here? Can you double-check by printing sizeof for both types?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list