xwininfo: const in iconv

Thomas Klausner wiz at NetBSD.org
Sat Aug 25 02:24:47 PDT 2012


On Fri, Aug 24, 2012 at 06:14:20PM -0700, Alan Coopersmith wrote:
> I think that's already taken care of via the AM_ICONV autoconf macro that
> checks for the constness of the pointer and sets ICONV_CONST appropriately,
> but we don't seem to have released a tarball with that fix (commit
> 1410b0f0a9d50973) in yet.
> 
> Do you still need your patch if you build from git master?   If not, we
> can easily roll a release since it looks like a number of commits happened
> after the last release, but none in a while, so it's hopefully somewhat
> stable.

With master, I don't see any warning about the iconv line.
Many other warnings though :)

xwininfo.c: In function ‘scale_init’:
xwininfo.c:327:27: warning: declaration of ‘screen’ shadows a global declaration
xwininfo.c:258:22: warning: shadowed declaration is here

These are the lines:
xwininfo.c:static xcb_screen_t *screen;
xwininfo.c:scale_init (xcb_screen_t *screen)

Patch attached.

xwininfo.c: In function ‘wm_size_hints_reply’:
xwininfo.c:707:40: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c:708:61: warning: declaration of ‘err’ shadows a global declaration
xwininfo.c:259:29: warning: shadowed declaration is here
xwininfo.c: In function ‘Display_Window_Id’:
xwininfo.c:845:3: warning: cast discards qualifiers from pointer target type
xwininfo.c: In function ‘wm_hints_reply’:
xwininfo.c:1611:35: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c:1612:51: warning: declaration of ‘err’ shadows a global declaration
xwininfo.c:259:29: warning: shadowed declaration is here
xwininfo.c: In function ‘get_net_wm_name’:
xwininfo.c:1781:36: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c: In function ‘get_friendly_name’:
xwininfo.c:1970:6: warning: array subscript has type ‘char’
xwininfo.c: In function ‘usage’:
xwininfo.c:282:1: warning: function might be possible candidate for attribute ‘noreturn’
xwininfo.c: In function ‘print_utf8.clone.5’:
xwininfo.c:1830:19: warning: ‘codepoint’ may be used uninitialized in this function
xwininfo.c:1830:19: note: ‘codepoint’ was declared here

Should I try fixing the others as well?
 Thomas
-------------- next part --------------
diff --git a/xwininfo.c b/xwininfo.c
index f1126e6..5cfdba7 100644
--- a/xwininfo.c
+++ b/xwininfo.c
@@ -324,12 +324,12 @@ static int bp = 0, bmm = 0;
 static int english = 0, metric = 0;
 
 static void
-scale_init (xcb_screen_t *screen)
+scale_init (xcb_screen_t *scale_screen)
 {
-    xp = screen->width_in_pixels;
-    yp = screen->height_in_pixels;
-    xmm = screen->width_in_millimeters;
-    ymm = screen->height_in_millimeters;
+    xp = scale_screen->width_in_pixels;
+    yp = scale_screen->height_in_pixels;
+    xmm = scale_screen->width_in_millimeters;
+    ymm = scale_screen->height_in_millimeters;
     bp  = xp  + yp;
     bmm = xmm + ymm;
 }


More information about the xorg-devel mailing list