diff options
author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2004-07-31 14:46:41 +0000 |
---|---|---|
committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2004-07-31 14:46:41 +0000 |
commit | 0e519c96ef360d579bbd198b443d7d3a56341108 (patch) | |
tree | 17700412e15550d07676bad05fd8dc448ca0f706 | |
parent | a57e1ef0700fcfb5fa89a7ab1bdb20e0d04c11aa (diff) | |
download | src-0e519c96ef360d579bbd198b443d7d3a56341108.tar.gz src-0e519c96ef360d579bbd198b443d7d3a56341108.zip |
Kill a small herd of casts to off_t where they were not needed.
Thank Fortune, the C compiler can figure out by itself the proper
conversion for assignments, comparisons, and prototyped function
arguments.
Notes
Notes:
svn path=/head/; revision=132930
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 4 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index bb8744b7b51e..2dc49d0abd21 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -160,7 +160,7 @@ cmd_list if (fromname) free(fromname); fromname = (char *) 0; - restart_point = (off_t) 0; + restart_point = 0; } | cmd_list rcmd ; @@ -767,7 +767,7 @@ cmd rcmd : RNFR check_login_ro SP pathname CRLF { - restart_point = (off_t) 0; + restart_point = 0; if ($2 && $4) { if (fromname) free(fromname); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index b894b6835514..75c41ac8d08f 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -226,7 +226,7 @@ char proctitle[LINE_MAX]; /* initial part of title */ *(file2) == '/' ? "" : curdir(), file2); #define LOGBYTES(cmd, file, cnt) \ if (logging > 1) { \ - if (cnt == (off_t)-1) \ + if (cnt == -1) \ syslog(LOG_INFO,"%s %s%s", cmd, \ *(file) == '/' ? "" : curdir(), file); \ else \ @@ -1773,7 +1773,7 @@ store(char *name, char *mode, int unique) * because we are changing from reading to * writing. */ - if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) { + if (fseeko(fout, 0, SEEK_CUR) < 0) { perror_reply(550, name); goto done; } @@ -1782,7 +1782,7 @@ store(char *name, char *mode, int unique) goto done; } } - din = dataconn(name, (off_t)-1, "r"); + din = dataconn(name, -1, "r"); if (din == NULL) goto done; if (receive_data(din, fout) == 0) { @@ -1883,7 +1883,7 @@ dataconn(char *name, off_t size, char *mode) file_size = size; byte_count = 0; - if (size != (off_t) -1) + if (size != -1) (void) snprintf(sizebuf, sizeof(sizebuf), " (%jd bytes)", (intmax_t)size); else @@ -2658,7 +2658,7 @@ myoob(void) } if (strcmp(cp, "STAT\r\n") == 0) { tmpline[0] = '\0'; - if (file_size != (off_t) -1) + if (file_size != -1) reply(213, "Status: %jd of %jd bytes transferred", (intmax_t)byte_count, (intmax_t)file_size); else @@ -3023,7 +3023,7 @@ send_file_list(char *whichf) if (S_ISREG(st.st_mode)) { if (dout == NULL) { - dout = dataconn("file list", (off_t)-1, "w"); + dout = dataconn("file list", -1, "w"); if (dout == NULL) goto out; transflag++; @@ -3064,8 +3064,7 @@ send_file_list(char *whichf) if (simple || (stat(nbuf, &st) == 0 && S_ISREG(st.st_mode))) { if (dout == NULL) { - dout = dataconn("file list", (off_t)-1, - "w"); + dout = dataconn("file list", -1, "w"); if (dout == NULL) goto out; transflag++; |