diff options
author | dd <dd@FreeBSD.org> | 2001-07-15 06:20:45 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-07-15 06:20:45 +0000 |
commit | 12905cca18a426ad61e22cdda820116f6b9ecfcf (patch) | |
tree | cc364f39ce214e405b1f03e2e603c055b67c63f6 /usr.sbin/zic | |
parent | b578da3f944fbfadede60707e01e8b6cf4e06b23 (diff) | |
download | FreeBSD-src-12905cca18a426ad61e22cdda820116f6b9ecfcf.zip FreeBSD-src-12905cca18a426ad61e22cdda820116f6b9ecfcf.tar.gz |
Constify, add some prototypes, and set WARNS=2.
Submitted by: Mike Barcroft <mike@q9media.com>
Diffstat (limited to 'usr.sbin/zic')
-rw-r--r-- | usr.sbin/zic/private.h | 2 | ||||
-rw-r--r-- | usr.sbin/zic/scheck.c | 6 | ||||
-rw-r--r-- | usr.sbin/zic/zdump/Makefile | 1 | ||||
-rw-r--r-- | usr.sbin/zic/zic.c | 12 | ||||
-rw-r--r-- | usr.sbin/zic/zic/Makefile | 1 |
5 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/zic/private.h b/usr.sbin/zic/private.h index 585d6e6..4eb54a3 100644 --- a/usr.sbin/zic/private.h +++ b/usr.sbin/zic/private.h @@ -99,7 +99,7 @@ char * imalloc P((int n)); 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. diff --git a/usr.sbin/zic/scheck.c b/usr.sbin/zic/scheck.c index 692bf1a..028d009 100644 --- a/usr.sbin/zic/scheck.c +++ b/usr.sbin/zic/scheck.c @@ -13,7 +13,7 @@ static const char rcsid[] = #include "private.h" -char * +const char * scheck(string, format) const char * const string; const char * const format; @@ -22,7 +22,7 @@ const char * const format; 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 @@ const char * const format; *tp++ = 'c'; *tp = '\0'; if (sscanf(string, fbuf, &dummy) != 1) - result = (char *) format; + result = format; ifree(fbuf); return result; } diff --git a/usr.sbin/zic/zdump/Makefile b/usr.sbin/zic/zdump/Makefile index 2088d18..49bd6a0 100644 --- a/usr.sbin/zic/zdump/Makefile +++ b/usr.sbin/zic/zdump/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/.. PROG= zdump +WARNS?= 2 SRCS= zdump.c ialloc.c scheck.c MAN= ${.CURDIR}/../zdump.8 diff --git a/usr.sbin/zic/zic.c b/usr.sbin/zic/zic.c index 109b978..1d50a7f 100644 --- a/usr.sbin/zic/zic.c +++ b/usr.sbin/zic/zic.c @@ -89,6 +89,7 @@ static int addtype P((long gmtoff, const char * abbr, int isdst, 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 setgroup P((gid_t *flag, const char *name)); 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 @@ FILE * const fp; 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; } diff --git a/usr.sbin/zic/zic/Makefile b/usr.sbin/zic/zic/Makefile index 5980252..97db63e 100644 --- a/usr.sbin/zic/zic/Makefile +++ b/usr.sbin/zic/zic/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/.. PROG= zic +WARNS?= 2 SRCS= zic.c ialloc.c scheck.c MAN= ${.CURDIR}/../zic.8 |