summaryrefslogtreecommitdiff
path: root/src/XTest.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-18 19:12:42 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-18 19:12:42 -0700
commitafc015217221acd8667a96111b147f3a742a2c4e (patch)
tree27045d1bc7703f0c3c3d3b5d6cbf45e53ecc4f92 /src/XTest.c
parentff3456b04e1b42fd77e0db061bf7a563108b5868 (diff)
downloadxorg-lib-libXtst-afc015217221acd8667a96111b147f3a742a2c4e.tar.gz
Variable scope reductions as suggested by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/XTest.c')
-rw-r--r--src/XTest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/XTest.c b/src/XTest.c
index e534ee4..2e53700 100644
--- a/src/XTest.c
+++ b/src/XTest.c
@@ -99,10 +99,11 @@ XTestQueryExtension (Display *dpy,
int *major_return, int *minor_return)
{
XExtDisplayInfo *info = find_display (dpy);
- register xXTestGetVersionReq *req;
xXTestGetVersionReply rep;
if (XextHasExtension(info)) {
+ xXTestGetVersionReq *req;
+
LockDisplay(dpy);
GetReq(XTestGetVersion, req);
req->reqType = info->codes->major_opcode;
@@ -259,7 +260,6 @@ send_axes(
int n_axes)
{
deviceValuator ev;
- int n;
req->deviceid |= MORE_EVENTS;
req->length += ((n_axes + 5) / 6) * (SIZEOF(xEvent) >> 2);
@@ -267,7 +267,7 @@ send_axes(
ev.deviceid = dev->device_id;
ev.first_valuator = first_axis;
while (n_axes > 0) {
- n = n_axes > 6 ? 6 : n_axes;
+ int n = n_axes > 6 ? 6 : n_axes;
ev.num_valuators = n;
switch (n) {
case 6:
@@ -433,11 +433,10 @@ Status
XTestDiscard(Display *dpy)
{
Bool something;
- register char *ptr;
LockDisplay(dpy);
if ((something = (dpy->bufptr != dpy->buffer))) {
- for (ptr = dpy->buffer;
+ for (char *ptr = dpy->buffer;
ptr < dpy->bufptr;
ptr += (((xReq *)ptr)->length << 2))
dpy->request--;