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 785280 - GtkCenterBox: No G_BEGIN_DECLS and G_END_DECLS in gtkcenterbox.h
GtkCenterBox: No G_BEGIN_DECLS and G_END_DECLS in gtkcenterbox.h
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.91.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-07-22 19:24 UTC by Kjell Ahlstedt
Modified: 2017-08-05 17:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: centerbox: Add G_BEGIN_DECLS and G_END_DECLS (1.07 KB, patch)
2017-07-22 19:27 UTC, Kjell Ahlstedt
committed Details | Review

Description Kjell Ahlstedt 2017-07-22 19:24:08 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?
Comment 1 Kjell Ahlstedt 2017-07-22 19:27:45 UTC
Created attachment 356188 [details] [review]
patch: centerbox: Add G_BEGIN_DECLS and G_END_DECLS
Comment 2 Daniel Boles 2017-08-04 01:31:22 UTC
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."
Comment 3 Daniel Boles 2017-08-04 01:32:14 UTC
...and the latter return values should be marked (nullable) too, of course.
Comment 4 Kjell Ahlstedt 2017-08-05 09:32:35 UTC
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.
Comment 5 Daniel Boles 2017-08-05 17:58:49 UTC
(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!