aboutsummaryrefslogtreecommitdiff
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
parentb870af09ae1892ab84dd089529675cc2df533e71 (diff)
downloadbusybox-w32-fad04fdd12604a46eff62875343515c33e1863c6.tar.gz
busybox-w32-fad04fdd12604a46eff62875343515c33e1863c6.tar.bz2
busybox-w32-fad04fdd12604a46eff62875343515c33e1863c6.zip
More cleanups.
-Erik
-rw-r--r--coreutils/tail.c24
-rw-r--r--coreutils/test.c4
-rw-r--r--coreutils/tr.c8
-rw-r--r--internal.h10
-rw-r--r--lash.c6
-rw-r--r--networking/ping.c8
-rw-r--r--ping.c8
-rw-r--r--procps/ps.c2
-rw-r--r--ps.c2
-rw-r--r--sh.c6
-rw-r--r--shell/lash.c6
-rw-r--r--tail.c24
-rw-r--r--test.c4
-rw-r--r--tr.c8
-rw-r--r--utility.c18
15 files changed, 69 insertions, 69 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)
104 Return 0 if successful, 1 if an error occurred. */ 104 Return 0 if successful, 1 if an error occurred. */
105 105
106static int 106static int
107file_lines(const char *filename, int fd, long int n_lines, off_t pos) 107file_lines(int fd, long int n_lines, off_t pos)
108{ 108{
109 char buffer[BUFSIZ]; 109 char buffer[BUFSIZ];
110 int bytes_read; 110 int bytes_read;
@@ -164,7 +164,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
164 Buffer the text as a linked list of LBUFFERs, adding them as needed. 164 Buffer the text as a linked list of LBUFFERs, adding them as needed.
165 Return 0 if successful, 1 if an error occured. */ 165 Return 0 if successful, 1 if an error occured. */
166 166
167static int pipe_lines(const char *filename, int fd, long int n_lines) 167static int pipe_lines(int fd, long int n_lines)
168{ 168{
169 struct linebuffer { 169 struct linebuffer {
170 int nbytes, nlines; 170 int nbytes, nlines;
@@ -266,7 +266,7 @@ static int pipe_lines(const char *filename, int fd, long int n_lines)
266 If `forever' is nonzero, keep reading from the end of the file 266 If `forever' is nonzero, keep reading from the end of the file
267 until killed. Return the number of bytes read from the file. */ 267 until killed. Return the number of bytes read from the file. */
268 268
269static long dump_remainder(const char *filename, int fd) 269static long dump_remainder(int fd)
270{ 270{
271 char buffer[BUFSIZ]; 271 char buffer[BUFSIZ];
272 int bytes_read; 272 int bytes_read;
@@ -312,11 +312,11 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
312 if (S_ISREG(stats.st_mode) 312 if (S_ISREG(stats.st_mode)
313 && lseek(fd, (off_t) 0, SEEK_CUR) == (off_t) 0) { 313 && lseek(fd, (off_t) 0, SEEK_CUR) == (off_t) 0) {
314 length = lseek(fd, (off_t) 0, SEEK_END); 314 length = lseek(fd, (off_t) 0, SEEK_END);
315 if (length != 0 && file_lines(filename, fd, n_lines, length)) 315 if (length != 0 && file_lines(fd, n_lines, length))
316 return 1; 316 return 1;
317 dump_remainder(filename, fd); 317 dump_remainder(fd);
318 } else 318 } else
319 return pipe_lines(filename, fd, n_lines); 319 return pipe_lines(fd, n_lines);
320 320
321 return 0; 321 return 0;
322} 322}
@@ -616,7 +616,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
616 Buffer the text as a linked list of LBUFFERs, adding them as needed. 616 Buffer the text as a linked list of LBUFFERs, adding them as needed.
617 Return 0 if successful, 1 if an error occured. */ 617 Return 0 if successful, 1 if an error occured. */
618 618
619static int pipe_lines(const char *filename, int fd, long int n_lines) 619static int pipe_lines(int fd, long int n_lines)
620{ 620{
621 struct linebuffer { 621 struct linebuffer {
622 int nbytes, nlines; 622 int nbytes, nlines;
@@ -850,7 +850,7 @@ static int start_lines(const char *filename, int fd, long int n_lines)
850 If `forever' is nonzero, keep reading from the end of the file 850 If `forever' is nonzero, keep reading from the end of the file
851 until killed. Return the number of bytes read from the file. */ 851 until killed. Return the number of bytes read from the file. */
852 852
853static long dump_remainder(const char *filename, int fd) 853static long dump_remainder(int fd)
854{ 854{
855 char buffer[BUFSIZ]; 855 char buffer[BUFSIZ];
856 int bytes_read; 856 int bytes_read;
@@ -925,7 +925,7 @@ static void tail_forever(char **names, int nfiles)
925 write_header(names[i], NULL); 925 write_header(names[i], NULL);
926 last = i; 926 last = i;
927 } 927 }
928 file_sizes[i] += dump_remainder(names[i], file_descs[i]); 928 file_sizes[i] += dump_remainder(file_descs[i]);
929 } 929 }
930 930
931 /* If none of the files changed size, sleep. */ 931 /* 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)
955 lseek(fd, n_bytes, SEEK_CUR); 955 lseek(fd, n_bytes, SEEK_CUR);
956 else if (start_bytes(filename, fd, n_bytes)) 956 else if (start_bytes(filename, fd, n_bytes))
957 return 1; 957 return 1;
958 dump_remainder(filename, fd); 958 dump_remainder(fd);
959 } else { 959 } else {
960 if (S_ISREG(stats.st_mode)) { 960 if (S_ISREG(stats.st_mode)) {
961 off_t current_pos, end_pos; 961 off_t current_pos, end_pos;
@@ -1021,9 +1021,9 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
1021 length = lseek(fd, (off_t) 0, SEEK_END); 1021 length = lseek(fd, (off_t) 0, SEEK_END);
1022 if (length != 0 && file_lines(filename, fd, n_lines, length)) 1022 if (length != 0 && file_lines(filename, fd, n_lines, length))
1023 return 1; 1023 return 1;
1024 dump_remainder(filename, fd); 1024 dump_remainder(fd);
1025 } else 1025 } else
1026 return pipe_lines(filename, fd, n_lines); 1026 return pipe_lines(fd, n_lines);
1027 } 1027 }
1028 return 0; 1028 return 0;
1029} 1029}
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)
372 enum token mode; 372 enum token mode;
373{ 373{
374 struct stat s; 374 struct stat s;
375 int i; 375 unsigned int i;
376 376
377 if (mode == FILSYM) { 377 if (mode == FILSYM) {
378#ifdef S_IFLNK 378#ifdef S_IFLNK
@@ -535,7 +535,7 @@ char *path;
535int mode; 535int mode;
536{ 536{
537 struct stat st; 537 struct stat st;
538 int euid = geteuid(); 538 unsigned int euid = geteuid();
539 539
540 if (stat (path, &st) < 0) 540 if (stat (path, &st) < 0)
541 return (-1); 541 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)
140 return (buffer - buffer_start); 140 return (buffer - buffer_start);
141} 141}
142 142
143static int complement(unsigned char *buffer, unsigned int buffer_len) 143static int complement(unsigned char *buffer, int buffer_len)
144{ 144{
145 register short i, j, index; 145 register short i, j, index;
146 unsigned char conv[ASCII + 2]; 146 char conv[ASCII + 2];
147 147
148 index = 0; 148 index = 0;
149 for (i = 0; i <= ASCII; i++) { 149 for (i = 0; i <= ASCII; i++) {
@@ -160,9 +160,9 @@ static int complement(unsigned char *buffer, unsigned int buffer_len)
160extern int tr_main(int argc, char **argv) 160extern int tr_main(int argc, char **argv)
161{ 161{
162 register unsigned char *ptr; 162 register unsigned char *ptr;
163 unsigned int output_length=0, input_length; 163 int output_length=0, input_length;
164 int index = 1; 164 int index = 1;
165 short i; 165 int i;
166 166
167 if (argc > 1 && argv[index][0] == '-') { 167 if (argc > 1 && argv[index][0] == '-') {
168 for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) { 168 for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) {
diff --git a/internal.h b/internal.h
index b31b902f0..50b7869cd 100644
--- a/internal.h
+++ b/internal.h
@@ -275,11 +275,11 @@ extern char *xstrndup (const char *s, int n);
275/* These parse entries in /etc/passwd and /etc/group. This is desirable 275/* These parse entries in /etc/passwd and /etc/group. This is desirable
276 * for BusyBox since we want to avoid using the glibc NSS stuff, which 276 * for BusyBox since we want to avoid using the glibc NSS stuff, which
277 * increases target size and is often not needed embedded systems. */ 277 * increases target size and is often not needed embedded systems. */
278extern unsigned long my_getpwnam(char *name); 278extern long my_getpwnam(char *name);
279extern unsigned long my_getgrnam(char *name); 279extern long my_getgrnam(char *name);
280extern void my_getpwuid(char *name, unsigned long uid); 280extern void my_getpwuid(char *name, long uid);
281extern void my_getgrgid(char *group, unsigned long gid); 281extern void my_getgrgid(char *group, long gid);
282extern unsigned long my_getpwnamegid(char *name); 282extern long my_getpwnamegid(char *name);
283 283
284 284
285#if defined BB_INIT || defined BB_SYSLOGD 285#if defined BB_INIT || defined BB_SYSLOGD
diff --git a/lash.c b/lash.c
index 048394ab6..d829b6b29 100644
--- a/lash.c
+++ b/lash.c
@@ -150,9 +150,9 @@ static char *cwd = NULL;
150static char *local_pending_command = NULL; 150static char *local_pending_command = NULL;
151 151
152#ifdef BB_FEATURE_SH_COMMAND_EDITING 152#ifdef BB_FEATURE_SH_COMMAND_EDITING
153void win_changed(int sig) 153void win_changed(int junk)
154{ 154{
155 struct winsize win = { 0, 0 }; 155 struct winsize win = { 0, 0, 0, 0 };
156 ioctl(0, TIOCGWINSZ, &win); 156 ioctl(0, TIOCGWINSZ, &win);
157 if (win.ws_col > 0) { 157 if (win.ws_col > 0) {
158 cmdedit_setwidth( win.ws_col - 1); 158 cmdedit_setwidth( win.ws_col - 1);
@@ -251,7 +251,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
251} 251}
252 252
253/* built-in 'help' handler */ 253/* built-in 'help' handler */
254static int builtin_help(struct job *cmd, struct jobSet *junk) 254static int builtin_help(struct job *dummy, struct jobSet *junk)
255{ 255{
256 struct builtInCommand *x; 256 struct builtInCommand *x;
257 257
diff --git a/networking/ping.c b/networking/ping.c
index 52cb07be7..b2b4880ed 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.21 2000/07/14 01:51:25 kraai Exp $ 3 * $Id: ping.c,v 1.22 2000/07/14 06:49:52 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -294,7 +294,7 @@ static void unpack(char *, int, struct sockaddr_in *);
294 294
295/**************************************************************************/ 295/**************************************************************************/
296 296
297static void pingstats(int ign) 297static void pingstats(int junk)
298{ 298{
299 signal(SIGINT, SIG_IGN); 299 signal(SIGINT, SIG_IGN);
300 300
@@ -314,7 +314,7 @@ static void pingstats(int ign)
314 exit(0); 314 exit(0);
315} 315}
316 316
317static void sendping(int ign) 317static void sendping(int junk)
318{ 318{
319 struct icmp *pkt; 319 struct icmp *pkt;
320 int i; 320 int i;
@@ -337,7 +337,7 @@ static void sendping(int ign)
337 337
338 if (i < 0) 338 if (i < 0)
339 fatalError("sendto: %s\n", strerror(errno)); 339 fatalError("sendto: %s\n", strerror(errno));
340 else if (i != sizeof(packet)) 340 else if ((size_t)i != sizeof(packet))
341 fatalError("ping wrote %d chars; %d expected\n", i, 341 fatalError("ping wrote %d chars; %d expected\n", i,
342 (int)sizeof(packet)); 342 (int)sizeof(packet));
343 343
diff --git a/ping.c b/ping.c
index 52cb07be7..b2b4880ed 100644
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.21 2000/07/14 01:51:25 kraai Exp $ 3 * $Id: ping.c,v 1.22 2000/07/14 06:49:52 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -294,7 +294,7 @@ static void unpack(char *, int, struct sockaddr_in *);
294 294
295/**************************************************************************/ 295/**************************************************************************/
296 296
297static void pingstats(int ign) 297static void pingstats(int junk)
298{ 298{
299 signal(SIGINT, SIG_IGN); 299 signal(SIGINT, SIG_IGN);
300 300
@@ -314,7 +314,7 @@ static void pingstats(int ign)
314 exit(0); 314 exit(0);
315} 315}
316 316
317static void sendping(int ign) 317static void sendping(int junk)
318{ 318{
319 struct icmp *pkt; 319 struct icmp *pkt;
320 int i; 320 int i;
@@ -337,7 +337,7 @@ static void sendping(int ign)
337 337
338 if (i < 0) 338 if (i < 0)
339 fatalError("sendto: %s\n", strerror(errno)); 339 fatalError("sendto: %s\n", strerror(errno));
340 else if (i != sizeof(packet)) 340 else if ((size_t)i != sizeof(packet))
341 fatalError("ping wrote %d chars; %d expected\n", i, 341 fatalError("ping wrote %d chars; %d expected\n", i,
342 (int)sizeof(packet)); 342 (int)sizeof(packet));
343 343
diff --git a/procps/ps.c b/procps/ps.c
index 682135944..99c9edaf7 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -126,7 +126,7 @@ extern int ps_main(int argc, char **argv)
126 char groupName[10] = ""; 126 char groupName[10] = "";
127 int len, i, c; 127 int len, i, c;
128#ifdef BB_FEATURE_AUTOWIDTH 128#ifdef BB_FEATURE_AUTOWIDTH
129 struct winsize win = { 0, 0 }; 129 struct winsize win = { 0, 0, 0, 0 };
130 int terminal_width = TERMINAL_WIDTH; 130 int terminal_width = TERMINAL_WIDTH;
131#else 131#else
132#define terminal_width TERMINAL_WIDTH 132#define terminal_width TERMINAL_WIDTH
diff --git a/ps.c b/ps.c
index 682135944..99c9edaf7 100644
--- a/ps.c
+++ b/ps.c
@@ -126,7 +126,7 @@ extern int ps_main(int argc, char **argv)
126 char groupName[10] = ""; 126 char groupName[10] = "";
127 int len, i, c; 127 int len, i, c;
128#ifdef BB_FEATURE_AUTOWIDTH 128#ifdef BB_FEATURE_AUTOWIDTH
129 struct winsize win = { 0, 0 }; 129 struct winsize win = { 0, 0, 0, 0 };
130 int terminal_width = TERMINAL_WIDTH; 130 int terminal_width = TERMINAL_WIDTH;
131#else 131#else
132#define terminal_width TERMINAL_WIDTH 132#define terminal_width TERMINAL_WIDTH
diff --git a/sh.c b/sh.c
index 048394ab6..d829b6b29 100644
--- a/sh.c
+++ b/sh.c
@@ -150,9 +150,9 @@ static char *cwd = NULL;
150static char *local_pending_command = NULL; 150static char *local_pending_command = NULL;
151 151
152#ifdef BB_FEATURE_SH_COMMAND_EDITING 152#ifdef BB_FEATURE_SH_COMMAND_EDITING
153void win_changed(int sig) 153void win_changed(int junk)
154{ 154{
155 struct winsize win = { 0, 0 }; 155 struct winsize win = { 0, 0, 0, 0 };
156 ioctl(0, TIOCGWINSZ, &win); 156 ioctl(0, TIOCGWINSZ, &win);
157 if (win.ws_col > 0) { 157 if (win.ws_col > 0) {
158 cmdedit_setwidth( win.ws_col - 1); 158 cmdedit_setwidth( win.ws_col - 1);
@@ -251,7 +251,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
251} 251}
252 252
253/* built-in 'help' handler */ 253/* built-in 'help' handler */
254static int builtin_help(struct job *cmd, struct jobSet *junk) 254static int builtin_help(struct job *dummy, struct jobSet *junk)
255{ 255{
256 struct builtInCommand *x; 256 struct builtInCommand *x;
257 257
diff --git a/shell/lash.c b/shell/lash.c
index 048394ab6..d829b6b29 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -150,9 +150,9 @@ static char *cwd = NULL;
150static char *local_pending_command = NULL; 150static char *local_pending_command = NULL;
151 151
152#ifdef BB_FEATURE_SH_COMMAND_EDITING 152#ifdef BB_FEATURE_SH_COMMAND_EDITING
153void win_changed(int sig) 153void win_changed(int junk)
154{ 154{
155 struct winsize win = { 0, 0 }; 155 struct winsize win = { 0, 0, 0, 0 };
156 ioctl(0, TIOCGWINSZ, &win); 156 ioctl(0, TIOCGWINSZ, &win);
157 if (win.ws_col > 0) { 157 if (win.ws_col > 0) {
158 cmdedit_setwidth( win.ws_col - 1); 158 cmdedit_setwidth( win.ws_col - 1);
@@ -251,7 +251,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
251} 251}
252 252
253/* built-in 'help' handler */ 253/* built-in 'help' handler */
254static int builtin_help(struct job *cmd, struct jobSet *junk) 254static int builtin_help(struct job *dummy, struct jobSet *junk)
255{ 255{
256 struct builtInCommand *x; 256 struct builtInCommand *x;
257 257
diff --git a/tail.c b/tail.c
index 601f0873d..9232356eb 100644
--- a/tail.c
+++ b/tail.c
@@ -104,7 +104,7 @@ static void write_header(const char *filename)
104 Return 0 if successful, 1 if an error occurred. */ 104 Return 0 if successful, 1 if an error occurred. */
105 105
106static int 106static int
107file_lines(const char *filename, int fd, long int n_lines, off_t pos) 107file_lines(int fd, long int n_lines, off_t pos)
108{ 108{
109 char buffer[BUFSIZ]; 109 char buffer[BUFSIZ];
110 int bytes_read; 110 int bytes_read;
@@ -164,7 +164,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
164 Buffer the text as a linked list of LBUFFERs, adding them as needed. 164 Buffer the text as a linked list of LBUFFERs, adding them as needed.
165 Return 0 if successful, 1 if an error occured. */ 165 Return 0 if successful, 1 if an error occured. */
166 166
167static int pipe_lines(const char *filename, int fd, long int n_lines) 167static int pipe_lines(int fd, long int n_lines)
168{ 168{
169 struct linebuffer { 169 struct linebuffer {
170 int nbytes, nlines; 170 int nbytes, nlines;
@@ -266,7 +266,7 @@ static int pipe_lines(const char *filename, int fd, long int n_lines)
266 If `forever' is nonzero, keep reading from the end of the file 266 If `forever' is nonzero, keep reading from the end of the file
267 until killed. Return the number of bytes read from the file. */ 267 until killed. Return the number of bytes read from the file. */
268 268
269static long dump_remainder(const char *filename, int fd) 269static long dump_remainder(int fd)
270{ 270{
271 char buffer[BUFSIZ]; 271 char buffer[BUFSIZ];
272 int bytes_read; 272 int bytes_read;
@@ -312,11 +312,11 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
312 if (S_ISREG(stats.st_mode) 312 if (S_ISREG(stats.st_mode)
313 && lseek(fd, (off_t) 0, SEEK_CUR) == (off_t) 0) { 313 && lseek(fd, (off_t) 0, SEEK_CUR) == (off_t) 0) {
314 length = lseek(fd, (off_t) 0, SEEK_END); 314 length = lseek(fd, (off_t) 0, SEEK_END);
315 if (length != 0 && file_lines(filename, fd, n_lines, length)) 315 if (length != 0 && file_lines(fd, n_lines, length))
316 return 1; 316 return 1;
317 dump_remainder(filename, fd); 317 dump_remainder(fd);
318 } else 318 } else
319 return pipe_lines(filename, fd, n_lines); 319 return pipe_lines(fd, n_lines);
320 320
321 return 0; 321 return 0;
322} 322}
@@ -616,7 +616,7 @@ file_lines(const char *filename, int fd, long int n_lines, off_t pos)
616 Buffer the text as a linked list of LBUFFERs, adding them as needed. 616 Buffer the text as a linked list of LBUFFERs, adding them as needed.
617 Return 0 if successful, 1 if an error occured. */ 617 Return 0 if successful, 1 if an error occured. */
618 618
619static int pipe_lines(const char *filename, int fd, long int n_lines) 619static int pipe_lines(int fd, long int n_lines)
620{ 620{
621 struct linebuffer { 621 struct linebuffer {
622 int nbytes, nlines; 622 int nbytes, nlines;
@@ -850,7 +850,7 @@ static int start_lines(const char *filename, int fd, long int n_lines)
850 If `forever' is nonzero, keep reading from the end of the file 850 If `forever' is nonzero, keep reading from the end of the file
851 until killed. Return the number of bytes read from the file. */ 851 until killed. Return the number of bytes read from the file. */
852 852
853static long dump_remainder(const char *filename, int fd) 853static long dump_remainder(int fd)
854{ 854{
855 char buffer[BUFSIZ]; 855 char buffer[BUFSIZ];
856 int bytes_read; 856 int bytes_read;
@@ -925,7 +925,7 @@ static void tail_forever(char **names, int nfiles)
925 write_header(names[i], NULL); 925 write_header(names[i], NULL);
926 last = i; 926 last = i;
927 } 927 }
928 file_sizes[i] += dump_remainder(names[i], file_descs[i]); 928 file_sizes[i] += dump_remainder(file_descs[i]);
929 } 929 }
930 930
931 /* If none of the files changed size, sleep. */ 931 /* 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)
955 lseek(fd, n_bytes, SEEK_CUR); 955 lseek(fd, n_bytes, SEEK_CUR);
956 else if (start_bytes(filename, fd, n_bytes)) 956 else if (start_bytes(filename, fd, n_bytes))
957 return 1; 957 return 1;
958 dump_remainder(filename, fd); 958 dump_remainder(fd);
959 } else { 959 } else {
960 if (S_ISREG(stats.st_mode)) { 960 if (S_ISREG(stats.st_mode)) {
961 off_t current_pos, end_pos; 961 off_t current_pos, end_pos;
@@ -1021,9 +1021,9 @@ static int tail_lines(const char *filename, int fd, long int n_lines)
1021 length = lseek(fd, (off_t) 0, SEEK_END); 1021 length = lseek(fd, (off_t) 0, SEEK_END);
1022 if (length != 0 && file_lines(filename, fd, n_lines, length)) 1022 if (length != 0 && file_lines(filename, fd, n_lines, length))
1023 return 1; 1023 return 1;
1024 dump_remainder(filename, fd); 1024 dump_remainder(fd);
1025 } else 1025 } else
1026 return pipe_lines(filename, fd, n_lines); 1026 return pipe_lines(fd, n_lines);
1027 } 1027 }
1028 return 0; 1028 return 0;
1029} 1029}
diff --git a/test.c b/test.c
index d7b34a6a4..175cb5d05 100644
--- a/test.c
+++ b/test.c
@@ -372,7 +372,7 @@ filstat(nm, mode)
372 enum token mode; 372 enum token mode;
373{ 373{
374 struct stat s; 374 struct stat s;
375 int i; 375 unsigned int i;
376 376
377 if (mode == FILSYM) { 377 if (mode == FILSYM) {
378#ifdef S_IFLNK 378#ifdef S_IFLNK
@@ -535,7 +535,7 @@ char *path;
535int mode; 535int mode;
536{ 536{
537 struct stat st; 537 struct stat st;
538 int euid = geteuid(); 538 unsigned int euid = geteuid();
539 539
540 if (stat (path, &st) < 0) 540 if (stat (path, &st) < 0)
541 return (-1); 541 return (-1);
diff --git a/tr.c b/tr.c
index 89fe3f5b0..2971ef68e 100644
--- a/tr.c
+++ b/tr.c
@@ -140,10 +140,10 @@ static unsigned int expand(char *arg, register unsigned char *buffer)
140 return (buffer - buffer_start); 140 return (buffer - buffer_start);
141} 141}
142 142
143static int complement(unsigned char *buffer, unsigned int buffer_len) 143static int complement(unsigned char *buffer, int buffer_len)
144{ 144{
145 register short i, j, index; 145 register short i, j, index;
146 unsigned char conv[ASCII + 2]; 146 char conv[ASCII + 2];
147 147
148 index = 0; 148 index = 0;
149 for (i = 0; i <= ASCII; i++) { 149 for (i = 0; i <= ASCII; i++) {
@@ -160,9 +160,9 @@ static int complement(unsigned char *buffer, unsigned int buffer_len)
160extern int tr_main(int argc, char **argv) 160extern int tr_main(int argc, char **argv)
161{ 161{
162 register unsigned char *ptr; 162 register unsigned char *ptr;
163 unsigned int output_length=0, input_length; 163 int output_length=0, input_length;
164 int index = 1; 164 int index = 1;
165 short i; 165 int i;
166 166
167 if (argc > 1 && argv[index][0] == '-') { 167 if (argc > 1 && argv[index][0] == '-') {
168 for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) { 168 for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) {
diff --git a/utility.c b/utility.c
index 2b2156624..d39e9a1c1 100644
--- a/utility.c
+++ b/utility.c
@@ -820,12 +820,12 @@ extern int parse_mode(const char *s, mode_t * theMode)
820 * This uses buf as storage to hold things. 820 * This uses buf as storage to hold things.
821 * 821 *
822 */ 822 */
823unsigned long my_getid(const char *filename, char *name, unsigned long id, unsigned long *gid) 823unsigned long my_getid(const char *filename, char *name, long id, long *gid)
824{ 824{
825 FILE *file; 825 FILE *file;
826 char *rname, *start, *end, buf[128]; 826 char *rname, *start, *end, buf[128];
827 unsigned long rid; 827 long rid;
828 unsigned long rgid = 0; 828 long rgid = 0;
829 829
830 file = fopen(filename, "r"); 830 file = fopen(filename, "r");
831 if (file == NULL) { 831 if (file == NULL) {
@@ -881,33 +881,33 @@ unsigned long my_getid(const char *filename, char *name, unsigned long id, unsig
881} 881}
882 882
883/* returns a uid given a username */ 883/* returns a uid given a username */
884unsigned long my_getpwnam(char *name) 884long my_getpwnam(char *name)
885{ 885{
886 return my_getid("/etc/passwd", name, -1, NULL); 886 return my_getid("/etc/passwd", name, -1, NULL);
887} 887}
888 888
889/* returns a gid given a group name */ 889/* returns a gid given a group name */
890unsigned long my_getgrnam(char *name) 890long my_getgrnam(char *name)
891{ 891{
892 return my_getid("/etc/group", name, -1, NULL); 892 return my_getid("/etc/group", name, -1, NULL);
893} 893}
894 894
895/* gets a username given a uid */ 895/* gets a username given a uid */
896void my_getpwuid(char *name, unsigned long uid) 896void my_getpwuid(char *name, long uid)
897{ 897{
898 my_getid("/etc/passwd", name, uid, NULL); 898 my_getid("/etc/passwd", name, uid, NULL);
899} 899}
900 900
901/* gets a groupname given a gid */ 901/* gets a groupname given a gid */
902void my_getgrgid(char *group, unsigned long gid) 902void my_getgrgid(char *group, long gid)
903{ 903{
904 my_getid("/etc/group", group, gid, NULL); 904 my_getid("/etc/group", group, gid, NULL);
905} 905}
906 906
907/* gets a gid given a user name */ 907/* gets a gid given a user name */
908unsigned long my_getpwnamegid(char *name) 908long my_getpwnamegid(char *name)
909{ 909{
910 unsigned long gid; 910 long gid;
911 my_getid("/etc/passwd", name, -1, &gid); 911 my_getid("/etc/passwd", name, -1, &gid);
912 return gid; 912 return gid;
913} 913}