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

2000-05-01

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-05-01 09:42:38 +00:00
parent 42fc13311f
commit 0b0db73683
19 changed files with 382 additions and 319 deletions

View file

@ -1,3 +1,25 @@
Wed Apr 26 15:23:02 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* string.c (rb_str_succ): insert carrying character just before
the leftmost alpha numeric character.
* string.c (rb_str_succ): proper behavior for "".succ and "\377".succ.
* string.c (rb_str_succ): use realloc and memmove.
Sat Apr 22 23:14:41 2000 SHIROYAMA Takayuki <psi@fortune.nest.or.jp>
* configure.in: MacOS X support.
Fri Apr 21 21:44:34 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* io.c (rb_io_s_pipe): should set FMODE_SYNC.
Thu Apr 20 16:59:22 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* eval.c (massign): `*lvalue = false' should assign `[false]' to
lvalue.
Mon Apr 17 15:16:31 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_io_close): to detect some exceptional status, writable

2
README
View file

@ -128,7 +128,7 @@ You can redistribute it and/or modify it under either the terms of the GPL
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
* Ruby home-page

View file

@ -876,7 +876,7 @@ Returns the name of the class.
int rb_respond_to(VALUE object, ID id)
Returns true if the object reponds to the message specified by id.
Returns true if the object responds to the message specified by id.
** Instance Variables

4
config.guess vendored
View file

@ -969,6 +969,10 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:"Mac OS":*:*)
echo `uname -p`-apple-macos${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2

2
config.sub vendored
View file

@ -910,7 +910,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
| -interix* | -uwin* | -rhapsody* | -openstep* | -macos | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \

477
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -43,6 +43,12 @@ AC_ARG_ENABLE(fat-binary,
TARGET_ARCHS="ppc i386"
fi
;;
macos*)
echo -n "MacOS X : "
if test "$TARGET_ARCHS" = "" ; then
TARGET_ARCHS="ppc i386"
fi
;;
nextstep*|openstep*)
echo -n "NeXTSTEP/OPENSTEP: "
if test "$TARGET_ARCHS" = "" ; then
@ -140,6 +146,7 @@ case "$host_os" in
nextstep*) ;;
openstep*) ;;
rhapsody*) ;;
macos*) ;;
human*) ac_cv_func_getpgrp_void=yes;;
beos*) ;;
cygwin*) ;;
@ -394,6 +401,7 @@ if test "$with_dln_a_out" != yes; then
nextstep*) ;;
openstep*) ;;
rhapsody*) ;;
macos*) ;;
human*) ;;
bsdi*) ;;
cygwin*) ;;
@ -472,6 +480,10 @@ if test "$with_dln_a_out" != yes; then
LDFLAGS=""
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
macos*) LDSHARED='cc -dynamic -bundle -undefined suppress'
LDFLAGS=""
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
aix*) LDSHARED='/usr/ccs/bin/ld'
XLDFLAGS='-Wl,-bE:ruby.imp'
DLDFLAGS='-eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 -lc'
@ -540,6 +552,8 @@ else
AC_DEFINE(DLEXT, ".bundle");;
rhapsody*) DLEXT=bundle
AC_DEFINE(DLEXT, ".bundle");;
macos*) DLEXT=bundle
AC_DEFINE(DLEXT, ".bundle");;
cygwin*) DLEXT=dll
AC_DEFINE(DLEXT, ".dll");;
os2_emx*) DLEXT=dll
@ -565,6 +579,8 @@ case "$host_os" in
STRIP='strip -A -n';;
rhapsody*)
STRIP='strip -A -n';;
macos*)
STRIP='strip -A -n';;
esac
EXTSTATIC=

View file

