svn merge -r 16060:16222 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / blenkernel / intern / DerivedMesh.c
index 3772c2d06aec9b6903da4a6486bc475cd8d2f65c..03d45cce8887609c04dffb9052475be8834e5580 100644 (file)
@@ -78,6 +78,8 @@
 #include "BKE_utildefines.h"
 #include "BKE_particle.h"
 
+#include "BLO_sys_types.h" // for intptr_t support
+
 #ifdef WITH_VERSE
 #include "BKE_verse.h"
 #endif
@@ -453,7 +455,7 @@ static void emDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData,
                EditVert *eve;
 
                for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
                for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next)
                        func(userData, i, emdm->vertexCos[(int) eed->v1->tmp.l], emdm->vertexCos[(int) eed->v2->tmp.l]);
        } else {
@@ -471,7 +473,7 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
                EditVert *eve;
 
                for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
 
                glBegin(GL_LINES);
                for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) {
@@ -506,7 +508,7 @@ static void emDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(vo
                EditVert *eve;
 
                for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
 
                glBegin(GL_LINES);
                for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) {
@@ -593,7 +595,7 @@ static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use
 
        if (emdm->vertexCos) {
                for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
        }
 
        for(i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) {
@@ -611,7 +613,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
                EditVert *eve;
 
                for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
 
                for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) {
                        int drawSmooth = (efa->flag & ME_SMOOTH);
@@ -707,7 +709,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
                EditVert *eve;
 
                for (i=0,eve=em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
 
                for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) {
                        MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -1027,7 +1029,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
 
        /* store vertex indices in tmp union */
        for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
-               ev->tmp.l = (long) i;
+               ev->tmp.l = (intptr_t) i;
 
        for( ; ee; ee = ee->next, ++edge_r) {
                edge_r->crease = (unsigned char) (ee->crease*255.0f);
@@ -1055,7 +1057,7 @@ void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
 
        /* store vertexes indices in tmp union */
        for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
-               ev->tmp.l = (long) i;
+               ev->tmp.l = (intptr_t) i;
 
        for( ; ef; ef = ef->next, ++face_r) {
                face_r->mat_nr = ef->mat_nr;
@@ -1142,7 +1144,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
                int i;
 
                for (i=0,eve=em->verts.first; eve; eve= eve->next)
-                       eve->tmp.l = (long) i++;
+                       eve->tmp.l = (intptr_t) i++;
 
                emdm->vertexNos = MEM_callocN(sizeof(*emdm->vertexNos)*i, "emdm_vno");
                emdm->faceNos = MEM_mallocN(sizeof(*emdm->faceNos)*totface, "emdm_vno");