After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521366 - Fixes for sparse warnings in gtk
Fixes for sparse warnings in gtk
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-03-09 13:05 UTC by Kjartan Maraas
Modified: 2013-09-28 11:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
patch for warnings (10.41 KB, patch)
2008-03-09 13:05 UTC, Kjartan Maraas
needs-work Details | Review
warning fixes for gdk-pixbuf (3.65 KB, patch)
2008-03-09 13:06 UTC, Kjartan Maraas
reviewed Details | Review
warning fixes for gdk (3.10 KB, patch)
2008-03-09 14:44 UTC, Kjartan Maraas
needs-work Details | Review
updated patch (3.12 KB, patch)
2008-03-13 18:13 UTC, Kjartan Maraas
none Details | Review

Description Kjartan Maraas 2008-03-09 13:05:11 UTC
Attaching a patch
Comment 1 Kjartan Maraas 2008-03-09 13:05:51 UTC
Created attachment 106897 [details] [review]
patch for warnings
Comment 2 Kjartan Maraas 2008-03-09 13:06:43 UTC
Created attachment 106899 [details] [review]
warning fixes for gdk-pixbuf
Comment 3 Kjartan Maraas 2008-03-09 14:44:03 UTC
Created attachment 106908 [details] [review]
warning fixes for gdk
Comment 4 Matthias Clasen 2008-03-09 22:00:24 UTC
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
Comment 5 Kjartan Maraas 2008-03-12 15:15:22 UTC
I'll fix up according to your comments. Thanks for reviewing it.
Comment 6 Kjartan Maraas 2008-03-12 15:23:32 UTC
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?
Comment 7 Kjartan Maraas 2008-03-13 18:13:38 UTC
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’
Comment 8 Timothy Arceri 2013-09-28 11:39:56 UTC
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.