Граф коммитов

115 Коммитов

Автор SHA1 Сообщение Дата
nobu e27aaa177e * configure.in, ruby.h: define rb_[pgu]id_t macros instead of typedefs
to get rid of types which might not be defined yet.  [ruby-dev:26165]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-15 09:56:53 +00:00
nobu 642ddf7201 * configure.in: Check for the availability of pid_t, gid_t and uid_t and
remove AC_TYPE_UID_T.  fixed: [ruby-core:04745]

* defines.h: Remove pid_t typedef.

* ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with
 the available system types.

* process.c: Change instances of pid_t and gid_t to their rb_*
 counterparts.

* ext/pty/pty.c: Change pid_t to rb_pid_t.

* vms/config.h: Define HAVE_{P,G,U}ID_T to 1.

* win32/Makefile.sub: Remove #define for {g,u}id_t.

* win32/win32.c: Change pid_t to rb_pid_t.

* wince/Makefile.sub: Remove #define for {g,u}id_t.

* wince/sys/types.h: Remove definitions of {p,g,u}id_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-14 14:57:53 +00:00
nobu 27a9df2a6b * configure.in (RUBY_FUNC_ATTRIBUTE): check for function attribute.
[ruby-dev:26109]

* eval.c, gc.c: moved noinline to configure.in.

* rubyio.h (DEPRECATED): moved to configure.in.

* ruby.h (DEPRECATED, NOINLINE): default definition.

* win{32,ce}/Makefile.sub (config.h): deprecated and noinline for
  __declspec() are available for VC++7 or later.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-30 02:59:44 +00:00
nagai 9815949157 * eval.c (ruby_native_thread_kill): call pthread_kill() to send a
signal to ruby's native thread
* ruby.h: add definition of ruby_native_thread_kill()
* signal.c (sigsend_to_ruby_thread): send the signal to ruby's native
  thread ([ruby-dev:25744], [ruby-dev:25754]), and set signal mask to
  the current native thread


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-02 08:11:28 +00:00
matz 288ceaeec2 * re.c (rb_reg_initialize_m): should raise exception instead of
compile error.  [ruby-core:03755]

* string.c (rb_str_splice): move rb_str_modify() after
  StringValue(), which may alter the receiver.  [ruby-dev:24878]

* error.c (rb_error_frozen): now raise RuntimeError instead of
  TypeError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-17 02:27:38 +00:00
akr 8f1c92af4f * process.c (proc_getrlimit): new function for Process.getrlimit.
(proc_setrlimit): new function for Process.setrlimit.
  [ruby-dev:24834]

* configure.in: check rlim_t and its size.  check setrlimit.

* ruby.h (NUM2ULL): new macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-14 10:06:16 +00:00
matz 018837b84f * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
[ruby-talk:117841]

* ruby.h (FL_ABLE): nodes are not subject for flag operations.

* io.c (ARGF_FORWARD): should have specified argv explicitly,
  since we no longer have frame->argv saved.  [ruby-dev:24602]

* string.c (RESIZE_CAPA): check string attribute before modifying
  capacity member of string structure.  [ruby-dev:24594]

* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
  performance.  [ruby-talk:117701]

* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
  arguments, unless (digit)$ style used.

* io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
  interpreter termination.  [ruby-dev:24579]

* eval.c (frame_free): Guy Decoux solved the leak problem.
  Thanks.  [ruby-core:03549]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 09:29:26 +00:00
matz 0c97c8e335 * hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]
* st.c (st_foreach): add deep check.

* hash.c (rb_hash_fetch): returns KeyError instead of IndexError.

