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>2012-08-25 23:43:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-25 23:43:15 +0400
commit699b23ecdbaa98c78c9a0685253c3a0ee354f194 (patch)
tree86bb272a18fab988c3ffa11298836cf14c0e6d51 /source/blender/editors/sculpt_paint
parent7caff79a1a029312a7788239007c915ae0daa66a (diff)
fix for type mismatch with SWAP() macro.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d916ee299b6..953215b83aa 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -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);