Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api_inline.h')
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api_inline.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.h b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
index 16c2b8b0505..b405ecc1841 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api_inline.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
@@ -69,16 +69,16 @@ BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const shor
oflags[bm->stackdepth - 1].f ^= oflag;
}
-BLI_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slot_name,
+BLI_INLINE void BMO_slot_map_int_insert(BMOperator *op, BMOpSlot *slot,
void *element, int val)
{
- BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(int));
+ BMO_slot_map_insert(op, slot, element, &val, sizeof(int));
}
-BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slot_name,
+BLI_INLINE void BMO_slot_map_float_insert(BMOperator *op, BMOpSlot *slot,
void *element, float val)
{
- BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(float));
+ BMO_slot_map_insert(op, slot, element, &val, sizeof(float));
}
@@ -87,62 +87,62 @@ BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char
* do NOT use these for non-operator-api-allocated memory! instead
* use BMO_slot_map_data_get and BMO_slot_map_insert, which copies the data. */
-BLI_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slot_name,
- void *element, void *val)
+BLI_INLINE void BMO_slot_map_ptr_insert(BMOperator *op, BMOpSlot *slot,
+ const void *element, void *val)
{
- BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(void *));
+ BMO_slot_map_insert(op, slot, element, &val, sizeof(void *));
}
-BLI_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slot_name, void *element)
+BLI_INLINE int BMO_slot_map_contains(BMOpSlot *slot, const void *element)
{
- BMOpSlot *slot = BMO_slot_get(op, slot_name);
BLI_assert(slot->slot_type == BMO_OP_SLOT_MAPPING);
/* sanity check */
- if (!slot->data.ghash) return 0;
+ if (UNLIKELY(slot->data.ghash == NULL)) {
+ return 0;
+ }
return BLI_ghash_haskey(slot->data.ghash, element);
}
-BLI_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slot_name,
- void *element)
+BLI_INLINE void *BMO_slot_map_data_get(BMOpSlot *slot, const void *element)
{
BMOElemMapping *mapping;
- BMOpSlot *slot = BMO_slot_get(op, slot_name);
BLI_assert(slot->slot_type == BMO_OP_SLOT_MAPPING);
/* sanity check */
- if (!slot->data.ghash) return NULL;
+ if (UNLIKELY(slot->data.ghash == NULL)) {
+ return NULL;
+ }
mapping = (BMOElemMapping *)BLI_ghash_lookup(slot->data.ghash, element);
- if (!mapping) return NULL;
+ if (!mapping) {
+ return NULL;
+ }
return mapping + 1;
}
-BLI_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slot_name,
- void *element)
+BLI_INLINE float BMO_slot_map_float_get(BMOpSlot *slot, const void *element)
{
- float *val = (float *) BMO_slot_map_data_get(bm, op, slot_name, element);
+ float *val = (float *) BMO_slot_map_data_get(slot, element);
if (val) return *val;
return 0.0f;
}
-BLI_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slot_name,
- void *element)
+BLI_INLINE int BMO_slot_map_int_get(BMOpSlot *slot, const void *element)
{
- int *val = (int *) BMO_slot_map_data_get(bm, op, slot_name, element);
+ int *val = (int *) BMO_slot_map_data_get(slot, element);
if (val) return *val;
return 0;
}
-BLI_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slot_name,
- void *element)
+BLI_INLINE void *BMO_slot_map_ptr_get(BMOpSlot *slot, const void *element)
{
- void **val = (void **) BMO_slot_map_data_get(bm, op, slot_name, element);
+ void **val = (void **) BMO_slot_map_data_get(slot, element);
if (val) return *val;
return NULL;