Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / trace-ir / field-class-const.h
index eb9cb1508a2f1fb5767081f4df73b2a98f3f3a72..9f2f960b40ec9ff4b4b4612ef9eb8c9c70f2caa8 100644 (file)
@@ -32,7 +32,7 @@
  * bt_field_class_enumeration_mapping,
  * bt_field_class_unsigned_enumeration_mapping,
  * bt_field_class_signed_enumeration_mapping,
- * bt_field_class_enumeration_mapping_label_array
+ * bt_field_class_enumeration_mapping_label_array, __BT_UPCAST_CONST
  */
 #include <babeltrace/types.h>
 
@@ -97,7 +97,7 @@ const bt_field_class_enumeration_mapping *
 bt_field_class_unsigned_enumeration_mapping_as_mapping_const(
                const bt_field_class_unsigned_enumeration_mapping *mapping)
 {
-       return (const void *) mapping;
+       return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping);
 }
 
 static inline
@@ -105,7 +105,7 @@ const bt_field_class_enumeration_mapping *
 bt_field_class_signed_enumeration_mapping_as_mapping_const(
                const bt_field_class_signed_enumeration_mapping *mapping)
 {
-       return (const void *) mapping;
+       return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping);
 }
 
 extern const char *bt_field_class_enumeration_mapping_get_label(
This page took 0.023347 seconds and 4 git commands to generate.