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:14:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-19 05:14:36 +0300
commitf35e9f047a0381732a41ec331945b7a0654ee578 (patch)
tree5be3c632483cf2bc2960b21789849af27c9b2b59 /source/blender/editors
parent0ad183bf0289c3b9b1af0cd581bc30435cae3800 (diff)
parentbb3ec3ebafbc2c0e5d8530148a433242e0adad30 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c4
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c4
-rw-r--r--source/blender/editors/armature/pose_edit.c8
-rw-r--r--source/blender/editors/armature/pose_select.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_layout.c10
-rw-r--r--source/blender/editors/interface/interface_templates.c24
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c4
-rw-r--r--source/blender/editors/physics/particle_edit.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c16
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
-rw-r--r--source/blender/editors/space_file/filelist.c16
-rw-r--r--source/blender/editors/space_node/node_templates.c6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c4
-rw-r--r--source/blender/editors/transform/transform_snap.c2
18 files changed, 60 insertions, 60 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 79b7c7988fd..1dd8442b0df 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -4040,7 +4040,7 @@ static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void
bAnimContext ac;
ListBase anim_data = {NULL, NULL};
int filter;
- int setting = GET_INT_FROM_POINTER(setting_wrap);
+ int setting = POINTER_AS_INT(setting_wrap);
short on = 0;
/* send notifiers before doing anything else... */
@@ -4390,7 +4390,7 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAni
case ACHANNEL_SETTING_PINNED: /* NLA Actions - 'map/nomap' */
case ACHANNEL_SETTING_MOD_OFF:
case ACHANNEL_SETTING_ALWAYS_VISIBLE:
- UI_but_funcN_set(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), SET_INT_IN_POINTER(setting));
+ UI_but_funcN_set(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), POINTER_FROM_INT(setting));
break;
/* settings needing special attention */
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 951dcc2dddf..f1d8f9a1ebf 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -387,7 +387,7 @@ static void fmod_envelope_deletepoint_cb(bContext *UNUSED(C), void *fcm_dv, void
{
FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
FCM_EnvelopeData *fedn;
- int index = GET_INT_FROM_POINTER(ind_v);
+ int index = POINTER_AS_INT(ind_v);
/* check that no data exists for the current frame... */
if (env->totvert > 1) {
@@ -465,7 +465,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
but = uiDefIconBut(block, UI_BTYPE_BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 0.9 * UI_UNIT_X, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
- UI_but_func_set(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
+ UI_but_func_set(but, fmod_envelope_deletepoint_cb, env, POINTER_FROM_INT(i));
UI_block_align_begin(block);
}
}
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 15b8c3eb8de..876159c6167 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -1169,7 +1169,7 @@ void ARMATURE_OT_bone_layers(wmOperatorType *ot)
static int hide_pose_bone_fn(Object *ob, Bone *bone, void *ptr)
{
bArmature *arm = ob->data;
- const bool hide_select = (bool)GET_INT_FROM_POINTER(ptr);
+ const bool hide_select = (bool)POINTER_AS_INT(ptr);
int count = 0;
if (arm->layer & bone->layer) {
if (((bone->flag & BONE_SELECTED) != 0) == hide_select) {
@@ -1194,7 +1194,7 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
bool changed_multi = false;
const int hide_select = !RNA_boolean_get(op->ptr, "unselected");
- void *hide_select_p = SET_INT_IN_POINTER(hide_select);
+ void *hide_select_p = POINTER_FROM_INT(hide_select);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob_iter = objects[ob_index];
@@ -1236,7 +1236,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;
int count = 0;
@@ -1261,7 +1261,7 @@ static int pose_reveal_exec(bContext *C, wmOperator *op)
Object **objects = BKE_object_pose_array_get_unique(view_layer, &objects_len);
bool changed_multi = false;
const bool select = RNA_boolean_get(op->ptr, "select");
- void *select_p = SET_INT_IN_POINTER(select);
+ void *select_p = POINTER_FROM_INT(select);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob_iter = objects[ob_index];
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index eb178d422ae..0784f7030a1 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -66,8 +66,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 ********************* */
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 539412afa8a..a3c2b0cce20 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1220,7 +1220,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
/* Random generator, only init once. */
uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
- rng_seed ^= GET_UINT_FROM_POINTER(gso);
+ rng_seed ^= POINTER_AS_UINT(gso);
gso->rng = BLI_rng_new(rng_seed);
gso->is_painting = false;
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 87ea779b7f7..54676c6a1eb 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1094,13 +1094,13 @@ static int gp_merge_layer_exec(bContext *C, wmOperator *op)
/* Collect frames of gpl_current in hash table to avoid O(n^2) lookups */
GHash *gh_frames_cur = BLI_ghash_int_new_ex(__func__, 64);
for (bGPDframe *gpf = gpl_current->frames.first; gpf; gpf = gpf->next) {
- BLI_ghash_insert(gh_frames_cur, SET_INT_IN_POINTER(gpf->framenum), gpf);
+ BLI_ghash_insert(gh_frames_cur, POINTER_FROM_INT(gpf->framenum), gpf);
}
/* read all frames from next layer and add any missing in current layer */
for (bGPDframe *gpf = gpl_next->frames.first; gpf; gpf = gpf->next) {
/* try to find frame in current layer */
- bGPDframe *frame = BLI_ghash_lookup(gh_frames_cur, SET_INT_IN_POINTER(gpf->framenum));
+ bGPDframe *frame = BLI_ghash_lookup(gh_frames_cur, POINTER_FROM_INT(gpf->framenum));
if (!frame) {
bGPDframe *actframe = BKE_gpencil_layer_getframe(gpl_current, gpf->framenum, GP_GETFRAME_USE_PREV);
frame = BKE_gpencil_frame_addnew(gpl_current, gpf->framenum);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 84fa842efa7..1f3230e44fe 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1978,7 +1978,7 @@ static tGPsdata *gp_session_initpaint(bContext *C, wmOperator *op)
/* Random generator, only init once. */
uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
- rng_seed ^= GET_UINT_FROM_POINTER(p);
+ rng_seed ^= POINTER_AS_UINT(p);
p->rng = BLI_rng_new(rng_seed);
/* return context data for running paint operator */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 76e6f64a80c..362f9ef2fda 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -4560,7 +4560,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *but, const c
for (item = item_array; item->identifier; item++) {
/* note: need to give the index rather than the identifier because the enum can be freed */
if (BLI_strcasestr(item->name, str)) {
- if (false == UI_search_item_add(items, item->name, SET_INT_IN_POINTER(item->value), item->icon))
+ if (false == UI_search_item_add(items, item->name, POINTER_FROM_INT(item->value), item->icon))
break;
}
}
@@ -4578,7 +4578,7 @@ static void operator_enum_call_cb(struct bContext *UNUSED(C), void *but, void *a
if (ot) {
if (ot->prop) {
- RNA_property_enum_set(opptr, ot->prop, GET_INT_FROM_POINTER(arg2));
+ RNA_property_enum_set(opptr, ot->prop, POINTER_AS_INT(arg2));
/* We do not call op from here, will be called by button code.
* ui_apply_but_funcs_after() (in interface_handlers.c) called this func before checking operators,
* because one of its parameters is the button itself!
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 9c7c55fb3c8..a874634d3ed 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -413,7 +413,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
uiBut *but = arg_but, *cbut;
PointerRNA *ptr = &but->rnapoin;
PropertyRNA *prop = but->rnaprop;
- int i, index = GET_INT_FROM_POINTER(arg_index);
+ int i, index = POINTER_AS_INT(arg_index);
int shift = win->eventstate->shift;
int len = RNA_property_array_length(ptr, prop);
@@ -507,7 +507,7 @@ static void ui_item_array(
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y + buth, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
- UI_but_func_set(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(layer_num));
+ UI_but_func_set(but, ui_layer_but_cb, but, POINTER_FROM_INT(layer_num));
}
for (a = 0; a < colbuts; a++) {
const int layer_num = a + len / 2 + b * colbuts;
@@ -525,7 +525,7 @@ static void ui_item_array(
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
- UI_but_func_set(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(layer_num));
+ UI_but_func_set(but, ui_layer_but_cb, but, POINTER_FROM_INT(layer_num));
}
UI_block_align_end(block);
@@ -623,7 +623,7 @@ static void ui_item_enum_expand_handle(bContext *C, void *arg1, void *arg2)
if (!win->eventstate->shift) {
uiBut *but = (uiBut *)arg1;
- int enum_value = GET_INT_FROM_POINTER(arg2);
+ int enum_value = POINTER_AS_INT(arg2);
int current_value = RNA_property_enum_get(&but->rnapoin, but->rnaprop);
if (!(current_value & enum_value)) {
@@ -707,7 +707,7 @@ static void ui_item_enum_expand(
but = uiDefButR_prop(block, UI_BTYPE_ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
- UI_but_func_set(but, ui_item_enum_expand_handle, but, SET_INT_IN_POINTER(value));
+ UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value));
}
if (ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL)
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6dab9807574..59b5db61b53 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -428,7 +428,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
TemplateID *template_ui = (TemplateID *)arg_litem;
PointerRNA idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
ID *id = idptr.data;
- int event = GET_INT_FROM_POINTER(arg_event);
+ int event = POINTER_AS_INT(arg_event);
switch (event) {
case UI_ID_BROWSE:
@@ -625,13 +625,13 @@ static uiBut *template_id_def_new_but(
but = uiDefIconTextButO(
block, but_type, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN,
(id) ? "" : CTX_IFACE_(template_id_context(type), "New"), 0, 0, w, but_height, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW));
}
else {
but = uiDefIconTextBut(
block, but_type, 0, ICON_ZOOMIN, (id) ? "" : CTX_IFACE_(template_id_context(type), "New"),
0, 0, w, but_height, NULL, 0, 0, 0, 0, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW));
}
if ((idfrom && idfrom->lib) || !editable) {
@@ -686,7 +686,7 @@ static void template_ID(
but = uiDefButR(
block, UI_BTYPE_TEXT, 0, name, 0, 0, TEMPLATE_SEARCH_TEXTBUT_WIDTH, TEMPLATE_SEARCH_TEXTBUT_HEIGHT,
&idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_RENAME));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_RENAME));
if (user_alert) UI_but_flag_enable(but, UI_BUT_REDALERT);
if (id->lib) {
@@ -709,7 +709,7 @@ static void template_ID(
UI_but_flag_enable(but, UI_BUT_DISABLED);
}
else {
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_LOCAL));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_LOCAL));
}
}
}
@@ -718,7 +718,7 @@ static void template_ID(
block, UI_BTYPE_BUT, 0, ICON_LIBRARY_DATA_OVERRIDE, 0, 0, UI_UNIT_X, UI_UNIT_Y,
NULL, 0, 0, 0, 0,
TIP_("Static override of linked library data-block, click to make fully local"));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_OVERRIDE));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OVERRIDE));
}
if (id->us > 1) {
@@ -733,7 +733,7 @@ static void template_ID(
TIP_("Display number of users of this data (click to make a single-user copy)"));
but->flag |= UI_BUT_UNDO;
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ALONE));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ALONE));
if (/* test only */
(id_copy(CTX_data_main(C), id, NULL, true) == false) ||
(idfrom && idfrom->lib) ||
@@ -775,13 +775,13 @@ static void template_ID(
but = uiDefIconTextButO(
block, UI_BTYPE_BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id) ? "" : IFACE_("Open"),
0, 0, w, UI_UNIT_Y, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_OPEN));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OPEN));
}
else {
but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, ICON_FILESEL, (id) ? "" : IFACE_("Open"), 0, 0, w, UI_UNIT_Y,
NULL, 0, 0, 0, 0, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_OPEN));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OPEN));
}
if ((idfrom && idfrom->lib) || !editable)
@@ -805,7 +805,7 @@ static void template_ID(
block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
TIP_("Unlink data-block "
"(Shift + Click to set users to zero, data will then not be saved)"));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_DELETE));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_DELETE));
if (RNA_property_flag(template_ui->prop) & PROP_NEVER_NULL) {
UI_but_flag_enable(but, UI_BUT_DISABLED);
@@ -3356,7 +3356,7 @@ void uiTemplateCryptoPicker(uiLayout *layout, PointerRNA *ptr, const char *propn
static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
{
uiBut *but = arg1;
- int cur = GET_INT_FROM_POINTER(arg2);
+ int cur = POINTER_AS_INT(arg2);
wmWindow *win = CTX_wm_window(C);
int i, tot, shift = win->eventstate->shift;
@@ -3440,7 +3440,7 @@ void uiTemplateLayers(
icon = ICON_LAYER_USED;
but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2);
- UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer));
+ UI_but_func_set(but, handle_layer_buttons, but, POINTER_FROM_INT(layer));
but->type = UI_BTYPE_TOGGLE;
}
}
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index c98aef74ae7..942a5c857a9 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -505,7 +505,7 @@ static void set_lowest_face_tri(KnifeTool_OpData *kcd, BMFace *f, int index)
if (i == -1)
i++;
- BLI_ghash_insert(kcd->facetrimap, f, SET_INT_IN_POINTER(i + 1));
+ BLI_ghash_insert(kcd->facetrimap, f, POINTER_FROM_INT(i + 1));
}
/* This should only be called for faces that have had a lowest face tri set by previous function */
@@ -513,7 +513,7 @@ static int get_lowest_face_tri(KnifeTool_OpData *kcd, BMFace *f)
{
int ans;
- ans = GET_INT_FROM_POINTER(BLI_ghash_lookup(kcd->facetrimap, f));
+ ans = POINTER_AS_INT(BLI_ghash_lookup(kcd->facetrimap, f));
BLI_assert(ans != 0);
return ans - 1;
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 9c7c9fde066..19488064c97 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -491,8 +491,8 @@ static void PE_free_shape_tree(PEData *data)
static void PE_create_random_generator(PEData *data)
{
uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
- rng_seed ^= GET_UINT_FROM_POINTER(data->ob);
- rng_seed ^= GET_UINT_FROM_POINTER(data->edit);
+ rng_seed ^= POINTER_AS_UINT(data->ob);
+ rng_seed ^= POINTER_AS_UINT(data->edit);
data->rng = BLI_rng_new(rng_seed);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 43ca0382bf1..805f51f008a 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -186,7 +186,7 @@ BLI_INLINE unsigned char f_to_char(const float val)
#define PROJ_VERT_CULL 1
/* to avoid locking in tile initialization */
-#define TILE_PENDING SET_INT_IN_POINTER(-1)
+#define TILE_PENDING POINTER_FROM_INT(-1)
/* This is mainly a convenience struct used so we can keep an array of images we use -
* their imbufs, etc, in 1 array, When using threads this array is copied for each thread
@@ -598,7 +598,7 @@ static int project_paint_PickFace(
* that the point its testing is only every originated from an existing face */
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
- const int tri_index = GET_INT_FROM_POINTER(node->link);
+ const int tri_index = POINTER_AS_INT(node->link);
const MLoopTri *lt = &ps->mlooptri_eval[tri_index];
const float *vtri_ss[3] = {
ps->screenCoords[ps->mloop_eval[lt->tri[0]].v],
@@ -812,7 +812,7 @@ static bool project_bucket_point_occluded(
* that the point its testing is only every originated from an existing face */
for (; bucketFace; bucketFace = bucketFace->next) {
- const int tri_index = GET_INT_FROM_POINTER(bucketFace->link);
+ const int tri_index = POINTER_AS_INT(bucketFace->link);
if (orig_face != tri_index) {
const MLoopTri *lt = &ps->mlooptri_eval[tri_index];
@@ -1033,7 +1033,7 @@ static bool check_seam(
int i1_fidx = -1, i2_fidx = -1; /* index in face */
for (node = ps->vertFaces[i1]; node; node = node->next) {
- const int tri_index = GET_INT_FROM_POINTER(node->link);
+ const int tri_index = POINTER_AS_INT(node->link);
if (tri_index != orig_face) {
const MLoopTri *lt = &ps->mlooptri_eval[tri_index];
@@ -2928,7 +2928,7 @@ static void project_bucket_init(
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
project_paint_face_init(
- ps, thread_index, bucket_index, GET_INT_FROM_POINTER(node->link), 0,
+ ps, thread_index, bucket_index, POINTER_AS_INT(node->link), 0,
clip_rect, bucket_bounds, ibuf, &tmpibuf);
}
}
@@ -2936,7 +2936,7 @@ static void project_bucket_init(
/* More complicated loop, switch between images */
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
- tri_index = GET_INT_FROM_POINTER(node->link);
+ tri_index = POINTER_AS_INT(node->link);
/* Image context switching */
tpage = project_paint_face_paint_image(ps, tri_index);
@@ -3045,7 +3045,7 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MLoopTri *
int bucket_index = bucket_x + (bucket_y * ps->buckets_x);
BLI_linklist_prepend_arena(
&ps->bucketFaces[bucket_index],
- SET_INT_IN_POINTER(tri_index), /* cast to a pointer to shut up the compiler */
+ POINTER_FROM_INT(tri_index), /* cast to a pointer to shut up the compiler */
arena
);
@@ -3385,7 +3385,7 @@ static void project_paint_bleed_add_face_user(
/* annoying but we need to add all faces even ones we never use elsewhere */
if (ps->seam_bleed_px > 0.0f) {
const int lt_vtri[3] = { PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt) };
- void *tri_index_p = SET_INT_IN_POINTER(tri_index);
+ void *tri_index_p = POINTER_FROM_INT(tri_index);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[0]], tri_index_p, arena);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[1]], tri_index_p, arena);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[2]], tri_index_p, arena);
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index b5d68786664..af27ad5d307 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -414,7 +414,7 @@ static bool paint_brush_update(
if ((do_random || do_random_mask) && stroke->rng == NULL) {
/* Lazy initialization. */
uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
- rng_seed ^= (uint)GET_INT_FROM_POINTER(brush);
+ rng_seed ^= (uint)POINTER_AS_INT(brush);
stroke->rng = BLI_rng_new(rng_seed);
}
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 968757bc637..fb4b8babda5 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1516,7 +1516,7 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
return cache->block_entries[idx];
}
- if ((ret = BLI_ghash_lookup(cache->misc_entries, SET_INT_IN_POINTER(index)))) {
+ if ((ret = BLI_ghash_lookup(cache->misc_entries, POINTER_FROM_INT(index)))) {
return ret;
}
@@ -1529,11 +1529,11 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
/* Else, we have to add new entry to 'misc' cache - and possibly make room for it first! */
ret = filelist_file_create_entry(filelist, index);
old_index = cache->misc_entries_indices[cache->misc_cursor];
- if ((old = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(old_index), NULL))) {
+ if ((old = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(old_index), NULL))) {
BLI_ghash_remove(cache->uuids, old->uuid, NULL, NULL);
filelist_file_release_entry(filelist, old);
}
- BLI_ghash_insert(cache->misc_entries, SET_INT_IN_POINTER(index), ret);
+ BLI_ghash_insert(cache->misc_entries, POINTER_FROM_INT(index), ret);
BLI_ghash_insert(cache->uuids, ret->uuid, ret);
cache->misc_entries_indices[cache->misc_cursor] = index;
@@ -1628,7 +1628,7 @@ static bool filelist_file_cache_block_create(FileList *filelist, const int start
FileDirEntry *entry;
/* That entry might have already been requested and stored in misc cache... */
- if ((entry = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(idx), NULL)) == NULL) {
+ if ((entry = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), NULL)) == NULL) {
entry = filelist_file_create_entry(filelist, idx);
BLI_ghash_insert(cache->uuids, entry->uuid, entry);
}
@@ -2064,7 +2064,7 @@ unsigned int filelist_entry_select_set(
{
/* Default NULL pointer if not found is fine here! */
void **es_p = BLI_ghash_lookup_p(filelist->selection_state, entry->uuid);
- unsigned int entry_flag = es_p ? GET_UINT_FROM_POINTER(*es_p) : 0;
+ unsigned int entry_flag = es_p ? POINTER_AS_UINT(*es_p) : 0;
const unsigned int org_entry_flag = entry_flag;
BLI_assert(entry);
@@ -2090,7 +2090,7 @@ unsigned int filelist_entry_select_set(
if (entry_flag != org_entry_flag) {
if (es_p) {
if (entry_flag) {
- *es_p = SET_UINT_IN_POINTER(entry_flag);
+ *es_p = POINTER_FROM_UINT(entry_flag);
}
else {
BLI_ghash_remove(filelist->selection_state, entry->uuid, MEM_freeN, NULL);
@@ -2099,7 +2099,7 @@ unsigned int filelist_entry_select_set(
else if (entry_flag) {
void *key = MEM_mallocN(sizeof(entry->uuid), __func__);
memcpy(key, entry->uuid, sizeof(entry->uuid));
- BLI_ghash_insert(filelist->selection_state, key, SET_UINT_IN_POINTER(entry_flag));
+ BLI_ghash_insert(filelist->selection_state, key, POINTER_FROM_UINT(entry_flag));
}
}
@@ -2139,7 +2139,7 @@ unsigned int filelist_entry_select_get(FileList *filelist, FileDirEntry *entry,
((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR)))
{
/* Default NULL pointer if not found is fine here! */
- return GET_UINT_FROM_POINTER(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
+ return POINTER_AS_UINT(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
}
return 0;
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 8667056a687..7b60963e082 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -375,7 +375,7 @@ static void ui_node_link(bContext *C, void *arg_p, void *event_p)
bNode *node_to = arg->node;
bNodeSocket *sock_to = arg->sock;
bNodeTree *ntree = arg->ntree;
- int event = GET_INT_FROM_POINTER(event_p);
+ int event = POINTER_AS_INT(event_p);
if (event == UI_NODE_LINK_DISCONNECT)
node_socket_disconnect(bmain, ntree, node_to, sock_to);
@@ -573,11 +573,11 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_
but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Remove"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Remove nodes connected to the input"));
- UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_REMOVE));
+ UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), POINTER_FROM_INT(UI_NODE_LINK_REMOVE));
but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Disconnect"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Disconnect nodes connected to the input"));
- UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_DISCONNECT));
+ UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), POINTER_FROM_INT(UI_NODE_LINK_DISCONNECT));
}
ui_node_menu_column(arg, NODE_CLASS_GROUP, N_("Group"));
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 5506ccf249a..5391bacf9a1 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -1151,7 +1151,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
}
SEQ_END;
- actseq->tmp = SET_INT_IN_POINTER(true);
+ actseq->tmp = POINTER_FROM_INT(true);
for (BKE_sequence_iterator_begin(ed, &iter, true); iter.valid; BKE_sequence_iterator_next(&iter)) {
seq = iter.seq;
@@ -1176,7 +1176,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
if (enddisp < seq->enddisp) enddisp = seq->enddisp;
if (machine < seq->machine) machine = seq->machine;
- seq->tmp = SET_INT_IN_POINTER(true);
+ seq->tmp = POINTER_FROM_INT(true);
seq->flag |= SELECT;
changed = true;
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index fe8b833281a..22eb817c2b1 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -594,7 +594,7 @@ static void initSnappingMode(TransInfo *t)
(bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled,
bm_edge_is_snap_target,
bm_face_is_snap_target,
- SET_UINT_IN_POINTER((BM_ELEM_SELECT | BM_ELEM_HIDDEN)));
+ POINTER_FROM_UINT((BM_ELEM_SELECT | BM_ELEM_HIDDEN)));
}
}
}