summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-03-30 17:17:26 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-03-30 17:17:26 +0000
commitaafb6b12f80921401f374f773995cc7bcd87c2eb (patch)
tree0d6e2e712f45fedfd5f86903c6ae9d33f106b494
parent99e772806a36ae098c6182c10930a22d0e294773 (diff)
downloadFreeBSD-src-aafb6b12f80921401f374f773995cc7bcd87c2eb.zip
FreeBSD-src-aafb6b12f80921401f374f773995cc7bcd87c2eb.tar.gz
1) Staticise.
2) Remove registers. 3) Change some ints to size_t which are used with fread/fwrite.
-rw-r--r--usr.bin/head/head.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c
index e773f43..1daf115 100644
--- a/usr.bin/head/head.c
+++ b/usr.bin/head/head.c
@@ -60,17 +60,17 @@ static const char rcsid[] =
* Bill Joy UCB August 24, 1977
*/
-void head(FILE *, int);
-void head_bytes(FILE *, int);
-void obsolete(char *[]);
-void usage(void);
+static void head(FILE *, int);
+static void head_bytes(FILE *, size_t);
+static void obsolete(char *[]);
+static void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
{
- register int ch;
+ int ch;
FILE *fp;
int first, linecnt = -1, bytecnt = -1, eval = 0;
char *ep;
@@ -125,13 +125,13 @@ main(argc, argv)
exit(eval);
}
-void
+static void
head(fp, cnt)
FILE *fp;
- register int cnt;
+ int cnt;
{
char *cp;
- int error, readlen;
+ size_t error, readlen;
while (cnt && (cp = fgetln(fp, &readlen)) != NULL) {
error = fwrite(cp, sizeof(char), readlen, stdout);
@@ -141,13 +141,13 @@ head(fp, cnt)
}
}
-void
+static void
head_bytes(fp, cnt)
FILE *fp;
- register int cnt;
+ size_t cnt;
{
char buf[4096];
- register int readlen;
+ size_t readlen;
while (cnt) {
if (cnt < sizeof(buf))
@@ -163,7 +163,7 @@ head_bytes(fp, cnt)
}
}
-void
+static void
obsolete(argv)
char *argv[];
{
@@ -182,7 +182,7 @@ obsolete(argv)
}
}
-void
+static void
usage()
{
OpenPOWER on IntegriCloud