1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2002-09-08 10:25:43 +00:00
parent 432dd2ead8
commit 4cea021747
5 changed files with 63 additions and 5 deletions

View file

@ -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

6
dir.c
View file

@ -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);

View file

@ -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;

View file

@ -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;
}

View file

@ -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
//