GNOME Bugzilla – Bug 521366
Fixes for sparse warnings in gtk
Last modified: 2013-09-28 11:39:56 UTC
Attaching a patch
Created attachment 106897 [details] [review] patch for warnings
Created attachment 106899 [details] [review] warning fixes for gdk-pixbuf
Created attachment 106908 [details] [review] warning fixes for gdk
If you look at the if before this change - g_slist_remove (style->styles, style); + style->styles = g_slist_remove (style->styles, style); you will notice that the assignment is unnecessary. Owen cited this very example when arguing against the warn-if-unused-return annotation for g_slist_remove. Therefore, I'd like to keep the code as is. For the unused treeview functions, You need to check with Kris. The rest of the gtk patch looks ok - GdkPixbufModule *builtin_module = NULL; #define load_one_builtin_module(format) \ + GdkPixbufModule *builtin_module = NULL; \ This one looks pretty dubious to me. Doesn't that introduce multiple definitions of buildin_module ? - { "XdndActionCopy", None, GDK_ACTION_COPY }, - { "XdndActionMove", None, GDK_ACTION_MOVE }, - { "XdndActionLink", None, GDK_ACTION_LINK }, - { "XdndActionAsk", None, GDK_ACTION_ASK }, - { "XdndActionPrivate", None, GDK_ACTION_COPY }, + { "XdndActionCopy", (GdkAtom)None, GDK_ACTION_COPY }, + { "XdndActionMove", (GdkAtom)None, GDK_ACTION_MOVE }, + { "XdndActionLink", (GdkAtom)None, GDK_ACTION_LINK }, + { "XdndActionAsk", (GdkAtom)None, GDK_ACTION_ASK }, + { "XdndActionPrivate", (GdkAtom)None, GDK_ACTION_COPY }, Would probably be better to use GDK_NONE here. extern gboolean _gdk_synchronize; +extern Display *gdk_display; This doesn't look correct, gdk_display is already declared in gdkx.h. Why do you think you need this ? - dest_x + req.x - src_x, dest_y + req.y - src_y) == None) + dest_x + req.x - src_x, dest_y + req.y - src_y) == (XImage *)None) This should just check against NULL instead. - *encoding = None; + *encoding = (GdkAtom)None; See above on GDK_NONE
I'll fix up according to your comments. Thanks for reviewing it.
Wrt the gdk_display change I was just trying to fix this warning: gdkglobals-x11.c:35:18: warning: symbol 'gdk_display' was not declared. Should it be static? should I just include gdkx.h there instead? What's that .c file used for btw?
Created attachment 107242 [details] [review] updated patch Reverted the builtin_module change. It was done to "fix" a warning that's probably just the compiler not being smart enough about macros: gdk-pixbuf-io.c:303: warning: unused variable ‘builtin_module’
Marking as obsolete patch is over five years out of date with master and not in git format. If you are still seeing these warnings feel free to reopen this bug and provide an updated patch.