Skip to content

Commit 39ac1d7

Browse files
author
matz
committed
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c086e78 commit 39ac1d7

File tree

8 files changed

+51
-32
lines changed

8 files changed

+51
-32
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Fri Aug 14 11:01:47 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
2+
3+
* eval.c (call_trace_func): save __FILE__, __LINE__ before
4+
executing trace_func, since trace function should not corrupt
5+
line number information.
6+
7+
Thu Aug 13 15:09:02 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
8+
9+
* array.c (ary_s_new): was marking unallocated region on GC.
10+
111
Tue Aug 11 11:57:35 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
212

313
* version 1.1c2 released.

array.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ ary_s_new(argc, argv, klass)
167167
VALUE *argv;
168168
VALUE klass;
169169
{
170+
int len = 0;
170171
VALUE size, val;
171172
NEWOBJ(ary, struct RArray);
172173
OBJSETUP(ary, klass, T_ARRAY);
@@ -186,10 +187,11 @@ ary_s_new(argc, argv, klass)
186187
ArgError("array size too big");
187188
}
188189
ary->capa = capa;
189-
ary->len = capa;
190+
len = capa;
190191
}
191192
ary->ptr = ALLOC_N(VALUE, ary->capa);
192-
memfill(ary->ptr, ary->len, val);
193+
memfill(ary->ptr, len, val);
194+
ary->len = len;
193195
obj_call_init((VALUE)ary);
194196

195197
return (VALUE)ary;

eval.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,8 @@ call_trace_func(event, file, line, self, id)
15541554
int state;
15551555
volatile VALUE trace;
15561556
struct FRAME *prev;
1557+
char *file_save = sourcefile;
1558+
int line_save = sourceline;
15571559

15581560
if (!trace_func) return;
15591561

@@ -1585,6 +1587,8 @@ call_trace_func(event, file, line, self, id)
15851587
thread_critical--;
15861588
#endif
15871589
if (!trace_func) trace_func = trace;
1590+
sourceline = line_save;
1591+
sourcefile = file_save;
15881592
if (state) JUMP_TAG(state);
15891593
}
15901594

@@ -2780,7 +2784,7 @@ rb_longjmp(tag, mesg)
27802784
errinfo = mesg;
27812785
}
27822786

