$OpenBSD: patch-parse_c,v 1.2 2017/05/05 22:11:08 naddy Exp $
Index: parse.c
--- parse.c.orig
+++ parse.c
@@ -41,6 +41,7 @@
 #include <errno.h>
 #include <X11/Xos.h>
 #include <X11/Xmu/CharSet.h>
+#include <X11/Xmu/SysUtil.h>
 #include "twm.h"
 #include "screen.h"
 #include "menus.h"
@@ -81,6 +82,7 @@ static char **stringListSource, *currentString;
 static int ParseUsePPosition();
 static int ParseState();
 static FILE *start_m4();
+static char *m4_defs(Display *, char *);
 int m4_pid;
 
 /* If you're using flex (and lex on 386 bsd boxes, which *is* flex, really)
@@ -95,6 +97,7 @@ extern char *InitFile;
 
 int ConstrainedMoveTime = 400;		/* milliseconds, event times */
 
+static void def_netmask();
 static int twmFileInput(), twmStringListInput(), twmMenuInput();
 void twmUnput();
 int (*twmInputFunc)();
@@ -1420,6 +1423,7 @@ switch(keyword)
 /*
  * put_pixel_on_root() Save a pixel value in twm root window color property.
  */
+static void
 put_pixel_on_root(pixel)                                 
     Pixel pixel;                                         
 {                                                        
@@ -1563,7 +1567,7 @@ static int ParseState (s)
 }
 
 
-do_squeeze_entry (list, name, type, justify, num, denom)
+void do_squeeze_entry (list, name, type, justify, num, denom)
     name_list **list;			/* squeeze or dont-squeeze list */
     char *name;				/* window name */
     short type;				/* match type */
@@ -1598,7 +1602,7 @@ do_squeeze_entry (list, name, type, justify, num, deno
 
 	if (!sinfo) {
 	    twmrc_error_prefix();
-	    fprintf (stderr, "unable to allocate %d bytes for squeeze info\n",
+	    fprintf (stderr, "unable to allocate %zu bytes for squeeze info\n",
 		     sizeof(SqueezeInfo));
 	    return;
 	}
@@ -1627,7 +1631,6 @@ FILE *fraw;
 	if (fres == 0) {
 		extern Display *dpy;
 		extern char *display_name;
-		static char *m4_defs();
 		char *tmp_file;
 
 		/* Child */
@@ -1703,7 +1706,7 @@ char *name, *def;
 
 	cp = malloc(3 + strlen(def));
 	if (cp == NULL) {
-		fprintf(stderr, "Can't get %d bytes for arg parm\n", 3 + strlen(def));
+		fprintf(stderr, "Can't get %zu bytes for arg parm\n", 3 + strlen(def));
 		exit(27);
 	}
 
@@ -1952,7 +1955,7 @@ err:
 #endif
 }
 
-def_netmask(tmpf)
+static void def_netmask(tmpf)
 FILE *tmpf;
 {
 	int mask;
