lib, tools, pan: old-style function definition fixes
No functional changes. No "cleanup". Just fixes for
"old-style function definition" compile warnings.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
diff --git a/lib/datapid.c b/lib/datapid.c
index 23164d3..dad1a12 100644
--- a/lib/datapid.c
+++ b/lib/datapid.c
@@ -81,11 +81,7 @@
* thus, offset 16 is the start of the second full word
* Thus, offset 8 is in middle of word 1
***********************************************************************/
-int datapidgen(pid, buffer, bsize, offset)
-int pid;
-char *buffer;
-int bsize;
-int offset;
+int datapidgen(int pid, char *buffer, int bsize, int offset)
{
#if CRAY
@@ -182,12 +178,7 @@
*
*
***********************************************************************/
-int datapidchk(pid, buffer, bsize, offset, errmsg)
-int pid;
-char *buffer;
-int bsize;
-int offset;
-char **errmsg;
+int datapidchk(int pid, char *buffer, int bsize, int offset, char **errmsg)
{
#if CRAY
diff --git a/lib/file_lock.c b/lib/file_lock.c
index 52c8947..0d86f2c 100644
--- a/lib/file_lock.c
+++ b/lib/file_lock.c
@@ -58,10 +58,7 @@
* Test interface to the fcntl system call.
* It will loop if the LOCK_NB flags is NOT set.
***********************************************************************/
-int file_lock(fd, flags, errormsg)
-int fd;
-int flags;
-char **errormsg;
+int file_lock(int fd, int flags, char **errormsg)
{
register int cmd, ret;
struct flock flocks;
@@ -133,12 +130,7 @@
* Test interface to the fcntl system call.
* It will loop if the LOCK_NB flags is NOT set.
***********************************************************************/
-int record_lock(fd, flags, start, len, errormsg)
-int fd;
-int flags;
-int start;
-int len;
-char **errormsg;
+int record_lock(int fd, int flags, int start, int len, char **errormsg)
{
register int cmd, ret;
struct flock flocks;
diff --git a/lib/forker.c b/lib/forker.c
index 5e6ac48..0f82815 100644
--- a/lib/forker.c
+++ b/lib/forker.c
@@ -127,8 +127,7 @@
* 0 : if fork did not fail
* !0 : if fork failed, the return value will be the errno.
***********************************************************************/
-int background(prefix)
-char *prefix;
+int background(char *prefix)
{
switch (fork()) {
case -1:
@@ -153,12 +152,11 @@
* Forker will fork ncopies-1 copies of self.
*
***********************************************************************/
-int forker(ncopies, mode, prefix)
-int ncopies;
-int mode; /* 0 - all childern of parent, 1 - only 1 direct child */
-char *prefix; /* if ! NULL, an message will be printed to stderr */
- /* if fork fails. The prefix (program name) will */
- /* preceed the message */
+int forker(int ncopies,
+ int mode, /* 0 - all children of parent, 1 - only 1 direct child */
+ char *prefix) /* if ! NULL, an message will be printed to stderr */
+ /* if fork fails. The prefix (program name) will */
+ /* preceed the message */
{
int cnt;
int pid;
diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index 3e99bdb..759fd3f 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -632,7 +632,7 @@
/*
* routine to goto when we get the SIGUSR1 for STD_PAUSE
*/
-void STD_go()
+void STD_go(int sig)
{
return;
}
diff --git a/lib/pattern.c b/lib/pattern.c
index 5863965..7f46aef 100644
--- a/lib/pattern.c
+++ b/lib/pattern.c
@@ -37,12 +37,7 @@
* with/against a known pattern.
*/
-int pattern_check(buf, buflen, pat, patlen, patshift)
-char *buf;
-int buflen;
-char *pat;
-int patlen;
-int patshift;
+int pattern_check(char *buf, int buflen, char *pat, int patlen, int patshift)
{
int nb, ncmp, nleft;
char *cp;
@@ -103,12 +98,7 @@
return 0;
}
-int pattern_fill(buf, buflen, pat, patlen, patshift)
-char *buf;
-int buflen;
-char *pat;
-int patlen;
-int patshift;
+int pattern_fill(char *buf, int buflen, char *pat, int patlen, int patshift)
{
int trans, ncopied, nleft;
char *cp;
diff --git a/lib/random_range.c b/lib/random_range.c
index cd2096c..1d88dd2 100644
--- a/lib/random_range.c
+++ b/lib/random_range.c
@@ -98,14 +98,8 @@
static int str_to_int();
static long long divider(long long, long long, long long, long long);
-int parse_ranges(str, defmin, defmax, defmult, parse_func, rangeptr, errptr)
-char *str;
-int defmin;
-int defmax;
-int defmult;
-int (*parse_func) ();
-char **rangeptr;
-char **errptr;
+int parse_ranges(char *str, int defmin, int defmax, int defmult,
+ int (*parse_func)(), char **rangeptr, char **errptr)
{
int ncommas;
char *tmpstr, *cp, *tok, *n1str, *n2str, *multstr;
@@ -224,9 +218,7 @@
* The default integer-parsing function
*/
-static int str_to_int(str, ip)
-char *str;
-int *ip;
+static int str_to_int(char *str, int *ip)
{
char c;
@@ -243,23 +235,17 @@
* and that r is a valid range within that buffer.
*/
-int range_min(rbuf, r)
-char *rbuf;
-int r;
+int range_min(char *rbuf, int r)
{
return ((struct range *)rbuf)[r].min;
}
-int range_max(rbuf, r)
-char *rbuf;
-int r;
+int range_max(char *rbuf, int r)
{
return ((struct range *)rbuf)[r].max;
}
-int range_mult(rbuf, r)
-char *rbuf;
-int r;
+int range_mult(char *rbuf, int r)
{
return ((struct range *)rbuf)[r].mult;
}
@@ -289,11 +275,7 @@
* setting the seed.
*****************************************************************************/
-long random_range(min, max, mult, errp)
-int min;
-int max;
-int mult;
-char **errp;
+long random_range(int min, int max, int mult, char **errp)
{
int r, nmults, orig_min, orig_max, orig_mult, tmp;
extern long lrand48();
@@ -380,11 +362,7 @@
/*
* Just like random_range, but all values are longs.
*/
-long random_rangel(min, max, mult, errp)
-long min;
-long max;
-long mult;
-char **errp;
+long random_rangel(long min, long max, long mult, char **errp)
{
long r, nmults, orig_min, orig_max, orig_mult, tmp;
extern long lrand48();
@@ -470,11 +448,8 @@
/*
* Attempts to be just like random_range, but everything is long long (64 bit)
*/
-long long random_rangell(min, max, mult, errp)
-long long min;
-long long max;
-long long mult;
-char **errp;
+long long random_rangell(long long min, long long max,
+ long long mult, char **errp)
{
long long r, nmults, orig_min, orig_max, orig_mult, tmp;
long long randnum;
@@ -634,8 +609,7 @@
* be used in random_range().
*****************************************************************************/
-void random_range_seed(s)
-long s;
+void random_range_seed(long s)
{
extern void srand48();
diff --git a/lib/search_path.c b/lib/search_path.c
index a5ebfad..5c516c9 100644
--- a/lib/search_path.c
+++ b/lib/search_path.c
@@ -124,11 +124,10 @@
/*
*/
-int search_path(cmd, res_path, access_mode, fullpath)
-char *cmd; /* The requested filename */
-char *res_path; /* The resulting path or error mesg */
-int access_mode; /* the mode used by access(2) */
-int fullpath; /* if set, cwd will be prepended to all non-full paths */
+int search_path(char *cmd, /* the requested filename */
+ char *res_path, /* the resulting path or error msg*/
+ int access_mode, /* the mode used by access(2) */
+ int fullpath) /* if set, cwd wil be prepended to all non-full paths */
{
char *cp; /* used to scan PATH for directories */
int ret; /* return value from access */
diff --git a/lib/tlibio.c b/lib/tlibio.c
index 9104a72..6b6103f 100644
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -216,13 +216,8 @@
* (maule, 11/16/95)
***********************************************************************/
-int stride_bounds(offset, stride, nstrides, bytes_per_stride, min, max)
-int offset;
-int stride;
-int nstrides;
-int bytes_per_stride;
-int *min;
-int *max;
+int stride_bounds(int offset, int stride, int nstrides, int bytes_per_stride,
+ int *min, int *max)
{
int nbytes, min_byte, max_byte;
@@ -268,7 +263,7 @@
/***********************************************************************
* This function will allow someone to set the debug level.
***********************************************************************/
-int lio_set_debug(level)
+int lio_set_debug(int level)
{
int old;
@@ -539,14 +534,13 @@
*
* (rrl 04/96)
***********************************************************************/
-int lio_write_buffer(fd, method, buffer, size, sig, errmsg, wrd)
-int fd; /* open file descriptor */
-int method; /* contains io type and wait method bitmask */
-char *buffer; /* pointer to buffer */
-int size; /* the size of the io */
-int sig; /* signal to use if async io */
-char **errmsg; /* char pointer that will be updated to point to err message */
-long wrd; /* to allow future features, use zero for now */
+int lio_write_buffer(int fd, /* open file descriptor */
+ int method, /* contains io type and wait method bitmask */
+ char *buffer, /* pointer to buffer */
+ int size, /* the size of the io */
+ int sig, /* signal to use if async io */
+ char **errmsg, /* char pointer that will be updated to point to err message */
+ long wrd) /* to allow future features, use zero for now */
{
int ret = 0; /* syscall return or used to get random method */
char *io_type; /* Holds string of type of io */
@@ -1110,14 +1104,13 @@
*
* (rrl 04/96)
***********************************************************************/
-int lio_read_buffer(fd, method, buffer, size, sig, errmsg, wrd)
-int fd; /* open file descriptor */
-int method; /* contains io type and wait method bitmask */
-char *buffer; /* pointer to buffer */
-int size; /* the size of the io */
-int sig; /* signal to use if async io */
-char **errmsg; /* char pointer that will be updated to point to err message */
-long wrd; /* to allow future features, use zero for now */
+int lio_read_buffer(int fd, /* open file descriptor */
+ int method, /* contains io type and wait method bitmask*/
+ char *buffer, /* pointer to buffer */
+ int size, /* the size of the io */
+ int sig, /* signal to use if async io */
+ char **errmsg, /* char pointer that will be updated to point to err message */
+ long wrd) /* to allow future features, use zero for now */
{
int ret = 0; /* syscall return or used to get random method */
char *io_type; /* Holds string of type of io */
diff --git a/lib/write_log.c b/lib/write_log.c
index 1731dc3..6fc6258 100644
--- a/lib/write_log.c
+++ b/lib/write_log.c
@@ -110,10 +110,7 @@
* umask.
*/
-int wlog_open(wfile, trunc, mode)
-struct wlog_file *wfile;
-int trunc;
-int mode;
+int wlog_open(struct wlog_file *wfile, int trunc, int mode)
{
int omask, oflags;
@@ -159,8 +156,7 @@
* with the wlog_open() call.
*/
-int wlog_close(wfile)
-struct wlog_file *wfile;
+int wlog_close(struct wlog_file *wfile)
{
close(wfile->w_afd);
close(wfile->w_rfd);
@@ -193,10 +189,8 @@
* place before the record is written.
*/
-int wlog_record_write(wfile, wrec, offset)
-struct wlog_file *wfile;
-struct wlog_rec *wrec;
-long offset;
+int wlog_record_write(struct wlog_file *wfile, struct wlog_rec *wrec,
+ long offset)
{
int reclen;
char wbuf[WLOG_REC_MAX_SIZE + 2];
@@ -264,11 +258,8 @@
* will be passed a single parameter - a wlog_rec structure .
*/
-int wlog_scan_backward(wfile, nrecs, func, data)
-struct wlog_file *wfile;
-int nrecs;
-int (*func) ();
-long data;
+int wlog_scan_backward(struct wlog_file *wfile, int nrecs,
+ int (*func)(), long data)
{
int fd, leftover, nbytes, offset, recnum, reclen, rval;
char buf[BSIZE * 32], *bufend, *cp, *bufstart;
@@ -410,10 +401,7 @@
* these routines must be reflected in the other.
*/
-static int wlog_rec_pack(wrec, buf, flag)
-struct wlog_rec *wrec;
-char *buf;
-int flag;
+static int wlog_rec_pack(struct wlog_rec *wrec, char *buf, int flag)
{
char *file, *host, *pattern;
struct wlog_rec_disk *wrecd;
@@ -460,9 +448,7 @@
}
}
-static int wlog_rec_unpack(wrec, buf)
-struct wlog_rec *wrec;
-char *buf;
+static int wlog_rec_unpack(struct wlog_rec *wrec, char *buf)
{
char *file, *host, *pattern;
struct wlog_rec_disk *wrecd;