Module Name:    xsrc
Committed By:   mrg
Date:           Mon Jun 19 08:02:08 UTC 2023

Modified Files:
        xsrc/external/mit/xinput/dist/src: xinput.c
        xsrc/external/mit/xrdb/dist: xrdb.c
        xsrc/external/mit/xwininfo/dist: xwininfo.c
        xsrc/external/mit/xwininfo/include: config.h

Log Message:
merge xinput 1.6.4, xrdb 1.2.2, xwd 1.0.9, and xwininfo 1.1.6


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xinput/dist/src/xinput.c
cvs rdiff -u -r1.11 -r1.12 xsrc/external/mit/xrdb/dist/xrdb.c
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xwininfo/dist/xwininfo.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xwininfo/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xinput/dist/src/xinput.c
diff -u xsrc/external/mit/xinput/dist/src/xinput.c:1.5 xsrc/external/mit/xinput/dist/src/xinput.c:1.6
--- xsrc/external/mit/xinput/dist/src/xinput.c:1.5	Fri Jul 19 07:29:35 2019
+++ xsrc/external/mit/xinput/dist/src/xinput.c	Mon Jun 19 08:02:08 2023
@@ -105,7 +105,7 @@ static entry drivers[] =
       test_xi2,
     },
     { "map-to-output",
-      "<device> <output name>",
+      "<device> <output name>|all",
       map_to_output,
     },
 #endif
