Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2001 19:04:35 -0400 (EDT)
From:      Mike Barcroft <mike@q9media.com>
To:        audit@FreeBSD.org
Subject:   src/usr.sbin/zic patch
Message-ID:  <200106232304.f5NN4Zh89727@coffee.q9media.com>

next in thread | raw e-mail | index | archive | help
I would appreciate it if someone would commit the patch at the end of
this message.  Also available at:
http://testbed.q9media.net/freebsd/zic.20010623.patch

Best regards,
Mike Barcroft

-----------------------------------------------------------------------

zic.20010623.patch

o Silence a series of compiler warnings and set WARNS?=2


Index: zic/private.h
===================================================================
RCS file: /home/ncvs/src/usr.sbin/zic/private.h,v
retrieving revision 1.4
diff -u -r1.4 private.h
--- zic/private.h	2000/11/28 18:18:56	1.4
+++ zic/private.h	2001/06/23 22:19:53
@@ -99,7 +99,7 @@
 void *	irealloc P((void * pointer, int size));
 void	icfree P((char * pointer));
 void	ifree P((char * pointer));
-char *	scheck P((const char *string, const char *format));
+const char * scheck P((const char *string, const char *format));
 
 /*
 ** Finally, some convenience items.
Index: zic/scheck.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/zic/scheck.c,v
retrieving revision 1.5
diff -u -r1.5 scheck.c
--- zic/scheck.c	2000/11/28 18:18:56	1.5
+++ zic/scheck.c	2001/06/23 22:19:53
@@ -13,7 +13,7 @@
 
 #include "private.h"
 
-char *
+const char *
 scheck(string, format)
 const char * const	string;
 const char * const	format;
@@ -22,7 +22,7 @@
 	register const char *	fp;
 	register char *		tp;
 	register int		c;
-	register char *		result;
+	register const char *	result;
 	char			dummy;
 	static char		nada;
 
@@ -58,7 +58,7 @@
 	*tp++ = 'c';
 	*tp = '\0';
 	if (sscanf(string, fbuf, &dummy) != 1)
-		result = (char *) format;
+		result = format;
 	ifree(fbuf);
 	return result;
 }
Index: zic/zic.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/zic/zic.c,v
retrieving revision 1.12
diff -u -r1.12 zic.c
--- zic/zic.c	2000/11/28 18:18:56	1.12
+++ zic/zic.c	2001/06/23 22:19:56
@@ -89,6 +89,7 @@
 static void	leapadd P((time_t t, int positive, int rolling, int count));
 static void	adjleap P((void));
 static void	associate P((void));
+static int	atcomp P((const void * avp, const void * bvp));
 static int	ciequal P((const char * ap, const char * bp));
 static void	convert P((long val, char * buf));
 static void	dolink P((const char * fromfile, const char * tofile));
@@ -129,6 +130,7 @@
 static void	setuser P((uid_t *flag, const char *name));
 static time_t	tadd P((time_t t1, long t2));
 static void	usage P((void));
+static void	warning P((const char * const string));
 static void	writezone P((const char * name));
 static int	yearistype P((int year, const char * type));
 
@@ -1360,12 +1362,14 @@
 
 static int
 atcomp(avp, bvp)
-void *	avp;
-void *	bvp;
+const void *	avp;
+const void *	bvp;
 {
-	if (((struct attype *) avp)->at < ((struct attype *) bvp)->at)
+	if (((const struct attype *) avp)->at <
+	    ((const struct attype *) bvp)->at)
 		return -1;
-	else if (((struct attype *) avp)->at > ((struct attype *) bvp)->at)
+	else if (((const struct attype *) avp)->at >
+	    ((const struct attype *) bvp)->at)
 		return 1;
 	else	return 0;
 }
Index: zic/zdump/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.sbin/zic/zdump/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- zic/zdump/Makefile	2001/03/26 14:42:20	1.6
+++ zic/zdump/Makefile	2001/06/23 22:19:56
@@ -3,6 +3,7 @@
 .PATH:	${.CURDIR}/..
 
 PROG=	zdump
+WARNS?=	2
 
 SRCS=	zdump.c ialloc.c scheck.c
 MAN=	${.CURDIR}/../zdump.8
Index: zic/zic/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.sbin/zic/zic/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- zic/zic/Makefile	2001/03/26 14:42:20	1.7
+++ zic/zic/Makefile	2001/06/23 22:19:56
@@ -3,6 +3,7 @@
 .PATH:	${.CURDIR}/..
 
 PROG=	zic
+WARNS?=	2
 
 SRCS=	zic.c ialloc.c scheck.c
 MAN=	${.CURDIR}/../zic.8

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106232304.f5NN4Zh89727>