summaryrefslogtreecommitdiff
path: root/src/XrrCrtc.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-17 17:24:23 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-17 17:24:23 -0700
commit8710ed270fbb9ec905b906826cb09095c57003f8 (patch)
treebf5c24943bd7e3251feb084c519836194e456383 /src/XrrCrtc.c
parent684ed1b997f9e8a2fe2219524c1dea04b20a7e25 (diff)
Variable scope reductions as recommended by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/XrrCrtc.c')
-rw-r--r--src/XrrCrtc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 8316b78..2da7ed2 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -375,11 +375,9 @@ XRRGetCrtcTransform (Display *dpy,
{
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRGetCrtcTransformReply rep;
- xRRGetCrtcTransformReq *req;
int major_version, minor_version;
XRRCrtcTransformAttributes *attr;
char *extra = NULL, *end = NULL, *e;
- int p;
*attributes = NULL;
@@ -398,6 +396,8 @@ XRRGetCrtcTransform (Display *dpy,
}
else
{
+ xRRGetCrtcTransformReq *req;
+
LockDisplay (dpy);
GetReq (RRGetCrtcTransform, req);
req->reqType = info->codes->major_opcode;
@@ -466,7 +466,7 @@ XRRGetCrtcTransform (Display *dpy,
memcpy (attr->pendingFilter, e, rep.pendingNbytesFilter);
attr->pendingFilter[rep.pendingNbytesFilter] = '\0';
e += (rep.pendingNbytesFilter + 3) & ~3;
- for (p = 0; p < rep.pendingNparamsFilter; p++) {
+ for (unsigned int p = 0; p < rep.pendingNparamsFilter; p++) {
INT32 f;
if (e + 4 > end) {
XFree (attr);
@@ -487,7 +487,7 @@ XRRGetCrtcTransform (Display *dpy,
memcpy (attr->currentFilter, e, rep.currentNbytesFilter);
attr->currentFilter[rep.currentNbytesFilter] = '\0';
e += (rep.currentNbytesFilter + 3) & ~3;
- for (p = 0; p < rep.currentNparamsFilter; p++) {
+ for (unsigned int p = 0; p < rep.currentNparamsFilter; p++) {
INT32 f;
if (e + 4 > end) {
XFree (attr);