Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / graph / component-sink-const.h
index 0fece9ce253124e0c3c4edaf477ff560d8a91d39..d0bd773d3ff0ddfde0628cb74e3fe0c008a01efb 100644 (file)
 
 #include <stdint.h>
 
-/* For bt_component, bt_component_filter, bt_port_input */
+/*
+ * For bt_component, bt_component_filter, bt_port_input,
+ * __BT_UPCAST_CONST
+ */
 #include <babeltrace/types.h>
 
 #ifdef __cplusplus
@@ -37,7 +40,7 @@ static inline
 const bt_component *bt_component_sink_as_component_const(
                const bt_component_sink *component)
 {
-       return (const void *) component;
+       return __BT_UPCAST_CONST(bt_component, component);
 }
 
 extern uint64_t bt_component_sink_get_input_port_count(
This page took 0.023182 seconds and 4 git commands to generate.