pulse: adjust CHECK_DEAD_GOTO macro to glib style
authorLennart Poettering <lennart@poettering.net>
Fri, 16 Oct 2009 22:03:06 +0000 (00:03 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 17 Oct 2009 06:48:23 +0000 (08:48 +0200)
ext/pulse/pulsemixerctrl.c

index cd3c8e243fc99104d8467aa16b0bb449228c6936..8df084073191761ee71be316430ca6d6d64106ba 100644 (file)
@@ -199,12 +199,15 @@ gst_pulsemixer_ctrl_success_cb (pa_context * context, int success,
   pa_threaded_mainloop_signal (c->mainloop, 0);
 }
 
-#define CHECK_DEAD_GOTO(c, label) do { \
-if (!(c)->context || pa_context_get_state((c)->context) != PA_CONTEXT_READY) { \
-    GST_WARNING_OBJECT (c->object, "Not connected: %s", (c)->context ? pa_strerror(pa_context_errno((c)->context)) : "NULL"); \
-    goto label; \
-} \
-} while(0);
+#define CHECK_DEAD_GOTO(c, label)                                       \
+  G_STMT_START {                                                        \
+    if (!(c)->context ||                                                \
+        !PA_CONTEXT_IS_GOOD(pa_context_get_state((c)->context))) {      \
+      GST_WARNING_OBJECT ((c)->object, "Not connected: %s",             \
+                          (c)->context ? pa_strerror(pa_context_errno((c)->context)) : "NULL"); \
+      goto label;                                                       \
+    }                                                                   \
+  } G_STMT_END
 
 static gboolean
 gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)