From 29b13fa3cae61bff3707d6a3d844188f21dda06c Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Tue, 21 Sep 2021 20:01:16 +0200 Subject: Cleanup: Clang-tidy warnings --- .../editors/space_sequencer/sequencer_draw.c | 26 +++++++++++++--------- source/blender/sequencer/SEQ_render.h | 4 ++-- source/blender/sequencer/intern/render.c | 4 ++-- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index a6a83b0c3bc..6edf2413e87 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1393,7 +1393,7 @@ static float seq_thumbnail_get_start_frame(Sequence *seq, float frame_step, rctf return ((no_invisible_thumbs - 1) * frame_step) + seq->start; } -static void thumbnail_start_job(void *data, short *stop, short *do_update, float *progress) +static void thumbnail_start_job(void *data, const short *stop, const short *do_update, const float *progress) { ThumbnailDrawJob *tj = data; float start_frame, frame_step; @@ -1627,24 +1627,28 @@ static ImBuf *sequencer_thumbnail_closest_from_memory(const SeqRenderData *conte int frame_guaranteed = sequencer_thumbnail_closest_guaranteed_frame_get(seq, timeline_frame); ImBuf *ibuf_guaranteed = SEQ_get_thumbnail(context, seq, frame_guaranteed, crop, clipped); - if (ibuf_previous && ibuf_guaranteed && - abs(frame_previous - timeline_frame) < abs(frame_guaranteed - timeline_frame)) { + ImBuf *closest_in_memory = NULL; - IMB_freeImBuf(ibuf_guaranteed); - return ibuf_previous; - } - else { - IMB_freeImBuf(ibuf_previous); - return ibuf_guaranteed; + if (ibuf_previous && ibuf_guaranteed) { + if (abs(frame_previous - timeline_frame) < abs(frame_guaranteed - timeline_frame)) { + IMB_freeImBuf(ibuf_guaranteed); + closest_in_memory = ibuf_previous; + } + else { + IMB_freeImBuf(ibuf_previous); + closest_in_memory = ibuf_guaranteed; + } } if (ibuf_previous == NULL) { - return ibuf_guaranteed; + closest_in_memory = ibuf_guaranteed; } if (ibuf_guaranteed == NULL) { - return ibuf_previous; + closest_in_memory = ibuf_previous; } + + return closest_in_memory; } static void draw_seq_strip_thumbnail(View2D *v2d, diff --git a/source/blender/sequencer/SEQ_render.h b/source/blender/sequencer/SEQ_render.h index 50280db55ff..e99dc6d344f 100644 --- a/source/blender/sequencer/SEQ_render.h +++ b/source/blender/sequencer/SEQ_render.h @@ -75,7 +75,7 @@ void SEQ_render_thumbnails(const struct SeqRenderData *context, float start_frame, float frame_step, rctf *view_area, - short *stop); + const short *stop); struct ImBuf *SEQ_get_thumbnail(const struct SeqRenderData *context, struct Sequence *seq, float timeline_frame, @@ -86,7 +86,7 @@ void SEQ_render_thumbnails_base_set(const struct SeqRenderData *context, struct Sequence *seq, struct Sequence *seq_orig, rctf *view_area, - short *stop); + const short *stop); void SEQ_render_init_colorspace(struct Sequence *seq); void SEQ_render_new_render_data(struct Main *bmain, diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index b2642228c91..2578a6d4223 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -1990,7 +1990,7 @@ void SEQ_render_thumbnails(const SeqRenderData *context, float start_frame, float frame_step, rctf *view_area, - short *stop) + const short *stop) { SeqRenderState state; seq_render_state_init(&state); @@ -2044,7 +2044,7 @@ int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Sequence *seq) /* Render set of evenly spaced thumbnails that are drawn when zooming. */ void SEQ_render_thumbnails_base_set( - const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, rctf *view_area, short *stop) + const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, rctf *view_area, const short *stop) { SeqRenderState state; seq_render_state_init(&state); -- cgit v1.2.3