Here is a patch ansifying xwininfo.c. I diffed the executable after the
changes to the executable from before the changes, and they were the same.

Index: xwininfo.c
===================================================================
RCS file: /cvs/xc/programs/xwininfo/xwininfo.c,v
retrieving revision 1.8
diff -u -3 -p -r1.8 xwininfo.c
--- xwininfo.c  14 Dec 2001 20:02:35 -0000      1.8
+++ xwininfo.c  9 Sep 2003 15:17:24 -0000
@@ -58,28 +58,26 @@ typedef struct {
        char *name;
 } binding;
 
-#if NeedFunctionPrototypes
-extern void scale_init(void);
-extern char *nscale(int, int, int, char *);
-extern char *xscale(int);
-extern char *yscale(int);
-extern char *bscale(int);
-extern int bad_window_handler(Display *, XErrorEvent *);
-extern int main(int, char **);
-extern char *LookupL(long, binding *);
-extern char *Lookup(int, binding *);
-extern void Display_Window_Id(Window, int);
-extern void Display_Stats_Info(Window);
-extern void Display_Bits_Info(Window);
-extern void Display_Event_Mask(long);
-extern void Display_Events_Info(Window);
-extern void Display_Tree_Info(Window, int);
-extern void display_tree_info_1(Window, int, int);
-extern void Display_Hints(XSizeHints *);
-extern void Display_Size_Hints(Window);
-extern void Display_Window_Shape(Window);
-extern void Display_WM_Info(Window);
-#endif
+void scale_init(void);
+char *nscale(int, int, int, char *);
+char *xscale(int);
+char *yscale(int);
+char *bscale(int);
+int bad_window_handler(Display *, XErrorEvent *);
+int main(int, char **);
+char *LookupL(long, binding *);
+char *Lookup(int, binding *);
+void Display_Window_Id(Window, int);
+void Display_Stats_Info(Window);
+void Display_Bits_Info(Window);
+void Display_Event_Mask(long);
+void Display_Events_Info(Window);
+void Display_Tree_Info(Window, int);
+void display_tree_info_1(Window, int, int);
+void Display_Hints(XSizeHints *);
+void Display_Size_Hints(Window);
+void Display_Window_Shape(Window);
+void Display_WM_Info(Window);
 
 static char *window_id_format = "0x%lx";
 
@@ -87,7 +85,7 @@ static char *window_id_format = "0x%lx";
  * Report the syntax for calling xwininfo:
  */
 void
