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:
authorCampbell Barton <ideasman42@gmail.com>2018-09-19 05:05:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-19 05:12:21 +0300
commitbb3ec3ebafbc2c0e5d8530148a433242e0adad30 (patch)
treed30aaa3df2d03f90f6e7749bdc075445a5642045 /source/blender/editors/armature
parent4c918efd44be11d47afc1efed684a15ad5579722 (diff)
BLI_utildefines: rename pointer conversion macros
Terms get/set don't make much sense when casting values. Name macros so the conversion is obvious, use common prefix for easier completion. - GET_INT_FROM_POINTER -> POINTER_AS_INT - SET_INT_IN_POINTER -> POINTER_FROM_INT - GET_UINT_FROM_POINTER -> POINTER_AS_UINT - SET_UINT_IN_POINTER -> POINTER_FROM_UINT
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c10
-rw-r--r--source/blender/editors/armature/pose_edit.c4
-rw-r--r--source/blender/editors/armature/pose_select.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 691da4cbd2b..dd800613382 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -157,7 +157,7 @@ void BIF_makeListTemplates(const bContext *C)
if (ob != obedit && ob->type == OB_ARMATURE) {
index++;
- BLI_ghash_insert(TEMPLATES_HASH, SET_INT_IN_POINTER(index), ob);
+ BLI_ghash_insert(TEMPLATES_HASH, POINTER_FROM_INT(index), ob);
if (ob == ts->skgen_template) {
TEMPLATES_CURRENT = index;
@@ -187,7 +187,7 @@ const char *BIF_listTemplates(const bContext *UNUSED(C))
while (!BLI_ghashIterator_done(&ghi)) {
Object *ob = BLI_ghashIterator_getValue(&ghi);
- int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
+ int key = POINTER_AS_INT(BLI_ghashIterator_getKey(&ghi));
p += sprintf(p, "|%s %%x%i", ob->id.name + 2, key);
@@ -208,7 +208,7 @@ int BIF_currentTemplate(const bContext *C)
while (!BLI_ghashIterator_done(&ghi)) {
Object *ob = BLI_ghashIterator_getValue(&ghi);
- int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
+ int key = POINTER_AS_INT(BLI_ghashIterator_getKey(&ghi));
if (ob == ts->skgen_template) {
TEMPLATES_CURRENT = key;
@@ -302,7 +302,7 @@ void BIF_setTemplate(bContext *C, int index)
{
ToolSettings *ts = CTX_data_tool_settings(C);
if (index > 0) {
- ts->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, SET_INT_IN_POINTER(index));
+ ts->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, POINTER_FROM_INT(index));
}
else {
ts->skgen_template = NULL;
@@ -2051,7 +2051,7 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
for (p = sketch->depth_peels.first; p; p = p->next)
{
- int index = GET_INT_FROM_POINTER(p->ob);
+ int index = POINTER_AS_INT(p->ob);
index = (index >> 5) & 7;
glColor3fv(colors[index]);
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index d91d3809a42..f04106dac3a 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -1124,7 +1124,7 @@ void POSE_OT_hide(wmOperatorType *ot)
static int show_pose_bone_cb(Object *ob, Bone *bone, void *data)
{
- const bool select = GET_INT_FROM_POINTER(data);
+ const bool select = POINTER_AS_INT(data);
bArmature *arm = ob->data;
@@ -1147,7 +1147,7 @@ static int pose_reveal_exec(bContext *C, wmOperator *op)
bArmature *arm = ob->data;
const bool select = RNA_boolean_get(op->ptr, "select");
- bone_looper(ob, arm->bonebase.first, SET_INT_IN_POINTER(select), show_pose_bone_cb);
+ bone_looper(ob, arm->bonebase.first, POINTER_FROM_INT(select), show_pose_bone_cb);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index ecfaa41b0b5..c4a7ecd25c7 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -63,8 +63,8 @@
#include "armature_intern.h"
/* utility macros for storing a temp int in the bone (selection flag) */
-#define PBONE_PREV_FLAG_GET(pchan) ((void)0, (GET_INT_FROM_POINTER((pchan)->temp)))
-#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = SET_INT_IN_POINTER(val))
+#define PBONE_PREV_FLAG_GET(pchan) ((void)0, (POINTER_AS_INT((pchan)->temp)))
+#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
/* ***************** Pose Select Utilities ********************* */