Skip to content

Commit

Permalink
renderer: fix scan-build warning
Browse files Browse the repository at this point in the history
It doesn't like referencing values as part of the same struct
initialization.
  • Loading branch information
haasn committed Feb 11, 2023
1 parent 135e8f9 commit 29dd6e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 29dd6e4

Please sign in to comment.