summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:24:13 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:24:13 +0000
commit5203a0a465a65bd5e6e40b6364bb0dbe05feb7cf (patch)
treebb89216bd31fd20d2f8d292f03ed0842028b958d /bin/dd
parent41e5cc1a95a5bfa252a69404fcb3cd5e9eaec898 (diff)
downloadFreeBSD-src-5203a0a465a65bd5e6e40b6364bb0dbe05feb7cf.zip
FreeBSD-src-5203a0a465a65bd5e6e40b6364bb0dbe05feb7cf.tar.gz
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/dd')
-rw-r--r--bin/dd/args.c80
-rw-r--r--bin/dd/conv.c12
-rw-r--r--bin/dd/dd.c27
-rw-r--r--bin/dd/extern.h28
-rw-r--r--bin/dd/misc.c8
-rw-r--r--bin/dd/position.c4
6 files changed, 68 insertions, 91 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c
index f639e77..96d9e35 100644
--- a/bin/dd/args.c
+++ b/bin/dd/args.c
@@ -54,25 +54,25 @@ static const char rcsid[] =
#include "dd.h"
#include "extern.h"
-static int c_arg __P((const void *, const void *));
-static int c_conv __P((const void *, const void *));
-static void f_bs __P((char *));
-static void f_cbs __P((char *));
-static void f_conv __P((char *));
-static void f_count __P((char *));
-static void f_files __P((char *));
-static void f_ibs __P((char *));
-static void f_if __P((char *));
-static void f_obs __P((char *));
-static void f_of __P((char *));
-static void f_seek __P((char *));
-static void f_skip __P((char *));
-static u_quad_t get_num __P((const char *));
-static off_t get_off_t __P((const char *));
+static int c_arg(const void *, const void *);
+static int c_conv(const void *, const void *);
+static void f_bs(char *);
+static void f_cbs(char *);
+static void f_conv(char *);
+static void f_count(char *);
+static void f_files(char *);
+static void f_ibs(char *);
+static void f_if(char *);
+static void f_obs(char *);
+static void f_of(char *);
+static void f_seek(char *);
+static void f_skip(char *);
+static u_quad_t get_num(const char *);
+static off_t get_off_t(const char *);
static const struct arg {
const char *name;
- void (*f) __P((char *));
+ void (*f)(char *);
u_int set, noset;
} args[] = {
{ "bs", f_bs, C_BS, C_BS|C_IBS|C_OBS|C_OSYNC },
@@ -96,8 +96,7 @@ static char *oper;
* args -- parse JCL syntax of dd.
*/
void
-jcl(argv)
- char **argv;
+jcl(char **argv)
{
struct arg *ap, tmp;
char *arg;
@@ -173,8 +172,7 @@ jcl(argv)
}
static int
-c_arg(a, b)
- const void *a, *b;
+c_arg(const void *a, const void *b)
{
return (strcmp(((const struct arg *)a)->name,
@@ -182,8 +180,7 @@ c_arg(a, b)
}
static void
-f_bs(arg)
- char *arg;
+f_bs(char *arg)
{
u_quad_t res;
@@ -194,8 +191,7 @@ f_bs(arg)
}
static void
-f_cbs(arg)
- char *arg;
+f_cbs(char *arg)
{
u_quad_t res;
@@ -206,8 +202,7 @@ f_cbs(arg)
}
static void
-f_count(arg)
- char *arg;
+f_count(char *arg)
{
u_quad_t res;
@@ -221,8 +216,7 @@ f_count(arg)
}
static void
-f_files(arg)
- char *arg;
+f_files(char *arg)
{
files_cnt = get_num(arg);
@@ -231,8 +225,7 @@ f_files(arg)
}
static void
-f_ibs(arg)
- char *arg;
+f_ibs(char *arg)
{
u_quad_t res;
@@ -245,16 +238,14 @@ f_ibs(arg)
}
static void
-f_if(arg)
- char *arg;
+f_if(char *arg)
{
in.name = arg;
}
static void
-f_obs(arg)
- char *arg;
+f_obs(char *arg)
{
u_quad_t res;
@@ -267,24 +258,21 @@ f_obs(arg)
}
static void
-f_of(arg)
- char *arg;
+f_of(char *arg)
{
out.name = arg;
}
static void
-f_seek(arg)
- char *arg;
+f_seek(char *arg)
{
out.offset = get_off_t(arg);
}
static void
-f_skip(arg)
- char *arg;
+f_skip(char *arg)
{
in.offset = get_off_t(arg);
@@ -314,8 +302,7 @@ static const struct conv {
};
static void
-f_conv(arg)
- char *arg;
+f_conv(char *arg)
{
struct conv *cp, tmp;
@@ -334,8 +321,7 @@ f_conv(arg)
}
static int
-c_conv(a, b)
- const void *a, *b;
+c_conv(const void *a, const void *b)
{
return (strcmp(((const struct conv *)a)->name,
@@ -355,8 +341,7 @@ c_conv(a, b)
* the product of the indicated values.
*/
static u_quad_t
-get_num(val)
- const char *val;
+get_num(const char *val)
{
u_quad_t num, mult, prevnum;
char *expr;
@@ -424,8 +409,7 @@ erange:
* cast down to an off_t, if possible.
*/
static off_t
-get_off_t(val)
- const char *val;
+get_off_t(const char *val)
{
quad_t num, mult, prevnum;
char *expr;
diff --git a/bin/dd/conv.c b/bin/dd/conv.c
index 0987a67..5b56c57 100644
--- a/bin/dd/conv.c
+++ b/bin/dd/conv.c
@@ -58,7 +58,7 @@ static const char rcsid[] =
* Worst case buffer calculation is (ibs + obs - 1).
*/
void
-def()
+def(void)
{
u_char *inp;
const u_char *t;
@@ -87,7 +87,7 @@ def()
}
void
-def_close()
+def_close(void)
{
/* Just update the count, everything is already in the buffer. */
if (in.dbcnt)
@@ -102,7 +102,7 @@ def_close()
* max out buffer: obs + cbsz
*/
void
-block()
+block(void)
{
u_char *inp, *outp;
const u_char *t;
@@ -188,7 +188,7 @@ block()
}
void
-block_close()
+block_close(void)
{
/*
* Copy any remaining data into the output buffer and pad to a record.
@@ -215,7 +215,7 @@ block_close()
* max out buffer: obs + cbsz
*/
void
-unblock()
+unblock(void)
{
u_char *inp;
const u_char *t;
@@ -249,7 +249,7 @@ unblock()
}
void
-unblock_close()
+unblock_close(void)
{
u_char *t;
size_t cnt;
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 35d3d37..52d4144 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -69,15 +69,14 @@ static const char rcsid[] =
#include "dd.h"
#include "extern.h"
-static void dd_close __P((void));
-static void dd_in __P((void));
-int main __P((int, char *[]));
-static void getfdtype __P((IO *));
-static void setup __P((void));
+static void dd_close(void);
+static void dd_in(void);
+static void getfdtype(IO *);
+static void setup(void);
IO in, out; /* input/output state */
STAT st; /* statistics */
-void (*cfunc) __P((void)); /* conversion function */
+void (*cfunc)(void); /* conversion function */
u_quad_t cpy_cnt; /* # of blocks to copy */
off_t pending = 0; /* pending seek if sparse */
u_int ddflags; /* conversion options */
@@ -86,9 +85,7 @@ quad_t files_cnt = 1; /* # of files to copy */
const u_char *ctab; /* conversion table */
int
-main(argc, argv)
- int argc __unused;
- char *argv[];
+main(int argc __unused, char *argv[])
{
(void)setlocale(LC_CTYPE, "");
jcl(argv);
@@ -107,7 +104,7 @@ main(argc, argv)
}
static void
-setup()
+setup(void)
{
u_int cnt;
struct timeval tv;
@@ -209,8 +206,7 @@ setup()
}
static void
-getfdtype(io)
- IO *io;
+getfdtype(IO *io)
{
struct stat sb;
int type;
@@ -246,7 +242,7 @@ getfdtype(io)
}
static void
-dd_in()
+dd_in(void)
{
ssize_t n;
@@ -353,7 +349,7 @@ dd_in()
* is truncated.
*/
static void
-dd_close()
+dd_close(void)
{
if (cfunc == def)
def_close();
@@ -373,8 +369,7 @@ dd_close()
}
void
-dd_out(force)
- int force;
+dd_out(int force)
{
u_char *outp;
size_t cnt, i, n;
diff --git a/bin/dd/extern.h b/bin/dd/extern.h
index 7f01b8b..8bbb357 100644
--- a/bin/dd/extern.h
+++ b/bin/dd/extern.h
@@ -40,23 +40,23 @@
#include <sys/cdefs.h>
-void block __P((void));
-void block_close __P((void));
-void dd_out __P((int));
-void def __P((void));
-void def_close __P((void));
-void jcl __P((char **));
-void pos_in __P((void));
-void pos_out __P((void));
-void summary __P((void));
-void summaryx __P((int));
-void terminate __P((int));
-void unblock __P((void));
-void unblock_close __P((void));
+void block(void);
+void block_close(void);
+void dd_out(int);
+void def(void);
+void def_close(void);
+void jcl(char **);
+void pos_in(void);
+void pos_out(void);
+void summary(void);
+void summaryx(int);
+void terminate(int);
+void unblock(void);
+void unblock_close(void);
extern IO in, out;
extern STAT st;
-extern void (*cfunc) __P((void));
+extern void (*cfunc)(void);
extern u_quad_t cpy_cnt;
extern size_t cbsz;
extern u_int ddflags;
diff --git a/bin/dd/misc.c b/bin/dd/misc.c
index 654462e..d59d52e 100644
--- a/bin/dd/misc.c
+++ b/bin/dd/misc.c
@@ -56,7 +56,7 @@ static const char rcsid[] =
#include "extern.h"
void
-summary()
+summary(void)
{
struct timeval tv;
double secs;
@@ -89,8 +89,7 @@ summary()
/* ARGSUSED */
void
-summaryx(notused)
- int notused __unused;
+summaryx(int notused __unused)
{
int save_errno = errno;
@@ -100,8 +99,7 @@ summaryx(notused)
/* ARGSUSED */
void
-terminate(sig)
- int sig;
+terminate(int sig)
{
summary();
diff --git a/bin/dd/position.c b/bin/dd/position.c
index 1a9c4b1..90019e7 100644
--- a/bin/dd/position.c
+++ b/bin/dd/position.c
@@ -60,7 +60,7 @@ static const char rcsid[] =
* output.
*/
void
-pos_in()
+pos_in(void)
{
off_t cnt;
int warned;
@@ -123,7 +123,7 @@ pos_in()
}
void
-pos_out()
+pos_out(void)
{
struct mtop t_op;
off_t cnt;
OpenPOWER on IntegriCloud