From 800ca21e555e5e9fe1f07a4a8473d6d24ada6301 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Wed, 1 Aug 2012 11:57:22 -0400 Subject: [PATCH] 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 --- gio/gdbuserror.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; * } * -- 2.7.4