Subject: Re: FVWM: Re: Beta version 2.0.42 now ready

From: Martin Kraemer <[email-masked]>
Date: Thu, 18 Apr 1996 18:16:35 +0200 (MET DST)

Hello,

Only today did I find the time to compile fvwm-2.0.42 on my SIEMENS NIXDORF
SINIX-D 5.41 SVR4+X11R4 system. My compiler is rather talkative, and when
given the ansi switch, it is also kind of strict when it comes to passing
pointers to anything. Here's a selected list of errors and a list of
patches to cure them for several fvwm modules; the patches don't break
anything but make fvwm compilable on all platforms (not just on those with
gcc ;-) :

===> fvwm/decorations.c:
cc -kansi -O   -I/usr/include   -I. -I../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c decorations.c -o decorations.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
/usr/include/X11/Xproto.h  1385: [warning]:   'delete' is a C++ reserved word
     c0: errors: 0, warnings: 3
decorations.c   189: [error]:     Argument type 'ptr to unsigned long' does not match parameter type 'ptr to char'
decorations.c   206: [error]:     Argument type 'ptr to unsigned long' does not match parameter type 'ptr to char'
decorations.c   223: [error]:     Argument type 'ptr to unsigned long' does not match parameter type 'ptr to char'
     c1: errors: 3, warnings: 0
Make: *** [decorations.o] Error 1

--- fvwm/decorations.c.bak	Thu Apr 11 17:27:42 1996
+++ fvwm/decorations.c	Thu Apr 18 17:32:34 1996
@@ -186,7 +186,7 @@
 	    t->ol_hints &= ~OL_DECOR_ICON_NAME;
 	}
 
-      XFree (hints);
+      XFree ((XtPointer)hints);
     }
 
   if(XGetWindowProperty (dpy, t->w, _XA_OL_DECOR_ADD, 0L, 20L, False,
@@ -203,7 +203,7 @@
 	else if (hints[i] == _XA_OL_DECOR_ICON_NAME)
             t->ol_hints |= OL_DECOR_ICON_NAME;
       }
-      XFree (hints);
+      XFree ((XtPointer)hints);
     }
 
   if(XGetWindowProperty (dpy, t->w, _XA_OL_DECOR_DEL, 0L, 20L, False,
@@ -220,7 +220,7 @@
 	else if (hints[i] == _XA_OL_DECOR_ICON_NAME)
             t->ol_hints &= ~OL_DECOR_ICON_NAME;
       }
-      XFree (hints);
+      XFree ((XtPointer)hints);
     }
 
 }

===> modules/FvwmButtons/FvwmButtons.c
cc -kansi -O   -I/usr/include   -I. -I../../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c FvwmButtons.c -o FvwmButtons.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
/usr/include/X11/Xproto.h  1385: [warning]:   'delete' is a C++ reserved word
     c0: errors: 0, warnings: 3
FvwmButtons.c   159: [warning]:   d never used
FvwmButtons.c   242: [warning]:   whatever never used
FvwmButtons.c   385: [warning]:   '==' or '=' desired?
FvwmButtons.c   509: [warning]:   Condition is always true
FvwmButtons.c   589: [warning]:   Flow between cases
FvwmButtons.c   598: [warning]:   '==' or '=' desired?
FvwmButtons.c   605: [warning]:   Flow between cases
FvwmButtons.c   608: [warning]:   '==' or '=' desired?
FvwmButtons.c   841: [warning]:   '==' or '=' desired?
FvwmButtons.c   856: [warning]:   '==' or '=' desired?
FvwmButtons.c   862: [warning]:   '==' or '=' desired?
FvwmButtons.c   913: [warning]:   '==' or '=' desired?
FvwmButtons.c  1092: [warning]:   Argument type 'ptr to unsigned char' does not match parameter type 'ptr to char'
FvwmButtons.c  1349: [warning]:   count set but not used
FvwmButtons.c  1516: [warning]:   Argument type 'ptr to int' does not match parameter type 'ptr to unsigned int'
FvwmButtons.c  1517: [error]:     Argument type 'ptr to unsigned long' does not match parameter type 'ptr to char'
     c1: errors: 1, warnings: 15