@ -402,6 +402,7 @@ typedef struct {
int n;
} syserr_index_entry;
static VALUE syserr_error;
static VALUE syserr_list_b_general[16+1];
static VALUE syserr_list_b_os0[2+1];
static VALUE syserr_list_b_os1[5+1];
@ -462,6 +463,11 @@ set_syserr(i, name)
VALUE error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError);
rb_define_const(error, "Errno", INT2FIX(i));
#ifdef __BEOS__
if (i == B_ERROR) {
syserr_error = error;
rb_global_variable(&syserr_error);
return error;
}
i -= B_GENERAL_ERROR_BASE;
ix = (i >> 12) & 0xf;
offset = (i >> 8) & 0xf;
@ -495,6 +501,7 @@ get_syserr(int i)
VALUE *list;
int ix, offset;
if (i == B_ERROR) return syserr_error;
i -= B_GENERAL_ERROR_BASE;
ix = (i >> 12) & 0xf;
offset = (i >> 8) & 0xf;
@ -686,6 +693,7 @@ init_syserr()
MEMZERO(syserr_list[ix + offset].list, VALUE, syserr_list[ix + offset].n);
}
}
set_syserr(B_ERROR, "ERROR");
#else
syserr_list = ALLOC_N(VALUE, sys_nerr+1);
MEMZERO(syserr_list, VALUE, sys_nerr+1);

50
eval.c
View file

