fixed up and turned back on GST_SCHEDULE_SAFETY
authorErik Walthinsen <omega@temple-baptist.org>
Sun, 27 May 2001 00:04:00 +0000 (00:04 +0000)
committerErik Walthinsen <omega@temple-baptist.org>
Sun, 27 May 2001 00:04:00 +0000 (00:04 +0000)
Original commit message from CVS:
fixed up and turned back on GST_SCHEDULE_SAFETY

gst/gstscheduler.h

index cdc9052219ce57fada45e8e03bae7c45de1a0203..c10b7009a5eb814b742540594c005ac8849958b6 100644 (file)
@@ -77,27 +77,35 @@ struct _GstScheduleClass {
   GstObjectClass parent_class;
 };
 
-//#define GST_SCHEDULE_SAFETY if (sched)
-#define GST_SCHEDULE_SAFETY
-
-#define GST_SCHEDULE_ADD_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY ((sched)->add_element((sched),(element)))
-#define GST_SCHEDULE_REMOVE_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY ((sched)->remove_element((sched),(element)))
-#define GST_SCHEDULE_ENABLE_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY ((sched)->enable_element((sched),(element)))
-#define GST_SCHEDULE_DISABLE_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY ((sched)->disable_element((sched),(element)))
-#define GST_SCHEDULE_LOCK_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY if ((sched)->lock_element != NULL) \
-    ((sched)->lock_element((sched),(element)))
-#define GST_SCHEDULE_UNLOCK_ELEMENT(sched,element) \
-  GST_SCHEDULE_SAFETY if ((sched)->unlock_element != NULL) \
-    ((sched)->unlock_element((sched),(element)))
-#define GST_SCHEDULE_PAD_CONNECT(sched,srcpad,sinkpad) \
-  GST_SCHEDULE_SAFETY ((sched)->pad_connect((sched),(srcpad),(sinkpad)))
-#define GST_SCHEDULE_PAD_DISCONNECT(sched,srcpad,sinkpad) \
-  GST_SCHEDULE_SAFETY ((sched)->pad_disconnect((sched),(srcpad),(sinkpad)))
+#define GST_SCHEDULE_SAFETY(sched) if (sched)
+//#define GST_SCHEDULE_SAFETY(sched)
+
+#define GST_SCHEDULE_ADD_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->add_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_REMOVE_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->remove_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_ENABLE_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->enable_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_DISABLE_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->disable_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_LOCK_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { if ((sched)->lock_element != NULL) \
+    ((sched)->lock_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_UNLOCK_ELEMENT(sched,element) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { if ((sched)->unlock_element != NULL) \
+    ((sched)->unlock_element((sched),(element))); } \
+}G_STMT_END
+#define GST_SCHEDULE_PAD_CONNECT(sched,srcpad,sinkpad) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->pad_connect((sched),(srcpad),(sinkpad))); } \
+}G_STMT_END
+#define GST_SCHEDULE_PAD_DISCONNECT(sched,srcpad,sinkpad) G_STMT_START{ \
+  GST_SCHEDULE_SAFETY(sched) { ((sched)->pad_disconnect((sched),(srcpad),(sinkpad))); } \
+}G_STMT_END
 #define GST_SCHEDULE_ITERATE(sched) \
   ((sched)->iterate((sched)))