diff options
Diffstat (limited to 'ioext.c')
-rw-r--r-- | ioext.c | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -93,6 +93,9 @@ SCM stat2scm P((struct stat *stat_temp)); #ifdef __MACH__ # include <unistd.h> #endif +#ifdef __CYGWIN__ +# include <unistd.h> +#endif #ifndef STDC_HEADERS int chdir P((const char *path)); @@ -136,7 +139,7 @@ SCM read_line(port) sizet len = 30; SCM tok_buf = makstr((long) len); register char *p = CHARS(tok_buf); - if UNBNDP(port) port = cur_inp; + if (UNBNDP(port)) port = cur_inp; else ASRTER(NIMP(port) && OPINPORTP(port), port, ARG1, s_read_line); if (EOF==(c = lgetc(port))) return EOF_VAL; while(1) { @@ -167,7 +170,7 @@ SCM read_line1(str, port) ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_read_line1); p = CHARS(str); len = LENGTH(str); - if UNBNDP(port) port = cur_inp; + if (UNBNDP(port)) port = cur_inp; else ASRTER(NIMP(port) && OPINPORTP(port), port, ARG2, s_read_line1); c = lgetc(port); if (EOF==c) return EOF_VAL; @@ -202,7 +205,7 @@ SCM file_position(port) long ans; ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_position); SYSCALL(ans = ftell(STREAM(port));); - if CRDYP(port) ans--; + if (CRDYP(port)) ans--; return MAKINUM(ans); } SCM file_set_position(port, pos) @@ -367,7 +370,7 @@ SCM l_closedir(port) int sts; ASRTER(DIRP(port), port, ARG1, s_closedir); DEFER_INTS; - if CLOSEDP(port) {ALLOW_INTS;return BOOL_F;} + if (CLOSEDP(port)) {ALLOW_INTS;return BOOL_F;} SYSCALL(sts = closedir((DIR *)CDR(port));); if (sts) {ALLOW_INTS; return BOOL_F;} CAR(port) = tc16_dir; @@ -384,10 +387,10 @@ int dir_print(sexp, port, writing) sizet dir_free(p) CELLPTR p; { - if OPENP((SCM)p) closedir((DIR *)CDR((SCM)p)); + if (OPENP((SCM)p)) closedir((DIR *)CDR((SCM)p)); return 0; } -# define dir_mark mark0 +# define dir_mark mark0 # else /* _WIN32 */ struct WDIR { long handle; //-1 if at end of list. @@ -464,7 +467,7 @@ SCM l_closedir(port) ASRTER(DIRP(port), port, ARG1, s_closedir); wdir = (struct WDIR*)CHARS(port); DEFER_INTS; - if CLOSEDP(port) {ALLOW_INTS;return BOOL_F;} + if (CLOSEDP(port)) {ALLOW_INTS;return BOOL_F;} if (-1 != wdir->handle) { SYSCALL(_findclose(wdir->handle);); wdir->handle = -1; @@ -624,7 +627,7 @@ SCM ren_fil(oldname, newname) SYSCALL(ans = link(CHARS(oldname), CHARS(newname)) ? BOOL_F : BOOL_T;); if (!FALSEP(ans)) { SYSCALL(ans = unlink(CHARS(oldname)) ? BOOL_F : BOOL_T;); - if FALSEP(ans) + if (FALSEP(ans)) SYSCALL(unlink(CHARS(newname));); /* unlink failed. remove new name */ } ALLOW_INTS; @@ -654,7 +657,7 @@ SCM l_access(pathname, mode) int val; int imodes; ASRTER(NIMP(pathname) && STRINGP(pathname), pathname, ARG1, s_access); - if INUMP(mode) imodes = INUM(mode); + if (INUMP(mode)) imodes = INUM(mode); else { ASRTER(NIMP(mode) && STRINGP(mode), mode, ARG2, s_access); imodes = F_OK | (strchr(CHARS(mode), 'r') ? R_OK : 0) @@ -674,9 +677,9 @@ SCM l_stat(str) { int i; struct stat stat_temp; - if IMP(str) + if (IMP(str)) badarg1: wta(str, (char *)ARG1, s_stat); - if STRINGP(str) {SYSCALL(i = stat(CHARS(str), &stat_temp););} + if (STRINGP(str)) {SYSCALL(i = stat(CHARS(str), &stat_temp););} else { # ifndef MCH_AMIGA if (!OPFPORTP(str)) goto badarg1; |