Scanfill: avoid converting int<>intptr_t for displist indices
authorCampbell Barton <ideasman42@gmail.com>
Wed, 5 Feb 2014 14:07:18 +0000 (01:07 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 5 Feb 2014 14:07:18 +0000 (01:07 +1100)
source/blender/blenkernel/intern/displist.c
source/blender/blenlib/BLI_scanfill.h

index e2c87e08b549a786717cea572781aae109555f48..ee2c42d33cdabdfaa8bba40c8dd2e350247f8446 100644 (file)
@@ -458,7 +458,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj
        DispList *dlnew = NULL, *dl;
        float *f1;
        int colnr = 0, charidx = 0, cont = 1, tot, a, *index, nextcol = 0;
-       intptr_t totvert;
+       int totvert;
 
        if (dispbase == NULL)
                return;
@@ -541,23 +541,22 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj
                                        f1 += 3;
 
                                        /* index number */
-                                       sf_vert->tmp.l = totvert;
+                                       sf_vert->tmp.i = totvert;
                                        totvert++;
                                }
 
                                /* index data */
-                               sf_tri = sf_ctx.fillfacebase.first;
+
                                index = dlnew->index;
-                               while (sf_tri) {
-                                       index[0] = (intptr_t)sf_tri->v1->tmp.l;
-                                       index[1] = (intptr_t)sf_tri->v2->tmp.l;
-                                       index[2] = (intptr_t)sf_tri->v3->tmp.l;
+                               for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
+                                       index[0] = sf_tri->v1->tmp.i;
+                                       index[1] = sf_tri->v2->tmp.i;
+                                       index[2] = sf_tri->v3->tmp.i;
 
                                        if (flipnormal)
                                                SWAP(int, index[0], index[2]);
 
                                        index += 3;
-                                       sf_tri = sf_tri->next;
                                }
                        }
 
index 4639ddbb26aba156e31ce1cc6c40427a5fdec78b..8e5445b6af278a1ad9158c00c6fc1cf68065e27b 100644 (file)
@@ -61,7 +61,7 @@ typedef struct ScanFillVert {
        union {
                struct ScanFillVert *v;
                void                *p;
-               intptr_t             l;
+               int                  i;
                unsigned int         u;
        } tmp;
        float co[3];  /* vertex location */