Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / graph / port-input-const.h
index 51aef4732697b89a1dadaa79274233fea855a526..5301769f08f5476d6b76a61b5ac4e1671905b4b5 100644 (file)
@@ -24,7 +24,7 @@
  * SOFTWARE.
  */
 
-/* For bt_port, bt_port_input */
+/* For bt_port, bt_port_input, __BT_UPCAST_CONST */
 #include <babeltrace/types.h>
 
 #include <stdint.h>
@@ -34,10 +34,9 @@ extern "C" {
 #endif
 
 static inline
-const bt_port *bt_port_input_as_port_const(
-               const bt_port_input *port_input)
+const bt_port *bt_port_input_as_port_const(const bt_port_input *port_input)
 {
-       return (const void *) port_input;
+       return __BT_UPCAST_CONST(bt_port, port_input);
 }
 
 extern void bt_port_input_get_ref(const bt_port_input *port_input);
This page took 0.033807 seconds and 4 git commands to generate.