[ruby-talk:110664]
* error.c (exc_equal): exceptions are equal if they share same
class, message and backtrace. [ruby-talk:110354]
* error.c (name_err_mesg_equal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unnecessary line trace for inlined expression.
(ruby-bugs PR#1320)
* numeric.c (flo_to_s): tweak output string based to preserve
decimal point and to remove trailing zeros. [ruby-talk:97891]
* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
search. [ruby-talk:97342]
* hash.c (rb_hash_equal): returns true if two hashes have same set
of key-value set. [ruby-talk:97559]
* hash.c (rb_hash_eql): returns true if two hashes are equal and
have same default values.
* string.c (rb_str_equal): always returns true or false, never
returns nil. [ruby-dev:23404]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the wrapper, not for a singleton class for wrapped main.
[ruby-dev:23305]
* bignum.c (rb_big_eq): use temporary double variable to save the
result (internal float register may be bigger than 64 bits, for
example, 80 bits on x86). [ruby-dev:23311]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:22654]
* pack.c (pack_pack): do not auto convert nil to zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-core:02078]
* io.c (rb_io_getline): should return nil on eof, even when nil rs is
specified. [ruby-core:02077]
* pack.c (pack_pack): add sign check for 'i', and 'l'.
[ruby-dev:22427]
* bignum.c (rb_quad_pack): add range check for 'quad int'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* defines.h, rubysig.h, signal.c: removed macro handling which
should be done in configure.
* configure.in (intrinsics.h): check if present.
* ruby.h: include intrinsics.h if available.
* bignum.c, marshal.c: include ieeefp.h if available.
* missing.h (isinf): define as a macro if finite() and isnan()
are available. [ruby-core:02032]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
USRMARSHAL. [ruby-dev:21582]
* marshal.c (w_object): dump generic instance variables from
a string from '_dump'.
* variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
is not set.
* time.c (time_dump): copy instance variables to dumped string, to
be included in the marshaled data.
* bignum.c (rb_big2ulong): add range check to ensure round trip.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_string_value_cstr): check null byte in the string
before retrieving C ptr. accessed via macro StringValueCStr.
* file.c (sys_fail2): raise error for two operand system calls
such as rename, link, symlink. (ruby-bugs PR#1047)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
section. [ruby-dev:20490]
* eval.c (compile): put rb_compile_string() in a thread critical
section.
* variable.c (rb_const_get_0): should not warn if constant is not
defined. (ruby-bugs-ja PR#509)
* bignum.c (rb_big2dbl): give a warning on overflow.
(ruby-bugs-ja PR#510)
* util.c (ruby_strtod): change MDMAXEXPT from 511 to 308.
* pack.c (utf8_to_uv): long is sufficient. LONG_LONG is not
required.
* bignum.c (rb_big2str): support 32 bit (without `long long' type)
machines. (ruby-bugs-ja PR#512)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_quo): should return most exact quotient value,
i.e. float by default, rational if available.
* numeric.c (num_div): "div" should return x.divmod(x)[0].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_check_array_type): new function: return an array
(convert if possible), or nil.
* string.c (rb_check_string_type): new function: return a string
(convert if possible), or nil.
* numeric.c (rb_dbl_cmp): returns nil if values are not
comparable.
* numeric.c (fix_cmp,flo_cmp): use rb_num_coerce_cmp()
* bignum.c (rb_big_cmp): ditto.
* numeric.c (rb_num_coerce_cmp): new coercing function for "<=>",
which does not raise TypeError.
* numeric.c (do_coerce): can be supress exception now.
* object.c (rb_mod_cmp): should return nil for non class/module
objects.
* re.c (rb_reg_eqq): return false if the argument is not a
string. now returns boolean value.
* class.c (rb_include_module): argument should be T_MODULE, not
T_class, nor T_ICLASS.
* eval.c (is_defined): "defined?" should return "assignment" for
attribute assignment (e.g. a.foo=b) and indexed assignment
(e.g. a[2] = 44).
* parse.y (aryset): use NODE_ATTRASGN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zipped with nil if argument arrays are shorter. if arrays are
longer, left items are ignored. now works with blocks.
* enum.c (zip_i): changed for new behavior.
* array.c (rb_ary_transpose): added. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bits if x is negative.
* bignum.c (bigdivmod): len for bignum zero is 1, not 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_dup): should preserve HASH_PROC_DEFAULT and
HASH_DELETED flags.
* hash.c (rb_hash_shift): shift from empty hash should not return
its default proc.
* hash.c (rb_hash_default_proc): new method. [new]
* array.c (rb_ary_aref): no need for Bignum check.
* array.c (rb_ary_aset): explicit Bignum check removd.
* numeric.c (fix_aref): normalize bignum before bit-op.
* bignum.c (rb_big_rand): max may be Bignum zero.
* bignum.c (rb_cstr_to_inum): should normalize bignums, to avoid
returning fixable bignum value.
* bignum.c (rb_uint2big): there should be no zero sized bignum.
* ext/extmk.rb.in: extmake() that works properly for both tkutil
(tk/tkutil.so) and digest/sha1.
* hash.c (rb_hash_equal): should check HASH_PROC_DEFAULT too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
big2dbl().
* bignum.c (Init_Bignum): rb_big_zero_p() removed. There may be
Bignum zero.
* eval.c (rb_call0): new argument added for original method name.
preserve original method name in frame->orig_func.
* eval.c (is_defined): use frame->orig_func, not last_func.
* eval.c (rb_eval): ditto.
* eval.c (method_call): supply data->oid also to rb_call0().
* object.c (rb_class_allocate_instance): call rb_obj_alloc() when
called from alias, thus invoke original "allocate".
* eval.c (remove_method): removing allocate from classes should
cause NameError.
* hash.c (rb_hash_equal): should check default values.
* ext/socket/socket.c (s_recvfrom): update RSTRING len.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (jump_tag_but_local_jump): preserve retval in
LocalJumpError exceptions.
* parse.y (command): no more check for "super outside of method".
* eval.c (rb_mod_define_method): should set last_class and
last_func in the block->frame.
* eval.c (error_handle): should handle TAG_THROW as well.
* parse.y (yylex): new decimal notation '0d4567'.
* parse.y (yylex): new octal notation '0o777'.
* parse.y (string_content): every string_content node should
return string only. use NODE_EVSTR to coercing.
* eval.c (rb_eval): NODE_EVSTR support.
* re.c (rb_reg_quote): avoid unnecessary string allocation.
* string.c (get_pat): quote metachracters before compiling a
string into a regex.
* string.c (rb_str_split_m): special treatment of strings of size
1, but AWK emulation. now uses get_pat().
* string.c (rb_str_match_m): quote metacharacters.
* string.c (rb_str_match2): ditto.
* ext/socket/socket.c (sock_addrinfo): make all 3 versions of
getaddrinfo happy. [ruby-core:00184]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
etc, instead.
* parse.y (yylex): no here document after a dot.
* parse.y (yylex): should have set lex_state after '`'.
* parse.y (yylex): should have set lex_state properly after
tOP_ASGN.
* bignum.c (rb_big2dbl): return canonical HUGE_VAL for infinity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
called outside of a method.
* parse.y (arg): use INT2NUM, not INT2FIX for tUMINUS.
* parse.y (arg): unnecessary negative tPOW treatment.
* parse.y (tokadd_escape): wrong backslash escapement.
* parse.y (stmt,arg): too much void value check.
* parse.y (stmt,arg): need to check void value on rules which does
not use node_assign().
* ext/socket/socket.c (ipaddr): need not to taint hostnames.
* range.c (range_include): should be based on "<=>", whereas
member? still is based on "each".
* range.c (range_min,range_max): redefine methods based on "<=>".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (set_method_visibility): should have clear cache forq
updated visibility.
* numeric.c (flo_to_s): default format precision to be "%.16g".
* util.c (ruby_strtod): use own strtod(3) implementation to avoid
locale hell. Due to this change "0xff".to_f no longer returns 255.0
* eval.c (avalue_to_yvalue): new function to distinguish yvalue
(no-arg == Qundef) from svalue (no-arg == Qnil).
* eval.c (rb_yield_0): use avalue_to_yvalue().
* eval.c (assign): warn if val == Qundef where it means rhs is
void (e.g. yield without value or call without argument).
* parse.y (value_expr): need not to warn for WHILE and UNTIL,
since they can have return value (via valued break).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
<Masamichi.Akiyoshi@jp.compaq.com> is merged.
* eval.c (exec_under): changing ruby_class is OK, but should not
alter cbase.
* eval.c (yield_under_i): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e