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

5088 Коммитов

Автор SHA1 Сообщение Дата
emboss a3a62f87e1 * lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
critical.
  The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
  the certificate that has critical SAN value.  X509 extension could
  include 2 or 3 elements in it:

  [id, criticality, octet_string] if critical,
  [id, octet_string] if not.

  Making sure to pick the last element of X509 extension and use it as
  SAN value.
  [ruby-core:55685] [Bug #8575]

  Thank you @nahi for providing the patch!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 21:08:04 +00:00
tenderlove c62aca26c5 * ext/psych/lib/psych/visitors/yaml_tree.rb: register time objects so
they are referenced as ids during output.
* test/psych/test_date_time.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 19:51:12 +00:00
hsbt 660fed6741 Fix comment typo by @parroty [fix GH-350]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 00:46:10 +00:00
akr 8c55a0a6e4 * ext/socket/ipsocket.c (init_inetsock_internal): Don't try mismached
address family if already failed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 15:43:21 +00:00
mrkn d08a79cfe1 * ext/bigdecimal/bigdecimal.h (RB_UNUSED_VAR, UNREACHABLE):
import macros from ruby.h for 1.9.3.
  [Bug #8588] [ruby-core:55730]

* ext/bigdecimal/bigdecimal.gemspec: Bump version to 1.2.1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 11:46:15 +00:00
akr b7fd00c8fa * ext/socket/ipsocket.c (init_inetsock_internal): Use an address
family for local address wihch is different to the remote
  address if no other choice.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 11:05:47 +00:00
nobu 8776802385 stringio.c: keep coderange
* ext/stringio/stringio.c (strio_write): keep coderange of
  ptr->string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 06:04:23 +00:00
akr 7251c93cb3 * bignum.c (RBIGNUM_SET_NEGATIVE_SIGN): New macro.
(RBIGNUM_SET_POSITIVE_SIGN): Ditto.
  (rb_big_neg): Inline get2comp to avoid double negation.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-29 15:57:07 +00:00
akr a5fcce2820 * ext/socket/ipsocket.c (init_inetsock_internal): Don't use local
addresses which address family is different to remote address.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-28 03:16:07 +00:00
nagachika bc47f294ee * ext/openssl/lib/openssl/ssl.rb (verify_certificate_identity): fix
hostname verification. Patched by nahi.

* test/openssl/test_ssl.rb (test_verify_certificate_identity): test for
  above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-27 11:09:19 +00:00
charliesome 685f91236c * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode): fix typo.
Fixes GH-343. Patch by @jgarber.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26 14:54:36 +00:00
mrkn 448c66c516 * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when
the argument x is not a BigDecimal.
  This change is based on the patch made by Garth Snyder.
  [Fix GH-332] https://github.com/ruby/ruby/pull/332

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25 12:29:00 +00:00
akr 2b93ed5e76 * bignum.c (MSB): Removed.
(BDIGIT_MSB): Defined using BIGRAD_HALF.
  (bary_2comp): Apply BIGLO after possible over flow of BDIGIT.
  (get2comp): Ditto.
  (bary_unpack_internal): Use BDIGIT_MSB.
  Apply BIGLO after possible over flow of BDIGIT.
  (rb_integer_unpack): Use BDIGIT_MSB.
  (calc_hbase): Use BDIGMAX.
  (big2dbl): Use BDIGMAX.
  Apply BIGLO after possible over flow of BDIGIT.
  (rb_big_neg): Apply BIGLO after possible over flow of BDIGIT.
  (biglsh_bang): Ditto.
  (bigrsh_bang): Ditto.
  (bary_divmod): Use BDIGIT_MSB.
  (bigdivrem): Ditto.
  (bigxor_int): Apply BIGLO after possible over flow of BDIGIT.

* marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).

* ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS
  instead of sizeof(BDIGIT).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25 03:08:23 +00:00
shirosaki 8ad8407e60 dl/cfunc.c: fix conversion of Bignum
* ext/dl/cfunc.c (rb_dlcfunc_call): fix conversion from Bignum to
  pointer. sizeof(DLSTACK_TYPE) is larger than sizeof(long) on
  Windows x64 and higher bits over sizeof(long) of DLSTACK_TYPE was
  zero even if a pointer value was over 32 bits which causes SEGV on
  DL::TestCPtr#test_to_ptr_io. Adding a cast solves the bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-24 13:39:08 +00:00
akr 8f0c3ff6e4 * bignum.c (bary_pack): Support
INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION flag.
  Fix byte order and word order handling in code specialized for
  wordsize % SIZEOF_BDIGITS == 0.

* internal.h (INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION): Defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 09:55:27 +00:00
charliesome 98fec7b4a2 * ext/etc/etc.c (setup_passwd): revert r41560, unnecessary
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 06:26:32 +00:00
charliesome 3f236ce7ba * ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of
  fields and values in setup_passwd

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:43:08 +00:00
akr 4b4ba84eb8 * ext/dl/cfunc.c (rb_dlcfunc_call): Use rb_big_pack instead of
rb_big2ulong_pack and rb_big2ull.

* include/ruby/intern.h (rb_big2ulong_pack): Deprecated.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:37:30 +00:00
charliesome 1a2c400273 * ext/etc/etc.c (setup_passwd): pass 0 as VALUE to rb_struct_new to
prevent segfault if the compiler passes it as a 32 bit integer on
  a 64 bit ruby

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:35:23 +00:00
charliesome ff0e82ed9d * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
of %s and RSTRING_PTR

