diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | dir.c | 6 | ||||
-rw-r--r-- | ext/tcltklib/tcltklib.c | 6 | ||||
-rw-r--r-- | win32/win32.c | 10 | ||||
-rw-r--r-- | win32/win32.h | 30 |
5 files changed, 63 insertions, 5 deletions
@@ -1,3 +1,19 @@ +Sun Sep 8 19:21:48 2002 NAKAMURA Usaku <usa@ruby-lang.org> + + * dir.c (rb_glob): add prototype of 2nd argument to avoid VC++ warning. + + * dir.c (push_pattern): add const directive to 1st argument. + + * dir.c: prototype; push_pattern() to avoid VC++ warning. + + * ext/tcltklib/tcltklib.c: prototype; _timer_for_tcl() and ip_ruby() + to avoid VC++ warning. + + * win32/win32.c (win32_stat): remove S_IWGRP and S_IWOTH bits from + st_mode. + + * win32/win32.h (S_I*): define if not defined. + Sat Sep 7 23:32:56 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp @@ -715,7 +715,7 @@ rb_glob_helper(path, sub, flags, func, arg) void rb_glob(path, func, arg) char *path; - void (*func)(); + void (*func) _((const char*, VALUE)); VALUE arg; { rb_glob_helper(path, 0, FNM_PERIOD, func, arg); @@ -730,9 +730,11 @@ rb_iglob(path, func, arg) rb_glob_helper(path, 0, FNM_PERIOD|FNM_NOCASE, func, arg); } +static void push_pattern _((const char *, VALUE)); + static void push_pattern(path, ary) - char *path; + const char *path; VALUE ary; { VALUE str = rb_tainted_str_new2(path); diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 081dcb1d2e..7818f0e0bc 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -64,6 +64,7 @@ static VALUE main_thread; static Tcl_TimerToken timer_token; /* timer callback */ +static void _timer_for_tcl _((ClientData)); static void _timer_for_tcl(clientData) ClientData clientData; @@ -144,14 +145,17 @@ lib_restart(self) return Qnil; } -static int #if TCL_MAJOR_VERSION >= 8 +static int ip_ruby _((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST [])); +static int ip_ruby(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #else +static int ip_ruby _((ClientData, Tcl_Interp *, int, Tcl_Obj *[])); +static int ip_ruby(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; diff --git a/win32/win32.c b/win32/win32.c index 6415eeab31..d029a11d14 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2630,6 +2630,7 @@ win32_stat(const char *path, struct stat *st) char *buf2 = ALLOCA_N(char, MAXPATHLEN); char *s; int len; + int ret; for (p = path, s = buf1; *p; p++, s++) { if (*p == '/') @@ -2645,8 +2646,13 @@ win32_stat(const char *path, struct stat *st) strcat(buf1, "\\"); } else if (*p == '\\' || *p == ':') strcat(buf1, "."); - if (_fullpath(buf2, buf1, MAXPATHLEN)) - return stat(buf2, st); + if (_fullpath(buf2, buf1, MAXPATHLEN)) { + ret = stat(buf2, st); + if (ret == 0) { + st->st_mode &= ~(S_IWGRP | S_IWOTH); + } + return ret; + } else return -1; } diff --git a/win32/win32.h b/win32/win32.h index f3eac8f41a..8ea735dfe0 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -227,6 +227,36 @@ extern int isinf(double); extern int isnan(double); +#ifndef S_IRUSR +#define S_IRUSR 0400 +#endif +#ifndef S_IRGRP +#define S_IRGRP 0040 +#endif +#ifndef S_IROTH +#define S_IROTH 0004 +#endif + +#ifndef S_IWUSR +#define S_IWUSR 0200 +#endif +#ifndef S_IWGRP +#define S_IWGRP 0020 +#endif +#ifndef S_IWOTH +#define S_IWOTH 0002 +#endif + +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 +#endif + // // define this so we can do inplace editing // |