summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-02-09 09:54:46 +0000
committerotto <otto@openbsd.org>2006-02-09 09:54:46 +0000
commit5c151985f8a19b8e17f09b2ba4cdc157c50b3cb3 (patch)
treece210507d37f85560ba58edfaff06c595d30d1b4
parentTurn validate_plist() into a real visitor that calls validate() for each (diff)
downloadwireguard-openbsd-5c151985f8a19b8e17f09b2ba4cdc157c50b3cb3.tar.xz
wireguard-openbsd-5c151985f8a19b8e17f09b2ba4cdc157c50b3cb3.zip
delint; remove redundant vars and functions; ok jaredy@
-rw-r--r--usr.bin/grep/file.c20
-rw-r--r--usr.bin/grep/grep.c4
-rw-r--r--usr.bin/grep/grep.h10
-rw-r--r--usr.bin/grep/mmfile.c14
-rw-r--r--usr.bin/grep/queue.c8
-rw-r--r--usr.bin/grep/util.c9
6 files changed, 9 insertions, 56 deletions
diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c
index dcb99ed8d26..fd935574204 100644
--- a/usr.bin/grep/file.c
+++ b/usr.bin/grep/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.8 2006/02/07 22:05:54 otto Exp $ */
+/* $OpenBSD: file.c,v 1.9 2006/02/09 09:54:46 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -173,24 +173,6 @@ grep_bin_file(file_t *f)
}
}
-long
-grep_tell(file_t *f)
-{
- switch (f->type) {
- case FILE_STDIO:
- return ftell(f->f);
- case FILE_MMAP:
- return mmtell(f->mmf);
-#ifndef NOZ
- case FILE_GZIP:
- return gztell(f->gzf);
-#endif
- default:
- /* can't happen */
- errx(2, "invalid file type");
- }
-}
-
char *
grep_fgetln(file_t *f, size_t *l)
{
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index 0a90cd39578..eedc610ba94 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.33 2005/04/03 19:18:33 jaredy Exp $ */
+/* $OpenBSD: grep.c,v 1.34 2006/02/09 09:54:46 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -67,7 +67,6 @@ int Lflag; /* -L: only show names of files with no matches */
int Pflag; /* -P: if -R, no symlinks are followed */
int Rflag; /* -R: recursively search directory trees */
int Sflag; /* -S: if -R, follow all symlinks */
-int Vflag; /* -V: display version information */
#ifndef NOZ
int Zflag; /* -Z: decompress input before processing */
#endif
@@ -97,7 +96,6 @@ enum {
/* Housekeeping */
int first; /* flag whether or not this is our first match */
int tail; /* lines left to print */
-int lead; /* number of lines in leading context queue */
struct patfile {
const char *pf_file;
diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h
index cd2ca511455..b753bc8740a 100644
--- a/usr.bin/grep/grep.h
+++ b/usr.bin/grep/grep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.h,v 1.12 2004/10/03 19:23:02 otto Exp $ */
+/* $OpenBSD: grep.h,v 1.13 2006/02/09 09:54:47 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -69,7 +69,7 @@ extern int Aflag, Bflag, Eflag, Fflag, Gflag, Hflag, Lflag, Pflag,
vflag, wflag, xflag;
extern int binbehave;
-extern int first, lead, matchall, patterns, tail;
+extern int first, matchall, patterns, tail;
extern char **pattern;
extern fastgrep_t *fg_pattern;
extern regex_t *r_pattern;
@@ -85,14 +85,13 @@ void *grep_malloc(size_t size);
void *grep_realloc(void *ptr, size_t size);
void printline(str_t *line, int sep);
int fastcomp(fastgrep_t *, const char *);
-int fgrepcomp(fastgrep_t *, const char *);
+void fgrepcomp(fastgrep_t *, const char *);
/* queue.c */
void initqueue(void);
void enqueue(str_t *x);
void printqueue(void);
void clearqueue(void);
-int countqueue(void);
/* mmfile.c */
typedef struct mmfile {
@@ -104,8 +103,6 @@ typedef struct mmfile {
mmf_t *mmopen(char *fn, char *mode);
void mmclose(mmf_t *mmf);
char *mmfgetln(mmf_t *mmf, size_t *l);
-long mmtell(mmf_t *mmf);
-void mmrewind(mmf_t *mmf);
/* file.c */
struct file;
@@ -114,7 +111,6 @@ typedef struct file file_t;
file_t *grep_fdopen(int fd, char *mode);
file_t *grep_open(char *path, char *mode);
int grep_bin_file(file_t *f);
-long grep_tell(file_t *f);
char *grep_fgetln(file_t *f, size_t *l);
void grep_close(file_t *f);
diff --git a/usr.bin/grep/mmfile.c b/usr.bin/grep/mmfile.c
index 0f1af57cf13..c0996ade624 100644
--- a/usr.bin/grep/mmfile.c
+++ b/usr.bin/grep/mmfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmfile.c,v 1.9 2004/10/03 19:23:02 otto Exp $ */
+/* $OpenBSD: mmfile.c,v 1.10 2006/02/09 09:54:47 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -96,15 +96,3 @@ mmfgetln(mmf_t *mmf, size_t *l)
++mmf->ptr;
return p;
}
-
-long
-mmtell(mmf_t *mmf)
-{
- return mmf->ptr - mmf->base;
-}
-
-void
-mmrewind(mmf_t *mmf)
-{
- mmf->ptr = mmf->base;
-}
diff --git a/usr.bin/grep/queue.c b/usr.bin/grep/queue.c
index 12cce5569ed..0ca6f76a8c5 100644
--- a/usr.bin/grep/queue.c
+++ b/usr.bin/grep/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.4 2003/06/25 05:31:11 deraadt Exp $ */
+/* $OpenBSD: queue.c,v 1.5 2006/02/09 09:54:47 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -120,9 +120,3 @@ clearqueue(void)
while ((item = dequeue()) != NULL)
free_item(item);
}
-
-int
-countqueue(void)
-{
- return count;
-}
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 1f93e9ef632..6c6d5d25063 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.30 2005/04/03 19:12:40 otto Exp $ */
+/* $OpenBSD: util.c,v 1.31 2006/02/09 09:54:47 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -221,10 +221,7 @@ print:
return c;
}
-/*
- * Returns: -1 on failure, 0 on success
- */
-int
+void
fgrepcomp(fastgrep_t *fg, const char *pattern)
{
int i;
@@ -261,8 +258,6 @@ fgrepcomp(fastgrep_t *fg, const char *pattern)
if (iflag)
fg->qsBc[tolower(fg->pattern[i])] = fg->patternLen - i;
}
-
- return (0);
}
/*