summaryrefslogtreecommitdiffstats
path: root/bin/cp
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:15:22 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:15:22 +0000
commit41e5cc1a95a5bfa252a69404fcb3cd5e9eaec898 (patch)
tree6322786c2b91ab96c1f709f394e8db65851d90b8 /bin/cp
parentef44ec93a71d6f956cf008bf3f58ad2fc4623a4f (diff)
downloadFreeBSD-src-41e5cc1a95a5bfa252a69404fcb3cd5e9eaec898.zip
FreeBSD-src-41e5cc1a95a5bfa252a69404fcb3cd5e9eaec898.tar.gz
Modernization effort for bin/c*:
o __P has been reoved o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Approved by: arch@, new style(9)
Diffstat (limited to 'bin/cp')
-rw-r--r--bin/cp/cp.c16
-rw-r--r--bin/cp/extern.h12
-rw-r--r--bin/cp/utils.c22
3 files changed, 17 insertions, 33 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 19faa28..0aede8b 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -88,13 +88,11 @@ int Rflag, iflag, pflag, rflag, fflag, vflag;
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
-int copy __P((char *[], enum op, int));
-int mastercmp __P((const FTSENT **, const FTSENT **));
+int copy(char *[], enum op, int);
+int mastercmp(const FTSENT **, const FTSENT **);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat to_stat, tmp_stat;
enum op type;
@@ -238,10 +236,7 @@ main(argc, argv)
}
int
-copy(argv, type, fts_options)
- char *argv[];
- enum op type;
- int fts_options;
+copy(char *argv[], enum op type, int fts_options)
{
struct stat to_stat;
FTS *ftsp;
@@ -460,8 +455,7 @@ copy(argv, type, fts_options)
* files first reduces seeking.
*/
int
-mastercmp(a, b)
- const FTSENT **a, **b;
+mastercmp(const FTSENT **a, const FTSENT **b)
{
int a_info, b_info;
diff --git a/bin/cp/extern.h b/bin/cp/extern.h
index 4e5f07c..5647b5f 100644
--- a/bin/cp/extern.h
+++ b/bin/cp/extern.h
@@ -46,10 +46,10 @@ extern int iflag, pflag, fflag, vflag;
#include <sys/cdefs.h>
__BEGIN_DECLS
-int copy_fifo __P((struct stat *, int));
-int copy_file __P((FTSENT *, int));
-int copy_link __P((FTSENT *, int));
-int copy_special __P((struct stat *, int));
-int setfile __P((struct stat *, int));
-void usage __P((void));
+int copy_fifo(struct stat *, int);
+int copy_file(FTSENT *, int);
+int copy_link(FTSENT *, int);
+int copy_special(struct stat *, int);
+int setfile(struct stat *, int);
+void usage(void);
__END_DECLS
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index adc04a7..d6eb0b1 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -59,9 +59,7 @@ static const char rcsid[] =
#include "extern.h"
int
-copy_file(entp, dne)
- FTSENT *entp;
- int dne;
+copy_file(FTSENT *entp, int dne)
{
static char buf[MAXBSIZE];
struct stat *fs;
@@ -190,9 +188,7 @@ copy_file(entp, dne)
}
int
-copy_link(p, exists)
- FTSENT *p;
- int exists;
+copy_link(FTSENT *p, int exists)
{
int len;
char link[PATH_MAX];
@@ -214,9 +210,7 @@ copy_link(p, exists)
}
int
-copy_fifo(from_stat, exists)
- struct stat *from_stat;
- int exists;
+copy_fifo(struct stat *from_stat, int exists)
{
if (exists && unlink(to.p_path)) {
warn("unlink: %s", to.p_path);
@@ -230,9 +224,7 @@ copy_fifo(from_stat, exists)
}
int
-copy_special(from_stat, exists)
- struct stat *from_stat;
- int exists;
+copy_special(struct stat *from_stat, int exists)
{
if (exists && unlink(to.p_path)) {
warn("unlink: %s", to.p_path);
@@ -249,9 +241,7 @@ copy_special(from_stat, exists)
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
int
-setfile(fs, fd)
- register struct stat *fs;
- int fd;
+setfile(struct stat *fs, int fd)
{
static struct timeval tv[2];
struct stat ts;
@@ -308,7 +298,7 @@ setfile(fs, fd)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
OpenPOWER on IntegriCloud