From 79b6165507e9bdadcc5e7ea088562cb77c2b5a27 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Sun, 19 Feb 2012 19:16:28 +0000 Subject: [PATCH] [GTK] Fix build on platforms where UChar is wchar_t https://bugs.webkit.org/show_bug.cgi?id=78996 Patch by Kalev Lember on 2012-02-19 Reviewed by Martin Robinson. The ICU backend defines UChar as wchar_t for platforms where wchar_t is 16 bits wide, e.g. win32. * platform/graphics/pango/FontPango.cpp: (WebCore::utf16ToUtf8): Use reinterpret_cast instead of static_cast. * platform/gtk/GtkPopupMenu.cpp: (WebCore::GtkPopupMenu::typeAheadFind): Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108191 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/platform/graphics/pango/FontPango.cpp | 2 +- Source/WebCore/platform/gtk/GtkPopupMenu.cpp | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index f53d5f9..7729cc4 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-02-19 Kalev Lember + + [GTK] Fix build on platforms where UChar is wchar_t + https://bugs.webkit.org/show_bug.cgi?id=78996 + + Reviewed by Martin Robinson. + + The ICU backend defines UChar as wchar_t for platforms where wchar_t is + 16 bits wide, e.g. win32. + + * platform/graphics/pango/FontPango.cpp: + (WebCore::utf16ToUtf8): Use reinterpret_cast instead of static_cast. + * platform/gtk/GtkPopupMenu.cpp: + (WebCore::GtkPopupMenu::typeAheadFind): Ditto. + 2012-02-19 Carlos Garcia Campos Unreviewed. Fix make distcheck issues. diff --git a/Source/WebCore/platform/graphics/pango/FontPango.cpp b/Source/WebCore/platform/graphics/pango/FontPango.cpp index 2684f53..0c60c767 100644 --- a/Source/WebCore/platform/graphics/pango/FontPango.cpp +++ b/Source/WebCore/platform/graphics/pango/FontPango.cpp @@ -136,7 +136,7 @@ static gchar* utf16ToUtf8(const UChar* aText, gint aLength, gint &length) gchar* utf8Text; glong itemsWritten; - utf8Text = g_utf16_to_utf8(static_cast(aText), aLength, 0, &itemsWritten, 0); + utf8Text = g_utf16_to_utf8(reinterpret_cast(aText), aLength, 0, &itemsWritten, 0); length = itemsWritten; return utf8Text; diff --git a/Source/WebCore/platform/gtk/GtkPopupMenu.cpp b/Source/WebCore/platform/gtk/GtkPopupMenu.cpp index b9112e9..fd7c84c 100644 --- a/Source/WebCore/platform/gtk/GtkPopupMenu.cpp +++ b/Source/WebCore/platform/gtk/GtkPopupMenu.cpp @@ -178,9 +178,9 @@ bool GtkPopupMenu::typeAheadFind(GdkEventKey* event) // menulists. bool repeatingCharacter = unicodeCharacter != m_previousKeyEventCharacter; if (event->time - m_previousKeyEventTimestamp > gSearchTimeoutMs) - m_currentSearchString = String(static_cast(utf16String.get()), charactersWritten); + m_currentSearchString = String(reinterpret_cast(utf16String.get()), charactersWritten); else if (repeatingCharacter) - m_currentSearchString.append(String(static_cast(utf16String.get()), charactersWritten)); + m_currentSearchString.append(String(reinterpret_cast(utf16String.get()), charactersWritten)); m_previousKeyEventTimestamp = event->time; m_previousKeyEventCharacter = unicodeCharacter; -- 2.7.4