make[1]: [FvwmButtons.o] Error 1 (ignored)

--- modules/FvwmButtons/FvwmButtons.c.bak	Mon Apr 15 20:50:16 1996
+++ modules/FvwmButtons/FvwmButtons.c	Thu Apr 18 17:47:19 1996
@@ -1514,7 +1514,7 @@
   XTranslateCoordinates(dpy,win,root,*x,*y,x,y,&rp);
 
   XQueryTree(dpy,win,&root,&rp,&children,&n); 
-  XFree(children);
+  XFree((XtPointer)children);
 
   return rp;
 }

===> modules/FvwmForm/FvwmForm.c:
cc -kansi -O   -I/usr/include   -I. -I../../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c FvwmForm.c -o FvwmForm.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
     c0: errors: 0, warnings: 2
FvwmForm.c   202: [warning]:   Condition is always true
FvwmForm.c   212: [warning]:   No flow into statement
FvwmForm.c   225: [warning]:   Condition is always true
FvwmForm.c   280: [error]:     'ptr to struct  of size 80' = 'int'
FvwmForm.c   339: [error]:     'ptr to struct  of size 80' = 'int'
FvwmForm.c   347: [error]:     'ptr to struct  of size 80' = 'int'
FvwmForm.c   355: [error]:     'ptr to struct  of size 80' = 'int'
FvwmForm.c   597: [warning]:   fp never used
FvwmForm.c   611: [warning]:   Argument type 'ptr to long' does not match parameter type 'ptr to unsigned long'
FvwmForm.c   871: [warning]:   Condition is always true
FvwmForm.c   887: [warning]:   Condition is always true
FvwmForm.c   953: [warning]:   vp set but not used
FvwmForm.c   953: [warning]:   wp set but not used
FvwmForm.c  1191: [warning]:   No flow into statement
FvwmForm.c  1199: [warning]:   No flow into statement
FvwmForm.c  1211: [warning]:   No flow into statement
FvwmForm.c  1224: [warning]:   No flow into statement
FvwmForm.c  1244: [warning]:   No flow into statement
FvwmForm.c  1453: [warning]:   Condition is always true
FvwmForm.c  1517: [warning]:   '==' or '=' desired?
FvwmForm.c  1540: [warning]:   nonsense never used
     c1: errors: 4, warnings: 17

--- modules/FvwmForm/FvwmForm.c.orig	Fri Feb 16 14:59:47 1996
+++ modules/FvwmForm/FvwmForm.c	Thu Apr 18 18:05:26 1996
@@ -24,6 +24,7 @@
 #if defined ___AIX || defined _AIX || defined ___AIXV3
 #include <sys/select.h>
 #endif
+#include "../../libs/fvwmlib.h" /* get prototypes */
 
 void dummy () {
 }
@@ -181,7 +182,7 @@
 static int N = 8;
 
 /* copy a string until '\0', or up to n chars, and delete trailing spaces */
