fix for type mismatch with SWAP() macro.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 25 Aug 2012 19:43:15 +0000 (19:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 25 Aug 2012 19:43:15 +0000 (19:43 +0000)
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/curve/editcurve.c
source/blender/editors/sculpt_paint/paint_image.c

index d2b8ec2cc0244db1cd51055c0ae289b6bb55c855..664172f28514829f89d22abac018672cfd2af0d4 100644 (file)
@@ -3094,11 +3094,11 @@ void BKE_nurb_direction_switch(Nurb *nu)
                                swapdata(bezt2->vec[0], bezt2->vec[2], 12);
 
                        SWAP(char, bezt1->h1, bezt1->h2);
-                       SWAP(short, bezt1->f1, bezt1->f3);
+                       SWAP(char, bezt1->f1, bezt1->f3);
 
                        if (bezt1 != bezt2) {
                                SWAP(char, bezt2->h1, bezt2->h2);
-                               SWAP(short, bezt2->f1, bezt2->f3);
+                               SWAP(char, bezt2->f1, bezt2->f3);
                                bezt1->alfa = -bezt1->alfa;
                                bezt2->alfa = -bezt2->alfa;
                        }
index f5ae3c7da2b3613b54739b838ad2d12412a0a6d9..8c3ec7e2e4085f58be9759ad982edb7c801d29ae 100644 (file)
@@ -2702,13 +2702,13 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
 #endif
                {
                        /* sort loop indices to ensure winding is correct */
-                       if (mf->v1 > mf->v2) SWAP(int, mf->v1, mf->v2);
-                       if (mf->v2 > mf->v3) SWAP(int, mf->v2, mf->v3);
-                       if (mf->v1 > mf->v2) SWAP(int, mf->v1, mf->v2);
+                       if (mf->v1 > mf->v2) SWAP(unsigned int, mf->v1, mf->v2);
+                       if (mf->v2 > mf->v3) SWAP(unsigned int, mf->v2, mf->v3);
+                       if (mf->v1 > mf->v2) SWAP(unsigned int, mf->v1, mf->v2);
 
-                       if (mf->v1 > mf->v2) SWAP(int, mf->v1, mf->v2);
-                       if (mf->v2 > mf->v3) SWAP(int, mf->v2, mf->v3);
-                       if (mf->v1 > mf->v2) SWAP(int, mf->v1, mf->v2);
+                       if (mf->v1 > mf->v2) SWAP(unsigned int, mf->v1, mf->v2);
+                       if (mf->v2 > mf->v3) SWAP(unsigned int, mf->v2, mf->v3);
+                       if (mf->v1 > mf->v2) SWAP(unsigned int, mf->v1, mf->v2);
                }
 
                /* end abusing the edcode */
index 17764fa9775057bc439ec08c8e379ea124c40dae..3bcef50a3b457ec32766efd765c8b2790391952e 100644 (file)
@@ -3627,8 +3627,8 @@ int BKE_sequence_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
        SWAP(float, seq_a->blend_opacity, seq_b->blend_opacity);
 
 
-       SWAP(void *, seq_a->prev, seq_b->prev);
-       SWAP(void *, seq_a->next, seq_b->next);
+       SWAP(Sequence *, seq_a->prev, seq_b->prev);
+       SWAP(Sequence *, seq_a->next, seq_b->next);
        SWAP(int, seq_a->start, seq_b->start);
        SWAP(int, seq_a->startofs, seq_b->startofs);
        SWAP(int, seq_a->endofs, seq_b->endofs);
index bc154de9691a1cc2d3b06ee1de07e2d899ff9e19..e2d15897233bf8599be567d0bff3234ef171bdb4 100644 (file)
@@ -1938,7 +1938,7 @@ static void adduplicateflagNurb(Object *obedit, short flag)
                                }
                                else {
 
-                                       if (newu == 1) SWAP(short, newu, newv);
+                                       if (newu == 1) SWAP(int, newu, newv);
 
                                        newnu = (Nurb *)MEM_mallocN(sizeof(Nurb), "adduplicateN5");
                                        memcpy(newnu, nu, sizeof(Nurb));
index d916ee299b6448fd21f1c147f06dd2bc23bc4811..953215b83aa2d2adafa0dda1f81265fa32da113d 100644 (file)
@@ -388,7 +388,11 @@ typedef struct UndoImageTile {
        char idname[MAX_ID_NAME];  /* name instead of pointer*/
        char ibufname[IB_FILENAME_SIZE];
 
-       void *rect;
+       union {
+               float        *fp;
+               unsigned int *uint;
+               void         *pt;
+       } rect;
        int x, y;
 
        short source, use_float;
@@ -406,10 +410,10 @@ static void undo_copy_tile(UndoImageTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, int
                    tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
 
        if (ibuf->rect_float) {
-               SWAP(void *, tmpibuf->rect_float, tile->rect);
+               SWAP(float *, tmpibuf->rect_float, tile->rect.fp);
        }
        else {
-               SWAP(void *, tmpibuf->rect, tile->rect);
+               SWAP(unsigned int *, tmpibuf->rect, tile->rect.uint);
        }
        
        if (restore)
@@ -428,7 +432,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
                if (tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type && ima->source == tile->source)
                        if (tile->use_float == use_float)
                                if (strcmp(tile->idname, ima->id.name) == 0 && strcmp(tile->ibufname, ibuf->name) == 0)
-                                       return tile->rect;
+                                       return tile->rect.pt;
        
        if (*tmpibuf == NULL)
                *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat | IB_rect);
@@ -440,7 +444,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
 
        allocsize = IMAPAINT_TILE_SIZE * IMAPAINT_TILE_SIZE * 4;
        allocsize *= (ibuf->rect_float) ? sizeof(float) : sizeof(char);
-       tile->rect = MEM_mapallocN(allocsize, "UndeImageTile.rect");
+       tile->rect.pt = MEM_mapallocN(allocsize, "UndeImageTile.rect");
 
        BLI_strncpy(tile->ibufname, ibuf->name, sizeof(tile->ibufname));
 
@@ -453,7 +457,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
 
        BLI_addtail(lb, tile);
        
-       return tile->rect;
+       return tile->rect.pt;
 }
 
 static void image_undo_restore(bContext *C, ListBase *lb)
@@ -517,7 +521,7 @@ static void image_undo_free(ListBase *lb)
        UndoImageTile *tile;
 
        for (tile = lb->first; tile; tile = tile->next)
-               MEM_freeN(tile->rect);
+               MEM_freeN(tile->rect.pt);
 }
 
 /* get active image for face depending on old/new shading system */
@@ -4545,15 +4549,15 @@ static int imapaint_canvas_set(ImagePaintState *s, Image *ima)
 
                /* temporarily add float rect for cloning */
                if (s->canvas->rect_float && !s->clonecanvas->rect_float) {
-                       int profile = IB_PROFILE_NONE;
+                       short profile = IB_PROFILE_NONE;
                        
                        /* Don't want to color manage, but don't disturb existing profiles */
-                       SWAP(int, s->clonecanvas->profile, profile);
+                       SWAP(short, s->clonecanvas->profile, profile);
 
                        IMB_float_from_rect(s->clonecanvas);
                        s->clonefreefloat = 1;
                        
-                       SWAP(int, s->clonecanvas->profile, profile);
+                       SWAP(short, s->clonecanvas->profile, profile);
                }
                else if (!s->canvas->rect_float && !s->clonecanvas->rect)
                        IMB_rect_from_float(s->clonecanvas);