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

119 Коммитов

Автор SHA1 Сообщение Дата
nobu f2549e0bf7 * marshal.c (r_object0): check inheritance by the internal function.
[ruby-dev:24515]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-18 14:37:42 +00:00
matz c800d0b75d * io.c (rb_fopen): mode string copy at the lowest level.
* io.c (rb_io_flags_mode): requires output buffer no more.  no
  allocation needed.

* array.c (rb_ary_index): takes a block to compare items in an
  array.  [ruby-talk:113069] [Ruby2]

* array.c (rb_ary_rindex): ditto.

* marshal.c (r_byte): retrieve pointer from string value for each
  time.  [ruby-dev:24404]

* marshal.c (r_bytes0): ditto.

* enum.c (sort_by_i): re-entrance check added.  [ruby-dev:24399]

* io.c (io_read): should freeze all reading buffer.
  [ruby-dev:24400]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-05 01:37:46 +00:00
matz 30116ff8c2 * array.c (rb_ary_delete): comparison may change the capacity.
[ruby-dev:24348]

* array.c (rb_ary_fill): fill should honor length argument.
  [ruby-dev:24346]

* array.c (rb_ary_replace): should not use ptr from shared array.
  [ruby-dev:24345]

* ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
  [ruby-talk:113807]

* array.c (flatten): element size might change during comparison.
  [ruby-dev:24343]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-29 05:15:33 +00:00
nobu 0bedb2e07f * intern.h, struct.c (rb_struct_s_members, rb_struct_members): public
accessors.  [ruby-dev:24342]

* marshal.c (w_object, r_object0): use accessors.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-27 04:46:54 +00:00
matz 67232b2151 * io.c (rb_io_reopen): should clear allocated OpenFile. pointed
out by Guy Decoux. [ruby-core:03288]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-08-17 09:02:40 +00:00
matz 002517aba8 * parse.y (newline_node): do not use NODE_NEWLINE node anymore,
use NEWLINE flag instead.

