Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/intern/bmesh_operator_api_inline.h
| Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | |||||
| ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ||||
| BLI_INLINE float BMO_slot_map_float_get(BMOpSlot *slot, const void *element) | BLI_INLINE float BMO_slot_map_float_get(BMOpSlot *slot, const void *element) | ||||
| { | { | ||||
| void **data; | void **data; | ||||
| BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_FLT); | BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_FLT); | ||||
| data = BMO_slot_map_data_get(slot, element); | data = BMO_slot_map_data_get(slot, element); | ||||
| if (data) { | if (data) { | ||||
| return **(float **)data; | return **(float **)&data; | ||||
campbellbarton: Note, this is the same as `*(float *)data` - edited in final commit. | |||||
| } | } | ||||
| else { | else { | ||||
| return 0.0f; | return 0.0f; | ||||
| } | } | ||||
| } | } | ||||
| ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ||||
| BLI_INLINE int BMO_slot_map_int_get(BMOpSlot *slot, const void *element) | BLI_INLINE int BMO_slot_map_int_get(BMOpSlot *slot, const void *element) | ||||
| { | { | ||||
| void **data; | void **data; | ||||
| BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_INT); | BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_INT); | ||||
| data = BMO_slot_map_data_get(slot, element); | data = BMO_slot_map_data_get(slot, element); | ||||
| if (data) { | if (data) { | ||||
| return **(int **)data; | return **(int **)&data; | ||||
| } | } | ||||
| else { | else { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||
| ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ||||
| BLI_INLINE bool BMO_slot_map_bool_get(BMOpSlot *slot, const void *element) | BLI_INLINE bool BMO_slot_map_bool_get(BMOpSlot *slot, const void *element) | ||||
| { | { | ||||
| void **data; | void **data; | ||||
| BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_BOOL); | BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_BOOL); | ||||
| data = BMO_slot_map_data_get(slot, element); | data = BMO_slot_map_data_get(slot, element); | ||||
| if (data) { | if (data) { | ||||
| return **(bool **)data; | return **(bool **)&data; | ||||
| } | } | ||||
| else { | else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) | ||||
| BLI_INLINE void *BMO_slot_map_ptr_get(BMOpSlot *slot, const void *element) | BLI_INLINE void *BMO_slot_map_ptr_get(BMOpSlot *slot, const void *element) | ||||
| Show All 19 Lines | |||||
Note, this is the same as *(float *)data - edited in final commit.