2783-
if (debug && !NIL_P(errinfo)) {
2787+
if (debug && !NIL_P(errinfo) && !obj_is_kind_of(errinfo, eSystemExit)) {
27842788
fprintf(stderr, "Exception `%s' at %s:%d\n",
27852789
rb_class2name(CLASS_OF(errinfo)),
27862790
sourcefile, sourceline);

lib/debug.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def debug_command(file, line, id, binding)
176176
printf "no sourcefile available for %s\n", file
177177
end
178178
when /^p\s+/
179-
p debug_eval($', binding)
179+
p debug_eval($', binding) #'
180180
else
181181
v = debug_eval(input, binding)
182182
p v unless v == nil
@@ -194,10 +194,13 @@ def line_at(file, line)
194194
return "\n" unless line
195195
return line
196196
end
197+
save = $DEBUG
197198
begin
199+
$DEBUG = FALSE
198200
f = open(file)
199201
lines = @scripts[file] = f.readlines
200202
rescue
203+
$DEBUG = save
201204
@scripts[file] = TRUE
202205
return "\n"
203206
end

lib/e2mmap.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def E2MM.extend_object(cl)
2222
cl.bind(self)
2323
end
2424

25-
# 以前との互換性のために残してある.
25+
# backward compatibility
2626
def E2MM.extend_to(b)
2727
c = eval("self", b)
2828
c.extend(self)
2929
end
3030

31-
# public :fail
31+
# public :fail
3232
# alias e2mm_fail fail
3333

3434
def fail(err = nil, *rest)
@@ -39,8 +39,8 @@ def bind(cl)
3939
self.module_eval %q^
4040
E2MM_ErrorMSG = {} unless self.const_defined?(:E2MM_ErrorMSG)
4141
# fail(err, *rest)
42-
# err: 例外
43-
# rest: メッセージに渡すパラメータ
42+
# err: Exception
43+
# rest: Parameter accompanied with the exception
4444
#
4545
def self.fail(err = nil, *rest)
4646
if form = E2MM_ErrorMSG[err]
@@ -63,7 +63,6 @@ class << self
6363
# def_exception(c, m)
6464
# c: exception
6565
# m: message_form
66-
# 例外cのメッセージをmとする.
6766
#
6867
def self.def_e2message(c, m)
6968
E2MM_ErrorMSG[c] = m
@@ -72,8 +71,8 @@ def self.def_e2message(c, m)
7271
# def_exception(c, m)
7372
# n: exception_name
7473
# m: message_form
75-
# s: 例外スーパークラス(デフォルト: Exception)
76-
# 例外名``c''をもつ例外を定義し, そのメッセージをmとする.
74+
# s: superclass_of_exception (default: Exception)
75+
# defines excaption named ``c'', whose message is ``m''.
7776
#
7877
#def def_exception(n, m)
7978
def self.def_exception(n, m, s = nil)
@@ -99,4 +98,3 @@ def self.def_exception(n, m, s = nil)
9998
def_exception(:ErrNotRegisteredException, "not registerd exception(%s)")
10099
end
101100
end
102-

lib/matrix.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717
# :
1818
# rown]
1919
#
20-
# column: 列
21-
# row: 行
2220
#
2321
# module ExceptionForMatrix::
2422
# Exceptions:
2523
# ErrDimensionMismatch
26-
# 行または列数が一致していない.
24+
# number of column/row do not match
2725
# ErrNotRegular
28-
# 正則行列でない.
26+
# not a regular matrix
2927
# ErrOperationNotDefined
30-
# その演算子はまだ定義されていない.
28+
# specified operator is not defined (yet)
3129
#
3230
# class Matrix
3331
# include ExceptionForMatrix

missing/snprintf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@
6060
#include <sys/types.h>
6161

6262

63+
# undef __P
6364
#if defined(__STDC__)
65+
# define __P(x) x
6466
# include <stdarg.h>
6567
#else
6668
# undef __P
6769
# define __P(x) ()
70+
# define const
6871
# include <varargs.h>
6972
#endif
7073
#ifndef _BSD_VA_LIST_
@@ -347,7 +350,9 @@ static BSD__sfvwrite(fp, uio)
347350
#define u_int unsigned int
348351

349352
#include <limits.h>
353+
#if !defined(__CYGWIN32__)
350354
#include <stdlib.h>
355+
#endif
351356
#include <string.h>
352357

353358
#if defined(__STDC__)

sample/rbc.rb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@
1111
#
1212
# rbc.rb [options] file_name opts
1313
# options:
14-
# -d デバッグモード(利用しない方が良いでしょう)
15-
# -f ~/.irbrc を読み込まない.
16-
# -m bcモード(分数, 行列の計算ができます)
17-
# -r load-module ruby -r と同じ.
18-
# --inspect 結果出力にinspectを用いる(bcモード以外はデ
19-
# フォルト).
20-
# --noinspect 結果出力にinspectを用いない.
21-
# --noreadline readlineライブラリを利用しない(デフォルト
22-
# ではreadlineライブラリを利用しようとする).
14+
# -d debug mode (not recommended)
15+
# -f does not read ~/.irbrc
16+
# -m bc mode (rational/matrix calc)
17+
# -r load-module same as `ruby -r'
18+
# --inspect use inspect for result output
19+
# (default for non-bc mode)
20+
# --noinspect does not use inspect for result output
21+
# --noreadline does not use readline library
22+
# (default: try to use readline)
2323
#
24-
# 追加 private method:
25-
# exit, quit 終了する.
26-
# inspect_mode(sw = nil) インスペクトモードのトグル
27-
# trace_load(sw = nil) load/require時にrbcのfile読み込み機能を用
28-
# いるモードのスイッチ(デフォルトはトレース
29-
# モード)
24+
# additional private method (as function):
25+
# exit, quit terminate the interpreter
26+
# inspect_mode(sw = nil) toggle inspect mode
27+
# trace_load(sw = nil) change trace mode for file loading using
28+
# load/require. (default: trace-mode on)
3029
#
3130
require "e2mmap.rb"
3231

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy