diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-28 11:41:27 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-07 17:59:53 +0000 |
commit | 229c65d2dd6de511a005127245dc28d426ad6860 (patch) | |
tree | f88bf8b46f5679ed92e12318347640ecd61dfb03 /src/Poly.c | |
parent | cc4ad7a3990826ca44470dbca3a5b03c35548cab (diff) | |
download | xorg-lib-libXrender-229c65d2dd6de511a005127245dc28d426ad6860.tar.gz |
Reduce variable scopes as recommended by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Poly.c')
-rw-r--r-- | src/Poly.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -245,8 +245,8 @@ XRenderCompositeDoublePoly (Display *dpy, { Edge *edges; XTrapezoid *traps; - int i, nedges, ntraps; - XFixed x, y, prevx = 0, prevy = 0, firstx = 0, firsty = 0; + int nedges, ntraps; + XFixed prevx = 0, prevy = 0, firstx = 0, firsty = 0; XFixed top = 0, bottom = 0; /* GCCism */ edges = Xmalloc ((npoints * sizeof (Edge)) + @@ -255,8 +255,10 @@ XRenderCompositeDoublePoly (Display *dpy, return; traps = (XTrapezoid *) (edges + npoints); nedges = 0; - for (i = 0; i <= npoints; i++) + for (int i = 0; i <= npoints; i++) { + XFixed x, y; + if (i == npoints) { x = firstx; |