summaryrefslogtreecommitdiff
path: root/src/Picture.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-28 11:41:27 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-07 17:59:53 +0000
commit229c65d2dd6de511a005127245dc28d426ad6860 (patch)
treef88bf8b46f5679ed92e12318347640ecd61dfb03 /src/Picture.c
parentcc4ad7a3990826ca44470dbca3a5b03c35548cab (diff)
downloadxorg-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/Picture.c')
-rw-r--r--src/Picture.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Picture.c b/src/Picture.c
index d9d6913..500eef1 100644
--- a/src/Picture.c
+++ b/src/Picture.c
@@ -172,15 +172,17 @@ XRenderSetPictureClipRegion (Display *dpy,
Region r)
{
XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
- int i;
- XRectangle *xr, *pr;
- BOX *pb;
+ XRectangle *xr;
unsigned long total;
RenderSimpleCheckExtension (dpy, info);
LockDisplay(dpy);
total = r->numRects * sizeof (XRectangle);
if ((xr = (XRectangle *) _XAllocTemp(dpy, total))) {
+ int i;
+ XRectangle *pr;
+ BOX *pb;
+
for (pr = xr, pb = r->rects, i = r->numRects; --i >= 0; pr++, pb++) {
pr->x = pb->x1;
pr->y = pb->y1;