-usage()
+usage(void)
 {
     fprintf (stderr,
        "usage:  %s [-options ...]\n\n", program_name);
@@ -151,7 +149,8 @@ int yp=0, ymm=0;
 int bp=0, bmm=0;
 int english = 0, metric = 0;
 
-void scale_init()
+void
+scale_init(void)
 {
   getdsp(yp,  DisplayHeight);
   getdsp(ymm, DisplayHeightMM);
@@ -165,9 +164,8 @@ void scale_init()
 #define YARD (3*12)
 #define FOOT (12)
 
-char *nscale(n, np, nmm, nbuf)
-     int n, np, nmm;
-     char *nbuf;
+char
+*nscale(int n, int np, int nmm, char *nbuf)
 {
   sprintf(nbuf, "%d", n);
   if(metric||english) {
@@ -220,8 +218,7 @@ char *nscale(n, np, nmm, nbuf)
 }        
   
 char xbuf[BUFSIZ];
-char *xscale(x)
-     int x;
+char *xscale(int x)
 {
   if(!xp) {
     scale_init();
@@ -230,8 +227,7 @@ char *xscale(x)
 }
 
 char ybuf[BUFSIZ];
-char *yscale(y)
-     int y;
+char *yscale(int y)
 {
   if(!yp) {
     scale_init();
@@ -240,8 +236,7 @@ char *yscale(y)
 }
 
 char bbuf[BUFSIZ];
-char *bscale(b)
-     int b;
+char *bscale(int b)
 {
   if(!bp) {
     scale_init();
@@ -256,9 +251,7 @@ char *bscale(b)
 
 /* ARGSUSED */
 int
-bad_window_handler(disp, err)
-    Display *disp;
-    XErrorEvent *err;
+bad_window_handler(Display *disp, XErrorEvent *err)
 {
     char badid[20];
 
@@ -270,9 +263,7 @@ bad_window_handler(disp, err)
 
 
 int
-main(argc, argv)
-     int argc;
-     char **argv;
+main(int argc, char **argv)
 {
   register int i;
   int tree = 0, stats = 0, bits = 0, events = 0, wm = 0, size  = 0, shape =
0;
@@ -412,9 +403,7 @@ main(argc, argv)
  */
 static char _lookup_buffer[100];
 
-char *LookupL(code, table)
-    long code;
-    binding *table;
+char *LookupL(long code, binding *table)
 {
        char *name;
 
@@ -432,9 +421,7 @@ char *LookupL(code, table)
        return(name);
 }
 
-char *Lookup(code, table)
-    int code;
-    binding *table;
+char *Lookup(int code, binding *table)
 {
     return LookupL((long)code, table);
 }
@@ -444,9 +431,7 @@ char *Lookup(code, table)
  */
 
 void
-Display_Window_Id(window, newline_wanted)
-    Window window;
-    Bool newline_wanted;
+Display_Window_Id(Window window, Bool newline_wanted)
 {
     char *win_name;
     
@@ -532,8 +517,7 @@ static binding _visual_classes[] = {
        { 0, 0 }};
 
 void
-Display_Stats_Info(window)
-     Window window;
+Display_Stats_Info(Window window)
 {
   XWindowAttributes win_attributes;
   XVisualInfo vistemplate, *vinfo;
@@ -724,8 +708,7 @@ static binding _bool[] = {
        { 0, 0 } };
 
 void
-Display_Bits_Info(window)
-     Window window;
+Display_Bits_Info(Window window)
 {
   XWindowAttributes win_attributes;
 
@@ -779,8 +762,7 @@ static binding _event_mask_names[] = {
        { 0, 0 } };
 
 void
-Display_Event_Mask(mask)
-     long mask;
+Display_Event_Mask(long mask)
 {
   long bit, bit_mask;
 
@@ -795,8 +777,7 @@ Display_Event_Mask(mask)
  * Display info on events
  */
 void
-Display_Events_Info(window)
-     Window window;
+Display_Events_Info(Window window)
 {
   XWindowAttributes win_attributes;
 
@@ -822,20 +803,19 @@ Display_Events_Info(window)
 
 /*
  * Display root, parent, and (recursively) children information
+ * recurse - true to show children information
  */
 void
-Display_Tree_Info(window, recurse)
-     Window window;
-     int recurse;              /* true if should show children's children */
+Display_Tree_Info(Window window, int recurse)
 {
     display_tree_info_1(window, recurse, 0);
 }
 
+/*
+ * level - recursion level
+ */
 void
-display_tree_info_1(window, recurse, level)
-     Window window;
-     int recurse;
-     int level;                        /* recursion level */
+display_tree_info_1(Window window, int recurse, int level)
 {
   int i, j;
   int rel_x, rel_y, abs_x, abs_y;
@@ -907,8 +887,7 @@ display_tree_info_1(window, recurse, lev
  * Display a set of size hints
  */
 void
-Display_Hints(hints)
-     XSizeHints *hints;
+Display_Hints(XSizeHints *hints)
 {
        long flags;
 
@@ -986,8 +965,7 @@ Display_Hints(hints)
  * Display Size Hints info
  */
 void
-Display_Size_Hints(window)
-     Window window;
+Display_Size_Hints(Window window)
 {
        XSizeHints *hints = XAllocSizeHints();
        long supplied;
@@ -1013,8 +991,7 @@ Display_Size_Hints(window)
 
 
 void
-Display_Window_Shape (window)
-    Window  window;
+Display_Window_Shape (Window window)
 {
     Bool    ws, bs;
     int            xws, yws, xbs, ybs;
@@ -1054,8 +1031,7 @@ static binding _state_hints[] = {
        { 0, 0 } };
 
 void
-Display_WM_Info(window)
-     Window window;
+Display_WM_Info(Window window)
 {
         XWMHints *wmhints;
        long flags;
-- 
President, GOLUM, Inc.
http://www.golum.org

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to