Subject: xisp patches for gcc3
To: None <tech-pkg@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-pkg
Date: 10/18/2003 20:41:40
--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,
xisp needs the attached patch to bild on gcc3 (it's just a varargs->stdarg
conversion). I don't think it can cause problems on other systems, as
they all should have stdarg too (solaris9 and linux redhat7 have it,
and seems to be available on NetBSD since 0.8).
I checked that xisp can still connect.

Should I commit this ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xisp.diff"

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/comms/xisp/distinfo,v
retrieving revision 1.5
diff -u -r1.5 distinfo
--- distinfo	2002/09/21 23:17:24	1.5
+++ distinfo	2003/10/18 18:36:12
@@ -3,3 +3,10 @@
 SHA1 (xisp-2.6p1.tar.gz) = 5e6f1795f20b22fd26212215b86b505e00d43b9e
 Size (xisp-2.6p1.tar.gz) = 260645 bytes
 SHA1 (patch-aa) = 73d3a226124082f9f98e616e8b0bf1b7d8f26f04
+SHA1 (patch-ab) = 48ecd1244b002bf826d61ee97e12c71929517655
+SHA1 (patch-ac) = 980f61bc1186b785e1c038e3408edf62dca982b6
+SHA1 (patch-ad) = 89d3b7509801c488e89ea162bc9db6511c96aac7
+SHA1 (patch-ae) = b4ec7b8444d0b9b042e4da0e6c71faf7e685d77f
+SHA1 (patch-af) = 27f3c6936a426371c4c6cfec917782754e92ac06
+SHA1 (patch-ag) = 1556423374340a0addd5deb1015e95474dd65974
+SHA1 (patch-ah) = 91879466e49f8749c97d7276345d608e1e839434
Index: patches/patch-ab
===================================================================
RCS file: patch-ab
diff -N patch-ab
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ab	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,32 @@
+$NetBSD: $
+
+--- logs.c.orig	2003-10-18 20:01:39.000000000 +0200
++++ logs.c	2003-10-18 20:03:09.000000000 +0200
+@@ -29,7 +29,7 @@
+ #include <time.h>
+ #include <math.h>
+ #include <errno.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -3116,16 +3116,12 @@
+ /* Function for writing strings in the costs and logging files,
+    as well as in xispPTTs, while checking for write errors */
+ 
+-static int safePrint(va_alist) va_dcl
++static int safePrint(FILE *fp, char *fmt, ...)
+ {
+ 	int bw;
+ 	va_list ap;
+-	char *fmt;
+-	FILE *fp;
+ 
+-	va_start(ap);
+-	fp = va_arg(ap, FILE*);
+-	fmt = va_arg(ap, char*);
++	va_start(ap, fmt);
+ 	bw = vfprintf(fp, fmt, ap);
+ 	va_end(ap);
+ 	if (bw <= 0)
Index: patches/patch-ac
===================================================================
RCS file: patch-ac
diff -N patch-ac
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ac	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,32 @@
+$NetBSD: $
+
+--- rcio.c.orig	2003-10-18 19:57:40.000000000 +0200
++++ rcio.c	2003-10-18 20:01:01.000000000 +0200
+@@ -23,7 +23,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <string.h>
+ #include <math.h>
+ #include <sys/time.h>
+@@ -169,16 +169,12 @@
+ 
+ /* Function for writing strings in the .xisprc resource control file */
+ 
+-static int rcPrint(va_alist) va_dcl
++static int rcPrint(FILE *fp, char *fmt, ...)
+ {
+ 	int bw;
+ 	va_list ap;
+-	char *fmt;
+-	FILE *fp;
+ 
+-	va_start(ap);
+-	fp = va_arg(ap, FILE*);
+-	fmt = va_arg(ap, char*);
++	va_start(ap, fmt);
+ 	bw = vfprintf(fp, fmt, ap);
+ 	va_end(ap);
+ 	if (bw <= 0)
Index: patches/patch-ad
===================================================================
RCS file: patch-ad
diff -N patch-ad
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ad	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,75 @@
+$NetBSD: $
+
+--- xisp.c.orig	2003-10-18 19:44:57.000000000 +0200
++++ xisp.c	2003-10-18 19:56:48.000000000 +0200
+@@ -22,7 +22,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <time.h>
+ #include <string.h>
+ #include <pwd.h>
+@@ -576,15 +576,13 @@
+ 	}
+ }
+ 
+-int bprintf(va_alist) va_dcl
++int bprintf(char *fmt, ...)
+ {
+ 	int bw, pending = 0;
+ 	va_list ap;
+-	char *fmt;
+ 	static int tot = 0;
+ 
+-	va_start(ap);								/* start variable arg list */
+-	fmt = va_arg(ap, char*);					/* first string is format */
++	va_start(ap, fmt);								/* start variable arg list */
+ #ifdef BROKEN_VSPRINTF
+ 	vsprintf(btmp, fmt, ap);					/* pass the rest to vsprintf */
+ 	bw = strlen(btmp);
+@@ -654,13 +652,14 @@
+ 	npppd_args = 0;								/* and restart counter */
+ }
+ 
+-void pppdArg(va_alist) va_dcl
++void pppdArg(char *firstarg, ...)
+ {
+ 	va_list ap;
+ 	char *arg;
+ 
+-	va_start(ap);								/* start variable arg list */
+-	while ((arg=va_arg(ap,char*))!=(char*)0) {	/* get next argument */
++	va_start(ap, firstarg);								/* start variable arg list */
++	arg = firstarg;
++	while (arg!=(char*)0) {
+ 		if (npppd_args > MAXARGS_CHILD-1) {		/* next argument overflows ? */
+ 			fprintf(stderr, "xISP: %s %s\n",	/* yup, bail out */
+ 					"pppdArg",
+@@ -672,6 +671,7 @@
+ 			doErr("pppdArg");					/* then bail out */
+ 		strcpy(pppd_arg[npppd_args], arg);		/* all OK, copy it */
+ 		++npppd_args;							/* and increment the counter */
++		arg=va_arg(ap,char*);				/* get next argument */
+ 	}
+ 	va_end(ap);									/* end variable arg list */
+ }
+@@ -1499,15 +1499,13 @@
+ 
+ #define MAXLEN_PTTINFB 64
+ 
+-int ibprt(va_alist) va_dcl
++int ibprt(char *fmt, ...)
+ {
+ 	int bw;
+ 	char buf[MAXLEN_PTTINFB+1] = {0};
+ 	va_list ap;
+-	char *fmt;
+ 
+-	va_start(ap);
+-	fmt = va_arg(ap, char*);
++	va_start(ap, fmt);
+ #ifdef BROKEN_VSPRINTF
+ 	vsprintf(buf, fmt, ap);
+ 	bw = strlen(buf);
Index: patches/patch-ae
===================================================================
RCS file: patch-ae
diff -N patch-ae
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ae	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,57 @@
+$NetBSD: $
+
+--- xispdial.c.orig	2003-10-18 20:03:58.000000000 +0200
++++ xispdial.c	2003-10-18 20:12:05.000000000 +0200
+@@ -20,7 +20,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <sys/param.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+@@ -138,14 +138,13 @@
+ 
+ #define MSGLEN_PIPE 256
+ 
+-int pprintf(va_alist) va_dcl
++int pprintf(char *fmt, ...)
+ {
+ 	int iw, bw;
+ 	va_list ap;
+-	char *fmt, msg[MSGLEN_PIPE];
++	char msg[MSGLEN_PIPE];
+ 
+-	va_start(ap);								/* start variable arg list */
+-	fmt = va_arg(ap, char*);					/* first string is format */
++	va_start(ap, fmt);								/* start variable arg list */
+ #ifdef BROKEN_VSPRINTF
+ 	vsprintf(msg, fmt, ap);						/* pass rest to vsprintf() */
+ 	iw = strlen(msg);
+@@ -165,7 +164,7 @@
+ 
+ #define MAXARGS_CHILD 16
+ 
+-int child(va_alist) va_dcl
++int child(char *arg0, ...)
+ {
+ 	int i, stat;
+ 	char *args[MAXARGS_CHILD+1];
+@@ -182,12 +181,12 @@
+ 	}
+ 	else {										/* in child process */
+ 		dup2(pipeFD, 2);						/* tack stderr on pipe input */
+-		va_start(ap);							/* start variable arg list */
++		va_start(ap, arg0);							/* start variable arg list */
++		args[0] = arg0;
+ 		for (									/* parse program arguments */
+ 			i=0; i < MAXARGS_CHILD &&			/* to a max of MAXARGS_CHILD */
+-			(args[i]=va_arg(ap, char*)) !=
+-				(char *)0;
+-			i++
++			args[i] != (char *)0;
++			args[++i] = va_arg(ap, char*)
+ 		);
+ 		va_end(ap);								/* end variable arg list */
+ 		execv(args[0], args);					/* exec child */
Index: patches/patch-af
===================================================================
RCS file: patch-af
diff -N patch-af
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-af	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,36 @@
+$NetBSD: $
+
+--- xispid.c.orig	2003-10-18 20:15:10.000000000 +0200
++++ xispid.c	2003-10-18 20:16:23.000000000 +0200
+@@ -32,7 +32,7 @@
+ #include <grp.h>
+ #include <unistd.h>
+ #include <string.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include "common.h"
+@@ -77,20 +77,15 @@
+ #define strerror private_strerror
+ #endif
+ 
+-void error (va_alist) va_dcl
++void error (int status, int errnum, char *message, ...)
+ {
+-  int status, errnum;
+-  char *message;
+   extern char *program_name;
+   va_list args;
+ 
+   fflush (stdout);
+   fprintf (stderr, "%s: ", program_name);
+ 
+-  va_start (args);
+-  status = va_arg(args, int);
+-  errnum = va_arg(args, int);
+-  message = va_arg(args, char*);
++  va_start (args, message);
+   vfprintf (stderr, message, args);
+   va_end (args);
+ 
Index: patches/patch-ag
===================================================================
RCS file: patch-ag
diff -N patch-ag
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ag	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,32 @@
+$NetBSD: $
+
+--- xisprccv.c.orig	2003-10-18 20:12:35.000000000 +0200
++++ xisprccv.c	2003-10-18 20:13:31.000000000 +0200
+@@ -20,7 +20,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <pwd.h>
+ #include <unistd.h>
+ #include <string.h>
+@@ -1940,16 +1940,12 @@
+ 	fclose(rcfp);
+ }
+ 
+-int rcPrint(va_alist) va_dcl
++int rcPrint(FILE *fp, char *fmt, ...)
+ {
+ 	int bw;
+ 	va_list ap;
+-	char *fmt;
+-	FILE *fp;
+ 
+-	va_start(ap);
+-	fp = va_arg(ap, FILE*);
+-	fmt = va_arg(ap, char*);
++	va_start(ap, fmt);
+ 	bw = vfprintf(fp, fmt, ap);
+ 	va_end(ap);
+ 	if (bw <= 0)
Index: patches/patch-ah
===================================================================
RCS file: patch-ah
diff -N patch-ah
--- /dev/null	Mon Aug 30 16:41:34 1999
+++ patch-ah	Sat Oct 18 18:36:12 2003
@@ -0,0 +1,31 @@
+$NetBSD: $
+
+--- xispterm.c.orig	2003-10-18 20:13:58.000000000 +0200
++++ xispterm.c	2003-10-18 20:14:47.000000000 +0200
+@@ -21,7 +21,7 @@
+ #include <forms.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <strings.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+@@ -141,15 +141,13 @@
+ 	}
+ }
+ 
+-int bprintf(va_alist) va_dcl
++int bprintf(char *fmt, ...)
+ {
+ 	int bw, pending = 0, ll;
+ 	va_list ap;
+-	char *fmt;
+ 	static int tot = 0;
+ 
+-	va_start(ap);								/* start variable arg list */
+-	fmt = va_arg(ap, char*);					/* first string is format */
++	va_start(ap, fmt);								/* start variable arg list */
+ #ifdef BROKEN_VSPRINTF
+ 	vsprintf(btmp, fmt, ap);					/* pass the rest to vsprintf */
+ 	bw = strlen(btmp);

--qDbXVdCdHGoSgWSk--