summaryrefslogtreecommitdiffstats
path: root/usr.bin/uniq
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-09-04 23:29:10 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-09-04 23:29:10 +0000
commitb4339b74aded4c38ebcfe3a2a9b37b900abb8874 (patch)
treefb230419005f211ecea1e667385bde9886dbf0d8 /usr.bin/uniq
parent228b93ce829543fee06561687a63c17a7e821dfd (diff)
downloadFreeBSD-src-b4339b74aded4c38ebcfe3a2a9b37b900abb8874.zip
FreeBSD-src-b4339b74aded4c38ebcfe3a2a9b37b900abb8874.tar.gz
ANSIify function definitions.
Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5
Diffstat (limited to 'usr.bin/uniq')
-rw-r--r--usr.bin/uniq/uniq.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index e7d9645..4f3a7f4 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -71,11 +71,9 @@ static void usage(void);
int stricoll(char *, char*);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
- register char *t1, *t2;
+ char *t1, *t2;
FILE *ifp, *ofp;
int ch;
char *prevline, *thisline, *p;
@@ -199,9 +197,7 @@ getline(char *buf, size_t buflen, FILE *fp)
* of the line.
*/
void
-show(ofp, str)
- FILE *ofp;
- char *str;
+show(FILE *ofp, char *str)
{
if (cflag && *str)
@@ -211,10 +207,9 @@ show(ofp, str)
}
char *
-skip(str)
- register char *str;
+skip(char *str)
{
- register int nchars, nfields;
+ int nchars, nfields;
for (nfields = 0; *str != '\0' && nfields++ != numfields; ) {
while (isblank((unsigned char)*str))
@@ -227,8 +222,7 @@ skip(str)
}
FILE *
-file(name, mode)
- const char *name, *mode;
+file(const char *name, const char *mode)
{
FILE *fp;
@@ -238,8 +232,7 @@ file(name, mode)
}
void
-obsolete(argv)
- char *argv[];
+obsolete(char *argv[])
{
int len;
char *ap, *p, *start;
@@ -268,7 +261,7 @@ obsolete(argv)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: uniq [-c | -d | -u] [-i] [-f fields] [-s chars] [input [output]]\n");
@@ -276,8 +269,7 @@ usage()
}
int
-stricoll(s1, s2)
- char *s1, *s2;
+stricoll(char *s1, char *s2)
{
char *p, line1[MAXLINELEN], line2[MAXLINELEN];
OpenPOWER on IntegriCloud