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.
This commit is contained in:
Yaroslav Tykhiy 2004-07-31 14:46:41 +00:00
parent a57e1ef070
commit 0e519c96ef
2 changed files with 9 additions and 10 deletions

View File

@ -160,7 +160,7 @@ cmd_list
if (fromname) if (fromname)
free(fromname); free(fromname);
fromname = (char *) 0; fromname = (char *) 0;
restart_point = (off_t) 0; restart_point = 0;
} }
| cmd_list rcmd | cmd_list rcmd
; ;
@ -767,7 +767,7 @@ cmd
rcmd rcmd
: RNFR check_login_ro SP pathname CRLF : RNFR check_login_ro SP pathname CRLF
{ {
restart_point = (off_t) 0; restart_point = 0;
if ($2 && $4) { if ($2 && $4) {
if (fromname) if (fromname)
free(fromname); free(fromname);

View File

@ -226,7 +226,7 @@ char proctitle[LINE_MAX]; /* initial part of title */
*(file2) == '/' ? "" : curdir(), file2); *(file2) == '/' ? "" : curdir(), file2);
#define LOGBYTES(cmd, file, cnt) \ #define LOGBYTES(cmd, file, cnt) \
if (logging > 1) { \ if (logging > 1) { \
if (cnt == (off_t)-1) \ if (cnt == -1) \
syslog(LOG_INFO,"%s %s%s", cmd, \ syslog(LOG_INFO,"%s %s%s", cmd, \
*(file) == '/' ? "" : curdir(), file); \ *(file) == '/' ? "" : curdir(), file); \
else \ else \
@ -1773,7 +1773,7 @@ store(char *name, char *mode, int unique)
* because we are changing from reading to * because we are changing from reading to
* writing. * writing.
*/ */
if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) { if (fseeko(fout, 0, SEEK_CUR) < 0) {
perror_reply(550, name); perror_reply(550, name);
goto done; goto done;
} }
@ -1782,7 +1782,7 @@ store(char *name, char *mode, int unique)
goto done; goto done;
} }
} }
din = dataconn(name, (off_t)-1, "r"); din = dataconn(name, -1, "r");
if (din == NULL) if (din == NULL)
goto done; goto done;
if (receive_data(din, fout) == 0) { if (receive_data(din, fout) == 0) {
@ -1883,7 +1883,7 @@ dataconn(char *name, off_t size, char *mode)
file_size = size; file_size = size;
byte_count = 0; byte_count = 0;
if (size != (off_t) -1) if (size != -1)
(void) snprintf(sizebuf, sizeof(sizebuf), (void) snprintf(sizebuf, sizeof(sizebuf),
" (%jd bytes)", (intmax_t)size); " (%jd bytes)", (intmax_t)size);
else else
@ -2658,7 +2658,7 @@ myoob(void)
} }
if (strcmp(cp, "STAT\r\n") == 0) { if (strcmp(cp, "STAT\r\n") == 0) {
tmpline[0] = '\0'; tmpline[0] = '\0';
if (file_size != (off_t) -1) if (file_size != -1)
reply(213, "Status: %jd of %jd bytes transferred", reply(213, "Status: %jd of %jd bytes transferred",
(intmax_t)byte_count, (intmax_t)file_size); (intmax_t)byte_count, (intmax_t)file_size);
else else
@ -3023,7 +3023,7 @@ send_file_list(char *whichf)
if (S_ISREG(st.st_mode)) { if (S_ISREG(st.st_mode)) {
if (dout == NULL) { if (dout == NULL) {
dout = dataconn("file list", (off_t)-1, "w"); dout = dataconn("file list", -1, "w");
if (dout == NULL) if (dout == NULL)
goto out; goto out;
transflag++; transflag++;
@ -3064,8 +3064,7 @@ send_file_list(char *whichf)
if (simple || (stat(nbuf, &st) == 0 && if (simple || (stat(nbuf, &st) == 0 &&
S_ISREG(st.st_mode))) { S_ISREG(st.st_mode))) {
if (dout == NULL) { if (dout == NULL) {
dout = dataconn("file list", (off_t)-1, dout = dataconn("file list", -1, "w");
"w");
if (dout == NULL) if (dout == NULL)
goto out; goto out;
transflag++; transflag++;