* hash.c (env_fetch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22 04:48:52 +00:00
matz df84c64be9 * pack.c (pack_pack): use NUM2INT() instead of num2i32().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 06:30:15 +00:00
matz 4ded52b623 * file.c (rb_get_path): get path string via "to_path" method if
path object is not a string. [Ruby2]

* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
  exit finalizers.

* io.c (rb_io_reopen): should use rb_io_check_io().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 02:51:05 +00:00
nobu 111d2ad8c5 * intern.h: provide proper prototypes. [ruby-core:02724]
* ruby.h: missing.h is now prerequisite to intern.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 03:05:22 +00:00
matz 7c097dc891 * struct.c (rb_struct_s_def): Struct::new executes block with
generated struct class. [ruby-talk:02606]

* io.c (rb_io_ungetc): raise IOError instead of calling
  rb_sys_fail().  [ruby-talk:23181]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-10 07:05:19 +00:00
ocean 30fd29a174 * ruby.h, dir.c (rb_glob): add const.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-15 06:34:21 +00:00
matz 7a987b9bcd * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
[ruby-dev:22761]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-29 08:05:29 +00:00
matz 51e6d9061d * misc/ruby-mode.el: better support for general delimited
strings.  [ruby-dev:22695]

* lib/weakref.rb (WeakRef::initialize): set up @__id before
  calling "super".

* lib/delegate.rb (Delegator::initialize): preserve
  singleton_method_added method [ruby-dev:22685]

* lib/delegate.rb (Delegator::initialize): use Kernel::raise
  instead of mere raise.  [ruby-dev:22681]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-27 06:05:04 +00:00
matz 6760a5ed9f * parse.y (primary): allow no "when" case. [ruby-dev:22578]
* ruby.h (rb_class_of): reduce branch. [ruby-dev:22577]

* ruby.h (rb_type): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-13 05:48:59 +00:00
nobu 748b699d1b * configure.in (ac_cv_func_setitimer): moved from defines.h
* 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
2003-12-22 08:23:55 +00:00
nobu faab8f264d * configure.in (ieeefp.h), numeric.c: needed for finite() on
Solaris.  [ruby-core:01921]

* file.c (rb_stat_inspect): adjust format specifier.

* parse.c (arg_prepend): nodetype() is for debug use.

* ruby.h (ISASCII, etc): cast to int to get rid of warning.

* ruby.h (alloca.h): include even in GCC.  [ruby-core:01925]

* ext/bigdecimal/bigdecimal.c (GetVpValue): adjust format
  specifier.

* ext/bigdecimal/bigdecimal.c (BigDecimal_prec, BigDecimal_coerce,
  BigDecimal_divmod): use rb_assoc_new() to suppress memory usage.

* ext/bigdecimal/bigdecimal.c (BigDecimal_split): ditto.

* ext/dl/sym.c (rb_dlsym_guardcall): guard itself should be
  volatile.

* ext/iconv/iconv.c (iconv_convert): ensure actual parameter with
  format specifier.

* ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): do not
  define unless used.

* ext/pty/pty.c (getDevice): get rid of warning.

* ext/socket/socket.c (port_str, sock_s_getaddrinfo,
  sock_s_getnameinfo): FIX2INT() now returns long.

* ext/socket/socket.c (init_inetsock_internal): uninitialized
  variable.

* ext/syck/rubyext.c (syck_parser_assign_io): add prototype.

* ext/syck/rubyext.c (rb_syck_mktime, yaml_org_handler): use
  ISDIGIT() instead of isdigit() to avoid warnings and for
  platforms which don't support non-ascii charater.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11 02:39:59 +00:00
matz b0acbc4c9a * pack.c (htov16): converts endian using swap16. htov32(), hton16,
hton32 as well. [ruby-talk:85377]

* pack.c (swap16): swap 2 bytes no matter how big short is on the
  platform.  swap32() is also prepared.

* numeric.c (rb_num2int): returns long to preserve information.
  rb_fix2int(), rb_num2uint(), rb_fix2uint() as well.
  [ruby-talk:85377]

* numeric.c (rb_num2uint): should not check for value range if the
  source value is negative.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-01 08:42:53 +00:00
eban ec373c3e1c * ruby.h: don't treat Cygwin as Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-25 07:17:14 +00:00
nagai c5061b6116 * check existence of "pthread.h"
* define is_ruby_native_thread() macro when not HAVE_NATIVETHREAD


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 16:47:30 +00:00
nagai b33ea38a9b * ruby.h: define is_ruby_native_thread() for no native thread environment
* eval.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 04:39:08 +00:00
nagai 340a511fdf * configure.in: always check existence of the pthread library
* ruby.h: define macros for ruby's native thread check
* eval.c: add ruby's native thread check
* gc.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 03:50:32 +00:00
nobu 921d595fd4 * intern.h (ruby_stop): never return.
* ruby.h (ruby_run): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-14 02:53:53 +00:00
matz 7ff7bcbf9d * enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto.

* eval.c (rb_yield_splat): new function to call "yield *values".

