Constify, add some prototypes, and set WARNS=2.
Submitted by: Mike Barcroft <mike@q9media.com>
This commit is contained in:
parent
c33fa91f61
commit
74a5ebbd66
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79751
@ -99,7 +99,7 @@ char * imalloc P((int n));
|
|||||||
void * irealloc P((void * pointer, int size));
|
void * irealloc P((void * pointer, int size));
|
||||||
void icfree P((char * pointer));
|
void icfree P((char * pointer));
|
||||||
void ifree 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.
|
** Finally, some convenience items.
|
||||||
|
@ -13,7 +13,7 @@ static const char rcsid[] =
|
|||||||
|
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
scheck(string, format)
|
scheck(string, format)
|
||||||
const char * const string;
|
const char * const string;
|
||||||
const char * const format;
|
const char * const format;
|
||||||
@ -22,7 +22,7 @@ const char * const format;
|
|||||||
register const char * fp;
|
register const char * fp;
|
||||||
register char * tp;
|
register char * tp;
|
||||||
register int c;
|
register int c;
|
||||||
register char * result;
|
register const char * result;
|
||||||
char dummy;
|
char dummy;
|
||||||
static char nada;
|
static char nada;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ const char * const format;
|
|||||||
*tp++ = 'c';
|
*tp++ = 'c';
|
||||||
*tp = '\0';
|
*tp = '\0';
|
||||||
if (sscanf(string, fbuf, &dummy) != 1)
|
if (sscanf(string, fbuf, &dummy) != 1)
|
||||||
result = (char *) format;
|
result = format;
|
||||||
ifree(fbuf);
|
ifree(fbuf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
.PATH: ${.CURDIR}/..
|
.PATH: ${.CURDIR}/..
|
||||||
|
|
||||||
PROG= zdump
|
PROG= zdump
|
||||||
|
WARNS?= 2
|
||||||
|
|
||||||
SRCS= zdump.c ialloc.c scheck.c
|
SRCS= zdump.c ialloc.c scheck.c
|
||||||
MAN= ${.CURDIR}/../zdump.8
|
MAN= ${.CURDIR}/../zdump.8
|
||||||
|
@ -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 leapadd P((time_t t, int positive, int rolling, int count));
|
||||||
static void adjleap P((void));
|
static void adjleap P((void));
|
||||||
static void associate 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 int ciequal P((const char * ap, const char * bp));
|
||||||
static void convert P((long val, char * buf));
|
static void convert P((long val, char * buf));
|
||||||
static void dolink P((const char * fromfile, const char * tofile));
|
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 void setuser P((uid_t *flag, const char *name));
|
||||||
static time_t tadd P((time_t t1, long t2));
|
static time_t tadd P((time_t t1, long t2));
|
||||||
static void usage P((void));
|
static void usage P((void));
|
||||||
|
static void warning P((const char * const string));
|
||||||
static void writezone P((const char * name));
|
static void writezone P((const char * name));
|
||||||
static int yearistype P((int year, const char * type));
|
static int yearistype P((int year, const char * type));
|
||||||
|
|
||||||
@ -1360,12 +1362,14 @@ FILE * const fp;
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
atcomp(avp, bvp)
|
atcomp(avp, bvp)
|
||||||
void * avp;
|
const void * avp;
|
||||||
void * bvp;
|
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;
|
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;
|
return 1;
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
.PATH: ${.CURDIR}/..
|
.PATH: ${.CURDIR}/..
|
||||||
|
|
||||||
PROG= zic
|
PROG= zic
|
||||||
|
WARNS?= 2
|
||||||
|
|
||||||
SRCS= zic.c ialloc.c scheck.c
|
SRCS= zic.c ialloc.c scheck.c
|
||||||
MAN= ${.CURDIR}/../zic.8
|
MAN= ${.CURDIR}/../zic.8
|
||||||
|
Loading…
Reference in New Issue
Block a user