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 164269 - g_enum_complete_type_info example code
g_enum_complete_type_info example code
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-01-16 18:44 UTC by Sebastien Bacher
Modified: 2005-01-17 03:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Bacher 2005-01-16 18:44:37 UTC
This bug has been opened here: http://bugs.debian.org/289053

"In the gobject reference manual under "Enums and Flags",
g_enum_complete_type_info says for the values parameter that

    The array is terminated by a struct with all members being 0.

But the example code is

    static const GEnumValue values[] = {
      { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
      { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }
    };
    g_enum_complete_type_info (type, info, values);

Perhaps there should be a "{ 0 }" element at the end of that array.

(I only noticed this while reading it, I haven't actually tried to use the
function.)"
Comment 1 Sebastien Bacher 2005-01-16 18:45:13 UTC
trivial patch:

RCS file: /cvs/gnome/glib/docs/reference/gobject/tmpl/enumerations_flags.sgml,v
retrieving revision 1.17
diff -u -r1.17 enumerations_flags.sgml
--- docs/reference/gobject/tmpl/enumerations_flags.sgml 21 Oct 2003 21:49:21
-0000      1.17
+++ docs/reference/gobject/tmpl/enumerations_flags.sgml 16 Jan 2005 18:44:25 -0000
@@ -254,7 +254,8 @@
 {
   static const GEnumValue values[] = {
     { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
-    { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }
+    { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
+    { 0, NULL, NULL }
   };
Comment 2 Matthias Clasen 2005-01-17 03:20:39 UTC
2005-01-16  Matthias Clasen  <mclasen@redhat.com>

	* gobject/tmpl/enumerations_flags.sgml: Fix an
	example.  (#164269, Sebastian Bacher)