Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / graph / self-component-filter.h
index 8d12e106e4ec36cc3c9856e5c912e4899b3520d1..3fec35cf8424e6c89d088d8ba389b1e748d70ec0 100644 (file)
@@ -31,7 +31,8 @@
 
 /*
  * For bt_component_filter, bt_self_component, bt_self_component_filter,
- * bt_self_component_port_input, bt_self_component_port_output
+ * bt_self_component_port_input, bt_self_component_port_output,
+ * __BT_UPCAST, __BT_UPCAST_CONST
  */
 #include <babeltrace/types.h>
 
@@ -43,7 +44,7 @@ static inline
 bt_self_component *bt_self_component_filter_as_self_component(
                bt_self_component_filter *self_comp_filter)
 {
-       return (void *) self_comp_filter;
+       return __BT_UPCAST(bt_self_component, self_comp_filter);
 }
 
 static inline
@@ -51,7 +52,7 @@ const bt_component_filter *
 bt_self_component_filter_as_component_filter(
                bt_self_component_filter *self_comp_filter)
 {
-       return (const void *) self_comp_filter;
+       return __BT_UPCAST_CONST(bt_component_filter, self_comp_filter);
 }
 
 extern bt_self_component_port_output *
This page took 0.025228 seconds and 4 git commands to generate.