GNOME Bugzilla – Bug 785280
GtkCenterBox: No G_BEGIN_DECLS and G_END_DECLS in gtkcenterbox.h
Last modified: 2017-08-05 17:58:49 UTC
File gtkcenterbox.h does not contain G_BEGIN_DECLS and G_END_DECLS. That's a problem when it's used in C++ code, such as gtkmm. Nor does gtkcenterbox.h contain #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif Is that omission deliberate? (It doesn't matter to me, I'm just curious.) The child parameter in gtk_center_box_set_start_widget(), gtk_center_box_set_center_widget() and gtk_center_box_set_end_widget() does not contain a (nullable) annotation, but the code indicates that NULL is an acceptable value. Is it?
Created attachment 356188 [details] [review] patch: centerbox: Add G_BEGIN_DECLS and G_END_DECLS
Review of attachment 356188 [details] [review]: I don't see how anyone could argue with this! As for the others, likewise. About the nullable in parameters, though: the patch should be accompanied by an addition to the doc comment along the lines of "@child the child, or %NULL to remove the child widget at this position". Equally, get_blah_widget() comments should be "Gets the blah widget, or %NULL if there is no widget at this position."
...and the latter return values should be marked (nullable) too, of course.
Comment on attachment 356188 [details] [review] patch: centerbox: Add G_BEGIN_DECLS and G_END_DECLS I have pushed the patch, but I keep the bug open until the other GtkCenterBox issues have been fixed.
(In reply to Kjell Ahlstedt from comment #0) > Nor does gtkcenterbox.h contain > #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) > #error "Only <gtk/gtk.h> can be included directly." > #endif > Is that omission deliberate? (It doesn't matter to me, I'm just curious.) > > The child parameter in gtk_center_box_set_start_widget(), > gtk_center_box_set_center_widget() and gtk_center_box_set_end_widget() does > not > contain a (nullable) annotation, but the code indicates that NULL is an > acceptable value. Is it? Fixed by: https://git.gnome.org/browse/gtk+/commit/?id=4accb9f1679f08ab64a945800d733f51361d0f42 https://git.gnome.org/browse/gtk+/commit/?id=cbe53fec07737fc33e5e0d61cb710aaa57d30eda Thanks for the reports!