GDBusError: Fix up G_STATIC_ASSERT guidance
authorDavid Zeuthen <zeuthen@gmail.com>
Wed, 1 Aug 2012 15:57:22 +0000 (11:57 -0400)
committerDavid Zeuthen <zeuthen@gmail.com>
Wed, 1 Aug 2012 15:57:22 +0000 (11:57 -0400)
This was reported in bug 680994.

https://bugzilla.gnome.org/show_bug.cgi?id=680994

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
gio/gdbuserror.c

index 9e1c50f..f743226 100644 (file)
@@ -68,6 +68,7 @@
  *   FOO_BAR_ERROR_FAILED,
  *   FOO_BAR_ERROR_ANOTHER_ERROR,
  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
+ *   FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
  * } FooBarError;
  *
  * /<!-- -->* foo-bar-error.c: *<!-- -->/
@@ -79,6 +80,9 @@
  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
  * };
  *
+ * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
+ * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
+ *
  * GQuark
  * foo_bar_error_quark (void)
  * {
@@ -87,7 +91,6 @@
  *                                       &quark_volatile,
  *                                       foo_bar_error_entries,
  *                                       G_N_ELEMENTS (foo_bar_error_entries));
- *   G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR);
  *   return (GQuark) quark_volatile;
  * }
  * </programlisting></example>