@@ -352,7 +352,7 @@ usage(void)
 {
     entry	*pdriver = drivers;
 
-    fprintf(stderr, "usage :\n");
+    fprintf(stderr, "usage:\n");
 
     while(pdriver->func_name) {
 	fprintf(stderr, "\txinput %s %s\n", pdriver->func_name,
@@ -388,6 +388,7 @@ main(int argc, char * argv[])
     entry	*driver = drivers;
     char        *func;
     int event, error;
+    int xwl_op, xwl_ev, xwl_err;
 
     if (argc > 1) {
 	func = argv[1];
@@ -422,7 +423,7 @@ main(int argc, char * argv[])
 	goto out;
     }
 
-    if (is_xwayland(display))
+    if (XQueryExtension(display, "XWAYLAND", &xwl_op, &xwl_ev, &xwl_err) || is_xwayland(display))
         fprintf(stderr, "WARNING: running xinput against an Xwayland server. See the xinput man page for details.\n");
 
     while(driver->func_name) {

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.11 xsrc/external/mit/xrdb/dist/xrdb.c:1.12
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.11	Mon Aug 23 21:28:58 2021
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Mon Jun 19 08:02:08 2023
@@ -168,25 +168,24 @@ asprintf(char **ret, const char *format,
     if (len < 0)
         return -1;
 
+    *ret = malloc(len + 1); /* snprintf doesn't count trailing '\0' */
+    if (*ret == NULL)
+        return -1;
+
     if (len < sizeof(buf)) {
-        *ret = strdup(buf);
+        memcpy(*ret, buf, len + 1);
     }
     else {
-        *ret = malloc(len + 1); /* snprintf doesn't count trailing '\0' */
-        if (*ret != NULL) {
-            va_start(ap, format);
-            len = vsnprintf(*ret, len + 1, format, ap);
-            va_end(ap);
-            if (len < 0) {
-                free(*ret);
-                *ret = NULL;
-            }
+        va_start(ap, format);
+        len = vsnprintf(*ret, len + 1, format, ap);
+        va_end(ap);
+        if (len < 0) {
+            free(*ret);
+            *ret = NULL;
+            return -1;
         }
     }
 
-    if (*ret == NULL)
-        return -1;
-
     return len;
 }
 #endif                          /* HAVE_ASPRINTF */
@@ -249,9 +248,7 @@ InitEntries(Entries *e)
 static void
 FreeEntries(Entries *e)
 {
-    size_t i;
-
-    for (i = 0; i < e->used; i++) {
+    for (size_t i = 0; i < e->used; i++) {
         if (e->entry[i].usable) {
             free(e->entry[i].tag);
             free(e->entry[i].value);
@@ -263,9 +260,7 @@ FreeEntries(Entries *e)
 static void
 AddEntry(Entries *e, Entry *entry)
 {
-    size_t n;
-
-    for (n = 0; n < e->used; n++) {
+    for (size_t n = 0; n < e->used; n++) {
         if (!strcmp(e->entry[n].tag, entry->tag)) {
             /* overwrite old entry */
             if (e->entry[n].lineno && !quiet) {
@@ -403,11 +398,12 @@ GetEntries(Entries *entries, Buffer *buf
 static void
 GetEntriesString(Entries *entries, char *str)
 {
-    Buffer buff;
-
     if (str && *str) {
-        buff.buff = str;
-        buff.used = strlen(str);
+        Buffer buff = {
+            .buff = str,
+            .used = strlen(str)
+        };
+
         GetEntries(entries, &buff, 1);
     }
 }
@@ -512,13 +508,12 @@ AddDefTok(String *buff, const char *pref
 static void
 AddDefHostname(String *buff, const char *title, const char *value)
 {
-    char *s;
     char name[512];
     char c;
 
     strncpy(name, value, sizeof(name) - 1);
     name[sizeof(name) - 1] = '\0';
-    for (s = name; (c = *s); s++) {
+    for (char *s = name; (c = *s); s++) {
         if (!isalpha(c) && !isdigit(c) &&
             c != '_' && c != '.' && c != ':' && c != '-')
             *s = '_';
@@ -550,13 +545,10 @@ AddUndef(String *buff, const char *title
 static void
 DoCmdDefines(String *buff)
 {
-    int i;
-    char *arg, *val;
-
-    for (i = 0; i < num_cmd_defines; i++) {
-        arg = cmd_defines[i];
+    for (int i = 0; i < num_cmd_defines; i++) {
+        char *arg = cmd_defines[i];
         if (arg[1] == 'D') {
-            val = strchr(arg, '=');
+            char *val = strchr(arg, '=');
             if (val) {
                 *val = '\0';
                 AddDefQ(buff, arg + 2, val + 1);
@@ -647,8 +639,7 @@ DoScreenDefines(Display *display, int sc
     Screen *screen;
     Visual *visual;
     XVisualInfo vinfo, *vinfos;
-    int nv, i, j;
-    char name[50];
+    int nv;
 
     screen = ScreenOfDisplay(display, scrno);
     visual = DefaultVisualOfScreen(screen);
@@ -662,6 +653,8 @@ DoScreenDefines(Display *display, int sc
     AddNum(defs, "PLANES", DisplayPlanes(display, scrno));
     AddNum(defs, "BITS_PER_RGB", visual->bits_per_rgb);
     if (visual->class >= 0 && visual->class < NUM_CLASS_NAMES) {
+        char name[50];
+
         AddDefQ(defs, "CLASS", ClassNames[visual->class]);
         snprintf(name, sizeof(name), "CLASS_%s", ClassNames[visual->class]);
         AddNum(defs, name, (int) visual->visualid);
@@ -679,7 +672,9 @@ DoScreenDefines(Display *display, int sc
         AddSimpleDef(defs, "COLOR");
         break;
     }
-    for (i = 0; i < nv; i++) {
+    for (int i = 0; i < nv; i++) {
+        int j;
+
         for (j = i; --j >= 0;) {
             if (vinfos[j].class == vinfos[i].class &&
                 vinfos[j].depth == vinfos[i].depth)
@@ -687,6 +682,8 @@ DoScreenDefines(Display *display, int sc
         }
         if (j < 0) {
             if (vinfos[i].class >= 0 && vinfos[i].class < NUM_CLASS_NAMES) {
+                char name[50];
+
                 snprintf(name, sizeof(name), "CLASS_%s_%d",
                          ClassNames[vinfos[i].class], vinfos[i].depth);
                 AddNum(defs, name, (int) vinfos[i].visualid);
@@ -704,22 +701,23 @@ DoScreenDefines(Display *display, int sc
 static Entry *
 FindEntry(Entries *db, Buffer *b)
 {
-    size_t i;
-    register Entry *e;
-    Entries phoney;
-    Entry entry;
+    Entry entry = {
+        .usable = False,
+        .tag = NULL,
+        .value = NULL
+    };
+    Entries phoney = {
+        .used = 0,
+        .room = 1,
+        .entry = &entry
+    };
 
-    entry.usable = False;
-    entry.tag = NULL;
-    entry.value = NULL;
-    phoney.used = 0;
-    phoney.room = 1;
-    phoney.entry = &entry;
     GetEntries(&phoney, b, 1);
     if (phoney.used < 1)
         return NULL;
-    for (i = 0; i < db->used; i++) {
-        e = &db->entry[i];
+    for (size_t i = 0; i < db->used; i++) {
+        Entry *e = &db->entry[i];
+
         if (!e->usable)
             continue;
         if (strcmp(e->tag, entry.tag))
@@ -736,15 +734,16 @@ static void
 EditFile(Entries *new, FILE *in, FILE *out)
 {
     Buffer b;
-    char buff[BUFSIZ];
-    register Entry *e;
-    register char *c;
-    size_t i;
 
     InitBuffer(&b);
     while (in) {
+        Entry *e;
+
         b.used = 0;
         while (1) {
+            char *c;
+            char buff[BUFSIZ];
+
             buff[0] = '\0';
             if (!fgets(buff, BUFSIZ, in))
                 goto cleanup;
@@ -761,8 +760,8 @@ EditFile(Entries *new, FILE *in, FILE *o
             fwrite(b.buff, 1, b.used, out);
     }
  cleanup:
-    for (i = 0; i < new->used; i++) {
-        e = &new->entry[i];
+    for (size_t i = 0; i < new->used; i++) {
+        Entry *e = &new->entry[i];
         if (e->usable)
             fprintf(out, "%s:\t%s\n", e->tag, e->value);
     }
@@ -896,7 +895,6 @@ addtokstring(String *arg, const char *s)
 int
 main(int argc, char *argv[])
 {
-    int i;
     char *displayname = NULL;
     int whichResources = RALL;
     int retainProp = 0;
@@ -917,28 +915,27 @@ main(int argc, char *argv[])
     if (cpp_program == NULL) {
         int number_of_elements
             = (sizeof cpp_locations) / (sizeof cpp_locations[0]);
-        int j;
 
-        for (j = 0; j < number_of_elements; j++) {
-            char *end, *dup;
+        for (int j = 0; j < number_of_elements; j++) {
+            char *end, *cmd;
 
             /* cut off arguments */
-            dup = strdup(cpp_locations[j]);
-            end = strchr(dup, ' ');
+            cmd = strdup(cpp_locations[j]);
+            end = strchr(cmd, ' ');
             if (end)
                 *end = '\0';
-            if (access(dup, X_OK) == 0) {
+            if (access(cmd, X_OK) == 0) {
                 cpp_program = cpp_locations[j];
-                free(dup);
+                free(cmd);
                 break;
             }
-            free(dup);
+            free(cmd);
         }
     }
 
     /* needs to be replaced with XrmParseCommand */
 
-    for (i = 1; i < argc; i++) {
+    for (int i = 1; i < argc; i++) {
         char *arg = argv[i];
 
         if (arg[0] == '-') {
@@ -1086,9 +1083,13 @@ main(int argc, char *argv[])
     }                           /* end for */
 
 #ifndef WIN32
-    while ((i = open("/dev/null", O_RDONLY)) < 3)
-        ;      /* make sure later freopen won't clobber things */
-    (void) close(i);
+    {
+        int fd;
+
+        while ((fd = open("/dev/null", O_RDONLY)) < 3)
+            ;      /* make sure later freopen won't clobber things */
+        (void) close(fd);
+    }
 #endif
     /* Open display  */
     if (!(dpy = XOpenDisplay(displayname)))
@@ -1164,7 +1165,7 @@ main(int argc, char *argv[])
             if (need_newline)
                 printf("\n");
         }
-        for (i = 0; i < ScreenCount(dpy); i++) {
+        for (int i = 0; i < ScreenCount(dpy); i++) {
             if (need_newline) {
                 if (oper == OPSYMBOLS)
                     printf("# screen %d symbols\n", i);
@@ -1188,7 +1189,7 @@ main(int argc, char *argv[])
         dbs = mallocarray(ScreenCount(dpy), sizeof(Entries));
         if (dbs == NULL)
             fatal("%s: Can't allocate memory in %s\n", ProgramName, __func__);
-        for (i = 0; i < ScreenCount(dpy); i++) {
+        for (int i = 0; i < ScreenCount(dpy); i++) {
             Process(i, True, False);
             dbs[i] = newDB;
         }
@@ -1201,7 +1202,7 @@ main(int argc, char *argv[])
         ReProcess(0, False);
         if (need_newline)
             printf("\n");
-        for (i = 0; i < ScreenCount(dpy); i++) {
+        for (int i = 0; i < ScreenCount(dpy); i++) {
             newDB = dbs[i];
             if (need_newline) {
                 printf("! screen %d resources\n", i);
@@ -1228,14 +1229,12 @@ main(int argc, char *argv[])
 static void
 FormatEntries(Buffer *b, Entries *entries)
 {
-    size_t i;
-
     b->used = 0;
     if (!entries->used)
         return;
     if (oper == OPMERGE)
         qsort(entries->entry, entries->used, sizeof(Entry), CompareEntries);
-    for (i = 0; i < entries->used; i++) {
+    for (size_t i = 0; i < entries->used; i++) {
         if (entries->entry[i].usable)
             AppendEntryToBuffer(b, &entries->entry[i]);
     }
@@ -1338,11 +1337,11 @@ Process(int scrno, Bool doScreen, Bool e
         fclose(output);
         snprintf(old, sizeof(old), "%s%s", editFile, backup_suffix);
         if (dont_execute) {     /* then write to standard out */
-            char buf[BUFSIZ];
-            size_t n;
-
             output = fopen(template, "r");
             if (output) {
+                char buf[BUFSIZ];
+                size_t n;
+
                 while ((n = fread(buf, 1, sizeof buf, output)) > 0) {
                     fwrite(buf, 1, n, stdout);
                 }
@@ -1487,19 +1486,21 @@ static void
 ShuffleEntries(Entries *db, Entries *dbs, unsigned int num)
 {
     unsigned int *hits;
-    unsigned int i, j, k;
-    Entries cur, cmp;
-    char *curtag, *curvalue;
+    Entries cur;
 
     hits = mallocarray(num, sizeof(int));
     if (hits == NULL)
         fatal("%s: Can't allocate memory in %s\n", ProgramName, __func__);
     cur = dbs[0];
-    for (i = 0; i < cur.used; i++) {
-        curtag = cur.entry[i].tag;
-        curvalue = cur.entry[i].value;
+    for (unsigned int i = 0; i < cur.used; i++) {
+        char *curtag = cur.entry[i].tag;
+        char *curvalue = cur.entry[i].value;
+        unsigned int j;
+
         for (j = 1; j < num; j++) {
-            cmp = dbs[j];
+            Entries cmp = dbs[j];
+            unsigned int k;
+
             for (k = 0; k < cmp.used; k++) {
                 if (cmp.entry[k].usable &&
                     !strcmp(curtag, cmp.entry[k].tag) &&

Index: xsrc/external/mit/xwininfo/dist/xwininfo.c
diff -u xsrc/external/mit/xwininfo/dist/xwininfo.c:1.8 xsrc/external/mit/xwininfo/dist/xwininfo.c:1.9
--- xsrc/external/mit/xwininfo/dist/xwininfo.c:1.8	Thu Oct 24 18:19:27 2019
+++ xsrc/external/mit/xwininfo/dist/xwininfo.c	Mon Jun 19 08:02:08 2023
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -343,11 +343,10 @@ scale_init (xcb_screen_t *scale_screen)
 static char *
 nscale (int n, int np, int nmm, char *nbuf, size_t nbufsize)
 {
-    int s;
     snprintf (nbuf, nbufsize, "%d", n);
 
     if (metric||english) {
-	s = strlcat (nbuf, " (", nbufsize);
+	int s = strlcat (nbuf, " (", nbufsize);
 
 	if (metric) {
 	    snprintf (nbuf+s, nbufsize-s, "%.2f mm%s",
@@ -356,13 +355,13 @@ nscale (int n, int np, int nmm, char *nb
 	if (english) {
 	    double inch_frac;
 	    Bool printed_anything = False;
-	    int mi, yar, ft, inr;
+	    int inr;
 
 	    inch_frac = ((double) n)*(nmm/25.4)/np;
 	    inr = (int)inch_frac;
 	    inch_frac -= (double)inr;
 	    if (inr >= MILE) {
-		mi = inr/MILE;
+		int mi = inr/MILE;
 		inr %= MILE;
 		s = strlen (nbuf);
 		snprintf (nbuf+s, nbufsize-s, "%d %s(?!?)",
@@ -370,7 +369,7 @@ nscale (int n, int np, int nmm, char *nb
 		printed_anything = True;
 	    }
 	    if (inr >= YARD) {
-		yar = inr/YARD;
+		int yar = inr/YARD;
 		inr %= YARD;
 		if (printed_anything)
 		    strlcat (nbuf, ", ", nbufsize);
@@ -380,7 +379,7 @@ nscale (int n, int np, int nmm, char *nb
 		printed_anything = True;
 	    }
 	    if (inr >= FOOT) {
-		ft = inr/FOOT;
+		int ft = inr/FOOT;
 		inr  %= FOOT;
 		if (printed_anything)
 		    strlcat (nbuf, ", ", nbufsize);
@@ -440,7 +439,6 @@ window_id_str (xcb_window_t id)
 int
 main (int argc, char **argv)
 {
-    register int i;
     int tree = 0, stats = 0, bits = 0, events = 0, wm = 0, size = 0, shape = 0;
     int frame = 0, children = 0;
     int use_root = 0;
@@ -461,7 +459,7 @@ main (int argc, char **argv)
     memset (w, 0, sizeof(struct wininfo));
 
     /* Handle our command line arguments */
-    for (i = 1; i < argc; i++) {
+    for (int i = 1; i < argc; i++) {
 	if (!strcmp (argv[i], "-help"))
 	    usage ();
 	if (!strcmp (argv[i], "-display") || !strcmp (argv[i], "-d")) {
@@ -745,9 +743,9 @@ wm_size_hints_reply (xcb_connection_t *w
 static xcb_size_hints_t *
 fetch_normal_hints (struct wininfo *w, xcb_size_hints_t *hints_return)
 {
-    xcb_size_hints_t hints;
-
     if (!w->normal_hints) {
+	xcb_size_hints_t hints;
+
 	if (xcb_icccm_get_wm_normal_hints_reply (dpy, w->normal_hints_cookie,
 						 &hints, NULL)) {
 	    w->normal_hints = malloc (sizeof(xcb_size_hints_t));
@@ -764,7 +762,6 @@ fetch_normal_hints (struct wininfo *w, x
 /*
  * Lookup: lookup a code in a table.
  */
-static char _lookup_buffer[100];
 
 static const char *
 LookupL (long code, const binding *table)
@@ -780,6 +777,8 @@ LookupL (long code, const binding *table
     }
 
     if (name == NULL) {
+	static char _lookup_buffer[100];
+
 	snprintf (_lookup_buffer, sizeof(_lookup_buffer),
 		  "unknown (code = %ld. = 0x%lx)", code, code);
 	name = _lookup_buffer;
@@ -1280,7 +1279,6 @@ Display_Tree_Info (struct wininfo *w, in
 static void
 display_tree_info_1 (struct wininfo *w, int recurse, int level)
 {
-    int i, j;
     unsigned int num_children;
     xcb_query_tree_reply_t *tree;
 
@@ -1311,7 +1309,7 @@ display_tree_info_1 (struct wininfo *w, 
 
     if (level == 0  ||  num_children > 0) {
 	printf ("     ");
-	for (j = 0; j < level; j++) printf ("   ");
+	for (int j = 0; j < level; j++) printf ("   ");
 	printf ("%d child%s%s\n", num_children, num_children == 1 ? "" : "ren",
 		num_children ? ":" : ".");
     }
@@ -1324,7 +1322,7 @@ display_tree_info_1 (struct wininfo *w, 
 	if (children == NULL)
 	    Fatal_Error ("Failed to allocate memory in display_tree_info");
 
-	for (i = (int)num_children - 1; i >= 0; i--) {
+	for (int i = (int)num_children - 1; i >= 0; i--) {
 	    struct wininfo *cw = &children[i];
 
 	    cw->window = child_list[i];
@@ -1339,7 +1337,7 @@ display_tree_info_1 (struct wininfo *w, 
 	}
 	xcb_flush (dpy);
 
-	for (i = (int)num_children - 1; i >= 0; i--) {
+	for (int i = (int)num_children - 1; i >= 0; i--) {
 	    struct wininfo *cw = &children[i];
 	    Bool got_wm_class = False;
 	    char *instance_name = NULL, *class_name = NULL;
@@ -1352,7 +1350,7 @@ display_tree_info_1 (struct wininfo *w, 
 	    xcb_get_geometry_reply_t *geometry;
 
 	    printf ("     ");
-	    for (j = 0; j < level; j++) printf ("   ");
+	    for (int j = 0; j < level; j++) printf ("   ");
 	    Display_Window_Id (cw, False);
 	    printf (": (");
 
@@ -1660,8 +1658,6 @@ Display_WM_Info (struct wininfo *w)
 {
     xcb_icccm_wm_hints_t wmhints;
     long flags;
-    xcb_get_property_reply_t *prop;
-    int i;
 
     printf ("\n");
     if (!xcb_icccm_get_wm_hints_reply(dpy, w->hints_cookie, &wmhints, &err))
@@ -1698,6 +1694,8 @@ Display_WM_Info (struct wininfo *w)
 		Lookup (wmhints.initial_state, _state_hints));
 
     if (atom_net_wm_desktop) {
+	xcb_get_property_reply_t *prop;
+
 	prop = xcb_get_property_reply (dpy, w->wm_desktop_cookie, NULL);
 	if (prop && (prop->type != XCB_NONE)) {
 	    uint32_t *desktop = xcb_get_property_value (prop);
@@ -1711,6 +1709,8 @@ Display_WM_Info (struct wininfo *w)
     }
 
     if (atom_net_wm_window_type) {
+	xcb_get_property_reply_t *prop;
+
 	prop = xcb_get_property_reply (dpy, w->wm_window_type_cookie,
 				       NULL);
 	if (prop && (prop->type != XCB_NONE) && (prop->value_len > 0)) {
@@ -1719,7 +1719,7 @@ Display_WM_Info (struct wininfo *w)
 
 	    if (atom_count > 0) {
 		printf ("      Window type:\n");
-		for (i = 0; i < atom_count; i++)
+		for (int i = 0; i < atom_count; i++)
 		    Display_Atom_Name (atoms[i], "_NET_WM_WINDOW_TYPE_");
 	    }
 	}
@@ -1727,6 +1727,8 @@ Display_WM_Info (struct wininfo *w)
     }
 
     if (atom_net_wm_state) {
+	xcb_get_property_reply_t *prop;
+
 	prop = xcb_get_property_reply (dpy, w->wm_state_cookie, NULL);
 	if (prop && (prop->type != XCB_NONE) && (prop->value_len > 0)) {
 	    xcb_atom_t *atoms = xcb_get_property_value (prop);
@@ -1734,7 +1736,7 @@ Display_WM_Info (struct wininfo *w)
 
 	    if (atom_count > 0) {
 		printf ("      Window state:\n");
-		for (i = 0; i < atom_count; i++)
+		for (int i = 0; i < atom_count; i++)
 		    Display_Atom_Name (atoms[i], "_NET_WM_STATE_");
 	    }
 	}
@@ -1742,6 +1744,8 @@ Display_WM_Info (struct wininfo *w)
     }
 
     if (atom_net_wm_pid) {
+	xcb_get_property_reply_t *prop;
+
 	printf ("      Process id: ");
 	prop = xcb_get_property_reply (dpy, w->wm_pid_cookie, NULL);
 	if (prop && (prop->type == XCB_ATOM_CARDINAL)) {
@@ -1763,6 +1767,8 @@ Display_WM_Info (struct wininfo *w)
     }
 
     if (atom_net_frame_extents) {
+	xcb_get_property_reply_t *prop;
+
 	prop = xcb_get_property_reply (dpy, w->frame_extents_cookie, NULL);
 	if (prop && (prop->type == XCB_ATOM_CARDINAL)
 	    && (prop->value_len == 4)) {
@@ -1836,13 +1842,10 @@ static int
 is_valid_utf8 (const char *string, size_t len)
 {
     unsigned long codepoint;
-    int rem;
-    size_t i;
-    unsigned char c;
-
-    rem = 0;
-    for (i = 0; i < len; i++) {
-	c = (unsigned char) string[i];
+    int rem = 0;
+
+    for (size_t i = 0; i < len; i++) {
+	unsigned char c = (unsigned char) string[i];
 
 	/* Order of type check:
 	 *   - Single byte code point
@@ -1911,16 +1914,15 @@ print_utf8 (const char *prefix, char *u8
 
     if (iconv_from_utf8 != (iconv_t) -1) {
 	Bool done = True;
-	ICONV_CONST char *inp = u8str;
+	ICONV_CONST char *inp = (ICONV_CONST char *) u8str;
 	char convbuf[BUFSIZ];
-	int convres;
 
 	printf ("%s", prefix);
 	do {
 	    char *outp = convbuf;
 	    size_t outlen = sizeof(convbuf);
 
-	    convres = iconv (iconv_from_utf8, &inp, &inlen, &outp, &outlen);
+	    int convres = iconv (iconv_from_utf8, &inp, &inlen, &outp, &outlen);
 
 	    if ((convres == -1) && (errno == E2BIG)) {
 		done = False;
@@ -1953,7 +1955,7 @@ static char *
 get_friendly_name (const char *string, const char *prefix)
 {
     const char *name_start = string;
-    char *lowered_name, *n;
+    char *lowered_name;
     Bool first = True;
     size_t prefix_len = strlen (prefix);
 
@@ -1965,7 +1967,7 @@ get_friendly_name (const char *string, c
     if (lowered_name == NULL)
 	Fatal_Error ("Failed to allocate memory in get_friendly_name");
 
-    for (n = lowered_name ; *n != 0 ; n++) {
+    for (char *n = lowered_name ; *n != 0 ; n++) {
 	if (*n == '_') {
 	    *n = ' ';
 	    first = True;

Index: xsrc/external/mit/xwininfo/include/config.h
diff -u xsrc/external/mit/xwininfo/include/config.h:1.5 xsrc/external/mit/xwininfo/include/config.h:1.6
--- xsrc/external/mit/xwininfo/include/config.h:1.5	Mon Jul 15 04:54:48 2019
+++ xsrc/external/mit/xwininfo/include/config.h	Mon Jun 19 08:02:08 2023
@@ -47,7 +47,7 @@
 #define PACKAGE_NAME "xwininfo"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "xwininfo 1.1.5"
+#define PACKAGE_STRING "xwininfo 1.1.6"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "xwininfo"
@@ -56,7 +56,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.1.5"
+#define PACKAGE_VERSION "1.1.6"
 
 /* Major version of this package */
 #define PACKAGE_VERSION_MAJOR 1
@@ -65,7 +65,7 @@
 #define PACKAGE_VERSION_MINOR 1
 
 /* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 5
+#define PACKAGE_VERSION_PATCHLEVEL 6
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -97,7 +97,7 @@
 /* #undef USE_XCB_ICCCM */
 
 /* Version number of package */
-#define VERSION "1.1.5"
+#define VERSION "1.1.6"
 
 /* Define to 1 if on MINIX. */
 /* #undef _MINIX */

Reply via email to