summaryrefslogtreecommitdiffstats
path: root/usr.bin/touch
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/touch
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/touch')
-rw-r--r--usr.bin/touch/touch.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index 26ccf0e..30d22ed 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -65,9 +65,7 @@ void stime_file(char *, struct timeval *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
struct timeval tv[2];
@@ -197,9 +195,7 @@ main(argc, argv)
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
void
-stime_arg1(arg, tvp)
- char *arg;
- struct timeval *tvp;
+stime_arg1(char *arg, struct timeval *tvp)
{
time_t now;
struct tm *t;
@@ -260,10 +256,7 @@ terr: errx(1,
}
void
-stime_arg2(arg, year, tvp)
- char *arg;
- int year;
- struct timeval *tvp;
+stime_arg2(char *arg, int year, struct timeval *tvp)
{
time_t now;
struct tm *t;
@@ -293,9 +286,7 @@ stime_arg2(arg, year, tvp)
}
void
-stime_file(fname, tvp)
- char *fname;
- struct timeval *tvp;
+stime_file(char *fname, struct timeval *tvp)
{
struct stat sb;
@@ -306,10 +297,7 @@ stime_file(fname, tvp)
}
int
-rw(fname, sbp, force)
- char *fname;
- struct stat *sbp;
- int force;
+rw(char *fname, struct stat *sbp, int force)
{
int fd, needed_chmod, rval;
u_char byte;
@@ -358,7 +346,7 @@ err: rval = 1;
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: touch [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...\n");
exit(1);
OpenPOWER on IntegriCloud