[Webkit-unassigned] [Bug 18346] [GTK] Remove build warnings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 5 19:19:07 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=18346


alp at nuanti.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23204|review?(alp at nuanti.com)     |review-
               Flag|                            |




------- Comment #8 from alp at nuanti.com  2008-09-05 19:19 PDT -------
(From update of attachment 23204)
>--- a/WebCore/page/gtk/AccessibilityObjectWrapperAtk.cpp
>+++ b/WebCore/page/gtk/AccessibilityObjectWrapperAtk.cpp
>@@ -143,7 +143,7 @@ static AtkObject* webkit_accessible_ref_child(AtkObject* object, gint index)
>     AccessibilityObject* coreObject = core(object);
> 
>     g_return_val_if_fail(index >= 0, NULL);
>-    g_return_val_if_fail(index < coreObject->children().size(), NULL);
>+    g_return_val_if_fail(((size_t)index) < coreObject->children().size(), NULL);
> 
>     AccessibilityObject* coreChild = coreObject->children().at(index).get();
> 

This cast can just be "(size_t)index" without the extra parentheses (or a
C++-style cast, even better).

>diff --git a/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp b/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
>index 37bb734..2832074 100644
>--- a/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
>+++ b/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
>@@ -103,7 +103,7 @@ bool SimpleFontData::containsCharacters(const UChar* characters, int length) con
>     PangoCoverage* available = pango_font_get_coverage(m_font.m_font, pango_language_get_default());
>     pango_coverage_max(requested, available);
> 
>-    for (unsigned i = 0; i < length; i++) {
>+    for (unsigned i = 0; i < (unsigned)length; i++) {
>         if (PANGO_COVERAGE_NONE == pango_coverage_get(requested, i)) {
>             result = false;
>             break;

This can just be for (int i = 0; i < length; i++) since length is an int.

>diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
>index 8888f2b..00b3057 100644
>--- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
>+++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
>@@ -86,7 +86,7 @@ static const GtkUnicodeMenuEntry bidi_menu_entries[] = {
> 
> static void insertControlCharacter(GtkWidget* widget)
> {
>-    GtkUnicodeMenuEntry* entry = (GtkUnicodeMenuEntry*)g_object_get_data(G_OBJECT(widget), "gtk-unicode-menu-entry");
>+    // GtkUnicodeMenuEntry* entry = (GtkUnicodeMenuEntry*)g_object_get_data(G_OBJECT(widget), "gtk-unicode-menu-entry");
>     notImplemented();
> }
> 

Normally we try to avoid commented-out code but in this case it's the only hint
as to what's going on and what the author intended, so I'm OK with your change
here to fix the warning.

Looks good to land after suggested changes.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list