[telepathy-mission-control/master] mcd_debug_init: use G_N_ELEMENTS to count debug keys

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Sep 11 04:51:21 PDT 2009


---
 src/mcd-debug.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/mcd-debug.c b/src/mcd-debug.c
index 5a36355..201a57b 100644
--- a/src/mcd-debug.c
+++ b/src/mcd-debug.c
@@ -137,12 +137,8 @@ void mcd_debug_init ()
          * telepathy-glib-style flags-word */
         if (level == 0)
         {
-            guint nkeys;
-
-            /* count the debug keys */
-            for (nkeys = 0; keys[nkeys].value != 0; nkeys++) /* do nothing */ ;
-
-            categories = g_parse_debug_string (mc_debug_str, keys, nkeys);
+            categories = g_parse_debug_string (mc_debug_str, keys,
+                                               G_N_ELEMENTS (keys) - 1);
             tp_debug_set_flags (mc_debug_str);
 
             /* mcd-debug.h uses the value of mcd_debug_level directly, so
-- 
1.5.6.5



More information about the telepathy-commits mailing list