Various changes to make locate compilable with WARNS=6. Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents actually bumping this to WARNS=6 - I'm still considering the correct solution to this issue. Tested by: make universe
This commit is contained in:
parent
ddcdd26ef6
commit
31fa41024e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209571
@ -37,6 +37,7 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
@ -46,6 +47,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* bigram < sorted_file_names | sort -nr |
|
||||
@ -67,9 +69,9 @@ u_int bigram[UCHAR_MAX + 1][UCHAR_MAX + 1];
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
register u_char *cp;
|
||||
register u_char *oldpath = buf1, *path = buf2;
|
||||
register u_int i, j;
|
||||
u_char *cp;
|
||||
u_char *oldpath = buf1, *path = buf2;
|
||||
u_int i, j;
|
||||
|
||||
while (fgets(path, sizeof(buf2), stdin) != NULL) {
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
@ -46,6 +47,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)locate.code.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PURPOSE: sorted list compressor (works with a modified 'find'
|
||||
@ -122,14 +124,12 @@ int bgindex(char *);
|
||||
void usage(void);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
register u_char *cp, *oldpath, *path;
|
||||
u_char *cp, *oldpath, *path;
|
||||
int ch, code, count, diffcount, oldcount;
|
||||
u_int i, j;
|
||||
FILE *fp;
|
||||
register int i, j;
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch(ch) {
|
||||
@ -256,10 +256,9 @@ main(argc, argv)
|
||||
|
||||
#ifndef LOOKUP
|
||||
int
|
||||
bgindex(bg) /* Return location of bg in bigrams or -1. */
|
||||
char *bg;
|
||||
bgindex(char *bg) /* Return location of bg in bigrams or -1. */
|
||||
{
|
||||
register char bg0, bg1, *p;
|
||||
char bg0, bg1, *p;
|
||||
|
||||
bg0 = bg[0];
|
||||
bg1 = bg[1];
|
||||
@ -271,7 +270,7 @@ bgindex(bg) /* Return location of bg in bigrams or -1. */
|
||||
#endif /* !LOOKUP */
|
||||
|
||||
void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: locate.code common_bigrams < list > squozen_list\n");
|
||||
|
Loading…
Reference in New Issue
Block a user