summaryrefslogtreecommitdiffstats
path: root/variable.c
Commit message (Collapse)AuthorAgeFilesLines
* * variable.c (generic_ivar_get): rb_attr_get should not warn.ocean2005-05-131-6/+7
| | | | | | | [ruby-dev:26010] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_new4): should propagate taintedness.matz2005-01-201-3/+2
| | | | | | | | | | | | | | * struct.c (rb_struct_set): use original method name, not callee name, to retrieve member slot. [ruby-core:04268] * time.c (time_strftime): protect from format modification from GC finalizers. * gc.c (rb_data_object_alloc): klass may be NULL. [ruby-list:40498] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_autoload): hide internal data from ruby level.nobu2005-01-101-1/+2
| | | | | | | fixed: [ruby-dev:25435], [ruby-list:40498] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_autoload): [ruby-dev:25373]matz2004-12-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sum): check was done with false pointer.matz2004-10-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, error.c, eval.c, intern.h, object.c, variable.c:ocean2004-07-151-3/+9
| | | | | | | | do not set path if it is a singleton class. [ruby-dev:22588] (backport from 1.9) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add RDoc for Kernel global functions, tidy array and errordave2003-12-291-0/+42
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add RDoc documentation for stuff in object.cdave2003-12-281-0/+130
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): stack region is far smaller than usual ifmatz2003-11-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_feature_p): match by classified suffix.nobu2003-10-131-11/+16
| | | | | | | | | | | | | | | * eval.c (rb_require_safe): require library in the specified safe level. * variable.c (rb_autoload, rb_autoload_load): restore safe level when autoload was called. [ruby-dev:21338] * intern.h: prototypes; rb_require_safe. * test/runner.rb: accept non-option arguments. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): remove unnecessary iv restoration formatz2003-10-091-0/+1
| | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_const_defined_0): look up constants in Object asnobu2003-10-021-6/+8
| | | | | | | | | | well. [ruby-dev:21458] * test/ruby/test_defined.rb (TestDefined::test_defined): test for constants. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_const_defined_at): should exclude constants frommatz2003-10-011-7/+7
| | | | | | | | | | | Object when TYPE(klass) == T_MODULE *and* exclude is on. [ruby-dev:21458] * variable.c (rb_const_get_0): do not lookup constants from Object when TYPE(klass) == T_MODULE *and* exclude is on. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_and): convert argument using 'to_int'.matz2003-09-121-2/+1
| | | | | | | | | | | | | | | * bignum.c (rb_big_or): ditto. * bignum.c (rb_big_xor): ditto. * eval.c (rb_f_require): allow "require" on $SAFE>0, if feature name is not tainted. * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream): Supports StringIO. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (struct BLOCK): remove BLOCKTAG, use scope instead.matz2003-08-301-41/+27
| | | | | | | | | | | | | | | | | | | | | * eval.c (POP_TAG): no longer propagate retval. retval is now set directly by localjump_destination(). * eval.c (localjump_destination): new function to cast return/break local jump. * eval.c (rb_yield_0): stop TAG_RETURN/TAG_BREAK escaping. * variable.c (rb_autoload_load): call const_missing if autoloading constant is not defined to allow hook. * eval.c (rb_eval): use rb_const_get_from() instead of rb_const_get_at(). * eval.c (is_defined): forgot to check NODE_COLON3. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_const_get_0): should check constants defined inmatz2003-08-281-20/+13
| | | | | | | | | | | included modules, if klass is Object. [ruby-talk:79302] * numeric.c (check_uint): check should be done using UINT_MAX, not INT_MAX. this fix is submitted by <lyle@knology.net> in [ruby-core:01486] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (classname): find regular class name if not set.nobu2003-08-021-20/+15
| | | | | | | [ruby-dev:20496] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_const_missing): "const_missing" should notmatz2003-07-261-0/+1
| | | | | | | | | appear in the caller(); add call frame adjustment. * eval.c (rb_method_missing): simplify call frame adjustment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (tcp_s_gethostbyname): was usingmatz2003-07-251-10/+10
| | | | | | | | | uninitialized size_t value. [ruby-talk:76946] * Minor cleanups. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gcc -Wall clean-up.matz2003-07-241-3/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (thgroup_add): no warning for terminated threads.matz2003-07-241-0/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_const_missing): new method. [ruby-core:00441]matz2003-07-221-23/+18
| | | | | | | | | | | | | | | | * variable.c (rb_const_get_at): allow "const_missing" hook. * variable.c (rb_const_get_0): ditto. * eval.c (method_missing): rename from rb_undefined to clarify. * eval.c (ruby_finalize_0): update exit status if any of END proc raises SystemExit. [ruby-core:01256] * eval.c (rb_exec_end_proc): reduce rb_protect(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_load): put rb_load_file() in a thread criticalmatz2003-07-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_values_at): extract common procedure frommatz2003-07-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_ary_values_at. follow DRY principle. * re.c (match_values_at): values_at should understand ranges. * struct.c (rb_struct_values_at): ditto. * struct.c (inspect_struct): inspect format changed; add "struct " at the top. * sprintf.c (rb_f_sprintf): "%p" specifier for inspect output. (RCR#68) * eval.c (rb_mod_undef_method): allow "undef_method" to accept multiple arguments. (RCR#146) * lib/timeout.rb: put timeout in Timeout module. (RCR#121) [ruby-talk:61028] * re.c (match_groups): new method added. (RCR#139) * variable.c (rb_mod_const_of): should exclude constant defined in Object, unless retrieving constants of Object. * string.c (rb_str_new4): do not allocate new string if original is frozen or already have copy-on-write entry. [ruby-talk:74940] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_class, rb_define_module): also set constant undernobu2003-07-011-27/+1
| | | | | | | | | | | | | Object. [ruby-dev:20445] * object.c (boot_defclass): ditto. * variable.c (rb_const_get_at, rb_const_get_0, rb_mod_const_at, rb_const_defined, mod_av_set, rb_const_assign): toplevel constants are now under Object, rb_class_tbl remains for GC. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (autoload_delete): should delete Qundef from iv_tbl.matz2003-06-251-1/+2
| | | | | | | (ruby-bugs-ja PR#504) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (new_yield): distinguish "yield 1,2" and "yield [1,2]".matz2003-06-201-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-dev:20360] * eval.c (rb_eval): support new_yield() change. * variable.c (rb_const_get_0): warn for Foo::BAR when BAR is a toplevel constant (i.e. a constant defined under Object). [ruby-list:36935] * parse.y (no_blockarg): separate no block argument check and ret_args argument processing. * range.c (rb_range_beg_len): out_of_range check after adjusting end point. [ruby-dev:20370] * parse.y (call_args): the first argument to arg_cancat() should be NODE_LIST. [ruby-core:01151] * eval.c (rb_eval): should dispatch based on ID type. * eval.c (rb_yield_0): should restore scope_vmode during yield. [ruby-dev:20361] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (proc_alloc): re-unification of Block and Proc. Blockmatz2003-06-161-1/+1
| | | | | | | class is no longer available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final): eliminate rb_f_lambda() call.matz2003-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_autoload_load): autoloaded constants under a modulenobu2003-06-011-10/+0
| | | | | | | belong to the module. [ruby-core:01094], [ruby-dev:20309] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_autoload_load): should delete autoloadednobu2003-05-291-2/+15
| | | | | | | | | symbol itself before load. [ruby-core:01097] * variable.c (rb_mod_remove_const): must not return Qundef. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ev_const_defined, ev_const_get), variable.cnobu2003-05-291-127/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_const_get_at, rb_const_get, rb_mod_remove_const): use Qundef as autoload marker. [ruby-dev:18103], [ruby-dev:18184] * eval.c (rb_mod_autoload, rb_mod_autoload_p): new method; Module#autoload, Module#autoload?. * variable.c (rb_autoload, rb_autoload_load, rb_autoload_p): manage autoload constants per classes/modules. * variable.c (rb_const_defined_at, rb_const_defined): return false for autoloading constants. * class.c (rb_define_class, rb_define_module), eval.c (rb_eval), variable.c (rb_mod_const_at, rb_const_assign): removed autoload stuff. * intern.h: prototypes; rb_autoload, rb_autoload_load, rb_autoload_p. * lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse): do not treat unmatched argument as an option. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (set_stdio): $stdin, $stdout, $stderr now became read-only.matz2003-05-151-1/+1
| | | | | | | * variable.c (readonly_setter): message changed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_name): always return empty string formatz2003-04-101-29/+27
| | | | | | | | | | | | | | anonymous class/module. (ruby-bugs-ja PR#424) * config.sub: stop forcing addition of -gnu to -linux. * variable.c (classname): refactoring. * variable.c (rb_class_path): __tmp__classpath__ handling moved from classname(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_name): search module path if classname is notmatz2003-04-091-3/+3
| | | | | | | set yet. (ruby-bugs-ja PR#424) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_class_path): hold temporary class path in anobu2003-03-281-1/+10
| | | | | | | | | | instance variable to get rid of GC. [ruby-dev:19932] * variable.c (classname): remove temporary class path when exact name found. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): should not report uninitialized warning bymatz2003-02-181-3/+22
| | | | | | | | | | | | attribute reader method. * variable.c (rb_attr_get): new function to get instance variable without uninitialized warning. * io.c (argf_to_io): should prefetch argv. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_obj_classname): wrong tail recursion.nobu2003-01-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_obj_classname): new function.matz2003-01-311-0/+7
| | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Updated Copyrights of Matz to 2003.michal2003-01-161-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.h, st.c: Introduce new conventional typedef's, st_data_t,knu2003-01-061-28/+28
| | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_step): use DBL_EPSILON.matz2002-12-191-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* README.EXT: grammer updates by Simon Cozens.matz2002-10-231-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_global_entry): not add global entry untilnobu2002-10-161-2/+2
| | | | | | | | | initialized to avoid accessing it while GC. [ruby-dev:18514] * variable.c (rb_alias_variable): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regex.c (re_match): p1 may exceed pend limit.matz2002-09-261-3/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_nesting): load wrapping module should appear inmatz2002-09-171-0/+1
| | | | | | | | | Module#nesting list. (ruby-bugs-ja:PR#328) * eval.c (rb_thread_remove): free stack buffer on remove. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_path2class): should not use rb_eval_string().matz2002-09-051-8/+29
| | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_copy_generic_ivar): remove old generic instancematz2002-09-031-1/+9
| | | | | | | | | | variable table if it existes. * class.c (rb_make_metaclass): metaclass of a metaclass is a metaclass itself. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_const_assign): st_delete() takes pointer to key.nobu2002-08-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: Get rid of fix len buffer in rb_class_path (ruby-core:381)michal2002-08-281-5/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e