-char *CopyString (char *cp, int n)
+char *DupString (char *cp, int n)
 {
   char *dp, *bp;
   if (n == 0)
@@ -310,31 +311,31 @@
     else if (strncmp(cp, "Fore", 4) == 0) {
       cp += 4;
       while (isspace(*cp)) cp++;
-      color_names[c_fore] = CopyString(cp, 0);
+      color_names[c_fore] = DupString(cp, 0);
       fprintf(fp_err, "ColorFore: %s\n", color_names[c_fore]);
       continue;
     } else if (strncmp(cp, "Back", 4) == 0) {
       cp += 4;
       while (isspace(*cp)) cp++;
-      color_names[c_back] = CopyString(cp, 0);
+      color_names[c_back] = DupString(cp, 0);
       fprintf(fp_err, "ColorBack: %s\n", color_names[c_back]);
       continue;
     } else if (strncmp(cp, "ItemFore", 8) == 0) {
       cp += 8;
       while (isspace(*cp)) cp++;
-      color_names[c_itemfore] = CopyString(cp, 0);
+      color_names[c_itemfore] = DupString(cp, 0);
       fprintf(fp_err, "ColorItemFore: %s\n", color_names[c_itemfore]);
       continue;
     } else if (strncmp(cp, "ItemBack", 8) == 0) {
       cp += 8;
       while (isspace(*cp)) cp++;
-      color_names[c_itemback] = CopyString(cp, 0);
+      color_names[c_itemback] = DupString(cp, 0);
       fprintf(fp_err, "ColorItemBack: %s\n", color_names[c_itemback]);
       continue;
     } else if (strncmp(cp, "Font", 4) == 0) {
       cp += 4;
       while (isspace(*cp)) cp++;
-      font_names[f_text] = CopyString(cp, 0);
+      font_names[f_text] = DupString(cp, 0);
       fprintf(fp_err, "Font: %s\n", font_names[f_text]);
       xfs[f_text] = GetFontOrFixed(dpy, font_names[f_text]);
       fonts[f_text] = xfs[f_text]->fid;
@@ -342,7 +343,7 @@
     } else if (strncmp(cp, "ButtonFont", 10) == 0) {
       cp += 10;
       while (isspace(*cp)) cp++;
-      font_names[f_button] = CopyString(cp, 0);
+      font_names[f_button] = DupString(cp, 0);
       fprintf(fp_err, "ButtonFont: %s\n", font_names[f_button]);
       xfs[f_button] = GetFontOrFixed(dpy, font_names[f_button]);
       fonts[f_button] = xfs[f_button]->fid;
@@ -350,7 +351,7 @@
     } else if (strncmp(cp, "InputFont", 9) == 0) {
       cp += 9;
       while (isspace(*cp)) cp++;
-      font_names[f_input] = CopyString(cp, 0);
+      font_names[f_input] = DupString(cp, 0);
       fprintf(fp_err, "InputFont: %s\n", font_names[f_input]);
       xfs[f_input] = GetFontOrFixed(dpy, font_names[f_input]);
       fonts[f_input] = xfs[f_input]->fid;
@@ -510,7 +511,7 @@
       cp += 7;
       while (isspace(*cp)) cp++;
       cur_button->button.commands[cur_button->button.n++] =
-	CopyString(cp, 0);
+	DupString(cp, 0);
     }
   }  /* end of switch() */
   /* get the geometry right */

==> modules/FvwmIconBox/FvwmIconBox.c:
cc -kansi -O   -I/usr/include   -I. -I../../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c FvwmIconBox.c -o FvwmIconBox.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
/usr/include/X11/Xproto.h  1385: [warning]:   'delete' is a C++ reserved word
     c0: errors: 0, warnings: 3
FvwmIconBox.c   194: [warning]:   '==' or '=' desired?
FvwmIconBox.c   224: [error]:     Argument type 'ptr to struct  of size 24' does not match parameter type 'ptr to char'
FvwmIconBox.c   250: [warning]:   Condition is always true
FvwmIconBox.c   455: [error]:     Argument type 'ptr to struct  of size 36' does not match parameter type 'ptr to char'
FvwmIconBox.c  1219: [warning]:   Condition is always true
FvwmIconBox.c  1412: [warning]:   nonsense never used
FvwmIconBox.c  1798: [warning]:   Argument type 'ptr to unsigned char' does not match parameter type 'ptr to char'
FvwmIconBox.c  1850: [warning]:   '==' or '=' desired?
FvwmIconBox.c  1857: [warning]:   cbody never used
FvwmIconBox.c  1857: [warning]:   total never used
FvwmIconBox.c  1857: [warning]:   count2 set but not used
FvwmIconBox.c  1857: [warning]:   count set but not used
FvwmIconBox.c  1857: [warning]:   body_length never used
FvwmIconBox.c  1926: [warning]:   Flow between cases
FvwmIconBox.c  2297: [warning]:   '==' or '=' desired?
FvwmIconBox.c  2311: [warning]:   '==' or '=' desired?
FvwmIconBox.c  2507: [error]:     Argument type 'ptr to struct  of size 36' does not match parameter type 'ptr to char'
FvwmIconBox.c  2592: [warning]:   ev set but not used
     c1: errors: 3, warnings: 15
