8000 1.1b9_29 · jruby/ruby@ab801db · GitHub
[go: up one dir, main page]

Skip to content

Commit ab801db

Browse files
author
matz
committed
1.1b9_29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 1a2003d commit ab801db

25 files changed

+1037
-351
lines changed

ChangeLog

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
Fri Jul 3 16:05:11 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
2+
3+
* experimental release 1.1b9_29.
4+
5+
Fri Jul 3 11:20:46 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
6+
7+
* marshal.c (r_byte): byte should not extend sign bit.
8+
9+
* numeric.c (fix_mul): use FIX2LONG() instead of FIX2INT() for
10+
64bit architectures.
11+
12+
* marshal.c (r_bytes): use weird casting bwetween pointer and int.
13+
14+
* process.c (proc_setsid): new method Process#setsid().
15+
16+
Thu Jul 2 12:49:21 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
17+
18+
* marshal.c (w_object): remove `write_bignum' label for 64bit
19+
architectures.
20+
21+
* marshal.c (r_bytes): needs int, not long.
22+
23+
Wed Jul 1 14:21:06 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
24+
25+
* numeric.c (flo_plus): should not allow addition with strings.
26+
27+
Wed Jul 1 13:09:01 1998 Keiju ISHITSUKA <keiju@rational.com>
28+
29+
* numeric.c (num_uminus): wrong coerce direction.
30+
31+
Tue Jun 30 10:13:44 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
32+
33+
* io.c (f_p): accepts arbitrary number of arguments.
34+
35+
* eval.c (rb_yield_0): there's some case that iterator_p() returns
36+
true even if the_block was not set. check added.
37+
138
Tue Jun 30 01:05:20 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
239

340
* eval.c (BEGIN_CALLARGS): adjust the_block before evaluating the

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ lib/parsedate.rb
115115
lib/ping.rb
116116
lib/pstore.rb
117117
lib/rational.rb
118+
lib/readbytes.rb
118119
lib/shellwords.rb
119120
lib/sync.rb
120121
lib/telnet.rb

bignum.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typedef unsigned short USHORT;
2020
#define BIGRAD (1L << BITSPERDIG)
2121
#define DIGSPERINT ((unsigned int)(sizeof(long)/sizeof(short)))
2222
#define BIGUP(x) ((unsigned int)(x) << BITSPERDIG)
23-
#define BIGDN(x) RSHIFT((x),BITSPERDIG)
23+
#define BIGDN(x) (((x)<0) ? ~((~(x))>>BITSPERDIG) : (x)>>BITSPERDIG)
2424
#define BIGLO(x) ((x) & (BIGRAD-1))
2525

2626
static VALUE
@@ -61,7 +61,7 @@ big_2comp(x) /* get 2's complement */
6161
while (i--) ds[i] = ~ds[i];
6262
i = 0; num = 1;
6363
do {
64-
num += (long)ds[i];
64+
num += ds[i];
6565
ds[i++] = BIGLO(num);
6666
num = BIGDN(num);
6767
} while (i < RBIGNUM(x)->len);
@@ -441,7 +441,7 @@ big_cmp(x, y)
441441

442442
switch (TYPE(y)) {
443443
case T_FIXNUM:
444-
y = int2big(FIX2INT(y));
444+
y = int2big(FIX2LONG(y));
445445
break;
446446

447447
case T_BIGNUM:
@@ -585,7 +585,7 @@ bigadd(x, y, sign)
585585

586586
len = RBIGNUM(x)->len;
587587
for (i = 0, num = 0; i < len; i++) {
588-
num += (long)(BDIGITS(x)[i] + BDIGITS(y)[i]);
588+
num += BDIGITS(x)[i] + BDIGITS(y)[i];
589589
BDIGITS(z)[i] = BIGLO(num);
590590
num = BIGDN(num);
591591
}
@@ -610,7 +610,7 @@ big_plus(x, y)
610610
{
611611
switch (TYPE(y)) {
612612
case T_FIXNUM:
613-
y = int2big(FIX2INT(y));
613+
y = int2big(FIX2LONG(y));
614614
/* fall through */
615615
case T_BIGNUM:
616616
return bigadd(x, y, 1);
@@ -629,7 +629,7 @@ big_minus(x, y)
629629
{
630630
switch (TYPE(y)) {
631631
case T_FIXNUM:
632-
y = int2big(FIX2INT(y));
632+
y = int2big(FIX2LONG(y));
633633
/* fall through */
634634
case T_BIGNUM:
635635
return bigadd(x, y, 0);
@@ -651,10 +651,10 @@ big_mul(x, y)
651651
VALUE z;
652652
USHORT *zds;
653653

654-
if (FIXNUM_P(x)) x = int2big(FIX2INT(x));
654+
if (FIXNUM_P(x)) x = int2big(FIX2LONG(x));
655655
switch (TYPE(y)) {
656656
case T_FIXNUM:
657-
y = int2big(FIX2INT(y));
657+
y = int2big(FIX2LONG(y));
658658
break;
659659

660660
case T_BIGNUM:
@@ -737,15 +737,15 @@ bigdivmod(x, y, div, mod, modulo)
737737
j = 0;
738738
num = 0;
739739
while (j<ny) {
740-
num += (unsigned long)yds[j]*dd;
740+
num += (long)yds[j]*dd;
741741
tds[j++] = BIGLO(num);
742742
num = BIGDN(num);
743743
}
744744
yds = tds;
745745
j = 0;
746746
num = 0;
747747
while (j<nx) {
748-
num += (unsigned long)xds[j]*dd;
748+
num += (long)xds[j]*dd;
749749
zds[j++] = BIGLO(num);
750750
num = BIGDN(num);
751751
}
@@ -764,7 +764,7 @@ bigdivmod(x, y, div, mod, modulo)
764764
i = 0; num = 0; t2 = 0;
765765
do { /* multiply and subtract */
766766
int ee;
767-
t2 += (unsigned long)yds[i] * q;
767+
t2 += (long)yds[i] * q;
768768
ee = num - BIGLO(t2);
769769
num = zds[j - ny + i] + ee;
770770
if (ee) zds[j - ny + i] = BIGLO(num);
@@ -827,7 +827,7 @@ big_div(x, y)
827827

828828
switch (TYPE(y)) {
829829
case T_FIXNUM:
830-
y = int2big(FIX2INT(y));
830+
y = int2big(FIX2LONG(y));
831831
break;
832832

833833
case T_BIGNUM:
@@ -854,7 +854,7 @@ big_modulo(x, y, modulo)
854854

855855
switch (TYPE(y)) {
856856
case T_FIXNUM:
857-
y = int2big(FIX2INT(y));
857+
y = int2big(FIX2LONG(y));
858858
break;
859859

860860
case T_BIGNUM:
@@ -894,7 +894,7 @@ big_divmod(x, y)
894894

895895
switch (TYPE(y)) {
896896
case T_FIXNUM:
897-
y = int2big(FIX2INT(y));
897+
y = int2big(FIX2LONG(y));
898898
break;
899899

900900
case T_FLOAT:
@@ -931,8 +931,8 @@ big_pow(x, y)
931931
break;
932932

933933
case T_FIXNUM:
934-
if (FIX2INT(y) > 0) goto pos_big;
935-
d = (double)FIX2INT(y);
934+
if (FIX2LONG(y) > 0) goto pos_big;
935+
d = (double)FIX2LONG(y);
936936
break;
937937

938938
default:
@@ -964,7 +964,7 @@ big_and(x, y)
964964
char sign;
965965

966966
if (FIXNUM_P(y)) {
967-
y = int2big(FIX2INT(y));
967+
y = int2big(FIX2LONG(y));
968968
}
969969
else {
970970
Check_Type(y, T_BIGNUM);
@@ -1015,7 +1015,7 @@ big_or(x, y)
10151015
char sign;
10161016

10171017
if (FIXNUM_P(y)) {
1018-
y = int2big(FIX2INT(y));
1018+
y = int2big(FIX2LONG(y));
10191019
}
10201020
else {
10211021
Check_Type(y, T_BIGNUM);
@@ -1067,7 +1067,7 @@ big_xor(x, y)
10671067
char sign;
10681068

10691069
if (FIXNUM_P(y)) {
1070-
y = int2big(FIX2INT(y));
1070+
y = int2big(FIX2LONG(y));
10711071
}
10721072
else {
10731073
Check_Type(y, T_BIGNUM);
@@ -1219,7 +1219,7 @@ big_coerce(x, y)
12191219
VALUE x, y;
12201220
{
12211221
if (FIXNUM_P(y)) {
1222-
return assoc_new(int2big(FIX2INT(y)), x);
1222+
return assoc_new(int2big(FIX2LONG(y)), x);
12231223
}
12241224
else {
12251225
TypeError("can't coerce %s to Bignum", rb_class2name(CLASS_OF(y)));

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,7 +2694,7 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\
26942694
truncate chsize times utimes fcntl lockf setitimer\
26952695
setruid seteuid setreuid setrgid setegid setregid\
26962696
setpgrp2 getpgid getgroups getpriority\
2697-
dlopen sigprocmask sigaction _setjmp setpgrp
2697+
dlopen sigprocmask sigaction _setjmp setpgrp setsid
26982698
do
26992699
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
27002700
echo "configure:2701: checking for $ac_func" >&5
@@ -3181,7 +3181,7 @@ else
31813181
int
31823182
main()
31833183
{
3184-
if (-1==((-1)>>1))
3184+
if (-1==(-1>>1))
31853185
return 0;
31863186
return 1;
31873187
}

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd\
164164
truncate chsize times utimes fcntl lockf setitimer\
165165
setruid seteuid setreuid setrgid setegid setregid\
166166
setpgrp2 getpgid getgroups getpriority\
167-
dlopen sigprocmask sigaction _setjmp setpgrp)
167+
dlopen sigprocmask sigaction _setjmp setpgrp setsid)
168168
if test "$ac_cv_func_strftime" = no; then
169169
AC_STRUCT_TIMEZONE
170170
AC_TRY_LINK([],
@@ -237,7 +237,7 @@ AC_CACHE_VAL(rb_cv_rshift_sign,
237237
int
238238
main()
239239
{
240-
if (-1==((-1)>>1))
240+
if (-1==(-1>>1))
241241
return 0;
242242
return 1;
243243
}

enum.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ min_i(i, min)
198198
*min = i;
199199
else {
200200
cmp = rb_funcall(i, id_cmp, 1, *min);
201-
if (FIX2INT(cmp) < 0)
201+
if (FIX2LONG(cmp) < 0)
202202
*min = i;
203203
}
204204
return Qnil;
@@ -214,7 +214,7 @@ min_ii(i, min)
214214
*min = i;
215215
else {
216216
cmp = rb_yield(assoc_new(i, *min));
217-
if (FIX2INT(cmp) < 0)
217+
if (FIX2LONG(cmp) < 0)
218218
*min = i;
219219
}
220220
return Qnil;
@@ -240,7 +240,7 @@ max_i(i, max)
240240
*max = i;
241241
else {
242242
cmp = rb_funcall(i, id_cmp, 1, *max);
243-
if (FIX2INT(cmp) > 0)
243+
if (FIX2LONG(cmp) > 0)
244244
*max = i;
245245
}
246246
return Qnil;
@@ -256,7 +256,7 @@ max_ii(i, max)
256256
*max = i;
257257
else {
258258
cmp = rb_yield(assoc_new(i, *max));
259-
if (FIX2INT(cmp) > 0)
259+
if (FIX2LONG(cmp) > 0)
260260
*max = i;
261261
}
262262
return Qnil;

eval.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -981,27 +981,27 @@ ruby_run()
981981

982982
case TAG_RETURN:
983983
error_pos();
984-
fprintf(stderr, "unexpected return\n");
984+
fprintf(stderr, ": unexpected return\n");
985985
exit(1);
986986
break;
987987
case TAG_NEXT:
988988
error_pos();
989-
fprintf(stderr, "unexpected next\n");
989+
fprintf(stderr, ": unexpected next\n");
990990
exit(1);
991991
break;
992992
case TAG_BREAK:
993993
error_pos();
994-
fprintf(stderr, "unexpected break\n");
994+
fprintf(stderr, ": unexpected break\n");
995995
exit(1);
996996
break;
997997
case TAG_REDO:
998998
error_pos();
999-
fprintf(stderr, "unexpected redo\n");
999+
fprintf(stderr, ": unexpected redo\n");
10001000
exit(1);
10011001
break;
10021002
case TAG_RETRY:
10031003
error_pos();
1004-
fprintf(stderr, "retry outside of rescue clause\n");
1004+
fprintf(stderr, ": retry outside of rescue clause\n");
10051005
exit(1);
10061006
break;
10071007
case TAG_RAISE:
@@ -2340,6 +2340,9 @@ rb_eval(self, node)
23402340
VALUE origin;
23412341
int noex;
23422342

2343+
if (the_class == cObject && node->nd_mid == init) {
2344+
Warn("re-defining Object#initialize may cause infinite loop");
2345+
}
23432346
body = search_method(the_class, node->nd_mid, &origin);
23442347
if (body) {
23452348
if (origin == the_class) {
@@ -2844,7 +2847,7 @@ rb_yield_0(val, self)
28442847
int state;
28452848
static unsigned serial = 1;
28462849

2847-
if (!iterator_p()) {
2850+
if (!iterator_p() || !the_block) {
28482851
Raise(eLocalJumpError, "yield called out of iterator");
28492852
}
28502853

@@ -6220,12 +6223,12 @@ thread_create(fn, arg)
62206223
tval.it_interval.tv_usec = 100000;
62216224
tval.it_value = tval.it_interval;
62226225
setitimer(ITIMER_VIRTUAL, &tval, NULL);
6223-
6226+
#if 1
62246227
tval.it_interval.tv_sec = 2; /* unblock system calls */
62256228
tval.it_interval.tv_usec = 0;
62266229
tval.it_value = tval.it_interval;
62276230
setitimer(ITIMER_REAL, &tval, NULL);
6228-
6231+
#endif
62296232
init = 1;
62306233
}
62316234
#endif

ext/socket/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ sock_s_gethostbyaddr(argc, argv)
13671367
int alen;
13681368
struct hostent *h;
13691369

1370-
rb_scan_args(argc, argv, "11", &addr, &vtype);
1370+
rb_scan_args(argc, argv, "11", &vaddr, &vtype);
13711371
addr = str2cstr(vaddr, &alen);
13721372
if (!NIL_P(vtype)) {
13731373
type = NUM2INT(vtype);

hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ any_hash(a, mod)
103103
hval = rb_funcall(hval, '%', 1, INT2FIX(65439));
104104
}
105105
ENABLE_INTS;
106-
hval = FIX2INT(hval);
106+
hval = FIX2LONG(hval);
107107
}
108108
return hval % mod;
109109
}

0 commit comments

Comments
 (0)
0