@ -3326,34 +3326,27 @@ massign(self, node, val, check)
list = node->nd_head;
if (val) {
if (TYPE(val) != T_ARRAY) {
val = rb_Array(val);
}
len = RARRAY(val)->len;
for (i=0; list && i<len; i++) {
assign(self, list->nd_head, RARRAY(val)->ptr[i], check);
list = list->nd_next;
}
if (check && list) goto arg_error;
if (node->nd_args) {
if (node->nd_args == (NODE*)-1) {
/* ignore rest args */
}
else if (!list && i<len) {
assign(self, node->nd_args, rb_ary_new4(len-i, RARRAY(val)->ptr+i), check);
}
else {
assign(self, node->nd_args, rb_ary_new2(0), check);
}
}
else if (check && i<len) goto arg_error;
if (TYPE(val) != T_ARRAY) {
val = rb_Array(val);
}
else if (node->nd_args && node->nd_args != (NODE*)-1) {
assign(self, node->nd_args, Qnil, check);
len = RARRAY(val)->len;
for (i=0; list && i<len; i++) {
assign(self, list->nd_head, RARRAY(val)->ptr[i], check);
list = list->nd_next;
}
if (check && list) goto arg_error;
if (node->nd_args) {
if (node->nd_args == (NODE*)-1) {
/* ignore rest args */
}
else if (!list && i<len) {
assign(self, node->nd_args, rb_ary_new4(len-i, RARRAY(val)->ptr+i), check);
}
else {
assign(self, node->nd_args, rb_ary_new2(0), check);
}
}
if (check && list) goto arg_error;
while (list) {
i++;
assign(self, list->nd_head, Qnil, check);
@ -6159,7 +6152,9 @@ struct thread {
#define THREAD_RAISED 0x200
static thread_t main_thread;
static thread_t curr_thread = 0;
static int num_waiting_on_fd = 0;
static int num_waiting_on_timer = 0;
static int num_waiting_on_join = 0;
@ -6179,8 +6174,6 @@ timeofday()
return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
}
static thread_t main_thread;
#define STACK(addr) (th->stk_pos<(VALUE*)(addr) && (VALUE*)(addr)<th->stk_pos+th->stk_len)
#define ADJ(addr) (void*)(STACK(addr)?(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr):(VALUE*)(addr))
@ -6647,6 +6640,7 @@ rb_thread_schedule()
rb_thread_ready(next);
next->status = THREAD_TO_KILL;
}
printf("<0x%x>\n", next);
if (next->status == THREAD_RUNNABLE && next == curr_thread) {
return;
}
@ -7375,7 +7369,7 @@ rb_thread_raise(argc, argv, thread)
rb_f_raise(argc, argv);
}
if (!curr_thread->status != THREAD_KILLED)
if (curr_thread->status != THREAD_KILLED)
rb_thread_save_context(curr_thread);
if (thread_switch(setjmp(curr_thread->context))) {
return thread;

View file

@ -500,7 +500,7 @@ def extmake(target)
$objs = nil
$local_flags = ""
case RUBY_PLATFORM
when /cygwin|beos|openstep|nextstep|rhapsody|i386-os2_emx/
when /cygwin|beos|openstep|nextstep|rhapsody|macos|i386-os2_emx/
$libs = ""
when /mswin32/
$LIBEXT = "lib"

View file

@ -259,7 +259,8 @@ bsock_getsockopt(sock, lev, optname)
VALUE sock, lev, optname;
{
#if !defined(__BEOS__)
int level, option, len;
int level, option;
socklen_t len;
char *buf;
OpenFile *fptr;
@ -283,7 +284,7 @@ bsock_getsockname(sock)
VALUE sock;
{
char buf[1024];
int len = sizeof buf;
socklen_t len = sizeof buf;
OpenFile *fptr;
GetOpenFile(sock, fptr);
@ -297,7 +298,7 @@ bsock_getpeername(sock)
VALUE sock;
{
char buf[1024];
int len = sizeof buf;
socklen_t len = sizeof buf;
OpenFile *fptr;
GetOpenFile(sock, fptr);
@ -377,9 +378,9 @@ s_recv(sock, argc, argv, from)
OpenFile *fptr;
VALUE str;
char buf[1024];
int fd, alen = sizeof buf;
socklen_t alen = sizeof buf;
VALUE len, flg;
int flags;
int fd, flags;
rb_scan_args(argc, argv, "11", &len, &flg);
@ -960,7 +961,7 @@ s_accept(class, fd, sockaddr, len)
VALUE class;
int fd;
struct sockaddr *sockaddr;
int *len;
socklen_t *len;
{
int fd2;
@ -993,7 +994,7 @@ tcp_accept(sock)
{
OpenFile *fptr;
struct sockaddr_storage from;
int fromlen;
socklen_t fromlen;
GetOpenFile(sock, fptr);
fromlen = sizeof(from);
@ -1065,7 +1066,7 @@ ip_addr(sock)
{
OpenFile *fptr;
struct sockaddr_storage addr;
int len = sizeof addr;
socklen_t len = sizeof addr;
GetOpenFile(sock, fptr);
@ -1080,7 +1081,7 @@ ip_peeraddr(sock)
{
OpenFile *fptr;
struct sockaddr_storage addr;
int len = sizeof addr;
socklen_t len = sizeof addr;
GetOpenFile(sock, fptr);
@ -1239,7 +1240,7 @@ unix_path(sock)
GetOpenFile(sock, fptr);
if (fptr->path == 0) {
struct sockaddr_un addr;
int len = sizeof(addr);
socklen_t len = sizeof(addr);
if (getsockname(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
rb_sys_fail(0);
fptr->path = strdup(addr.sun_path);
@ -1269,7 +1270,7 @@ unix_accept(sock)
{
OpenFile *fptr;
struct sockaddr_un from;
int fromlen;
socklen_t fromlen;
GetOpenFile(sock, fptr);
fromlen = sizeof(struct sockaddr_un);
@ -1290,7 +1291,7 @@ unix_addr(sock)
{
OpenFile *fptr;
struct sockaddr_un addr;
int len = sizeof addr;
socklen_t len = sizeof addr;
GetOpenFile(sock, fptr);
@ -1305,7 +1306,7 @@ unix_peeraddr(sock)
{
OpenFile *fptr;
struct sockaddr_un addr;
int len = sizeof addr;
socklen_t len = sizeof addr;
GetOpenFile(sock, fptr);
@ -1508,7 +1509,7 @@ sock_accept(sock)
OpenFile *fptr;
VALUE sock2;
char buf[1024];
int len = sizeof buf;
socklen_t len = sizeof buf;
GetOpenFile(sock, fptr);
sock2 = s_accept(rb_cSocket,fileno(fptr->f),(struct sockaddr*)buf,&len);

View file

@ -428,15 +428,9 @@ class TkText<TkTextWin
rsearch_with_length(pat,start,stop)[0]
end
def dump(type_info, *index)
args = type_info.collect{|inf|
if inf.kind_of? Array
inf[0] = '-' + inf[0]
inf
else
'-' + inf
end
}.flatten
def dump(type_info, *index, &block)
args = type_info.collect{|inf| '-' + inf}
args << '-command' << Proc.new(&block) if iterator?
str = tk_send('dump', *(args + index))
result = []
sel = nil
@ -546,26 +540,23 @@ class TkText<TkTextWin
end
private :_retrieve_backslashed_text
def dump_all(*index)
dump(['all'], *index)
def dump_all(*index, &block)
dump(['all'], *index, &block)
end
def dump_command(cmd, *index)
dump([['command', cmd]], *index)
def dump_mark(*index, &block)
dump(['mark'], *index, &block)
end
def dump_mark(*index)
dump(['mark'], *index)
def dump_tag(*index, &block)
dump(['tag'], *index, &block)
end
def dump_tag(*index)
dump(['tag'], *index)
def dump_text(*index, &block)
dump(['text'], *index, &block)
end
def dump_text(*index)
dump(['text'], *index)
def dump_window(*index, &block)
dump(['window'], *index, &block)
end
def dump_window(*index)
dump(['window'], *index)
end
def dump_image(*index)
dump(['image'], *index)
def dump_image(*index, &block)
dump(['image'], *index, &block)
end
end

2
io.c
View file

@ -2850,7 +2850,7 @@ rb_io_s_pipe()
rb_sys_fail(0);
r = prep_stdio(rb_fdopen(pipes[0], "r"), FMODE_READABLE, rb_cIO);
w = prep_stdio(rb_fdopen(pipes[1], "w"), FMODE_WRITABLE, rb_cIO);
w = prep_stdio(rb_fdopen(pipes[1], "w"), FMODE_WRITABLE|FMODE_SYNC, rb_cIO);
ary = rb_ary_new2(2);
rb_ary_push(ary, r);

View file

@ -71,6 +71,7 @@ class Mutex
retry
end
Thread.critical = false
t.run if t
self
end

View file

@ -13,7 +13,7 @@
#include "ruby.h"
#include <math.h>
#include <stdio.h>
#ifdef __FreeBSD__
#if defined(__FreeBSD__) && __FreeBSD__ < 4
#include <floatingpoint.h>
#endif
@ -1410,7 +1410,7 @@ fix_zero_p(num)
void
Init_Numeric()
{
#ifdef __FreeBSD__
#if defined(__FreeBSD__) && __FreeBSD__ < 4
/* allow divide by zero -- Inf */
fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL));
#endif

2
re.c
View file

@ -184,7 +184,7 @@ kcode_reset_option()
int
rb_mbclen2(c, re)
unsigned char c;
unsigned int c;
VALUE re;
{
int len;

2
re.h
View file

@ -37,6 +37,6 @@ int rb_kcode _((void));
extern int ruby_ignorecase;
int rb_mbclen2 _((unsigned char, VALUE));
int rb_mbclen2 _((unsigned int, VALUE));
#define mbclen2(c,re) rb_mbclen2((c),(re))
#endif

View file

@ -721,29 +721,36 @@ rb_str_succ(orig)
VALUE str, str2;
char *sbeg, *s;
int c = -1;
int n = 0;
str = rb_str_new(RSTRING(orig)->ptr, RSTRING(orig)->len);
if (OBJ_TAINTED(orig)) OBJ_TAINT(str);
if (RSTRING(str)->len == 0) return str;
sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1;
while (sbeg <= s) {
if (ISALNUM(*s) && (c = succ_char(s)) == 0) break;
if (ISALNUM(*s)) {
if ((c = succ_char(s)) == 0) break;
n = s - sbeg;
}
s--;
}
if (s < sbeg) {
if (c == -1 && RSTRING(str)->len > 0) {
RSTRING(str)->ptr[RSTRING(str)->len-1] += 1;
}
else {
str2 = rb_str_new(0, RSTRING(str)->len+1);
RSTRING(str2)->ptr[0] = c;
memcpy(RSTRING(str2)->ptr+1, RSTRING(str)->ptr, RSTRING(str)->len);
str = str2;
if (c == -1) { /* str contains no alnum */
sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1;
c = '\001';
while (sbeg <= s) {
*s += 1;
if (*s-- != 0) break;
}
}
if (OBJ_TAINTED(orig)) {
OBJ_TAINT(str);
if (s < sbeg) {
REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + 1);
s = RSTRING(str)->ptr + n;
memmove(s+1, s, RSTRING(str)->len - n);
*s = c;
RSTRING(str)->len += 1;
}
return str;

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.4.4"
#define RUBY_RELEASE_DATE "2000-04-14"
#define RUBY_RELEASE_DATE "2000-05-01"
#define RUBY_VERSION_CODE 144
#define RUBY_RELEASE_CODE 20000414
#define RUBY_RELEASE_CODE 20000501