[glib] GDBusError: Fix up G_STATIC_ASSERT guidance
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GDBusError: Fix up G_STATIC_ASSERT guidance
- Date: Wed, 1 Aug 2012 15:58:22 +0000 (UTC)
commit 800ca21e555e5e9fe1f07a4a8473d6d24ada6301
Author: David Zeuthen <zeuthen gmail com>
Date: Wed Aug 1 11:57:22 2012 -0400
GDBusError: Fix up G_STATIC_ASSERT guidance
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 | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbuserror.c b/gio/gdbuserror.c
index 9e1c50f..f743226 100644
--- a/gio/gdbuserror.c
+++ b/gio/gdbuserror.c
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]