WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
18346
[GTK] Remove build warnings
https://bugs.webkit.org/show_bug.cgi?id=18346
Summary
[GTK] Remove build warnings
Luca Bruno
Reported
2008-04-07 11:24:24 PDT
A list of warnings from the gtk trunk buildbot: WebKit/gtk/webkit/webkitwebview.cpp:1134: warning: passing 'double' for argument 1 to 'void WebCore::Settings::setDefaultFontSize(int)' WebKit/gtk/webkit/webkitwebview.cpp:1135: warning: passing 'double' for argument 1 to 'void WebCore::Settings::setDefaultFixedFontSize(int)' WebKit/gtk/webkit/webkitwebview.cpp:1136: warning: passing 'double' for argument 1 to 'void WebCore::Settings::setMinimumFontSize(int)' WebKit/gtk/webkit/webkitwebview.cpp:1137: warning: passing 'double' for argument 1 to 'void WebCore::Settings::setMinimumLogicalFontSize(int)' WebCore/platform/gtk/RenderThemeGtk.cpp:165: warning: converting to 'gint' from 'double' WebCore/platform/gtk/RenderThemeGtk.cpp:166: warning: converting to 'gint' from 'double' WebCore/platform/gtk/RenderThemeGtk.cpp:167: warning: passing 'double' for argument 1 to 'WebCore::IntPoint::IntPoint(int, int)' WebCore/platform/gtk/RenderThemeGtk.cpp:167: warning: passing 'double' for argument 2 to 'WebCore::IntPoint::IntPoint(int, int)' WebCore/platform/gtk/ScrollViewGtk.cpp:523: warning: passing 'float' for argument 1 to 'void WebCore::ScrollView::scrollBy(int, int)' WebCore/platform/gtk/ScrollViewGtk.cpp:523: warning: passing 'float' for argument 2 to 'void WebCore::ScrollView::scrollBy(int, int)' WebCore/platform/gtk/gtk2drawing.c:1613: warning: unused variable 'shadow_type' WebCore/platform/gtk/gtk2drawing.c:1828: warning: passing argument 7 of 'gtk_paint_extension' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1894: warning: passing argument 7 of 'gtk_paint_extension' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1910: warning: passing argument 7 of 'gtk_paint_box_gap' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1919: warning: passing argument 7 of 'gtk_paint_extension' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1935: warning: passing argument 7 of 'gtk_paint_box_gap' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1962: warning: passing argument 7 of 'gtk_paint_box_gap' discards qualifiers from pointer target type WebCore/platform/gtk/gtk2drawing.c:1972: warning: unused variable 'shadow_type' WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:884: warning: passing 'double' for argument 1 to 'WebCore::IntPoint::IntPoint(int, int)' WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:884: warning: passing 'double' for argument 2 to 'WebCore::IntPoint::IntPoint(int, int)' WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp:98: warning: comparison between signed and unsigned integer expressions WebCore/plugins/gtk/PluginDatabaseGtk.cpp:50: warning: missing sentinel in function call WebCore/plugins/gtk/PluginDatabaseGtk.cpp:61: warning: unused variable 'directory' WebCore/platform/network/curl/ResourceHandleCurl.cpp:81: warning: 'WTF::HashSet<WebCore::String, WebCore::StringHash, WTF::HashTraits<WebCore::String> >& WebCore::allowsAnyHTTPSCertificateHosts()' defined but not used WebCore/platform/network/curl/ResourceHandleManager.cpp:322: warning: unused variable 'err'
Attachments
removing some build warnings to make the build prettier
(6.37 KB, patch)
2008-09-05 15:24 PDT
,
Gustavo Noronha (kov)
alp
: review-
Details
Formatted Diff
Diff
reworked patch
(6.38 KB, patch)
2008-09-05 20:27 PDT
,
Gustavo Noronha (kov)
alp
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Luca Ferretti
Comment 1
2008-06-02 01:22:23 PDT
Also add warnings in
bug #19353
and #19354
Luca Ferretti
Comment 2
2008-06-02 01:23:24 PDT
New warning in gtkk2drawing.c WebCore/platform/gtk/gtk2drawing.c: In function ‘moz_gtk_toolbar_paint’: WebCore/platform/gtk/gtk2drawing.c:1613: warning: unused variable ‘shadow_type’ WebCore/platform/gtk/gtk2drawing.c: In function ‘moz_gtk_menu_bar_paint’: WebCore/platform/gtk/gtk2drawing.c:1972: warning: unused variable ‘shadow_type’
Luca Ferretti
Comment 3
2008-06-02 01:25:58 PDT
Warnings from PNGImageDecoder.cpp Decoder.cpp' || echo './'`WebCore/platform/image-decoders/png/PNGImageDecoder.cpp WebCore/platform/image-decoders/png/PNGImageDecoder.cpp: In member function ‘void WebCore::PNGImageDecoder::headerAvailable()’: WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:235: warning: comparison between signed and unsigned integer expressions WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:235: warning: comparison between signed and unsigned integer expressions
Luca Ferretti
Comment 4
2008-06-02 01:27:01 PDT
Warning in SimpleFontDataGtk.cpp WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp: In member function ‘virtual bool WebCore::SimpleFontData::containsCharacters(const UChar*, int) const’: WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp:98: warning: comparison between signed and unsigned integer expressions
Luca Ferretti
Comment 5
2008-06-02 01:28:02 PDT
Warnings in VideoSinkGstreamer.cpp WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:43: warning: deprecated conversion from string constant to ‘gchar*’ WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:43: warning: deprecated conversion from string constant to ‘gchar*’ WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:43: warning: deprecated conversion from string constant to ‘gchar*’ WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:43: warning: deprecated conversion from string constant to ‘gchar*’ WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp: In function ‘gboolean webkit_video_sink_set_caps(GstBaseSink*, GstCaps*)’: WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:184: warning: comparison between signed and unsigned integer expressions WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp: In function ‘void webkit_video_sink_finalize(GObject*)’: WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp:211: warning: unused variable ‘sink’
Gustavo Noronha (kov)
Comment 6
2008-09-05 15:19:42 PDT
I'm not sure this bug report helps a lot; some of these build warnings are history now. Still, I was going to open a bug report to post my patch that does remove some warnings, and thought I'd use this one.
Gustavo Noronha (kov)
Comment 7
2008-09-05 15:24:14 PDT
Created
attachment 23204
[details]
removing some build warnings to make the build prettier some work in cleaning build warnings for GTK+-related stuff
Alp Toker
Comment 8
2008-09-05 19:19:07 PDT
Comment on
attachment 23204
[details]
removing some build warnings to make the build prettier
>--- 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.
Gustavo Noronha (kov)
Comment 9
2008-09-05 20:13:28 PDT
(In reply to
comment #8
)
> >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.
Yeah, that's why I decided to leave it. I also left some static functions which are generating warnings untouched, as they will probably still be called when the missing implementation comes into place.
> Looks good to land after suggested changes.
Just building webkit again to test that they are correct and will upload a new patch. Thanks for the quick review!
Gustavo Noronha (kov)
Comment 10
2008-09-05 20:27:55 PDT
Created
attachment 23210
[details]
reworked patch
Alp Toker
Comment 11
2008-09-05 21:00:41 PDT
Comment on
attachment 23210
[details]
reworked patch Thanks for the cleanup.
Alp Toker
Comment 12
2008-09-05 21:11:59 PDT
Landed in
r36123
. I'd rather look closely at the double/int cast warnings than simply silencing them, so going ahead and closing this bug to clear pending-commit.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug