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/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c12
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c36
-rw-r--r--source/blender/blenkernel/intern/armature.c4
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c22
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/font.c2
-rw-r--r--source/blender/blenkernel/intern/icons.c20
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c4
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mesh.c10
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c4
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c14
-rw-r--r--source/blender/blenkernel/intern/mesh_merge.c12
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c18
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c16
-rw-r--r--source/blender/blenkernel/intern/object.c10
-rw-r--r--source/blender/blenkernel/intern/object_deform.c2
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/particle_system.c8
-rw-r--r--source/blender/blenkernel/intern/pbvh.c16
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c68
22 files changed, 144 insertions, 144 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
index 98a17ad8009..004a50205ba 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
@@ -78,7 +78,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
ccgFaceIterator_next(&ccg_face_iter))
{
/*const*/ CCGFace *ccg_face = ccgFaceIterator_getCurrent(&ccg_face_iter);
- const int poly_index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ const int poly_index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
const MPoly *mp = &mpoly[poly_index];
int corner;
if (ccg_face->numVerts != mp->totloop) {
@@ -86,7 +86,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
}
for (corner = 0; corner < ccg_face->numVerts; corner++) {
/*const*/ CCGVert *ccg_vert = FACE_getVerts(ccg_face)[corner];
- const int vert_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert));
+ const int vert_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert));
if (vert_index != mloop[mp->loopstart + corner].v) {
return false;
}
@@ -104,9 +104,9 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
/* const */ CCGEdge *ccg_edge = ccgEdgeIterator_getCurrent(&ccg_edge_iter);
/* const */ CCGVert *ccg_vert1 = ccg_edge->v0;
/* const */ CCGVert *ccg_vert2 = ccg_edge->v1;
- const int ccg_vert1_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert1));
- const int ccg_vert2_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert2));
- const int edge_index = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ const int ccg_vert1_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert1));
+ const int ccg_vert2_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert2));
+ const int edge_index = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
const MEdge *me = &medge[edge_index];
if (me->v1 != ccg_vert1_index || me->v2 != ccg_vert2_index) {
return false;
@@ -122,7 +122,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
ccgEdgeIterator_next(&ccg_edge_iter))
{
/* const */ CCGEdge *ccg_edge = ccgEdgeIterator_getCurrent(&ccg_edge_iter);
- const int edge_index = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ const int edge_index = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
if (ccg_edge->crease != medge[edge_index].crease) {
return false;
}
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
index b378744fa7a..f81a1d9eec9 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
@@ -584,7 +584,7 @@ static int conv_ccg_get_num_face_verts(const OpenSubdiv_Converter *converter,
int face)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
return ccgSubSurf_getFaceNumVerts(ccg_face);
}
@@ -593,12 +593,12 @@ static void conv_ccg_get_face_verts(const OpenSubdiv_Converter *converter,
int *face_verts)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
int num_face_verts = ccgSubSurf_getFaceNumVerts(ccg_face);
int loop;
for (loop = 0; loop < num_face_verts; loop++) {
CCGVert *ccg_vert = ccgSubSurf_getFaceVert(ccg_face, loop);
- face_verts[loop] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert));
+ face_verts[loop] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert));
}
}
@@ -607,12 +607,12 @@ static void conv_ccg_get_face_edges(const OpenSubdiv_Converter *converter,
int *face_edges)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
int num_face_verts = ccgSubSurf_getFaceNumVerts(ccg_face);
int loop;
for (loop = 0; loop < num_face_verts; loop++) {
CCGEdge *ccg_edge = ccgSubSurf_getFaceEdge(ccg_face, loop);
- face_edges[loop] = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ face_edges[loop] = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
}
}
@@ -621,18 +621,18 @@ static void conv_ccg_get_edge_verts(const OpenSubdiv_Converter *converter,
int *edge_verts)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
CCGVert *ccg_vert0 = ccgSubSurf_getEdgeVert0(ccg_edge);
CCGVert *ccg_vert1 = ccgSubSurf_getEdgeVert1(ccg_edge);
- edge_verts[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert0));
- edge_verts[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert1));
+ edge_verts[0] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert0));
+ edge_verts[1] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert1));
}
static int conv_ccg_get_num_edge_faces(const OpenSubdiv_Converter *converter,
int edge)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
return ccgSubSurf_getEdgeNumFaces(ccg_edge);
}
@@ -641,12 +641,12 @@ static void conv_ccg_get_edge_faces(const OpenSubdiv_Converter *converter,
int *edge_faces)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
int num_edge_faces = ccgSubSurf_getEdgeNumFaces(ccg_edge);
int face;
for (face = 0; face < num_edge_faces; face++) {
CCGFace *ccg_face = ccgSubSurf_getEdgeFace(ccg_edge, face);
- edge_faces[face] = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ edge_faces[face] = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
}
}
@@ -654,7 +654,7 @@ static float conv_ccg_get_edge_sharpness(const OpenSubdiv_Converter *converter,
int edge)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
/* TODO(sergey): Multiply by subdivision level once CPU evaluator
* is switched to uniform subdivision type.
*/
@@ -665,7 +665,7 @@ static int conv_ccg_get_num_vert_edges(const OpenSubdiv_Converter *converter,
int vert)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
return ccgSubSurf_getVertNumEdges(ccg_vert);
}
@@ -674,12 +674,12 @@ static void conv_ccg_get_vert_edges(const OpenSubdiv_Converter *converter,
int *vert_edges)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
int num_vert_edges = ccgSubSurf_getVertNumEdges(ccg_vert);
int edge;
for (edge = 0; edge < num_vert_edges; edge++) {
CCGEdge *ccg_edge = ccgSubSurf_getVertEdge(ccg_vert, edge);
- vert_edges[edge] = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ vert_edges[edge] = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
}
}
@@ -687,7 +687,7 @@ static int conv_ccg_get_num_vert_faces(const OpenSubdiv_Converter *converter,
int vert)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
return ccgSubSurf_getVertNumFaces(ccg_vert);
}
@@ -696,12 +696,12 @@ static void conv_ccg_get_vert_faces(const OpenSubdiv_Converter *converter,
int *vert_faces)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
int num_vert_faces = ccgSubSurf_getVertNumFaces(ccg_vert);
int face;
for (face = 0; face < num_vert_faces; face++) {
CCGFace *ccg_face = ccgSubSurf_getVertFace(ccg_vert, face);
- vert_faces[face] = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ vert_faces[face] = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
}
}
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 52fbb7d4d59..83e5e4fe3f7 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1070,7 +1070,7 @@ void armature_deform_verts(Object *armOb, Object *target, const Mesh * mesh, flo
GHash *idx_hash = BLI_ghash_ptr_new("pose channel index by name");
int pchan_index = 0;
for (pchan = armOb->pose->chanbase.first; pchan != NULL; pchan = pchan->next, ++pchan_index) {
- BLI_ghash_insert(idx_hash, pchan, SET_INT_IN_POINTER(pchan_index));
+ BLI_ghash_insert(idx_hash, pchan, POINTER_FROM_INT(pchan_index));
}
for (i = 0, dg = target->defbase.first; dg; i++, dg = dg->next) {
defnrToPC[i] = BKE_pose_channel_find_name(armOb->pose, dg->name);
@@ -1080,7 +1080,7 @@ void armature_deform_verts(Object *armOb, Object *target, const Mesh * mesh, flo
defnrToPC[i] = NULL;
}
else {
- defnrToPCIndex[i] = GET_INT_FROM_POINTER(BLI_ghash_lookup(idx_hash, defnrToPC[i]));
+ defnrToPCIndex[i] = POINTER_AS_INT(BLI_ghash_lookup(idx_hash, defnrToPC[i]));
}
}
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 3f50321b4d5..9043460562d 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1274,7 +1274,7 @@ void CDDM_calc_loop_normals_spacearr(
r_lnors_spacearr->lspacearr[i]->ref_beta, r_lnors_spacearr->lspacearr[i]->loops);
printf("\t\t(shared with loops");
while (loops) {
- printf(" %d", GET_INT_FROM_POINTER(loops->link));
+ printf(" %d", POINTER_AS_INT(loops->link));
loops = loops->next;
}
printf(")\n");
@@ -1608,13 +1608,13 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
void **val_p;
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- newe[i] = GET_INT_FROM_POINTER(*val_p);
+ newe[i] = POINTER_AS_INT(*val_p);
}
else {
STACK_PUSH(olde, i);
STACK_PUSH(medge, *med);
newe[i] = c;
- *val_p = SET_INT_IN_POINTER(c);
+ *val_p = POINTER_FROM_INT(c);
c++;
}
}
@@ -1776,7 +1776,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
uint v2 = mlv;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -1785,7 +1785,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
@@ -1828,7 +1828,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
uint v2 = (vtargetmap[first_valid_ml->v] != -1) ? vtargetmap[first_valid_ml->v] : first_valid_ml->v;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -1837,7 +1837,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = first_valid_ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
@@ -2032,7 +2032,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
eh = BLI_edgehash_new_ex(__func__, eh_reserve);
if (med) {
for (i = 0; i < numEdges; i++, med++) {
- BLI_edgehash_insert(eh, med->v1, med->v2, SET_INT_IN_POINTER(i + 1));
+ BLI_edgehash_insert(eh, med->v1, med->v2, POINTER_FROM_INT(i + 1));
}
}
@@ -2061,7 +2061,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
BLI_edgehashIterator_step(ehi), ++i, ++med, ++index)
{
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
- j = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
+ j = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi));
if (j == 0 || !eindex) {
med->flag = ME_EDGEDRAW | ME_EDGERENDER;
@@ -2072,7 +2072,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
*index = eindex[j - 1];
}
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(i));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(i));
}
BLI_edgehashIterator_free(ehi);
@@ -2089,7 +2089,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
for (j = 0; j < mp->totloop; j++, ml++) {
v1 = ml->v;
v2 = ME_POLY_LOOP_NEXT(cddm->mloop, mp, j)->v;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(eh, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(eh, v1, v2));
}
}
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 87d93db640d..27d1ad01f2d 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -218,7 +218,7 @@ static void emDM_calcLoopNormalsSpaceArray(
r_lnors_spacearr->lspacearr[i]->ref_beta, r_lnors_spacearr->lspacearr[i]->loops);
printf("\t\t(shared with loops");
while (loops) {
- printf(" %d", GET_INT_FROM_POINTER(loops->link));
+ printf(" %d", POINTER_AS_INT(loops->link));
loops = loops->next;
}
printf(")\n");
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index ee946de44dc..0f475950dc0 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -360,7 +360,7 @@ VFont *BKE_vfont_builtin_get(void)
static VChar *find_vfont_char(VFontData *vfd, unsigned int character)
{
- return BLI_ghash_lookup(vfd->characters, SET_UINT_IN_POINTER(character));
+ return BLI_ghash_lookup(vfd->characters, POINTER_FROM_UINT(character));
}
static void build_underline(Curve *cu, ListBase *nubase, const rctf *rect,
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 23cb6c71696..2a348751365 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -157,7 +157,7 @@ static int get_next_free_id(void)
return gNextIconId++;
/* now we try to find the smallest icon id not stored in the gIcons hash */
- while (BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(startId)) && startId >= gFirstIconId)
+ while (BLI_ghash_lookup(gIcons, POINTER_FROM_INT(startId)) && startId >= gFirstIconId)
startId++;
/* if we found a suitable one that isn't used yet, return it */
@@ -211,7 +211,7 @@ void BKE_icons_deferred_free(void)
node != NULL;
node = node->next)
{
- BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(node->icon_id), NULL, icon_free);
+ BLI_ghash_remove(gIcons, POINTER_FROM_INT(node->icon_id), NULL, icon_free);
}
BLI_linklist_lockfree_clear(&g_icon_delete_queue, MEM_freeN);
}
@@ -522,7 +522,7 @@ void BKE_icon_changed(const int icon_id)
if (!icon_id || G.background) return;
- icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
+ icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id));
if (icon) {
/* We *only* expect ID-tied icons here, not non-ID icon/preview! */
@@ -557,7 +557,7 @@ static Icon *icon_create(int icon_id, int obj_type, void *obj)
new_icon->drawinfo = NULL;
new_icon->drawinfo_free = NULL;
- BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(icon_id), new_icon);
+ BLI_ghash_insert(gIcons, POINTER_FROM_INT(icon_id), new_icon);
return new_icon;
}
@@ -687,7 +687,7 @@ Icon *BKE_icon_get(const int icon_id)
Icon *icon = NULL;
- icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
+ icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id));
if (!icon) {
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
@@ -703,7 +703,7 @@ void BKE_icon_set(const int icon_id, struct Icon *icon)
void **val_p;
- if (BLI_ghash_ensure_p(gIcons, SET_INT_IN_POINTER(icon_id), &val_p)) {
+ if (BLI_ghash_ensure_p(gIcons, POINTER_FROM_INT(icon_id), &val_p)) {
printf("%s: Internal error, icon already set: %d\n", __func__, icon_id);
return;
}
@@ -732,7 +732,7 @@ void BKE_icon_id_delete(struct ID *id)
}
BKE_icons_deferred_free();
- BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(icon_id), NULL, icon_free);
+ BLI_ghash_remove(gIcons, POINTER_FROM_INT(icon_id), NULL, icon_free);
}
/**
@@ -745,7 +745,7 @@ bool BKE_icon_delete(const int icon_id)
return false;
}
- Icon *icon = BLI_ghash_popkey(gIcons, SET_INT_IN_POINTER(icon_id), NULL);
+ Icon *icon = BLI_ghash_popkey(gIcons, POINTER_FROM_INT(icon_id), NULL);
if (icon) {
icon_free_data(icon_id, icon);
icon_free(icon);
@@ -763,10 +763,10 @@ bool BKE_icon_delete_unmanaged(const int icon_id)
return false;
}
- Icon *icon = BLI_ghash_popkey(gIcons, SET_INT_IN_POINTER(icon_id), NULL);
+ Icon *icon = BLI_ghash_popkey(gIcons, POINTER_FROM_INT(icon_id), NULL);
if (icon) {
if (UNLIKELY(icon->flag & ICON_FLAG_MANAGED)) {
- BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(icon_id), icon);
+ BLI_ghash_insert(gIcons, POINTER_FROM_INT(icon_id), icon);
return false;
}
else {
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 76d16334630..d4508350d12 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -486,7 +486,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
unsigned int xi_max = (unsigned int) ((xmax - layer->bounds.xmin) * layer->buckets_xy_scalar[0]);
unsigned int yi_min = (unsigned int) ((ymin - layer->bounds.ymin) * layer->buckets_xy_scalar[1]);
unsigned int yi_max = (unsigned int) ((ymax - layer->bounds.ymin) * layer->buckets_xy_scalar[1]);
- void *face_index_void = SET_UINT_IN_POINTER(face_index);
+ void *face_index_void = POINTER_FROM_UINT(face_index);
unsigned int xi, yi;
@@ -538,7 +538,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
buckets_face[bucket_index] = bucket;
for (bucket_node = bucketstore[bucket_index]; bucket_node; bucket_node = bucket_node->next) {
- *bucket = GET_UINT_FROM_POINTER(bucket_node->link);
+ *bucket = POINTER_AS_UINT(bucket_node->link);
bucket++;
}
*bucket = TRI_TERMINATOR_ID;
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 9280f95a803..a46f7bf26dc 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -827,7 +827,7 @@ void BKE_material_remap_object_calc(
for (int i = 0; i < ob_dst->totcol; i++) {
Material *ma_src = give_current_material(ob_dst, i + 1);
- BLI_ghash_reinsert(gh_mat_map, ma_src, SET_INT_IN_POINTER(i), NULL, NULL);
+ BLI_ghash_reinsert(gh_mat_map, ma_src, POINTER_FROM_INT(i), NULL, NULL);
}
/* setup default mapping (when materials don't match) */
@@ -857,7 +857,7 @@ void BKE_material_remap_object_calc(
else {
void **index_src_p = BLI_ghash_lookup_p(gh_mat_map, ma_src);
if (index_src_p) {
- remap_src_to_dst[i] = GET_INT_FROM_POINTER(*index_src_p);
+ remap_src_to_dst[i] = POINTER_AS_INT(*index_src_p);
}
}
}
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 3e1412e0f5a..525f5d97083 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1654,7 +1654,7 @@ static int split_faces_prepare_new_verts(
if ((*lnor_space)->flags & MLNOR_SPACE_IS_SINGLE) {
/* Single loop in this fan... */
- BLI_assert(GET_INT_FROM_POINTER((*lnor_space)->loops) == loop_idx);
+ BLI_assert(POINTER_AS_INT((*lnor_space)->loops) == loop_idx);
BLI_BITMAP_ENABLE(done_loops, loop_idx);
if (vert_used) {
ml->v = new_vert_idx;
@@ -1662,7 +1662,7 @@ static int split_faces_prepare_new_verts(
}
else {
for (LinkNode *lnode = (*lnor_space)->loops; lnode; lnode = lnode->next) {
- const int ml_fan_idx = GET_INT_FROM_POINTER(lnode->link);
+ const int ml_fan_idx = POINTER_AS_INT(lnode->link);
BLI_BITMAP_ENABLE(done_loops, ml_fan_idx);
if (vert_used) {
mloop[ml_fan_idx].v = new_vert_idx;
@@ -1723,7 +1723,7 @@ static int split_faces_prepare_new_edges(
if (BLI_BITMAP_TEST(edges_used, edge_idx)) {
/* Original edge has already been used, we need to define a new one. */
const int new_edge_idx = num_edges++;
- *eval = SET_INT_IN_POINTER(new_edge_idx);
+ *eval = POINTER_FROM_INT(new_edge_idx);
ml_prev->e = new_edge_idx;
SplitFaceNewEdge *new_edge = BLI_memarena_alloc(memarena, sizeof(*new_edge));
@@ -1738,13 +1738,13 @@ static int split_faces_prepare_new_edges(
/* We can re-use original edge. */
medge[edge_idx].v1 = ml_prev->v;
medge[edge_idx].v2 = ml->v;
- *eval = SET_INT_IN_POINTER(edge_idx);
+ *eval = POINTER_FROM_INT(edge_idx);
BLI_BITMAP_ENABLE(edges_used, edge_idx);
}
}
else {
/* Edge already known, just update loop's edge index. */
- ml_prev->e = GET_INT_FROM_POINTER(*eval);
+ ml_prev->e = POINTER_AS_INT(*eval);
}
ml_prev = ml;
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 2e2afa6834b..2d342de2c21 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -182,7 +182,7 @@ static void make_edges_mdata_extend(
BLI_edgehashIterator_step(ehi), ++medge, e_index++)
{
BLI_edgehashIterator_getKey(ehi, &medge->v1, &medge->v2);
- BLI_edgehashIterator_setValue(ehi, SET_UINT_IN_POINTER(e_index));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_UINT(e_index));
medge->crease = medge->bweight = 0;
medge->flag = ME_EDGEDRAW | ME_EDGERENDER;
@@ -198,7 +198,7 @@ static void make_edges_mdata_extend(
int j;
for (j = 0; j < mp->totloop; j++, l++) {
/* lookup hashed edge index */
- l_prev->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(eh, l_prev->v, l->v));
+ l_prev->e = POINTER_AS_UINT(BLI_edgehash_lookup(eh, l_prev->v, l->v));
l_prev = l;
}
}
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 66419b03e01..00fac09da44 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -598,7 +598,7 @@ void BKE_lnor_space_add_loop(
lnors_spacearr->lspacearr[ml_index] = lnor_space;
if (bm_loop == NULL) {
- bm_loop = SET_INT_IN_POINTER(ml_index);
+ bm_loop = POINTER_FROM_INT(ml_index);
}
if (is_single) {
BLI_assert(lnor_space->loops == NULL);
@@ -1687,7 +1687,7 @@ static void mesh_normals_loop_custom_set(
const float *org_nor = NULL;
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1718,7 +1718,7 @@ static void mesh_normals_loop_custom_set(
* See T45984. */
loops = lnors_spacearr.lspacearr[i]->loops;
if (loops && org_nor) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1760,7 +1760,7 @@ static void mesh_normals_loop_custom_set(
*/
LinkNode *loops = lnors_spacearr.lspacearr[i]->loops;
if (lnors_spacearr.lspacearr[i]->flags & MLNOR_SPACE_IS_SINGLE) {
- BLI_assert(GET_INT_FROM_POINTER(loops) == i);
+ BLI_assert(POINTER_AS_INT(loops) == i);
const int nidx = use_vertices ? (int)mloops[i].v : i;
float *nor = r_custom_loopnors[nidx];
@@ -1774,7 +1774,7 @@ static void mesh_normals_loop_custom_set(
zero_v3(avg_nor);
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
const int nidx = use_vertices ? (int)mloops[lidx].v : lidx;
float *nor = r_custom_loopnors[nidx];
@@ -3225,7 +3225,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
/* build edge hash */
me = medge;
for (i = 0; i < totedge_i; i++, me++) {
- BLI_edgehash_insert(eh, me->v1, me->v2, SET_UINT_IN_POINTER(i));
+ BLI_edgehash_insert(eh, me->v1, me->v2, POINTER_FROM_UINT(i));
/* unrelated but avoid having the FGON flag enabled, so we can reuse it later for something else */
me->flag &= ~ME_FGON;
@@ -3247,7 +3247,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
# define ML(v1, v2) { \
ml->v = mf->v1; \
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
ml++; j++; \
} (void)0
diff --git a/source/blender/blenkernel/intern/mesh_merge.c b/source/blender/blenkernel/intern/mesh_merge.c
index d49ca507e02..5324c397ebf 100644
--- a/source/blender/blenkernel/intern/mesh_merge.c
+++ b/source/blender/blenkernel/intern/mesh_merge.c
@@ -342,13 +342,13 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, const int *vtargetmap, const int tot_vtar
void **val_p;
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- newe[i] = GET_INT_FROM_POINTER(*val_p);
+ newe[i] = POINTER_AS_INT(*val_p);
}
else {
STACK_PUSH(olde, i);
STACK_PUSH(medge, *med);
newe[i] = c;
- *val_p = SET_INT_IN_POINTER(c);
+ *val_p = POINTER_FROM_INT(c);
c++;
}
}
@@ -507,7 +507,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, const int *vtargetmap, const int tot_vtar
uint v2 = mlv;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -516,7 +516,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, const int *vtargetmap, const int tot_vtar
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
@@ -559,7 +559,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, const int *vtargetmap, const int tot_vtar
uint v2 = (vtargetmap[first_valid_ml->v] != -1) ? vtargetmap[first_valid_ml->v] : first_valid_ml->v;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -568,7 +568,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, const int *vtargetmap, const int tot_vtar
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = first_valid_ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index bf98b8040e3..704db453670 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -966,7 +966,7 @@ static void mesh_island_to_astar_graph_edge_process(
const int pidx = edge_to_poly_map[edge_idx].indices[i];
MPoly *mp = &polys[pidx];
const int pidx_isld = islands ? poly_island_index_map[pidx] : pidx;
- void *custom_data = is_edge_innercut ? SET_INT_IN_POINTER(edge_idx) : SET_INT_IN_POINTER(-1);
+ void *custom_data = is_edge_innercut ? POINTER_FROM_INT(edge_idx) : POINTER_FROM_INT(-1);
if (UNLIKELY(islands && (islands->items_to_islands[mp->loopstart] != island_index))) {
/* poly not in current island, happens with border edges... */
@@ -1082,12 +1082,12 @@ static float mesh_remap_calc_loops_astar_f_cost(
{
float *co_next, *co_dest;
- if (link && (GET_INT_FROM_POINTER(link->custom_data) != -1)) {
+ if (link && (POINTER_AS_INT(link->custom_data) != -1)) {
/* An innercut edge... We tag our solution as potentially crossing innercuts.
* Note it might not be the case in the end (AStar will explore around optimal path), but helps
* trimming off some processing later... */
- if (!GET_INT_FROM_POINTER(as_solution->custom_data)) {
- as_solution->custom_data = SET_INT_IN_POINTER(true);
+ if (!POINTER_AS_INT(as_solution->custom_data)) {
+ as_solution->custom_data = POINTER_FROM_INT(true);
}
}
@@ -1666,7 +1666,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(
continue;
}
- as_solution.custom_data = SET_INT_IN_POINTER(false);
+ as_solution.custom_data = POINTER_FROM_INT(false);
isld_res = &islands_res[best_island_index][plidx_dst];
if (use_from_vert) {
@@ -1689,7 +1689,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(
BLI_astar_graph_solve(
as_graph, pidx_isld_src_prev, pidx_isld_src,
mesh_remap_calc_loops_astar_f_cost, &as_solution, isld_steps_src);
- if (GET_INT_FROM_POINTER(as_solution.custom_data) && (as_solution.steps > 0)) {
+ if (POINTER_AS_INT(as_solution.custom_data) && (as_solution.steps > 0)) {
/* Find first 'cutting edge' on path, and bring back lidx_src on poly just
* before that edge.
* Note we could try to be much smarter (like e.g. storing a whole poly's indices,
@@ -1701,7 +1701,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(
/* Note we go backward here, from dest to src poly. */
for (i = as_solution.steps - 1; i--;) {
BLI_AStarGNLink *as_link = as_solution.prev_links[pidx_isld_src];
- const int eidx = GET_INT_FROM_POINTER(as_link->custom_data);
+ const int eidx = POINTER_AS_INT(as_link->custom_data);
pidx_isld_src = as_solution.prev_nodes[pidx_isld_src];
BLI_assert(pidx_isld_src != -1);
if (eidx != -1) {
@@ -1774,7 +1774,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(
BLI_astar_graph_solve(
as_graph, pidx_isld_src_prev, pidx_isld_src,
mesh_remap_calc_loops_astar_f_cost, &as_solution, isld_steps_src);
- if (GET_INT_FROM_POINTER(as_solution.custom_data) && (as_solution.steps > 0)) {
+ if (POINTER_AS_INT(as_solution.custom_data) && (as_solution.steps > 0)) {
/* Find first 'cutting edge' on path, and bring back lidx_src on poly just
* before that edge.
* Note we could try to be much smarter (like e.g. storing a whole poly's indices,
@@ -1786,7 +1786,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(
/* Note we go backward here, from dest to src poly. */
for (i = as_solution.steps - 1; i--;) {
BLI_AStarGNLink *as_link = as_solution.prev_links[pidx_isld_src];
- int eidx = GET_INT_FROM_POINTER(as_link->custom_data);
+ int eidx = POINTER_AS_INT(as_link->custom_data);
pidx_isld_src = as_solution.prev_nodes[pidx_isld_src];
BLI_assert(pidx_isld_src != -1);
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index f974362e4be..b75f5956b30 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -326,13 +326,13 @@ bool BKE_mesh_validate_arrays(
if ((me->v1 != me->v2) && BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) {
PRINT_ERR("\tEdge %u: is a duplicate of %d\n", i,
- GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
+ POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
remove = do_fixes;
}
if (remove == false) {
if (me->v1 != me->v2) {
- BLI_edgehash_insert(edge_hash, me->v1, me->v2, SET_INT_IN_POINTER(i));
+ BLI_edgehash_insert(edge_hash, me->v1, me->v2, POINTER_FROM_INT(i));
}
}
else {
@@ -566,7 +566,7 @@ bool BKE_mesh_validate_arrays(
* We already know from previous text that a valid edge exists, use it (if allowed)! */
if (do_fixes) {
int prev_e = ml->e;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2));
fix_flag.loops_edge = true;
PRINT_ERR("\tLoop %u has invalid edge reference (%d), fixed using edge %u\n",
sp->loopstart + j, prev_e, ml->e);
@@ -583,7 +583,7 @@ bool BKE_mesh_validate_arrays(
* and we already know from previous test that a valid one exists, use it (if allowed)! */
if (do_fixes) {
int prev_e = ml->e;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2));
fix_flag.loops_edge = true;
PRINT_ERR("\tPoly %u has invalid edge reference (%d, is_removed: %d), fixed using edge %u\n",
sp->index, prev_e, IS_REMOVED_EDGE(me), ml->e);
@@ -1351,7 +1351,7 @@ static void mesh_calc_edges_mdata(
/* set edge members of mloops */
hash = BLI_edgehash_new_ex(__func__, totedge_final);
for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) {
- BLI_edgehash_insert(hash, med->v1, med->v2, SET_UINT_IN_POINTER(edge_index));
+ BLI_edgehash_insert(hash, med->v1, med->v2, POINTER_FROM_UINT(edge_index));
}
mpoly = allpoly;
@@ -1363,7 +1363,7 @@ static void mesh_calc_edges_mdata(
ml = &ml_next[i - 1]; /* last loop */
while (i-- != 0) {
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(hash, ml->v, ml_next->v));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(hash, ml->v, ml_next->v));
ml = ml_next;
ml_next++;
}
@@ -1472,7 +1472,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
}
/* store the new edge index in the hash value */
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(i));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(i));
}
BLI_edgehashIterator_free(ehi);
@@ -1485,7 +1485,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
int j;
for (j = 0; j < mp->totloop; j++, l++) {
/* lookup hashed edge index */
- med_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(eh, l_prev->v, l->v));
+ med_index = POINTER_AS_INT(BLI_edgehash_lookup(eh, l_prev->v, l->v));
l_prev->e = med_index;
l_prev = l;
}
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 03d0d9704dd..8864a613761 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2010,7 +2010,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
if (use_special_ss_case) {
/* Special case if the last modifier is SS and no constructive modifier are in front of it. */
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, SET_INT_IN_POINTER(nr));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, POINTER_FROM_INT(nr));
/* In case we deleted some verts, nr may refer to inexistent one now, see T42557. */
if (ccg_vert) {
float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert);
@@ -2993,7 +2993,7 @@ Mesh *BKE_object_get_original_mesh(Object *object)
static int pc_cmp(const void *a, const void *b)
{
const LinkData *ad = a, *bd = b;
- if (GET_INT_FROM_POINTER(ad->data) > GET_INT_FROM_POINTER(bd->data))
+ if (POINTER_AS_INT(ad->data) > POINTER_AS_INT(bd->data))
return 1;
else return 0;
}
@@ -3006,14 +3006,14 @@ int BKE_object_insert_ptcache(Object *ob)
BLI_listbase_sort(&ob->pc_ids, pc_cmp);
for (link = ob->pc_ids.first, i = 0; link; link = link->next, i++) {
- int index = GET_INT_FROM_POINTER(link->data);
+ int index = POINTER_AS_INT(link->data);
if (i < index)
break;
}
link = MEM_callocN(sizeof(LinkData), "PCLink");
- link->data = SET_INT_IN_POINTER(i);
+ link->data = POINTER_FROM_INT(i);
BLI_addtail(&ob->pc_ids, link);
return i;
@@ -3028,7 +3028,7 @@ static int pc_findindex(ListBase *listbase, int index)
link = listbase->first;
while (link) {
- if (GET_INT_FROM_POINTER(link->data) == index)
+ if (POINTER_AS_INT(link->data) == index)
return number;
number++;
diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c
index b8273703a94..ac9193eae57 100644
--- a/source/blender/blenkernel/intern/object_deform.c
+++ b/source/blender/blenkernel/intern/object_deform.c
@@ -633,7 +633,7 @@ bool *BKE_object_defgroup_validmap_get(Object *ob, const int defbase_tot)
val_p = BLI_ghash_lookup_p(gh, chan->name);
if (val_p) {
- *val_p = SET_INT_IN_POINTER(1);
+ *val_p = POINTER_FROM_INT(1);
}
}
}
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 89ffe36ed41..73cb31146b8 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -520,7 +520,7 @@ static Object *find_family_object(Main *bmain, const char *family, size_t family
{
Object **ob_pt;
Object *ob;
- void *ch_key = SET_UINT_IN_POINTER(ch);
+ void *ch_key = POINTER_FROM_UINT(ch);
if ((ob_pt = (Object **)BLI_ghash_lookup_p(family_gh, ch_key))) {
ob = *ob_pt;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index ef681c72676..802c1c6b6b9 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1399,7 +1399,7 @@ int psys_particle_dm_face_lookup(
LinkNode *tessface_node = poly_nodes[pindex_orig];
for (; tessface_node; tessface_node = tessface_node->next) {
- int findex_dst = GET_INT_FROM_POINTER(tessface_node->link);
+ int findex_dst = POINTER_AS_INT(tessface_node->link);
faceuv = osface_final[findex_dst].uv;
/* check that this intersects - Its possible this misses :/ -
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 2179b035758..1f75b3fb7c4 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -369,7 +369,7 @@ void psys_calc_dmcache(Object *ob, Mesh *mesh_final, Mesh *mesh_original, Partic
for (i=0, node=nodedmelem; i<totdmelem; i++, node++) {
int origindex_final;
- node->link = SET_INT_IN_POINTER(i);
+ node->link = POINTER_FROM_INT(i);
/* may be vertex or face origindex */
if (use_modifier_stack) {
@@ -412,7 +412,7 @@ void psys_calc_dmcache(Object *ob, Mesh *mesh_final, Mesh *mesh_original, Partic
else {
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
- pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
+ pa->num_dmcache= POINTER_AS_INT(nodearray[pa->num]->link);
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
@@ -1550,7 +1550,7 @@ static EdgeHash *sph_springhash_build(ParticleSystem *psys)
springhash = BLI_edgehash_new_ex(__func__, psys->tot_fluidsprings);
for (i=0, spring=psys->fluid_springs; i<psys->tot_fluidsprings; i++, spring++)
- BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], SET_INT_IN_POINTER(i+1));
+ BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], POINTER_FROM_INT(i+1));
return springhash;
}
@@ -1752,7 +1752,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
/* Viscoelastic spring force */
if (pfn->psys == psys[0] && fluid->flag & SPH_VISCOELASTIC_SPRINGS && springhash) {
/* BLI_edgehash_lookup appears to be thread-safe. - z0r */
- spring_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(springhash, index, pfn->index));
+ spring_index = POINTER_AS_INT(BLI_edgehash_lookup(springhash, index, pfn->index));
if (spring_index) {
spring = psys[0]->fluid_springs + spring_index - 1;
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index ea346a3bfda..413f0407c86 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -247,7 +247,7 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
{
void *key, **value_p;
- key = SET_INT_IN_POINTER(vertex);
+ key = POINTER_FROM_INT(vertex);
if (!BLI_ghash_ensure_p(map, key, &value_p)) {
int value_i;
if (BLI_BITMAP_TEST(bvh->vert_bitmap, vertex) == 0) {
@@ -259,11 +259,11 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
value_i = ~(*face_verts);
(*face_verts)++;
}
- *value_p = SET_INT_IN_POINTER(value_i);
+ *value_p = POINTER_FROM_INT(value_i);
return value_i;
}
else {
- return GET_INT_FROM_POINTER(*value_p);
+ return POINTER_AS_INT(*value_p);
}
}
@@ -304,13 +304,13 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
GHashIterator gh_iter;
GHASH_ITER (gh_iter, map) {
void *value = BLI_ghashIterator_getValue(&gh_iter);
- int ndx = GET_INT_FROM_POINTER(value);
+ int ndx = POINTER_AS_INT(value);
if (ndx < 0)
ndx = -ndx + node->uniq_verts - 1;
vert_indices[ndx] =
- GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
+ POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
}
for (int i = 0; i < totface; ++i) {
@@ -915,7 +915,7 @@ static void BKE_pbvh_search_callback_occluded(PBVH *bvh,
static bool update_search_cb(PBVHNode *node, void *data_v)
{
- int flag = GET_INT_FROM_POINTER(data_v);
+ int flag = POINTER_AS_INT(data_v);
if (node->flag & PBVH_Leaf)
return (node->flag & flag) != 0;
@@ -1220,7 +1220,7 @@ void BKE_pbvh_update(PBVH *bvh, int flag, float (*fnors)[3])
PBVHNode **nodes;
int totnode;
- BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag),
+ BKE_pbvh_search_gather(bvh, update_search_cb, POINTER_FROM_INT(flag),
&nodes, &totnode);
if (flag & PBVH_UpdateNormals)
@@ -2087,7 +2087,7 @@ void BKE_pbvh_draw_cb(
PBVHNode **nodes;
int totnode;
- BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers),
+ BKE_pbvh_search_gather(bvh, update_search_cb, POINTER_FROM_INT(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers),
&nodes, &totnode);
pbvh_update_normals(bvh, nodes, totnode, fnors);
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 6db306854f4..139952c4cb4 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -284,7 +284,7 @@ static void get_face_uv_map_vert(UvVertMap *vmap, struct MPoly *mpoly, struct ML
break;
}
- fverts[j] = SET_UINT_IN_POINTER(mpoly[nv->poly_index].loopstart + nv->loop_of_poly_index);
+ fverts[j] = POINTER_FROM_UINT(mpoly[nv->poly_index].loopstart + nv->loop_of_poly_index);
}
}
@@ -331,7 +331,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
if (v->separate) {
CCGVert *ssv;
int loopid = mpoly[v->poly_index].loopstart + v->loop_of_poly_index;
- CCGVertHDL vhdl = SET_INT_IN_POINTER(loopid);
+ CCGVertHDL vhdl = POINTER_FROM_INT(loopid);
copy_v2_v2(uv, mloopuv[loopid].uv);
@@ -347,7 +347,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
MPoly *mp = &mpoly[i];
int nverts = mp->totloop;
int j, j_next;
- CCGFace *origf = ccgSubSurf_getFace(origss, SET_INT_IN_POINTER(i));
+ CCGFace *origf = ccgSubSurf_getFace(origss, POINTER_FROM_INT(i));
/* unsigned int *fv = &mp->v1; */
MLoop *ml = mloop + mp->loopstart;
@@ -361,12 +361,12 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
for (j = 0, j_next = nverts - 1; j < nverts; j_next = j++) {
- unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j_next]);
- unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j]);
+ unsigned int v0 = POINTER_AS_UINT(fverts[j_next]);
+ unsigned int v1 = POINTER_AS_UINT(fverts[j]);
if (BLI_edgeset_add(eset, v0, v1)) {
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j_next);
- CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j_next);
+ CCGEdgeHDL ehdl = POINTER_FROM_INT(mp->loopstart + j_next);
float crease = ccgSubSurf_getEdgeCrease(orige);
ccgSubSurf_syncEdge(ss, ehdl, fverts[j_next], fverts[j], crease, &e);
@@ -391,7 +391,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
#endif
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
- ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), nverts, fverts, &f);
+ ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), nverts, fverts, &f);
}
#ifndef USE_DYNSIZE
@@ -436,7 +436,7 @@ static void UNUSED_FUNCTION(set_subsurf_osd_ccg_uv)(CCGSubSurf *ss,
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
/* load coordinates from uvss into tface */
@@ -522,7 +522,7 @@ static void set_subsurf_legacy_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
for (ccgSubSurf_initFaceIterator(uvss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
/* load coordinates from uvss into tface */
@@ -698,10 +698,10 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
CCGVert *v;
if (vertexCos) {
- ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), vertexCos[i], 0, &v);
+ ccgSubSurf_syncVert(ss, POINTER_FROM_INT(i), vertexCos[i], 0, &v);
}
else {
- ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), mv->co, 0, &v);
+ ccgSubSurf_syncVert(ss, POINTER_FROM_INT(i), mv->co, 0, &v);
}
((int *)ccgSubSurf_getVertUserData(ss, v))[1] = (index) ? *index++ : i;
@@ -716,8 +716,8 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
crease = useFlatSubdiv ? creaseFactor :
me->crease * creaseFactor / 255.0f;
- ccgSubSurf_syncEdge(ss, SET_INT_IN_POINTER(i), SET_UINT_IN_POINTER(me->v1),
- SET_UINT_IN_POINTER(me->v2), crease, &e);
+ ccgSubSurf_syncEdge(ss, POINTER_FROM_INT(i), POINTER_FROM_UINT(me->v1),
+ POINTER_FROM_UINT(me->v2), crease, &e);
((int *)ccgSubSurf_getEdgeUserData(ss, e))[1] = (index) ? *index++ : i;
}
@@ -736,14 +736,14 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
ml = mloop + mp->loopstart;
for (j = 0; j < mp->totloop; j++, ml++) {
- fVerts[j] = SET_UINT_IN_POINTER(ml->v);
+ fVerts[j] = POINTER_FROM_UINT(ml->v);
}
/* this is very bad, means mesh is internally inconsistent.
* it is not really possible to continue without modifying
* other parts of code significantly to handle missing faces.
* since this really shouldn't even be possible we just bail.*/
- if (ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), mp->totloop,
+ if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), mp->totloop,
fVerts, &f) == eCCGError_InvalidValue)
{
static int hasGivenError = 0;
@@ -1398,7 +1398,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
CCGEdge *e = ccgdm->edgeMap[index].edge;
short ed_flag = 0;
int x;
- int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
+ int edgeIdx = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e));
if (!ccgSubSurf_getEdgeNumFaces(e)) {
ed_flag |= ME_LOOSEEDGE;
@@ -1502,19 +1502,19 @@ static void copyFinalLoopArray_task_cb(
edge_size, grid_size);
ml->v = v1;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v1, v2));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v1, v2));
ml++;
ml->v = v2;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v2, v3));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v2, v3));
ml++;
ml->v = v3;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v3, v4));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v3, v4));
ml++;
ml->v = v4;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v4, v1));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v4, v1));
ml++;
}
}
@@ -1536,7 +1536,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
medge = ccgdm->dm.getEdgeArray((DerivedMesh *)ccgdm);
for (int i = 0; i < ccgdm->dm.numEdgeData; i++) {
- BLI_edgehash_insert(ehash, medge[i].v1, medge[i].v2, SET_INT_IN_POINTER(i));
+ BLI_edgehash_insert(ehash, medge[i].v1, medge[i].v2, POINTER_FROM_INT(i));
}
atomic_cas_ptr((void **)&ccgdm->ehash, ccgdm->ehash, ehash);
@@ -1623,7 +1623,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v;
+ vertMap2[POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v))] = v;
}
totedge = ccgSubSurf_getNumEdges(ss);
@@ -1631,7 +1631,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initEdgeIterator(ss, &ei), i = 0; !ccgEdgeIterator_isStopped(&ei); i++, ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
- edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
+ edgeMap2[POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
}
totface = ccgSubSurf_getNumFaces(ss);
@@ -1639,7 +1639,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap2[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
i = 0;
@@ -2472,7 +2472,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v;
+ ccgdm->vertMap[POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v))].vert = v;
}
totedge = ccgSubSurf_getNumEdges(ss);
@@ -2483,7 +2483,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
- ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
+ ccgdm->edgeMap[POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
}
totface = ccgSubSurf_getNumFaces(ss);
@@ -2494,7 +2494,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))].face = f;
+ ccgdm->faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))].face = f;
}
}
@@ -2568,7 +2568,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges);
- int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int origIndex = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int g2_wid = gridCuts + 2;
float *w, *w2;
int s, x, y;
@@ -2602,7 +2602,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
#endif
for (s = 0; s < numVerts; s++) {
CCGVert *v = ccgSubSurf_getFaceVert(f, s);
- vertidx[s] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertidx[s] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
}
/*I think this is for interpolating the center vert?*/
@@ -2715,13 +2715,13 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
int mapIndex = ccgDM_getEdgeMapIndex(ss, e);
int x;
int vertIdx[2];
- int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
+ int edgeIdx = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e));
CCGVert *v;
v = ccgSubSurf_getEdgeVert0(e);
- vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx[0] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
v = ccgSubSurf_getEdgeVert1(e);
- vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx[1] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
ccgdm->edgeMap[index].startVert = vertNum;
ccgdm->edgeMap[index].startEdge = edgeNum;
@@ -2775,7 +2775,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
int mapIndex = ccgDM_getVertMapIndex(ccgdm->ss, v);
int vertIdx;
- vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
ccgdm->vertMap[index].startVert = vertNum;
@@ -3060,7 +3060,7 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ int idx = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
int N = ccgSubSurf_getVertNumEdges(v);
int numFaces = ccgSubSurf_getVertNumFaces(v);
float *co;