* ext/etc/etc.c (etc_getgrnam): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 04:46:47 +00:00
charliesome c500791b3e * ext/openssl/ossl_x509attr.c: change OSSL_X509ATTR_IS_SINGLE and
OSSL_X509ATTR_SET_SINGLE macros to use ->value.set rather than
  ->set to fix compile failure

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 07:39:15 +00:00
akr a461f2f8bb * ext/bigdecimal: Workaround fix for bigdecimal test failures caused
by [ruby-dev:47413] [Feature #8509]

* ext/bigdecimal/bigdecimal.h (BDIGIT): Make it independent from the
  definition for bignum.c.
  (SIZEOF_BDIGITS): Ditto.
  (BDIGIT_DBL): Ditto.
  (BDIGIT_DBL_SIGNED): Ditto.
  (PRI_BDIGIT_PREFIX): Undefine the definition.
  (PRI_BDIGIT_DBL_PREFIX): Ditto.

* ext/bigdecimal/bigdecimal.c (RBIGNUM_ZERO_P): Use rb_bigzero_p.
  (bigzero_p): Removed.
  (is_even): Use rb_big_pack.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-20 15:42:23 +00:00
zzak 31e1c32676 * ext/objspace/object_tracing.c: Return for ::allocation_generation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 13:10:25 +00:00
zzak b8df950282 * ext/objspace/object_tracing.c: Document object_tracing methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 13:05:32 +00:00
zzak a8ba051341 * ext/objspace/objspace.c: Document ObjectSpace::InternalObjectWrapper.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 11:56:03 +00:00
zzak b46df185b2 * ext/objspace/object_tracing.c: Teach rdoc object_tracing.c [Bug #8537]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 11:41:28 +00:00
zzak 0ec216e803 * ext/.document: add object_tracing.c to document file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 11:38:10 +00:00
zzak 765b9e962f * ext/objspace/objspace.c: rdoc on require to overview from r41355
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 11:21:38 +00:00
eregon ba49a1e025 * ext/objspace/objspace.c: let rdoc know about objspace methods.
Specify 'objspace' should be required. See #8537.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17 09:16:32 +00:00
eregon 089dd1a1ca * gc.c (ObjectSpace): is a module not a class.
* ext/objspace/objspace.c: try to include overview in rdoc,
  see #8537.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17 08:44:56 +00:00
nobu c2b7ae980e tkutil.c: prevent temporary objects from GC
* ext/tk/tkutil/tkutil.c: use rb_sprintf(), rb_id2str(), and
  rb_intern_str() instead of rb_intern() and RSTRING_PTR() with
  RB_GC_GUARD(), to prevent temporary objects from GC.
  [ruby-core:39000] [Bug #5199]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17 07:59:55 +00:00
nagai c58dc63686 * ext/tk/extconf.rb: support s390x (Thanks to bkabrda) [ruby-trunk - Bug #5465]
* ext/tk/extconf.rb: apply [Backport87 - Backport #5048]
* ext/tk/lib/tk/canvas.rb, ext/tk/sample/demos-{en,jp}/{tree.rb,widget}: fix bug (Thanks to zzak) [ruby-trunk - Bug #8319]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17 05:21:16 +00:00
akr 50794b3222 * bignum.c (bary_2comp): Extracted from get2comp.
(integer_unpack_num_bdigits): Extracted from
  rb_integer_unpack_internal.
  (bary_unpack_internal): Renamed from bary_unpack and support
  INTEGER_PACK_2COMP.
  (bary_unpack): New function to validate arguments and invoke
  bary_unpack_internal.
  (rb_integer_unpack_internal): Removed.
  (rb_integer_unpack): Invoke bary_unpack_internal.
  (rb_integer_unpack_2comp): Removed.

* internal.h (rb_integer_unpack_2comp): Removed.

* pack.c: Follow the above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-16 12:59:26 +00:00
akr ecabbf1bf6 * internal.h (INTEGER_PACK_2COMP): Defined.
(rb_integer_pack_2comp): Removed.

* bignum.c (bary_pack): Support INTEGER_PACK_2COMP.
  (rb_integer_pack): Invoke bary_pack directly.
  (rb_integer_pack_2comp): Removed.
  (rb_integer_pack_internal): Ditto.
  (absint_numwords_generic): Follow the above change.

* pack.c (pack_pack): Ditto.

* sprintf.c (rb_str_format): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-16 09:53:45 +00:00
zzak 54a22fb8c7 * ext/bigdecimal/bigdecimal.c: Update overview formatting of headers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 01:20:27 +00:00
zzak 184eaedb3a * ext/bigdecimal/bigdecimal.gemspec: Update authors
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 01:19:30 +00:00
zzak 51c43dba6a * ext/bigdecimal/*: improve documentation, nodoc samples with @mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 14:44:25 +00:00
drbrain d341276561 * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X
10.7+.  [ruby-trunk - Bug #8517]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 20:32:42 +00:00
akr aaa1461d7b * bignum.c (rb_integer_unpack_2comp): New function.
(rb_integer_unpack_internal): Extracted from rb_integer_unpack and
  nlp_bits_ret argument added.
  (integer_unpack_num_bdigits_small): nlp_bits_ret argument added to
  return number of leading padding bits.
  (integer_unpack_num_bdigits_generic): Ditto.

* internal.h (rb_integer_unpack_2comp): Declared.

* pack.c (pack_unpack): Use rb_integer_unpack_2comp and
  rb_integer_unpack.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 15:18:00 +00:00
shugo 1f828497d1 * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
when $SAFE is set to 4.  $SAFE=4 is now obsolete.
  [ruby-core:55222] [Feature #8468]

* object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
  Kernel#untrusted?, untrust, and trust are now deprecated.
  Their behavior is same as tainted?, taint, and untaint,
  respectively.

* include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
  and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
  respectively.

* array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
  ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
  ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
  ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
  ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
  ext/socket/socket.c, ext/socket/udpsocket.c,
  ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
  ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
  load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
  safe.c, string.c, thread.c, transcode.c, variable.c,
  vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
  $SAFE=4.

* test/dl/test_dl2.rb, test/erb/test_erb.rb,
  test/readline/test_readline.rb,
  test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
  test/ruby/test_array.rb, test/ruby/test_dir.rb,
  test/ruby/test_encoding.rb, test/ruby/test_env.rb,
  test/ruby/test_eval.rb, test/ruby/test_exception.rb,
  test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
  test/ruby/test_io.rb, test/ruby/test_method.rb,
  test/ruby/test_module.rb, test/ruby/test_object.rb,
  test/ruby/test_pack.rb, test/ruby/test_rand.rb,
  test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
  test/ruby/test_struct.rb, test/ruby/test_thread.rb,
  test/ruby/test_time.rb: remove tests for $SAFE=4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 14:20:51 +00:00
akr 0c9a719d77 * internal.h (INTEGER_PACK_NEGATIVE): Defined.
(rb_integer_unpack): sign argument removed.

* bignum.c (rb_integer_unpack): sign argument removed.
  Non-negative integers generated by default.
  INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers.

* pack.c (pack_unpack): Follow the above change.

* random.c (int_pair_to_real_inclusive): Ditto.
  (make_seed_value): Ditto.
  (mt_state): Ditto.
  (limited_big_rand): Ditto.

* marshal.c (r_object0): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 21:39:55 +00:00
akr 17a5321c40 rb_integer_pack tests refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 13:15:56 +00:00
akr d5a3818f8e * bignum.c (rb_integer_pack_internal): Renamed from rb_integer_pack
and overflow_2comp argument added.
  (rb_integer_pack): Just call rb_integer_pack_internal.
  (rb_integer_pack_2comp): New function.

* internal.h (rb_integer_pack_2comp): Declared.

* sprintf.c (rb_str_format): Use rb_integer_pack and
  rb_integer_pack_2comp to format binary/octal/hexadecimal integers.
  (ruby_digitmap): Declared.
  (remove_sign_bits): Removed.
  (BITSPERDIG): Ditto.
  (EXTENDSIGN): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 12:06:40 +00:00
eregon 8c6674ef03 * ext/racc/cparse/cparse.c: use rb_ary_entry() and
rb_ary_subseq() instead of RARRAY_PTR.
  Based on a patch by Dirkjan Bussink. See Bug #8399.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 20:06:53 +00:00
kou e214b1b6d3 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:51:48 +00:00
kou f6921a3cd1 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing return
value assignment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:50:45 +00:00
naruse 52a802a428 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
13.04's getaddrinfo issue with mdns4. [ruby-list:49420]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 11:59:36 +00:00
akr 0e8caa7d0f * bignum.c (rb_integer_pack): Returns sign instead of words.
(absint_numwords_generic): Follow the above change.
  (big2str_base_powerof2): Follow the above change.

* internal.h: Ditto.

* hash.c (rb_hash): Ditto.

* pack.c (pack_pack): Ditto.

* random.c (int_pair_to_real_inclusive): Ditto.
  (rand_init): Ditto.
  (random_load): Ditto.
  (limited_big_rand): Ditto.

* time.c (v2w_bignum): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 10:37:39 +00:00
akr 837392b452 * bignum.c (rb_integer_pack): numwords_allocated argument removed.
* internal.h (rb_integer_pack): Follow the above change.

* hash.c (rb_hash): Ditto.

* time.c (v2w_bignum): Ditto.

* pack.c (pack_pack): Ditto.

* random.c (int_pair_to_real_inclusive): Ditto.
  (rand_init): Ditto.
  (random_load): Ditto.
  (limited_big_rand): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-09 05:53:00 +00:00
akr f31aed6255 * bignum.c (rb_integer_pack): Arguments changed. Use flags to
specify word order and byte order.
  (rb_integer_unpack): Ditto.
  (validate_integer_format): Follow the above change.
  (integer_format_loop_setup): Ditto.

* pack.c: Ditto.

* internal.h: Ditto.
  (INTEGER_PACK_MSWORD_FIRST): Defined.
  (INTEGER_PACK_LSWORD_FIRST): Ditto.
  (INTEGER_PACK_MSBYTE_FIRST): Ditto.
  (INTEGER_PACK_LSBYTE_FIRST): Ditto.
  (INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto.
  (INTEGER_PACK_LITTLE_ENDIAN): Ditto.
  (INTEGER_PACK_BIG_ENDIAN): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 15:02:39 +00:00
akr a08b001100 * bignum.c (rb_integer_pack): Renamed from rb_int_export.
(rb_integer_unpack): Renamed from rb_int_import.

* internal.h, pack.c: Follow the above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 12:41:02 +00:00
naruse cac2f455a9 * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
RB_GC_GUARD. it should be after the object is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 04:45:16 +00:00
nobu 147775ac2b use NUM2SIZET and SIZET2NUM
* configure.in: revert r41106.  size_t may not be unsigned

* bignum.c (rb_absint_size_in_word, rb_int_export, rb_int_import): use
  NUM2SIZET() and SIZET2NUM() already defined in ruby/ruby.h.

* ext/-test-/bignum/export.c (rb_int_export_m): ditto.

* ext/-test-/bignum/import.c (rb_int_import_m): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 02:41:45 +00:00
akr d1f3d41f11 * internal.h (rb_int_export): countp argument is split into
wordcount_allocated and wordcount.

* bignum.c (rb_int_export): Follow the above change.

* pack.c (pack_pack): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 22:31:23 +00:00
akr c9c67d2fe0 * bignum.c (rb_int_import): New function.
(int_import_push_bits): Ditto.

* internal.h (rb_int_import): Declared.

* pack.c (pack_unpack): Use rb_int_import for BER compressed integer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 21:20:04 +00:00
akr 58eac2494f Specify dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 12:58:25 +00:00
akr 9fea8758e9 * configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
  with RUBY_REPLACE_TYPE.

* internal.h (rb_absint_size): Declared.
  (rb_absint_size_in_word): Ditto.
  (rb_int_export): Ditto.

* bignum.c (rb_absint_size): New function.
  (rb_absint_size_in_word): Ditto.
  (int_export_fill_dd): Ditto.
  (int_export_take_lowbits): Ditto.
  (rb_int_export): Ditto.

* pack.c (pack_pack): Use rb_int_export for BER compressed integer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 11:57:35 +00:00
tadf c247e62808 * ext/date/date_core.c: fixed coding error [ruby-core:55337].
reported by Riley Lynch.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 10:33:48 +00:00
nari fbece268c7 * ext/objspace/object_tracing.c: rename allocation_info to
lookup_allocation_info. At times I confused "struct
  allocation_info" with "function allocation_info".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 05:18:40 +00:00
nari 15d26c3fd9 * ext/objspace/object_tracing.c: allocation_info function isn't
called by any other file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 05:10:31 +00:00
tadf 4eabe8193a * ext/date/date_core.c (d_lite_cmp, d_lite_equal): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 22:18:12 +00:00
tadf 551bcc6364 * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reported
by Riley Lynch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 22:09:36 +00:00
eregon 71b6077a53 * ext/objspace/objspace.c: improve wording and remove duplicated comment.
Based on a patch by Dave Goodchild. [Fixes GH-299]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 14:09:25 +00:00
mrkn 1699396fe5 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
of figures.  Patch by Vipul A M <vipulnsward@gmail.com>.
  https://github.com/ruby/ruby/pull/323  fix GH-323

* test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 06:37:44 +00:00
naruse e2582ca28d * ext/socket/option.c: rename functions introduced in r41009
s/ip/ipv4/g because they are ipv4 functions.
  (there's a policy that the name "ip" is for methods which supports
   both ipv4 and ipv6)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 14:24:34 +00:00
nobu aa8cc01aa3 zlib.c: check EOF
* ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
  (gzreader_gets): check EOF.  [ruby-core:55220] [Bug #8467]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 23:00:48 +00:00
nobu 488f478d24 * ext/socket/option.c (inspect_byte): used only on NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 22:53:58 +00:00
naruse a78e45b5fe * ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
whose value's is byte.

* ext/socket/option.c (sockopt_byte): getter for above.

* ext/socket/option.c (inspect_byte): inspect for above.

* ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of
  the sockopt whose optname is IP_MULTICAST_LOOP.

* ext/socket/option.c (sockopt_ip_multicast_loop): getter for above.

* ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of
  the sockopt whose optname is IP_MULTICAST_TTL.

* ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above.

* ext/socket/option.c (sockopt_inspect): use above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 17:37:55 +00:00
mrkn 1db209763a * ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
to convert a double value to a Bignum.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 16:59:09 +00:00
zzak ee0478bce9 * ext/openssl/ossl_ssl.c: Add missing paren in rdoc [Fix GH-321]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 07:02:11 +00:00
tmm1 0a814e9b13 fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 20:57:14 +00:00
nobu 7d3fbdeacb object_tracing.c: fix argument type
* ext/objspace/object_tracing.c (make_unique_str): fix argument type.
  use long for string length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 04:52:07 +00:00
ko1 7453c53b08 * ext/objspace/object_tracing.c: fix a bug reported at
"[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head"
  Care about the case TracePoint#path #=> `nil'.
* ext/objspace/object_tracing.c: add two new methods:
* ObjectSpace.allocation_class_path(o)
* ObjectSpace.allocation_method_id(o)
  They are not useful for Object.new because they are always
  "Class" and :new.
  To trace more useful information, we need to maintain call-tree
  using call/return hooks, which is implemented by
  ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof>
* test/objspace/test_objspace.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 03:36:34 +00:00
nobu b0e7ec8c9a extmk.rb: untouch makefiles
* ext/extmk.rb (extmake): leave makefiles untouched if the content is
  not changed, to get rid of unnecessary re-linking.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 02:30:13 +00:00
nobu c9f982d4e8 ext/objspace: unexpand Author keywords
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 02:23:52 +00:00
nobu 40fe524bf3 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 18:16:05 +00:00
ko1 30dbed3837 * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
hook GC invocation.
* ObjectSpace.after_gc_start_hook=(proc)
* ObjectSpace.after_gc_end_hook=(proc)
  Note that hooks are not kicked immediately. Procs are kicked
  at postponed_job.
  This feature is a sample of new internal event and
  rb_postponed_job API.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 18:14:28 +00:00
ko1 c180e0d880 * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
* ext/-test-/postponed_job/postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 17:08:25 +00:00
nobu 462804fce4 suppress warnings
* ext/-test-/postponed_job/postponed_job.c (pjob_register),
  (pjob_call_direct): none void function.

* ext/-test-/tracepoint/tracepoint.c (tracepoint_track_objspace_events):
  adjust type to get rid of implicit cast.

* ext/objspace/object_tracing.c (newobj_i): ditto.

* ext/tk/tkutil/tkutil.c (tk_conv_args): adjust type against
  RHASH_SIZE().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 16:48:15 +00:00
ko1 e4c58251b7 * include/ruby/ruby.h, gc.c: add new internal event
RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
  after_sweep().
  Time chart with lazy sweep is here:
  (1) Kick RUBY_INTERNAL_EVENT_GC_START
  (2) [gc_marks()]
  (3) [lazy_sweep()]
  (4) [... run Ruby program (mutator) with lazy_sweep() ...]
  (5) [after_sweep()]
  (6) Kick RUBY_INTERNAL_EVENT_GC_END
  (7) [... run Ruby program (mutator), and go to (1) ...]
* ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: modify a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 15:40:27 +00:00
ko1 f0b6cb6fc7 * include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE to
RUBY_INTERNAL_EVENT_FREEOBJ.
* ext/-test-/tracepoint/tracepoint.c,
  ext/objspace/object_tracing.c,
  gc.c, vm_trace.c: catch up this change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 10:28:25 +00:00
ko1 050dd10d6f * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
Read the following test to know HOWTO.
  This feature is a sample of RUBY_INTERNAL_EVENT.
* test/objspace/test_objspace.rb: add a test.
* ext/objspace/object_tracing.c: ditto.
* gc.c (rb_gc_count): add. THis function returns GC count.
* internal.h: add decl. of rb_gc_count(). Same as `GC.count'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 10:01:45 +00:00
ko1 680f0b5ba4 * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.
* RUBY_INTERNAL_EVENT_NEWOBJ: object created.
* RUBY_INTERNAL_EVENT_FREE: object freeed.
* RUBY_INTERNAL_EVENT_GC_START: GC started.
  And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'.
  Internal events can not invoke any Ruby program because the tracing
  timing may be critical (under huge restriction).
  These events can be hooked only by C-extensions.
  We recommend to use rb_potponed_job_register() API to call Ruby
  program safely.
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-12
  [Feature #8107]
* include/ruby/debug.h, vm_trace.c: added two new APIs.
* rb_tracearg_event_flag() returns rb_event_flag_t of this event.
* rb_tracearg_object() returns created/freeed object.
* ext/-test-/tracepoint/extconf.rb,
  ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 00:21:02 +00:00
ko1 96090c083d * ext/-test-/postponed_job/postponed_job.c: fix `init' function name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 23:40:01 +00:00
ko1 e2793a908e * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.
Postponed jobs are registered with this API. Registered jobs
  are invoked at `ruby-running-safe-point' as soon as possible.
  This timing is completely same as finalizer timing.
  There are two APIs:
* rb_postponed_job_register(flags, func, data): register a
  postponed job with data. flags are reserved.
* rb_postponed_job_register_one(flags, func, data): same as
  `rb_postponed_job_register', but only one `func' job is
  registered (skip if `func' is already registered).
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-15
  [Feature #8107]
* gc.c: use postponed job API for finalizer.
* common.mk: add dependency from vm_trace.c to debug.h.
* ext/-test-/postponed_job/extconf.rb, postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.
* thread.c: implement postponed API.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 21:30:44 +00:00
ko1 a20a14727f * hash.c, include/ruby/ruby.h: support WB protected hash.
* constify RHash::ifnone and make new macro RHASH_SET_IFNONE().
* insert write barrier for st_update().
* include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone).
* marshal.c (r_object0): use RHASH_SET_IFNONE().
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 12:37:11 +00:00
naruse 0ea40b2294 * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable
added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or
  later supports it.
  http://www.freebsd.org/cgi/query-pr.cgi?pr=162374

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 12:34:50 +00:00
naruse 9b119ab456 Remove unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 11:37:35 +00:00
charliesome 2fb8799e6e * ext/fiddle/fiddle.c: fix typo in fiddle doc [Bug #8412]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 12:27:12 +00:00
naruse c43dd625b6 * ext/strscan/strscan.c (strscan_aref): raise error if given
name reference is not found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 07:32:45 +00:00
nobu 755f669316 io/console: rdoc
* ext/io/console/console.c (io_getch): add rdoc.

* ext/io/console/lib/console/size.rb (IO.console_size): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 06:54:25 +00:00
nobu db41a18845 rename generic io modules
* ext/io/console/console.c, ext/stringio/stringio.c: rename internally
  used modules as generic_readable and generic_writable.  [Fix GH-315]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 06:54:17 +00:00
nobu 4ea690ea3b extmk.rb: don't duplicate
* ext/extmk.rb (extract_makefile): do not add dldflags if duplicated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23 15:18:05 +00:00
akr d07439d5fd Add a comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23 13:49:10 +00:00
naruse ecd5bbe82a * ext/strscan/strscan.c (strscan_aref): support named captures.
patched by Konstantin Haase [ruby-core:54664] [Feature #8343]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-21 13:48:57 +00:00
knu 07a6b4cbb5 * ext/digest/lib/digest.rb (Digest::Class.file): Take optional
arguments that are passed to the constructor of the digest
  class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-21 12:41:34 +00:00
zzak c09172f395 * ext/extmk.rb: nodoc this file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-20 12:42:02 +00:00
zzak e87c6b192d * ext/stringio/stringio.c: Correct position of method rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 22:49:29 +00:00
zzak 2439bc9e69 * ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]
Based on a patch by @eLobato.
* ext/bigdecimal/lib/bigdecimal/math.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 21:00:43 +00:00
kazu c54733e120 fix typos inspired by r40825
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 14:50:47 +00:00
nobu b4795cdbba * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 03:11:09 +00:00
ktsj edb98f8b91 fix typos. Patch by k_takata.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 03:10:21 +00:00
ktsj 67964f299b * ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 02:42:16 +00:00
akr 9cc1cc2045 * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 11:28:51 +00:00
akr bfec5ad41f * ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 08:17:03 +00:00
akr 2c7c4b2e7b * ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:
comparison between signed and unsigned integer expressions



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 07:58:36 +00:00
akr 94dfc14ed8 * ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 00:01:10 +00:00
akr a7acc99193 * ext/socket/mkconstants.rb: Convert integer constants bigger than int
correctly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 15:39:59 +00:00
akr 9d099423e7 * ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flags
because SunOS 5.11 (OpenIndiana) defines ifa_flags as uint64_t.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 13:04:17 +00:00
akr d05010f6a4 Enable the document for Socket::Ifaddr#ifindex.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 03:11:42 +00:00
akr 8416b57943 Fix a dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-16 10:29:05 +00:00
tenderlove a1cc022e79 * ext/psych/lib/psych/visitors/yaml_tree.rb: fix syntax error.
Thanks @spastorino! [ruby-core:55011]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-15 20:48:15 +00:00
akr a84c2941c2 * ext/socket/depend: Add a dependency for ifaddr.o.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-15 17:04:03 +00:00
nobu ad6ae1db0a yaml_tree.rb: fix warning message
* ext/psych/lib/psych/visitors/yaml_tree.rb: fix warning message.
  Class.create does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-15 16:51:54 +00:00
tenderlove 4616913dc5 * ext/psych/lib/psych/visitors/yaml_tree.rb: only emit warnings when
-w is enabled.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-15 16:25:39 +00:00
tenderlove 3f51cff4f9 * ext/psych/lib/psych/visitors/yaml_tree.rb: adding backwards
compatible YAMLTree.new method

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 18:57:23 +00:00
tenderlove 7ceafcbdf5 * ext/psych/lib/psych.rb: Adding Psych.safe_load for loading a user
defined, restricted subset of Ruby object types.
* ext/psych/lib/psych/class_loader.rb: A class loader for
  encapsulating the logic for which objects are allowed to be
  deserialized.
* ext/psych/lib/psych/deprecated.rb: Changes to use the class loader
* ext/psych/lib/psych/exception.rb: ditto
* ext/psych/lib/psych/json/stream.rb: ditto
* ext/psych/lib/psych/nodes/node.rb: ditto
* ext/psych/lib/psych/scalar_scanner.rb: ditto
* ext/psych/lib/psych/stream.rb: ditto
* ext/psych/lib/psych/streaming.rb: ditto
* ext/psych/lib/psych/visitors/json_tree.rb: ditto
* ext/psych/lib/psych/visitors/to_ruby.rb: ditto
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* ext/psych/psych_to_ruby.c: ditto
* test/psych/helper.rb: ditto
* test/psych/test_safe_load.rb: tests for restricted subset.
* test/psych/test_scalar_scanner.rb: ditto
* test/psych/visitors/test_to_ruby.rb: ditto
* test/psych/visitors/test_yaml_tree.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 17:26:41 +00:00
tenderlove 0b8f727d7b changing variable name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 16:58:50 +00:00
akr 1e5a64261f * ext/socket/.document: Add ifaddr.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 14:48:00 +00:00
nobu 5ec5c6d52c socket: fix build error and warnings on mingw
* ext/socket/extconf.rb: check for if_nametoindex() for
  i686-w64-mingw32, and check for declarations of if_indextoname() and
  if_nametoindex().
* ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless
  if_nametoindex() is available.
* ext/socket/rubysocket.h: declare if_indextoname() and
  if_nametoindex() if available but not declared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 14:24:42 +00:00
akr b6decf289f Update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 11:35:50 +00:00
nagachika c7d7ff45f1 * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted when
$SAFE > 0.
* ext/fiddle/function.c (function_call): check tainted when $SAFE > 0.
* test/fiddle/test_func.rb (module Fiddle): add test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 11:06:58 +00:00
akr 2ad4c65b54 * ext/socket/extconf.rb: Check socketpair again.
It is required on Unix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 12:51:38 +00:00
usa cb3fcdcdc3 * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]
emulate getipaddrs(3) on Unix.

* win32/Makefile.sub, configure.in (LIBS): need iphlpapi.lib for above
  function.

* include/ruby/win32.h (socketpair): rb_w32_socketpair() doesn't
  substitute for any function, so use non-prefixed name.

* ext/socket/extconf.rb (socketpair); follow above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 11:29:32 +00:00
ko1 83aba04862 * include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
  This function reveal interal (hidden) object by rb_obj_hide().
  Note that do not change class before and after hiding.
  Only permitted example is:
  klass = RBASIC_CLASS(obj);
  rb_obj_hide(obj);
  ....
  rb_obj_reveal(obj, klass);
  TODO: API design. rb_obj_reveal() should be replaced with others.
  TODO: modify constified variables using cast may be harmful for
  compiler's analysis and optimizaton.
  Any idea to prohibt inserting RBasic::klass directly?
  If rename RBasic::klass and force to use RBASIC_CLASS(obj),
  then all codes such as `RBASIC(obj)->klass' will be
  compilation error. Is it acceptable? (We have similar
  experience at Ruby 1.9,
  for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
  object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
  without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
  file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
  parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
  string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
  Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
  ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 10:49:11 +00:00
yugui ee22fad45d * ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if
defined(OPENSSL_NO_SOCK).

  This fixes a linkage error on platforms which do not have socket.
  OpenSSL itself is still useful as a set of cryptographic functions
  even on such platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 02:08:59 +00:00
naruse 5aa618819b * ext/socket/rubysocket.h (rsock_inspect_sockaddr): as r40646
check HAVE_TYPE_STRUCT_SOCKADDR_DL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 07:09:26 +00:00
hsbt b9a34fd717 fixed wrong document for Socket.tcp by @lann [fix GH-302]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 01:44:06 +00:00
nobu 5b20e5e1fe raddrinfo.c: suppress warnings
* ext/socket/raddrinfo.c (rsock_inspect_sockaddr): cast down
  explicitly to suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11 18:28:32 +00:00
naruse 037ce7f6bc * ext/socket/rubysocket.h (HAVE_TYPE_STRUCT_SOCKADDR_DL):
MSVC has struct sockadddr_dl, but its content is broken.
  http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130511T103938Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11 14:07:20 +00:00
akr 26cb14f846 * ext/socket/raddrinfo.c (rsock_inspect_sockaddr): Add casts to
suppress warnings.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11 13:04:39 +00:00
akr b323d7d54c * ext/socket: New method, Socket.getifaddrs, implemented.
[ruby-core:54777] [Feature #8368]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11 08:32:26 +00:00
akr 2ffbe0345d * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
not be negative.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09 13:01:08 +00:00
akr bfb334eefa * file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
  HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09 12:12:17 +00:00
akr adb575e21e * ext/socket/ancdata.c (bsock_sendmsg_internal): Always set
controls_num to raise NotImplementedError appropriately.
  (bsock_recvmsg_internal): Raise NotImplementedError if
  :scm_rights=>true is given on platforms which don't have
  4.4BSD style control message.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09 11:48:29 +00:00
akr a5e6d48dfb * ext/socket/rubysocket.h, ext/socket/unixsocket.c,
ext/socket/ancdata.c: Use HAVE_STRUCT_MSGHDR_MSG_CONTROL instead
  of HAVE_ST_MSG_CONTROL.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09 03:08:58 +00:00
akr f9feb22f1a error message refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-08 19:58:38 +00:00
naruse ce573f3166 * ext/json/generator/generator.c (isArrayOrObject): cast char to
unsigned char. [Bug #8378]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-08 05:00:02 +00:00
naruse 279c7bdd88 * ext/json/generator/depend: fix dependencies [Bug #8379]
* ext/json/parser/depend: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-08 04:59:52 +00:00
naruse bbcf97fad6 * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled
sin6_scope_id on KAME introduced by r40593 for OpenIndiana.
  KAME uses fe80:<scope_id>::<interface id> for link-local address
  internally.
  Setting sin6_scope_id causes it leaked.
  see also comments of sockaddr_obj().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 22:51:16 +00:00
akr 4264240759 * ext/readline/readline.c (insert_ignore_escape): Add a cast to
unsigned char * before dereference.
  This suppress a warning on Cygwin.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 13:15:13 +00:00
akr 593c24f87c * ext/socket/ancdata.c (bsock_recvmsg_internal): Add a cast to
suppress warning.
  Bionic defines socklen_t as int.
  Bionic defines msg_controllen as unsigned int (__kernel_size_t)
  instead of socklen_t as POSIX.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 03:19:52 +00:00
akr cb2f3c1b87 * ext/socket/ancdata.c (ancillary_inspect): Don't call
anc_inspect_ipv6_pktinfo if !HAVE_TYPE_STRUCT_IN6_PKTINFO.
  anc_inspect_ipv6_pktinfo is not defined in the case.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 03:14:47 +00:00
akr 2b792abd69 * ext/socket/socket.c (socket_s_ip_address_list): Cast EXTRA_SPACE as
int.  This suppress a warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 03:12:32 +00:00
akr 301821bd45 * ext/socket/extconf.rb: Set close_fds false for Cygwin.
Cygwin doesn't support fd passing.
  This enables socket extension library cross-compilable by default.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 03:10:46 +00:00
akr 9e08404b8a * ext/socket/socket.c (socket_s_ip_address_list): Fill sin6_scope_id
if getifaddrs() returns an IPv6 link local address which
  sin6_scope_id is zero, such as on OpenIndiana SunOS 5.11.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-06 11:51:07 +00:00
akr 86d4511fe6 * ext/socket/extconf.rb: Make default_ipv6 true for Cygwin.
Cygwin supports IPv6 since Cygwin 1.7.1 (2009-12).
  http://cygwin.com/ml/cygwin-announce/2009-12/msg00027.html



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-03 05:11:06 +00:00
nobu 8202d6266f {getaddrinfo,getnameinfo}.c: fix for old platforms
* ext/socket/{getaddrinfo,getnameinfo}.c: define socklen_t if not
  defined, e.g., older VC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-03 04:35:37 +00:00
nobu f0a5e1fc3c curses/extconf.rb: simplify
* ext/curses/extconf.rb (curses_version): try once for each tests, a
  function or a variable.  fallback to variable for old SVR4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-01 07:48:06 +00:00
nobu 262669e6c6 extmk.rb: always dynamic non-install extensions
* ext/extmk.rb (extmake): extensions not to be installed should not
  make static libraries, but make dynamic libraries always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-01 07:17:53 +00:00
nobu 84c8319c8d ancdata.c: suppress warnings
* ext/socket/ancdata.c (bsock_sendmsg_internal): suppress warnings on
  platforms where msghdr does not have msg_control.

* ext/socket/ancdata.c (bsock_recvmsg_internal): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-01 04:43:00 +00:00
nagai df9991fe2b * ext/tk/MANUAL_tcltklib.ja, ext/tk/old-README.tcltklib.ja: rename from *.jp to *.ja
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-29 18:33:28 +00:00
nobu 6a8808011f * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-29 08:06:06 +00:00
naruse ecf017a9a0 * ext/nkf/nkf-utf8/nkf.h: Bionic libc doesn't have locale.
[Feature #8338]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-29 08:05:13 +00:00
nagai fb5d3a0afc * ext/tk/MANUAL_tcltklib.jp: rename from ext/tk/MANUAL_tcltklib.eucj [ruby-trunk - Bug #8084]
* ext/tk/old-README.tcltklib.jp: rename from ext/tk/old-README.tcltklib.eucj


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-29 00:20:56 +00:00
nobu 6fb5140dd6 ossl_bn.c: reduce alloca/malloc
* ext/openssl/ossl_bn.c (ossl_bn_initialize): no need of alloca for
  small fixed size array.
* ext/openssl/ossl_bn.c (ossl_bn_initialize): check overflow first,
  and use alloca for small size input.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-28 21:58:36 +00:00
shirosaki be4aa33037 ossl_bn.c: fix ossl_bn_initialize bug with integer
* ext/openssl/ossl_bn.c (ossl_bn_initialize): fix buffer overflow on
  x64 Windows and memory leak when initializing with integer.
  [ruby-core:54615] [Bug #8337]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-28 13:20:11 +00:00
zzak 7e70b8ac52 * ext/curses/curses.c: Update Curses::Window example for nicer output
Patch by Michal Suchanek [Bug #8121] [ruby-core:53520]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-27 23:30:11 +00:00
akr ef215077bc * ext/socket/extconf.rb: Redundant test removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-27 08:23:21 +00:00
akr fbbd7e29e7 * ext/socket/extconf.rb (test_recvmsg_with_msg_peek_creates_fds):
Extracted.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-27 07:00:26 +00:00
akr 56e982d447 * ext/socket/extconf.rb: Use a block of enable_config() for
--{enable,disable}-close-fds-by-recvmsg-with-peek configure option



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-26 09:42:14 +00:00
akr a36cd96c2a * ext/curses/extconf.rb: Test linkability of curses_version at first.
* ext/socket/extconf.rb: Test the behavior of fd passing with MSG_PEEK
  only if recvmsg(), msg_control member, AF_UNIX and SCM_RIGHTS are
  available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-26 03:43:19 +00:00
akr 5e9dc52be5 * ext/curses/extconf.rb: Implement
--with-curses-version={function,variable} configure option for
  cross-compiling.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 14:17:33 +00:00
akr a0fa43b094 * ext/socket/extconf.rb: Don't use WIDE getaddrinfo by default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 09:17:54 +00:00
akr 0ff2e1d531 * ext/socket/extconf.rb: Remove obsolete options: ---with-ipv6-lib and
--with-ipv6-libdir.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 08:57:15 +00:00
akr 79b807118f * ext/socket/extconf.rb: Implement
--{enable,disable}-close-fds-by-recvmsg-with-peek configure option
  for cross-compiling.
  Make --{enable,disable}-wide-getaddrinfo configure option
  cross-compiling friendly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 08:45:58 +00:00
nobu adb492406c ext/openssl/ossl_bn.c: fix implicit conversion
* ext/openssl/ossl_bn.c (ossl_bn_initialize): fix precision loss by
  implicit conversion.

* ext/openssl/ossl_bn.c (ossl_bn_initialize): check Bignum overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 07:57:17 +00:00
naruse 8b29525dad * ext/openssl/ossl_bn.c (ossl_bn_initialize): allow Fixnum and Bignum.
[ruby-core:53986] [Feature #8217]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 07:02:31 +00:00
akr ed33fcae5a * ext/socket/extconf.rb: Extract C programs as toplevel constants.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 03:03:59 +00:00
zzak c262fda9eb Typo by @windwiny [Fixes GH-295]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-24 05:01:59 +00:00
zzak 360843ef75 * ext/socket/lib/socket.rb: Doc typos by @vipulnsward [Fixes GH-292]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-24 03:55:02 +00:00
akr 80e4d412d3 * ext/socket/rubysocket.h (SOCKLEN_MAX): Expression simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-17 13:08:13 +00:00
akr ce6db8f286 * ext/socket/rubysocket.h (SOCKLEN_MAX): Defined.
* ext/socket/raddrinfo.c (ext/socket/raddrinfo.c): Reject too long
  Linux abstract socket name.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-17 11:01:17 +00:00
akr a294d45808 * ext/socket/unixsocket.c (unix_send_io): Suppress a warning by clang.
(unix_recv_io): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 14:07:50 +00:00
zzak 45b3c3ac39 * ext/sdbm/init.c: Fix comment indentation, by windwiny [Fixes GH-277]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 03:28:19 +00:00
zzak 3a7a773aeb * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
* ext/stringio/stringio.c: ditto
* ext/io/wait/wait.c: ditto
* ext/gdbm/gdbm.c: ditto
* ext/dl/cfunc.c: ditto
* ext/zlib/zlib.c: ditto
* ext/win32ole/win32ole.c: ditto
* ext/dbm/dbm.c: ditto
* ext/json/generator/generator.c: ditto
* ext/date/date_core.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 03:25:50 +00:00
hsbt bbf0ea6bfb fixed wrong value by @taksatou [fix GH-287]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 02:31:55 +00:00
zzak a152c41e53 * ext/openssl/*: Document synonymous methods, by windwiny [GH-277]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 02:24:09 +00:00
akr 582ba0a57c * ext/fiddle/depend: New file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 13:22:20 +00:00
emboss d6b1ab91dc * ext/openssl/ossl_ssl.c: Correct shutdown behavior w.r.t GC.
* test/openssl/test_ssl.rb: Add tests to verify correct behavior.  

[Bug #8240] Patch provided by Shugo Maeda. Thanks!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 02:04:07 +00:00
naruse e4f6efcc4a * ext/coverage/depend: fix id.h place as r40283.
* ext/coverage/extconf.rb: add topdir and topsrcdir to VPATH.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 01:24:37 +00:00
akr 788b45da3e * ext/-test-/debug/depend: New file.
* ext/-test-/exception/depend: Ditto.

* ext/-test-/printf/depend: Ditto.

* ext/-test-/string/depend: Ditto.

* ext/coverage/depend: Ditto.

* ext/io/console/depend: Ditto.

* ext/io/nonblock/depend: Ditto.

* ext/io/wait/depend: Ditto.

* ext/openssl/depend: Ditto.

* ext/pathname/depend: Ditto.

* ext/psych/depend: Ditto.

* ext/zlib/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-14 10:48:08 +00:00
naruse 34f5700a09 * lib/mkmf.rb (MakeMakefile#create_makefile): remove {$(VPATH)} other
than nmke.

* ext/ripper/depend: use VPATH expecting removed by above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 18:00:25 +00:00
usa b77d1a4f34 * lib/mkmf.rb (MakeMakefile#create_makefile): output new macro
disthdrdir to specify the path of id.h, parse.h and etc.

* ext/ripper/depend: use above macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 12:14:37 +00:00
naruse f9ba0dcaa4 fix building ripper: parse.h and id.h doesn't need directory
r40275 breaks Unix build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 11:44:05 +00:00
usa 0869d460ba * ext/ripper/depend: parse.h and id.h may be created on topdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 09:57:02 +00:00
nobu 4123b0d9db ripper/depend: fix out-of-place build
* ext/ripper/depend (ripper.o): fix out-of-place build.  probes.h
  depends on the platform, so it cannot be in $(top_srcdir).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 02:33:58 +00:00
akr b47138580c * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.

* ext/-test-/old_thread_select/depend: Update dependencies.

* ext/-test-/wait_for_single_fd/depend: Ditto.

* ext/bigdecimal/depend: Ditto.

* ext/curses/depend: Ditto.

* ext/digest/bubblebabble/depend: Ditto.

* ext/digest/depend: Ditto.

* ext/digest/md5/depend: Ditto.

* ext/digest/rmd160/depend: Ditto.

* ext/digest/sha1/depend: Ditto.

* ext/digest/sha2/depend: Ditto.

* ext/dl/callback/depend: Ditto.

* ext/dl/depend: Ditto.

* ext/etc/depend: Ditto.

* ext/nkf/depend: Ditto.

* ext/objspace/depend: Ditto.

* ext/pty/depend: Ditto.

* ext/readline/depend: Ditto.

* ext/ripper/depend: Ditto.

* ext/sdbm/depend: Ditto.

* ext/socket/depend: Ditto.

* ext/stringio/depend: Ditto.

* ext/strscan/depend: Ditto.

* ext/syslog/depend: Ditto.

* ext/-test-/num2int/depend: Removed.

* ext/dbm/depend: Ditto.

* ext/fcntl/depend: Ditto.

* ext/gdbm/depend: Ditto.

* ext/racc/cparse/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 00:46:29 +00:00
nobu 6e9c02515d * ext/etc/etc.c: fix struct name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12 15:23:22 +00:00
nobu 1e4b2f9bd1 etc.c: Etc namespace
* ext/etc/etc.c (Init_etc): move Passwd and Group under Etc namespace
  as primary names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12 15:16:00 +00:00
naruse 89bda514c2 Fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 15:52:41 +00:00
naruse cddd37aae2 * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 on
Mac OS X and Linux [Bug #3371]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 07:10:39 +00:00
naruse c0e0a684d7 * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): add missing case:
RUBY_LIBFFI_MODVERSION is not defined (usually on Windows).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 01:40:11 +00:00
naruse a0f7f29215 * ext/fiddle/extconf.rb: define RUBY_LIBFFI_MODVERSION macro.
* ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 or 1
  with platform and libffi's version. [Bug #3371]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 21:15:37 +00:00
naruse 2570f838da * ext/fiddle/closure.c (initialize): check mprotect's return value.
If mprotect is failed because of PaX or something, its function call
  will cause SEGV.
  http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 18:35:21 +00:00
akr 3f9e0e43c3 * ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
even when overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 08:39:53 +00:00
akr fa9b5bf223 * bignum.c (rb_ll2big): Don't overflow on signed integer negation.
* ext/bigdecimal/bigdecimal.c (MUL_OVERFLOW_SIGNED_VALUE_P): New
  macro.
  (AddExponent): Don't overflow on signed integer multiplication.
  (VpCtoV): Don't overflow on signed integer arithmetic.
  (VpCtoV): Don't overflow on signed integer arithmetic.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 03:34:38 +00:00
nobu fa93be2f05 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08 20:27:01 +00:00
headius 0626d9b91c Fix #6154 by introducing new EAGAIN/EWOULDBLOCK/EINPROGRESS
subclasses that include WaitReadable or WaitWritable rather than
extending them into the exception object each time.

* error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and
  export them for use in WaitReadable/Writable exceptions.
* io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that
  include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail
  for nonblocking failures using those exceptions. Use that
  function in io_getpartial and io_write_nonblock instead of
  rb_mod_sys_fail
* ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include
  WaitReadable and WaitWritable. Use those classes for
  write_would_block and read_would_block instead of rb_mod_sys_fail.
* ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of
  rb_mod_sys_fail in bsock_sendmsg_internal and
  bsock_recvmsg_internal.
* ext/socket/init.c: Use rb_readwrite_sys_fail instead of
  rb_mod_sys_fail in rsock_s_recvfrom_nonblock and
  rsock_s_connect_nonblock.
* ext/socket/socket.c: Use rb_readwrite_sys_fail instead of
  rb_mod_sys_fail in sock_connect_nonblock.
* include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead
  of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and
  RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08 19:58:55 +00:00
nobu 53fdb9e190 socket/extconf.rb: add -D
* ext/socket/extconf.rb: $defs needs -D or -U.  nothing is added
  otherwize.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08 17:44:35 +00:00