* string.c (rb_str_scan): use rb_yield_splat().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 08:09:58 +00:00
usa 28cbfaba2b * ruby.h (LLONG_MIN): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 08:28:54 +00:00
matz 37b2487c70 * lib/net/smtp.rb (Net::SMTP::send0): add taint check.
* ruby.h (LLONG_MIN): wrong value.

* io.c (rb_f_getc): $stdin may not be IO. [ruby-dev:20973]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 07:52:55 +00:00
matz dea1baa169 * ext/stringio/stringio.c (strio_gets): only "gets" should set $_.
* ext/stringio/stringio.c (strio_getline): should not set $_ here.

* io.c (argf_to_s): argf.to_s returns "ARGF".

* io.c (set_defout_var, set_deferr_var): make $defout and $deferr
  obsolete.

* io.c (set_input_var, set_output_var): allow $stdin, $stdout,
  $stderr not to be instance of IO.

* io.c (rb_f_readline): forward method to current_file. gets,
  readline, readlines, getc, readchar, tell, seek, pos=, rewind,
  fileno, to_io, eof, each_line, each_byte, binmode, and closed?
  as well.

* io.c (argf_forward): utility function to forward method to
  current_file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28 07:31:52 +00:00
matz e4de8e7566 * string.c: use StringValueCStr to retrieve paths to system calls.
* 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
2003-07-20 17:17:52 +00:00
matz 67dcad92b7 * string.c (rb_str_upto): generate sequence according to "succ"
order.  formerly check was done by dictionary order.
  [ruby-talk:74138]

* string.c (rb_string_value): fill constant empty string along
  with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179]

* string.c (rb_string_value_ptr): ditto.

* string.c (rb_check_string_type): ditto.

* string.c (str_gsub): move END(0) check before mbclen2().

* string.c (scan_once): reduce END(0) check.

* io.c (rb_io_initialize): accept fixnum mode.

* eval.c (error_print): replace strchr() by memchr(), einfo may
  contain "\0".

* pack.c (pack_unpack): range check for "@" move; initialize check
  for "m".

* error.c (syserr_initialize): avoid buffer overflow.

* file.c (rb_file_s_readlink): expand buffer until readlink
  succeed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 06:52:39 +00:00
matz f7afa61a0a * eval.c: remove rb_cBlock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-17 03:12:28 +00:00
matz bad7546f15 * gc.c (define_final): eliminate rb_f_lambda() call.
* class.c (rb_scan_args): ditto.

* signal.c (sig_trap): ditto.

* hash.c (rb_hash_initialize): ditto.

* variable.c (rb_f_trace_var): ditto.

* ext/dl/dl.c (rb_dl_callback): ditto.

* ext/win32ole/win32ole.c (ev_on_event): ditto.

* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.
  Each END proc should preserve its own $SAFE level. [ruby-core:01119]

* marshal.c (marshal_load): remove unused variable "hash".
  [ruby-core:01120]

* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]

* array.c (rb_ary_first): optional argument to retrieve first n
  elements.

* array.c (rb_ary_last): optional argument to retrieve last n
  elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:44:22 +00:00
nobu 045eb9773e * numeric.c (rb_num2uint, rb_fix2int): new function to convert
values over INT_MAX.  [ruby-core:01099]

* ruby.h (NUM2UINT, FIX2INT): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-30 13:28:10 +00:00
matz 82cf98939f * eval.c (rb_yield_0): give warning for multiple values for a
block parameter.

* eval.c (rb_yield_values): a function to yield multiple values.

* array.c (sort_1): use rb_yield_values.

* enum.c (min_ii, max_ii): ditto.

* hash.c (rb_hash_update_block_i, delete_if_i, select_i,
  each_pair_i, env_each, env_reject_bang, env_select,
  env_update_i): ditto.

* struct.c (rb_struct_each_pair): ditto.

* eval.c (top_include): should include module in the current self,
  not ruby_top_self. [ruby-dev:20198]

* eval.c (top_include): stop inclusion to ruby_wrapper; give
  warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20 06:29:23 +00:00
matz 5e8a9873a2 * eval.c (error_pos): use $deferr for output instead of stderr
directly.

* eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule):
  ditto.

* io.c (Init_IO): new variable $deferr which is default output
  port of error messages.

* io.c (rb_warn_m): new method "warn". [new]

* error.c (warn_print): use $deferr.

* error.c (rb_bug): ditto.

