From ae2b295c7deaf2d7c18ad1ed9b6050970e56bae7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:31 -0800 Subject: Import Upstream version 5e2 --- ioext.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'ioext.c') diff --git a/ioext.c b/ioext.c index 6a8e6e1..62efc2b 100644 --- a/ioext.c +++ b/ioext.c @@ -93,6 +93,9 @@ SCM stat2scm P((struct stat *stat_temp)); #ifdef __MACH__ # include #endif +#ifdef __CYGWIN__ +# include +#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; -- cgit v1.2.3