aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-07-14 06:49:52 +0000
committerEric Andersen <andersen@codepoet.org>2000-07-14 06:49:52 +0000
commitfad04fdd12604a46eff62875343515c33e1863c6 (patch)
tree7b840eb074878c454141ce76ba7328f4a8621f1b /coreutils
parentb870af09ae1892ab84dd089529675cc2df533e71 (diff)
downloadbusybox-fad04fdd12604a46eff62875343515c33e1863c6.tar.gz
More cleanups.
-Erik
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/tail.c24
-rw-r--r--coreutils/test.c4
-rw-r--r--coreutils/tr.c8
3 files changed, 18 insertions, 18 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 601f0873d..9232356eb 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -104,7 +104,7 @@ static void write_header(const char *filename)
Return 0 if successful, 1 if an error occurred. */
static int
-file_lines(const char *filename, int fd, long int n_lines, off_t pos)
+file_lines(int fd, long int n_lines, off_t pos)
{
char buffer[BUFSIZ];
int bytes_read;
@@ -164,7 +164,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
Buffer the text as a linked list of LBUFFERs, adding them as needed.
Return 0 if successful, 1 if an error occured. */
-static int pipe_lines(const char *filename, int fd, long int n_lines)
+static int pipe_lines(int fd, long int n_lines)
{
struct linebuffer {
int nbytes, nlines;
@@ -266,7 +266,7 @@ static int pipe_lines(const char *filename, int fd, long int n_lines)
If `forever' is nonzero, keep reading from the end of the file
until killed. Return the number of bytes read from the file. */
-static long dump_remainder(const char *filename, int fd)
+static long dump_remainder(int fd)
{
char buffer[BUFSIZ];
int bytes_read;
@@ -312,11 +312,11 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
if (S_ISREG(stats.st_mode)
&& lseek(fd, (off_t) 0, SEEK_CUR) == (off_t) 0) {
length = lseek(fd, (off_t) 0, SEEK_END);
- if (length != 0 && file_lines(filename, fd, n_lines, length))
+ if (length != 0 && file_lines(fd, n_lines, length))
return 1;
- dump_remainder(filename, fd);
+ dump_remainder(fd);
} else
- return pipe_lines(filename, fd, n_lines);
+ return pipe_lines(fd, n_lines);
return 0;
}
@@ -616,7 +616,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
Buffer the text as a linked list of LBUFFERs, adding them as needed.
Return 0 if successful, 1 if an error occured. */
-static int pipe_lines(const char *filename, int fd, long int n_lines)
+static int pipe_lines(int fd, long int n_lines)
{
struct linebuffer {
int nbytes, nlines;
@@ -850,7 +850,7 @@ static int start_lines(const char *filename, int fd, long int n_lines)
If `forever' is nonzero, keep reading from the end of the file
until killed. Return the number of bytes read from the file. */
-static long dump_remainder(const char *filename, int fd)
+static long dump_remainder(int fd)
{
char buffer[BUFSIZ];
int bytes_read;
@@ -925,7 +925,7 @@ static void tail_forever(char **names, int nfiles)
write_header(names[i], NULL);
last = i;
}
- file_sizes[i] += dump_remainder(names[i], file_descs[i]);
+ file_sizes[i] += dump_remainder(file_descs[i]);
}
/* If none of the files changed size, sleep. */
@@ -955,7 +955,7 @@ static int tail_bytes(const char *filename, int fd, off_t n_bytes)
lseek(fd, n_bytes, SEEK_CUR);
else if (start_bytes(filename, fd, n_bytes))
return 1;
- dump_remainder(filename, fd);
+ dump_remainder(fd);
} else {
if (S_ISREG(stats.st_mode)) {
off_t current_pos, end_pos;
@@ -1021,9 +1021,9 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
length = lseek(fd, (off_t) 0, SEEK_END);
if (length != 0 && file_lines(filename, fd, n_lines, length))
return 1;
- dump_remainder(filename, fd);
+ dump_remainder(fd);
} else
- return pipe_lines(filename, fd, n_lines);
+ return pipe_lines(fd, n_lines);
}
return 0;
}
diff --git a/coreutils/test.c b/coreutils/test.c
index d7b34a6a4..175cb5d05 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -372,7 +372,7 @@ filstat(nm, mode)
enum token mode;
{
struct stat s;
- int i;
+ unsigned int i;
if (mode == FILSYM) {
#ifdef S_IFLNK
@@ -535,7 +535,7 @@ char *path;
int mode;
{
struct stat st;
- int euid = geteuid();
+ unsigned int euid = geteuid();
if (stat (path, &st) < 0)
return (-1);
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 89fe3f5b0..2971ef68e 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -140,10 +140,10 @@ static unsigned int expand(char *arg, register unsigned char *buffer)
return (buffer - buffer_start);
}
-static int complement(unsigned char *buffer, unsigned int buffer_len)
+static int complement(unsigned char *buffer, int buffer_len)
{
register short i, j, index;
- unsigned char conv[ASCII + 2];
+ char conv[ASCII + 2];
index = 0;
for (i = 0; i <= ASCII; i++) {
@@ -160,9 +160,9 @@ static int complement(unsigned char *buffer, unsigned int buffer_len)
extern int tr_main(int argc, char **argv)
{
register unsigned char *ptr;
- unsigned int output_length=0, input_length;
+ int output_length=0, input_length;
int index = 1;
- short i;
+ int i;
if (argc > 1 && argv[index][0] == '-') {
for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) {