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>2019-08-15 21:54:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-15 23:44:25 +0300
commit266e7b67fd3e2c219d8646e37a2fb3e393df4bda (patch)
tree5d28c4aafc81502e447c733d9c4f2c82b78172d4 /source/blender/editors/sculpt_paint/paint_image_undo.c
parent0f79c346c63f21f246ab636d74eea9b7aa874a33 (diff)
Cleanup: use boolean
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_undo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c
index c7ec4f3f2b9..93dcd3ad0f6 100644
--- a/source/blender/editors/sculpt_paint/paint_image_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_image_undo.c
@@ -75,7 +75,8 @@ typedef struct UndoImageTile {
* adds unnecessary overhead restoring undo steps when most tiles share the same image. */
UndoRefID_Image image_ref;
- short source, use_float;
+ short source;
+ bool use_float;
char gen_type;
bool valid;
@@ -172,7 +173,7 @@ void *image_undo_find_tile(ListBase *undo_tiles,
bool validate)
{
UndoImageTile *tile;
- short use_float = ibuf->rect_float ? 1 : 0;
+ const bool use_float = (ibuf->rect_float != NULL);
for (tile = undo_tiles->first; tile; tile = tile->next) {
if (tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type &&
@@ -214,7 +215,7 @@ void *image_undo_push_tile(ListBase *undo_tiles,
{
UndoImageTile *tile;
int allocsize;
- short use_float = ibuf->rect_float ? 1 : 0;
+ const bool use_float = (ibuf->rect_float != NULL);
void *data;
/* check if tile is already pushed */
@@ -315,7 +316,6 @@ static void image_undo_restore_list(ListBase *lb)
IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat | IB_rect);
for (UndoImageTile *tile = lb->first; tile; tile = tile->next) {
- short use_float;
Image *ima = tile->image_ref.ptr;
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
@@ -341,7 +341,7 @@ static void image_undo_restore_list(ListBase *lb)
continue;
}
- use_float = ibuf->rect_float ? 1 : 0;
+ const bool use_float = (ibuf->rect_float != NULL);
if (use_float != tile->use_float) {
BKE_image_release_ibuf(ima, ibuf, NULL);
@@ -450,7 +450,7 @@ static bool image_undosys_step_encode(struct bContext *C,
tile = tmp_tile;
}
else {
- us->step.data_size += allocsize * ((tile->use_float) ? sizeof(float) : sizeof(char));
+ us->step.data_size += allocsize * (tile->use_float ? sizeof(float) : sizeof(char));
tile = tile->next;
}
}