* ext/socket/socket.c (sock_gethostbyname): returns host if
  ai_canonname is NULL. (ruby-bugs PR#1243)

* parse.y (block_append): update nd_end for "real" head node.
  [ruby-list:39058]

* marshal.c (w_class): should not dump singleton class.
  [ruby-dev:22631]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 16:47:23 +00:00
nobu 13fa93f777 * marshal.c (class2path): check anonymous class/module before
checking referable, and allow singleton classes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-17 15:23:59 +00:00
nobu 10b86da1b1 * marshal.c (class2path): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-16 05:36:54 +00:00
nobu ea339864af * marshal.c (class2path): get class path and check referable.
[ruby-dev:22588]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-16 05:33:39 +00:00
dave 75cc3e4f75 RDoc comments added by Elliott Hughes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-27 16:07:43 +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
matz 6212cfb9c5 * gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.

* marshal.c (w_extended): singleton methods should not be checked
  when dumping via marshal_dump() or _dump(). [ruby-talk:85909]

* file.c (getcwdofdrv): avoid using getcwd() directly, use
  my_getcwd() instead.

* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
  <sunshine@sunshineco.com>.  [ruby-core:01596]

* marshal.c (w_object): LINK check earlier than anything else,
  i.e. do not dump TYPE_IVAR for already dumped objects.
  (ruby-bugs PR#1220)

* eval.c (rb_eval): call "inherited" only when a new class is
  generated; not on reopening.

* eval.c (eval): prepend error position in evaluating string to

* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
  had become unbuildable; enhanced --enable-fat-binary option so that
  it accepts a list of desired architectures (rather than assuming a
  fixed list), or defaults to a platform-appropriate list if user does
  not provide an explicit list; made the default list of architectures
  for MAB (fat binary) more comprehensive; now uses -fno-common even
  when building the interpreter (in addition to using it for
  extensions), thus allowing the interpreter to be embedded into a
  plugin module of an external project (in addition to allowing
  embedding directly into an application); added checks for
  <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
  ensures that -I/usr/local/include is employed when extensions'
  extconf.rb scripts invoke have_header() since extension checks on
  NextStep and OpenStep will fail without it if the desired resource
  resides in the /usr/local tree; fixed formatting of --help message.

* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
  invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
  (see configure's --enable-fat-binary option); added rule for new
  missing/getcwd.c.

* defines.h: fixed endian handling during MAB build (see configure's
  --enable-fat-binary option) to ensure that all portions of the
  project see the correct WORDS_BIGENDIAN value (some extension modules
  were getting the wrong endian setting); added missing constants
  GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
  and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
  define in NeXT section.

* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
  NextStep since, on some installations, this value always resolves
  uselessly to zero.

* dln.c: added error reporting to NextStep extension loader since the
  previous behavior of failing silently was not useful; now ensures
  that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
  for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
  on Rhapsody since this header lacks multiple-include protection,
  which resulted in "redefinition" compilation errors.

* main.c: also create hard reference to objc_msgSend() on NeXT
  platforms (in addition to Apple platforms).

* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
  makefiles so that extensions can be built MAB (see configure's
  --enable-fat-binary option); also utilize XCFLAGS in cc_command()
  (but not cpp_command() because MAB flags are incompatible with
  direct invocation of `cpp').

* ext/curses/extconf.rb: now additionally checks for presence of these
  curses functions which are not present on NextStep or Openstep:
  bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
  setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
  wscrl(), wsetscrreg()

* ext/curses/curses.c: added appropriate #ifdef's for additional set of
  curses functions now checked by extconf.rb; fixed curses_bkgd() and
  window_bkgd() to correctly return boolean result rather than numeric
  result; fixed window_getbkgd() to correctly signal an error by
  returning nil rather than -1.

* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
  pointers before invoking rb_tainted_str_new2() upon fields extracted
  from `struct passwd' and `struct group' since null pointers in some
  fields are common on NextStep/OpenStep (especially so for the
  `pw_comment' field) and rb_tainted_str_new2() throws an exception
  when it receives a null pointer.

* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().

* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
  gethostbyaddr(), and gethostbyname() from (const char*) to non-const
  (char*) for older platforms such as NextStep and OpenStep.

* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup(); include
  <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
  argument of gethostbyaddr() and getservbyname() from (const char*) to
  non-const (char*) for older platforms.

* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 04:00:03 +00:00
matz e75c34c2e9 * gc.c (gc_sweep): loosen page free condition to avoid add_heap()
race condition. [ruby-dev:21633]

* gc.c (gc_sweep): do not update malloc_limit when malloc_increase
  is smaller than malloc_limit.

* ext/socket/socket.c (make_hostent): h_aliases may be NULL.
  (ruby-bugs PR#1195)

* ext/socket/socket.c (sock_s_gethostbyaddr): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-20 02:06:42 +00:00
matz 87025fdd43 * marshal.c (w_object): dump extended modules as well.
* marshal.c (r_object0): TYPE_USRMARSHAL should restore extended
  modules before invoking marshal_load.  these two fixes are done
  by Masatoshi Seki <m_seki@mva.biglobe.ne.jp>.

* parse.y (yylex): argument parentheses preceded by spaces should
  be warned; not error.  [ruby-talk:84103]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-15 02:27:56 +00:00
matz 90a88ab9a0 * marshal.c (r_object0): remove unnecessary iv restoration for
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
2003-10-09 17:45:53 +00:00
matz 0b2e94b2ab * pack.c (uv_to_utf8): change message to "out of range", since
negative values are not "too big". [ruby-dev21567]

* marshal.c (w_object): should pass the value of "weak" to
  w_object().  [ruby-dev:21555] and [ruby-dev:21561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 06:46:40 +00:00
nobu 2a07445e0b * marshal.c (w_object): wrong method name in the message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-06 07:23:40 +00:00
matz 56235e083d * marshal.c (w_object): should pass "weak" value to next level.
[ruby-dev:21496]

* eval.c (proc_alloc): should not use cached object if klass is
  different. [ruby-talk:83685]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-06 01:50:41 +00:00
matz 415283ac95 * marshal.c (w_object): instance variable dump do not cause error
for objects that cannot be dumped, if they traversed from
  marshal_dump.  they are just ignored.

* gc.c (Init_stack): cast "space" (doble value) into unsigned
  int.  should run on PowerPC.

* eval.c (rb_eval): should not execute else part if any exception
  is caught. [ruby-dev:21482]

* parse.y (f_args): should allow unparenthesized block argument.

* parse.y (f_rest_arg): should allow unparenthesized rest
  argument.

* lib/irb/ruby-lex.rb (RubyLex::identify_identifier): support
  'class ::Foo' syntax. [ruby-talk:83514]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-04 17:51:11 +00:00
matz 10c4bb29b2 * time.c (time_load): restore instance variables (if any) before
loading from marshaled data.

* time.c (time_mdump): new marshal dumper. _dump is still
  available for compatibility.

* time.c (time_mload): new marshal loader.

* marshal.c (w_object): preserve instance variables for objects
  with marshal_dump.

* marshal.c (r_object0): restore instance variables before calling
  marshal_load.

* error.c (rb_warn_m): always return nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02 08:25:00 +00:00
nobu 8695612caf * marshal.c (w_symbol, w_object): get rid of warnings.
* re.c (rb_memsearch): ditto.

* time.c (time_dump): ditto.

* ext/extmk.rb (extmake): not continue making when extconf.rb
  failed.

* ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.

* ext/openssl/ossl.h: remove version.h dependency.

* ext/openssl/ruby_missing.h: ditto.

* lib/mkmf.rb (pkg_config): use --libs output except with
  only-L for other options.  [ruby-list:38099]

* lib/mkmf.rb (create_makefile): separate rule for static
  library from shared object.

* win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
  define exec_prefix and libdir.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-16 14:58:34 +00:00
matz df71dae11f * marshal.c (w_object): do not dump generic instance variable when
marshal_dump is defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-09 15:19:17 +00:00
matz c49c51b76e * marshal.c (w_object): should set `c_arg' at first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-08 03:48:33 +00:00
matz b51416e21f * eval.c (rb_call0): update ruby_class as well as ruby_cref.
(ruby-bugs-ja PR#540)

* eval.c (rb_yield_0): remove ruby_frame->cbase and unify to
  ruby_cref.  [ruby-talk:78141]

* eval.c: initialize /* OK */ variables by Qnil to stop warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06 21:50:06 +00:00
matz 4aaa5493f9 * eval.c (method_proc): should specify YIELD_FUNC_SVALUE.
[ruby-dev:21107]

* marshal.c (w_object): should not call w_extended for USRMARSHAL
  dump. [ruby-dev:21106]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-04 05:28:50 +00:00
matz 5b9afca5e4 * numeric.c (rb_num_coerce_relop): export function.
* marshal.c (w_object): check has been dropped. "_dump must return
  string." [ruby-dev:21024]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-31 08:42:44 +00:00
matz d468497778 * marshal.c (w_object): marshal_dump should not take any
argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-30 07:24:11 +00:00
matz fe13785cc6 * marshal.c (w_object): if object responds to 'marshal_dump',
Marshal.dump uses it to dump object.  unlike '_dump',
  marshal_dump returns any kind of object.

* marshal.c (r_object0): restore instance by calling
  'marshal_load' method.  unlike '_load', it's an instance
  method, to handle cyclic reference.

* marshal.c (marshal_load): all objects read from file should be
  tainted. [ruby-core:01325]

* lib/timeout.rb (Timeout::timeout): execute immediately if sec is
  zero.

* ext/socket/socket.c (socks_init): typo fixed. [ruby-talk:77232]

* ext/socket/extconf.rb: the default value for --enable-socks is
  taken from ENV["SOCKS_SERVER"]. [ruby-talk:77232]

* ruby.c (proc_options): add -W option. -W0 to shut up all warning
  messages. [ruby-talk:77227]

* error.c (rb_warn): no message will be printed if the value of
  $VERBOSE is "nil", i.e. perfect silence.

* ruby.c (verbose_setter): $VERBOSE value is either true, false,
  or nil.

* io.c (Init_IO): no "read" check for $stdin.  in addition some
  function names has been changed.

* regex.c (re_match_exec): incorrect multibyte match.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 18:26:55 +00:00
matz 9e77e91a13 * 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@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:24:59 +00:00
matz 979f006b9e * io.c (rb_f_syscall): type dispatch should be based on
rb_check_string_type(), not FIXNUM_P(), because values may be a
  bignum.  [ruby-talk:72257]

* eval.c (rb_call0): should pass the current klass value to
  block_invoke, which may be called via "super". [ruby-core:01077]

* eval.c (block_invoke): now takes 4th argument "klass".

* eval.c (block_alloc): should propagate BLOCK_PROC to
  ruby_block.

* marshal.c (r_object0): should not use "yield" method, use "call"
  instead. (ruby-bugs-ja PR#476)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-30 16:08:03 +00:00
matz 717302e2c4 * gc.c (run_final): use rb_thread_critical instead of DEFER_INTS.
[ruby-dev:20272]

* marshal.c: try to make ArgumentError and TypeError consistent.
  [ruby-core:01068]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-22 08:30:58 +00:00
nobu aede0cf378 * marshal.c (save_mantissa, load_mantissa): for interoperability
should count cut-down bit from topmost.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-22 10:08:57 +00:00
nobu 3939629ddf * marshal.c: one more digit for decimal point. [ruby-talk:69808]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-21 13:02:08 +00:00
nobu 3f0eab216f * marshal.c (w_float): append least mantissa bits to get rid
of roundoff problem.  [ruby-talk:69518]

* marshal.c (r_object0): load least mantissa bits.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-20 15:11:20 +00:00
matz 6987b0806e * struct.c (rb_struct_eql): should compare values with "eql?".
* range.c (range_check): <=> returns nil for invalid values;
  should check.

* regex.c (re_compile_pattern): should not set RE_OPTIMIZE_ANCHOR,
  if anychar_repeat is enclosed by parentheses.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-18 18:05:11 +00:00
nobu db24e481b3 * marshal.c (w_object): preserve extended module on struct.
(ruby-bugs-ja:PR#422)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09 05:08:25 +00:00
matz ed0b577108 * eval.c (Init_Proc): make Method and UnboundMethod independent.
They are like instance and its class. [ruby-core:00941]

* parse.y (yylex): disallow global variables like "$1ve".
  [ruby-core:00945]

* marshal.c (marshal_dump): Marshal.dump(0, false) should cause an
  error. (ruby-bugs-ja PR#421)

* regex.c (re_compile_pattern): warn if '-' is the edge of
  character range.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-08 05:40:29 +00:00
matz 6d0b44501e * marshal.c (w_nbyte): should output always via rb_io_write().
* marshal.c (dump_ensure): ditto.

* marshal.c (marshal_dump): should call "binmode" method, if it
  responds to.

* marshal.c (r_byte): should input always via "getc" method.

* marshal.c (r_bytes0): should input always via "read" method.

* marshal.c (marshal_load): need not to set up FILE* fp;


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-03 07:20:17 +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
nobu 08771defc6 * configure.in (ARCHFILE): set even unless --enable-shared on
AIX.  [ruby-talk:61466]

* marshal.c (math.h): should be included after ruby.h on AIX.
  [ruby-talk:61366]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-15 06:29:05 +00:00
knu 91b9d37a85 * st.h, st.c: Introduce new conventional typedef's, st_data_t,
st_compare_func_t, st_hash_func_t and st_each_func_t.

* st.h, st.c: Do explicit function declarations and do not rely on
  implicit declarations.  On such platforms as IA64, int argument
  values are NOT automatically promoted to long (64bit) values, so
  explicit declarations are mandatory for those functions that
  take long values or pointers.  This fixes miniruby's coredump on
  FreeBSD/IA64.

* class.c, eval.c, gc.c, hash.c, marshal.c, parse.y, variable.c:
  Add proper casts to avoid warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-06 15:55:43 +00:00
nobu 5b615c70eb * io.c (rb_io_fwrite): separated from io_write().
* marshal.c (w_byten): use rb_io_fwrite() to support non-blocking
  IO, and added error check.

* rubyio.h: prototypes; rb_io_fwrite


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20 09:29:41 +00:00
matz baa00aa250 * numeric.c (num_step): use DBL_EPSILON.
* 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
2002-12-19 09:20:20 +00:00
nobu e6c77e4c4c * marshal.c (r_object0): singleton class instance can't be loaded. (ruby-bugs-ja:PR#366)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-12 07:29:14 +00:00
nobu 020caa3fc8 * marshal.c (w_byten): added; write n bytes from s to arg.
* marshal.c (dump): flush buffered data.

* marshal.c (marshal_dump, r_byte, r_bytes0, marshal_load): unify
  marshaling I/O.  [ruby-talk:53368]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-17 10:20:52 +00:00
nobu 12852c2e9a * dir.c (glob_helper): must not closedir() when exception raised
while globbing "**".

* marshal.c (w_uclass): unused variable.

* re.c (match_clone): unused.

* regex.c (re_compile_pattern): get rid of implicit promotion from
  plain char to int.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25 14:52:37 +00:00
matz 73a47246f2 * eval.c (rb_mod_nesting): load wrapping module should appear in
Module#nesting list. (ruby-bugs-ja:PR#328)

* eval.c (rb_thread_remove): free stack buffer on remove.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17 09:36:05 +00:00
matz 7881363731 * gc.c (ruby_xmalloc): remove MALLOC_LIMIT to avoid frequent
garabage collection.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 08:59:41 +00:00
matz 49cd091cf2 * variable.c (rb_path2class): should not use rb_eval_string().
* marshal.c (w_extended): should allow marshaling of object which
  is extended by named module.

* class.c (rb_make_metaclass): super may be T_ICLASS, need to skip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05 09:42:56 +00:00