From 29dd6e48ec0723544f8140a212b6ca3e9e4fc575 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 11 Feb 2023 18:30:34 +0100 Subject: [PATCH] renderer: fix scan-build warning It doesn't like referencing values as part of the same struct initialization. --- src/renderer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderer.c b/src/renderer.c index 66607316..f790a115 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -1643,12 +1643,11 @@ static bool pass_read_image(struct pass_state *pass) // For quality reasons, explicitly drop subpixel offsets from the ref rect // and re-add them as part of `pass->img.rect`, always rounding towards 0. // Additionally, drop anamorphic subpixel mismatches. - struct pl_rect2d ref_rounded = { - .x0 = truncf(ref->img.rect.x0), - .y0 = truncf(ref->img.rect.y0), - .x1 = ref_rounded.x0 + roundf(pl_rect_w(ref->img.rect)), - .y1 = ref_rounded.y0 + roundf(pl_rect_h(ref->img.rect)), - }; + struct pl_rect2d ref_rounded; + ref_rounded.x0 = truncf(ref->img.rect.x0); + ref_rounded.y0 = truncf(ref->img.rect.y0); + ref_rounded.x1 = ref_rounded.x0 + roundf(pl_rect_w(ref->img.rect)); + ref_rounded.y1 = ref_rounded.y0 + roundf(pl_rect_h(ref->img.rect)); PL_TRACE(rr, "Rounded reference rect: {%d %d %d %d}", ref_rounded.x0, ref_rounded.y0,