--- modules/FvwmIconBox/FvwmIconBox.c.bak        Tue Apr  2 21:49:05 1996
+++ modules/FvwmIconBox/FvwmIconBox.c    Thu Apr 18 17:57:21 1996
@@ -221,7 +221,7 @@
     size->max_height = size->min_height = max_icon_height + icon_relief;
     size->width_inc  = size->height_inc = 0;
     XSetIconSizes(dpy, Root, size, 1);
-    XFree(size);
+    XFree((XtPointer)size);
   }
 
   CreateWindow();
@@ -452,7 +452,7 @@
 		if (tmp == NULL || tmp->wmhints == NULL || !(tmp->extra_flags & DEFAULTICON)) 
 		  break;
 		if (tmp->wmhints)
-		  XFree (tmp->wmhints);
+		  XFree ((XtPointer)tmp->wmhints);
 		tmp->wmhints = XGetWMHints(dpy, tmp->id);
 		if (tmp->wmhints && (tmp->wmhints->flags & IconPixmapHint)){
 #ifdef SHAPE
@@ -2504,7 +2504,7 @@
   if (item->res_class != NULL)
     free(item->res_class);
   if (item->wmhints != NULL)
-    XFree(item->wmhints);
+    XFree((XtPointer)item->wmhints);
   if (item->iconPixmap != None)
     XFreePixmap(dpy, item->iconPixmap);
   if (item->icon_maskPixmap != None && 

===> modules/FvwmScroll/GrabWindow.c:
cc -kansi -O   -I/usr/include   -I. -I../../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c GrabWindow.c -o GrabWindow.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
/usr/include/X11/Xproto.h  1385: [warning]:   'delete' is a C++ reserved word
     c0: errors: 0, warnings: 3
GrabWindow.c   318: [warning]:   Condition is always true
GrabWindow.c   594: [error]:     Argument type 'ptr to struct  of size 36' does not match parameter type 'ptr to char'
GrabWindow.c   763: [warning]:   Argument type 'ptr to unsigned char' does not match parameter type 'ptr to char'
GrabWindow.c   781: [warning]:   Argument type 'ptr to unsigned char' does not match parameter type 'ptr to char'
GrabWindow.c   859: [error]:     Argument type 'ptr to struct  of size 36' does not match parameter type 'ptr to char'
     c1: errors: 2, warnings: 3

--- modules/FvwmScroll/GrabWindow.c.bak  Thu Jul 13 15:25:04 1995
+++ modules/FvwmScroll/GrabWindow.c      Thu Apr 18 18:00:19 1996
@@ -591,7 +591,7 @@
 
 	      wmhints = XGetWMHints(dpy,target);
 	      XSetWMHints(dpy,main_win, wmhints);
-	      XFree(wmhints);
+	      XFree((XtPointer)wmhints);
 	    }
 	  else if(Event.xproperty.atom == XA_WM_NORMAL_HINTS)	  
 	    {
@@ -856,7 +856,7 @@
     if(wmhints != NULL)
       {
 	XSetWMHints(dpy,main_win, wmhints);
-	XFree(wmhints);
+	XFree((XtPointer)wmhints);
       }
   }
   {

===> modules/FvwmButtons/misc.c:
cc -kansi -O   -I/usr/include   -I. -I../../libs  -Datt=att -DSYSV -DSVR4 -DSVR4_0 -Dsiemens -DXMVERSION=1100 -DSTREAMWRITEMAX=4096 -DSTRNET -DFUNCPROTO -DSHAPE -DPIXMAP_BUTTONS -DXPM      -c misc.c -o misc.o
/usr/include/X11/Xlib.h   232: [warning]:   'class' is a C++ reserved word
/usr/include/X11/Xlib.h   918: [warning]:   'new' is a C++ reserved word
misc.c      156: [error]:     Illegal characters after # directive
     c0: errors: 1, warnings: 2

--- modules/FvwmButtons/misc.c.bak       Fri Mar 29 13:25:42 1996
+++ modules/FvwmButtons/misc.c   Thu Apr 18 18:12:16 1996
@@ -153,7 +153,7 @@
   *widthp = dwidth;
   *heightp = dheight;
   return;
-#undef makemult(a,b)
+#undef makemult
 #undef maxAspectX
 #undef maxAspectY
 #undef minAspectX

-- 
| S I E M E N S |   [email-masked]   |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].