* error.c (err_append): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-13 05:53:08 +00:00
matz d4db9e9c60 * io.c (rb_io_initialize): should check rb_secure(4).
* dir.c (dir_s_getwd): should check rb_secure(4).

* object.c (rb_obj_infect): function version of OBJ_INFECT().

* eval.c (rb_secure_update): new function to check object update.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25 03:11:27 +00:00
matz ece972717b security enhancement of dl library (need test).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-24 09:38:37 +00:00
nobu f3bdfcc416 * configure.in, bcc32/Makefile.sub, win32/Makefile.sub: define
RUBY_EXPORT to export symbols.

* defines.h: use RUBY_EXTERN instead of EXTERN.

* intern.h, re.h, ruby.h, rubysig.h: ditto.

* win32/win32.h: remove EXTERN definition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-04 14:12:19 +00:00
nobu 8fc90b887b * intern.h (HAVE_RB_DEFINE_ALLOC_FUNC, RB_CVAR_SET_4ARGS):
define to 1.

* ruby.h (NORETURN_STYLE_NEW): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-09 06:16:08 +00:00
knu 0644ac3f8e * intern.h (HAVE_RB_DEFINE_ALLOC_FUNC): New boolean macro to make
it easier to write extensions that work with both ~1.6 and 1.8~.

* intern.h (RB_CVAR_SET_4ARGS): Ditto.

* ruby.h (NORETURN_STYLE_NEW): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-07 18:37:03 +00:00
matz 74d5623029 * variable.c (rb_obj_classname): new function.
* string.c (rb_str_dup): should preserve original's class (but not
  hidden singleton class).

* string.c (rb_str_substr): ditto.

* parse.y: backout EXPR_CMDARG removal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31 04:00:17 +00:00
michal 9df466b287 Updated Copyrights of Matz to 2003.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:34:03 +00:00
knu a2868ff651 * eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,
ext/socket/socket.c: differentiate long and int; use proper
  printf type specifiers and do casts where appropriate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-29 21:35:28 +00:00
michal 6f92767afc capa field in RString, and RArray is now LONG (ruby-lang:458)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-09 10:26:02 +00:00
matz 6f484e4930 * variable.c (rb_copy_generic_ivar): remove old generic instance
variable table if it existes.

	* class.c (rb_make_metaclass): metaclass of a metaclass is a
	  metaclass itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 05:20:14 +00:00
matz 40bc4f5ae4 * array.c (rb_ary_become): should not free ptr if it's shared.
* eval.c (rb_alias): prohibit making an alias named "allocate" if
  klass is a metaclass.

* string.c (rb_string_value_ptr): StringValuePtr() should never
  return NULL pointer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-29 09:08:18 +00:00
michal ffc13a6525 *.c: Int vs Long cleanup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21 15:47:54 +00:00
matz eb6118992b * eval.c (rb_clear_cache_by_class): new function.
* 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
2002-05-14 06:22:31 +00:00
eban 64db3a3251 * forgot to commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-11 19:34:13 +00:00
matz e3a8c62630 * io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.
* io.c (rb_io_mode_modenum): ditto.

* gc.c (rb_memerror): rename from mem_error, and exported.

* gc.c (Init_GC): pre-allocate NoMemoryError instance.

* object.c (convert_type): error message changed from "failed to
  convert" to "cannot convert", since it does not try to convert
  if an object does not respond to the converting method.

* eval.c (block_pass): convert Method to Proc using
  rb_check_convert_type().

* object.c (rb_check_convert_type): always convert T_DATA

* eval.c (rb_thread_cleanup): should not terminate main_thread by
  Fatal error.

* regex.c (is_in_list): need to not exclude NUL and NEWLINE.

* re.c (rb_reg_expr_str): wrong backslash escapement.

* re.c (rb_reg_expr_str): do not escape embedded space
  characters.

* marshal.c (w_object): T_DATA process patch from Joel VanderWerf
  <vjoel@PATH.Berkeley.EDU>.  This is temporary hack; it remains
  undocumented, and it will be removed when marshaling is
  re-designed.

* marshal.c (r_object): ditto.

* numeric.c (num_step): Integer#step is moved to Numeric#step;
  Fixnum#step is merged into this method.

* numeric.c (int_dotimes): Fixnum#times is merged.

* numeric.c (int_upto): Fixnum#upto is merged.

* numeric.c (int_downto): Fixnum#downto is merged.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24 04:54:16 +00:00