Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / graph / self-component-port-output.h
index 6fd4b138fb88b48ba5c796573d1e462b10087c6c..fee38aa84cc58211fadb4fed4da15f98c61302a6 100644 (file)
  * SOFTWARE.
  */
 
-/* For enum bt_self_component_port_status */
-#include <babeltrace/graph/self-component-port.h>
-
 /*
  * For bt_port_output, bt_self_component_port,
- * bt_self_component_port_output
+ * bt_self_component_port_output, __BT_UPCAST, __BT_UPCAST_CONST
  */
 #include <babeltrace/types.h>
 
@@ -41,14 +38,14 @@ bt_self_component_port *
 bt_self_component_port_output_as_self_component_port(
                bt_self_component_port_output *self_component_port)
 {
-       return (void *) self_component_port;
+       return __BT_UPCAST(bt_self_component_port, self_component_port);
 }
 
 static inline
 const bt_port_output *bt_self_component_port_output_as_port_output(
                bt_self_component_port_output *self_component_port)
 {
-       return (const void *) self_component_port;
+       return __BT_UPCAST_CONST(bt_port_output, self_component_port);
 }
 
 #ifdef __cplusplus
This page took 0.024716 seconds and 4 git commands to generate.