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

5477 Коммитов

Автор SHA1 Сообщение Дата
nobu 4cac2f4ada bigdecimal.h: suppress warnings
* ext/bigdecimal/bigdecimal.h (VpSetZero, VpSetInf): get rid of
  unused-value warnings by gcc 4.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12 02:25:28 +00:00
akr 09e6766d1a * ext/bigdecimal/bigdecimal.c (BigMath_s_log): Use rb_big_cmp instead of
RBIGNUM_NEGATIVE_P.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:55:37 +00:00
akr c1de2f4e3a * bignum.c (rb_big_cmp): Specialize a comparison to zero.
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
  RBIGNUM_NEGATIVE_P.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:43:23 +00:00
akr ab67419b75 * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use rb_integer_pack.
Fix SEGV by OpenSSL::BN.new(1 << (2**34)).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:06:51 +00:00
zzak bdeedccc5f * ext/tk/README.tcltklib: [DOC] Fix typo by @xta [Fixes GH-532] [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 08:02:01 +00:00
zzak 9699d0ddf4 * ext/ripper/lib/ripper/lexer.rb: [DOC] use lower case version of core
classes when referring to return value, since we aren't directly
  talking about the class. Patch by Jonathan Jackson [Bug #9483]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07 12:57:44 +00:00
hsbt c6c6a74fed * ext/stringio/stringio.c: [DOC] add docs and example by @schneems [ci skip] [fix GH-527]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06 03:08:38 +00:00
normal 2d603f9fee ext/thread: SizedQueue#max= wakes up waiters properly
* ext/thread/thread.c (rb_szqueue_max_set): use correct queue and
	  limit wakeups.  [Bug #9343][ruby-core:60517]
	* test/thread/test_queue.rb (test_sized_queue_assign_max):
	  test for bug

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 23:35:06 +00:00
ko1 d76b382683 * ext/objspace/objspace_dump.c (dump_object): use STR_SHARED_P()
instead of removed STR_NOCAPA_P() macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 05:41:04 +00:00
nobu 5c0d438fd3 * ext/psych/yaml/config.h (PACKAGE_VERSION): update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:31 +00:00
nobu 215b9e760a yaml/yaml_private.h: include ruby/extconf.h
* ext/psych/yaml/yaml_private.h: need ruby/extconf.h for
  HAVE_CONFIG_H.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:29 +00:00
nobu 990ba47c24 yaml/api.c, yaml/loader.c: integer overflow
* ext/psych/yaml/api.c (yaml_scalar_event_initialize): fix possible
  integer overflow.
  (yaml_document_add_scalar): ditto.
  (yaml_document_add_sequence): ditto.
   (yaml_document_add_mapping): ditto.

* ext/psych/yaml/loader.c (yaml_parser_load_scalar): ditto.
  (yaml_parser_load_sequence): ditto.
  (yaml_parser_load_mapping): ditto.

* ext/psych/yaml/scanner.c (yaml_parser_roll_indent): suppress
  warnigs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:28 +00:00
nobu 0483b29a8b yaml/emitter.c: constify, r37936
* ext/psych/yaml/emitter.c (yaml_emitter_write_indicator): constify.

* ext/psych/yaml/emitter.c (yaml_emitter_write_block_scalar_hints):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:26 +00:00
nobu 1af28b7b7e * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:04:25 +00:00
tenderlove bfda9402a9 * ext/psych/lib/psych.rb: New release of psych.
* ext/psych/psych.gemspec: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04 19:24:50 +00:00
tenderlove e8132aa4d7 * ext/psych/yaml/emitter.c: merge libyaml 0.1.5
* ext/psych/yaml/loader.c: ditto
* ext/psych/yaml/parser.c: ditto
* ext/psych/yaml/reader.c: ditto
* ext/psych/yaml/scanner.c: ditto
* ext/psych/yaml/writer.c: ditto
* ext/psych/yaml/yaml_private.h: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04 19:18:01 +00:00
ko1 c77a745aab * string.c: remvoe STR_ASSOC related code.
By r44804, string objects can not have STR_ASSOC flag.
* internal.h: ditto.
* ext/objspace/objspace_dump.c (dump_object): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04 07:12:49 +00:00
suke 7a2b7cf197 ext/win32ole/win32ole.c (ole_typedesc2val): add VT_RECORD case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-01 06:16:42 +00:00
normal cb07275001 socket: split out SOCK_CLOEXEC versions of wrappers for readability
* ext/socket/init.c (rsock_socket0): split out SOCK_CLOEXEC version
	* ext/socket/socket.c (rsock_socketpair0): ditto
	  [ruby-core:60377]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31 08:06:19 +00:00
nobu d0a84c2ce9 socket.c: suppress warnings
* ext/socket/init.c (rsock_socket0): suppress unused label
  warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31 07:08:52 +00:00
mame 995d330779 * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
[ruby-core:57599] [Bug #8978].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-29 23:27:14 +00:00
nobu 0cee7f8e2f socket.c: suppress warnings
* ext/socket/socket.c (rsock_socketpair0): suppress unused label
  warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-29 02:04:16 +00:00
tenderlove e25f3587bd * ext/openssl/ossl_ssl.c: pass read_nonblock options to underlying IO
when SSL session has not been started.

* test/openssl/test_ssl.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 19:31:48 +00:00
tenderlove 2ee916752c * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
[ruby-core:57599] [Bug #8978].  Thanks mame!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 18:53:23 +00:00
akr 965b947fff * ext/socket: Avoid redundant fcntl/fstat syscalls for cloexec
sockets.
  Patch by Eric Wong.  [ruby-core:59429] [Feature #9330]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 14:37:34 +00:00
zzak 5d83f5554f * ext/zlib/zlib.c (rb_zlib_adler32): [DOC] Add example for adler32
Patch by Vajrasky Kok [Bug #9307] [ci skip]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 06:13:50 +00:00
nobu 06d2e8aaf7 thread/thread.c: no dup
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue
  are not able to copy.  [ruby-core:59961] [Bug #9440]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-22 06:59:41 +00:00
akr 3ffc7535ba Several more OS information for TYPE_IP_MULTICAST_LOOP and
TYPE_IP_MULTICAST_TTL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-21 13:39:08 +00:00
nobu 6cfa67afe7 ext/socket/option.c: fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 22:52:17 +00:00
akr 8b5694d5e8 * ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
IP_MULTICAST_TTL on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 19:35:11 +00:00
akr 779a630aee * ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
IP_MULTICAST_TTL on Mac OS X.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 19:32:03 +00:00
akr 3682c6a327 * ext/socket/option.c: Use "byte" as default argument for
IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
  the original multicast implementation.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 15:43:47 +00:00
akr 3b8bcf42a7 * ext/socket/option.c: Use preprocessor macros to avoid repeated
conditionals.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 13:48:42 +00:00
nobu 5ecbe189af socket/option.c: helper functions
* ext/socket/option.c (sockopt_pack_byte, sockopt_pack_int):
  extract helper functions to pack integers in a String.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 14:56:05 +00:00
nobu 5c179cd66c socket/option.c: revert r44647
* ext/socket/option.c (NUM2SOCKOPT, sockopt_value): revert because
  these names are confusing.  [ruby-dev:47903]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 13:04:53 +00:00
nobu 41bdefd56f tracepoint.c: disable tracepoint
* ext/-test-/tracepoint/tracepoint.c (tracepoint_track_objspace_events):
  ensure tracepoint disabled.  [ruby-dev:47901] [Bug #9426]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 08:56:58 +00:00
hsbt 0558b8a5c4 * ext/psych/lib/psych.rb: fix typo by @jwworth [fix GH-500]
*  lib/rake/file_list.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:48:33 +00:00
hsbt d1ab866d4a * ext/nkf/nkf-utf8/nkf.c: fix typo by @windwiny [fix GH-506]
* ext/openssl/ossl_ssl.c: ditto
* ext/psych/yaml/scanner.c: ditto
* ext/socket/init.c: ditto
* ext/socket/socket.c: ditto
* ext/tk/tcltklib.c: ditto
* ext/win32ole/win32ole.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:43:23 +00:00
nobu 6282b3b5c3 socket/option.c: socket option variations
* ext/socket/option.c (NUM2SOCKOPT, sockopt_value): extract to wrap
  socket option variations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 01:11:01 +00:00
akr 971ef82267 * ext/socket: Avoid unnecessary ppoll/select on Linux.
Patch by Eric Wong.  [ruby-core:57950] [Bug #9039]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 14:13:22 +00:00
akr 7efaa4f5d0 [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 12:44:36 +00:00
akr 57b2190d55 * ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
option takes a byte on OpenBSD.
  Fixed by Jeremy Evans.  [ruby-core:59496] [Bug #9350]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 12:31:57 +00:00
mrkn 986a99b239 * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 15:17:33 +00:00
nobu cfa2a21062 ext/json: backward compatibilities
* ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c: add
  macros for backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:46 +00:00
nobu a1a237fb36 ext/fiddle: backward compatibilities
* ext/fiddle/function.c, ext/fiddle/pointer.c: add macros for
  backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:44 +00:00
nobu f5a12ac596 bigdecimal.c: rename macros
* ext/bigdecimal/bigdecimal.c (RB_OBJ_CLASSNAME): rename from CLASS_NAME().

* ext/bigdecimal/bigdecimal.c (RB_OBJ_STRING): for object itself.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:33 +00:00
nobu 405ad52ad7 function.c: adjust indent
* ext/fiddle/function.c (parse_keyword_arg_i): adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:32 +00:00
glass 79e69ec715 * ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERS
on SizedQueue#clear. [ruby-core:59462] [Bug #9342]

* test/thread/test_queue.rb: add test. the patch is from
  Justin Collins.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14 12:14:48 +00:00
nobu 0a8988c132 bigdecimal.c: backword compatibility as gem
* ext/bigdecimal/bigdecimal.c (CLASS_NAME): macro to wrap
  depending on PRIsVALUE for 1.9.  [Backport #9406]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14 06:58:43 +00:00
nobu 88383b058b bigdecimal.c: backword compatibility as gem
* ext/bigdecimal/bigdecimal.c (DECIMAL_SIZE_OF_BITS): fallback
  definition for 2.1 or older.  [ruby-core:59750] [Backport #9406]
* ext/bigdecimal/bigdecimal.c (raise_with_class): fallback definition
  for 1.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14 05:51:58 +00:00
nobu 43d4148682 strscan.c: fix typo
* ext/strscan/strscan.c (inspect1): fix typo, rb_str_cat() instead
  of rb_str_cat2().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14 03:23:20 +00:00
nobu 747e3c73e0 strscan.c: make string directly
* ext/strscan/strscan.c (inspect1): extract intermediate string from
  the buffer directly, like as inspect2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14 02:48:07 +00:00
mrkn e7fe5648cf * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
digit for the quotient to be compatible with bigdecimal 1.2.1 and
  the former.  [ruby-core:59365] [#9316] [#9305]

* test/bigdecimal/test_bigdecimal.rb: tests for the above change.

* ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 17:29:58 +00:00
zzak 3f039c96e2 * ext/openssl/ossl_pkey_dh.c: Fixed typo by Sandor Szücs [Bug #9243]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 05:27:23 +00:00
charliesome 64926db998 * ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
  [Bug #9302] [ruby-core:59324]

* test/thread/test_queue.rb: add test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 03:18:38 +00:00
nobu 23a8568739 openssl/ossl.h: calculate as long
* ext/openssl/ossl.h (ossl_str_adjust): calculate as long, not
  casting to int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:42 +00:00
nobu 74947c9d1e ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:41 +00:00
nobu eadaa8ba8b ext: use PRIsVALUE for rb_raise and rb_warn
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): use PRIsVALUE for
  rb_raise() and rb_warn().
* ext/openssl/ossl_cipher.c (ossl_cipher_init): ditto.
* ext/racc/cparse/cparse.c (extract_user_token): ditto.
* ext/syslog/syslog.c (mSyslog_log): ditto.

* ext/openssl/ossl.h (OSSL_Check_Kind, OSSL_Check_Instance): now
  ossl_raise() also accepts PRIsVALUE.
* ext/openssl/ossl_asn1.c (ossl_asn1_default_tag):

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:38 +00:00
nobu 7e9bd8f72c ext: real class name
* ext/dl/cptr.c (rb_dlptr_inspect): use real class name, not
  singleton class.

* ext/fiddle/pointer.c (rb_fiddle_ptr_inspect): ditto.

* ext/strscan/strscan.c (strscan_inspect): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:36 +00:00
nobu 56e96b9f73 cptr.c: unused variable
* ext/dl/cptr.c (rb_dlptr_inspect): remove no longer used variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:34 +00:00
nagai 738c298ce0 * ext/tk/extconf.rb: --with-tcllib and --with-tklib configure options
don't work correctly. Patch by jeremyevans0 (Jeremy Evans).
  [ruby-core:59483] [Bug #9348]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 09:04:06 +00:00
nobu 9bd672f668 ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:36 +00:00
nobu 4240685237 stubs.c: library name strings
* ext/tk/stubs.c (ruby_open_tcl_dll, ruby_open_tk_dll): make library
  names by string literal concatenation at compilation time, not by
  sprintf() at runtime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:34 +00:00
nobu 13e47e81d9 tcltklib.c: create_ip_exc format argument
* ext/tk/tcltklib.c (create_ip_exc): format argument must not be a
  dynamic string, not to contain unescaped %.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:32 +00:00
nobu 5e9b7bacc3 ruby/util.h: DECIMAL_SIZE_OF_BITS
* include/ruby/util.h (DECIMAL_SIZE_OF_BITS): a preprocessor
  constant macro to approximate decimal representation size of n-bits
  integer.
* iseq.c (register_label): use DECIMAL_SIZE_OF_BITS for better
  approximation.
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
* common.mk (iseq.o), ext/bigdecimal/depend (bigdecimal.o): add
  dependency to ruby/util.h for DECIMAL_SIZE_OF_BITS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 00:21:37 +00:00
nobu 2b1c47dadc bigdecimal.c: expand buffer
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): expand buffer size for
  64bit platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-11 03:15:01 +00:00
nobu f06ee90f95 tk/extconf.rb: fix libpathflag arguments
* ext/tk/extconf.rb: fix to pass arrays instead of strings to
  libpathflag.  patch at [ruby-core:59665].  [Bug #9386]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-09 15:47:54 +00:00
tenderlove b90076e85c * ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
quotes should not have changed.  [ruby-core:59316] [Bug #9300]

* ext/psych/lib/psych.rb: fixed missing require.

* test/psych/test_string.rb: test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-09 00:56:45 +00:00
tenderlove 7c6e4f8f38 * ext/psych/lib/psych/visitors/to_ruby.rb: anonymous structs
should be able to roundtrip.  Thanks @splattael!

* test/psych/test_object_references.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-09 00:54:37 +00:00
tmm1 738b8872ef ext/json: objects depend on $(ruby_headers)
* ext/json/generator/depend: add build dependencies for json extension
  Patch by normalperson (Eric Wong) [Bug #9374] [ruby-core:59609]
* ext/json/parser/depend: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07 01:13:46 +00:00
nobu dc4922b89d tk/extconf.rb: rpath by libpathflag
* ext/tk/extconf.rb: use libpathflag method instead of dealing with
  rpath options directly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-05 12:48:23 +00:00
nobu bd0ef220f0 ext/tk/extconf.rb: fix build error with tk variant
* ext/tk/extconf.rb: use -rpath linker option instead of -R, to
  fix build error with tk variant.  incorporate from MacPorts.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-04 12:10:20 +00:00
nobu 5b0fb1aadd socket.c: format flags
* ext/socket/socket.c (rsock_syserr_fail_host_port): use format flags,
  '+' to inspect, ' ' to quote unprintables.
* ext/socket/socket.c (rsock_syserr_fail_path): ditto.
* ext/socket/socket.c (rsock_syserr_fail_raddrinfo): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-04 10:15:31 +00:00
nobu a3f2fe4e4d socket.c: use rb_syserr_fail
* ext/socket/socket.c (rsock_syserr_fail_host_port): add errno
  argument version anduse rb_syserr_fail_str() instead of
  rb_sys_fail_str() with restoring errno.
* ext/socket/socket.c (rsock_syserr_fail_path): ditto, and
  rb_syserr_fail().
* ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto, use
  rsock_syserr_fail_raddrinfo().
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto.
* ext/socket/socket.c (setup_domain_and_type): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-04 10:13:36 +00:00
charliesome 8f04556111 * ext/socket/socket.c (rsock_sys_fail_host_port): save and restore errno
before calling rb_sys_fail_str to prevent [BUG] errno == 0.
  Patch by Eric Wong. [ruby-core:59498] [Bug #9352]

* ext/socket/socket.c (rsock_sys_fail_path): ditto
* ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto
* ext/socket/socket.c (rsock_sys_fail_raddrinfo_or_sockaddr): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-03 10:12:38 +00:00
eregon 1cc709a84a * ext/bigdecimal: update class method call style from :: to .
in documentation and usage.
* ext/bigdecimal/lib/bigdecimal/math.rb: [DOC] fix examples values.
  Computations were made using ruby 2.0.0p247 to ensure
  no effect of the recent BigDecimal bug.
* ext/bigdecimal/sample/nlsolve.rb: fix indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-02 15:10:13 +00:00
nobu e4518c5bde dbm.c: yield dup of keystr
* ext/dbm/dbm.c (fdbm_fetch): yield dup of keystr, to make it shared
  and get rid of use of uninitialized variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-01 18:43:13 +00:00
charliesome 75f4731f90 * benchmark/bm_so_meteor_contest.rb: [DOC] Fix a few typos
* ext/fiddle/lib/fiddle/import.rb: ditto
* ext/psych/lib/psych.rb: ditto
* ext/psych/lib/psych/nodes/sequence.rb: ditto
* ext/tk/lib/multi-tk.rb: ditto
* ext/tk/lib/tcltk.rb: ditto

Closes GH-490

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-28 08:25:28 +00:00
nobu 1e7a929c1d ossl_ssl.c: declare OP_MSIE_SSLV2_RSA_PADDING only if defined
* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Declare a constant
  `OP_MSIE_SSLV2_RSA_PADDING` only if the macro is defined.  The
  `SSL_OP_MSIE_SSLV2_RSA_PADDING` has been removed from latest
  snapshot of OpenSSL 1.0.1.  [Fixes GH-488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-25 01:42:09 +00:00
nobu 3e37a7f745 ossl.c: integer overflow
* ext/openssl/ossl.c (string2hex): fix signed integer overflow.
  [ruby-core:51711] [Bug #7744] [Fixes GH-242]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-24 16:44:49 +00:00
zzak cadd660689 * doc/ChangeLog-1.9.3: [DOC] Fix typos by @dvsuresh
[Fixes GH-485] https://github.com/ruby/ruby/pull/485
* ext/openssl/ossl_config.c: ditto
* lib/rss/utils.rb, lib/time.rb: ditto
* test/ruby/envutil.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-22 18:21:14 +00:00
a_matsuda 5cebf6d7a6 * ext/objspace/object_tracing.c: Fix typo in a variable name
s/registerd/registered/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-17 11:18:47 +00:00
ko1 d4f80bd74e * ext/objspace/objspace.c (reachable_object_from_root_i): use
compare_by_identity hash to avoid hash modify problem
  during iteration.
  [Bug #9252]
* ext/objspace/objspace.c (reachable_objects_from_root): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-16 10:16:51 +00:00
ko1 1448b0abf5 * ext/objspace/objspace.c (reachable_object_from_root_i):
reachable objects should not include categories and
  category_objects because it is noisy information.
  In fact, objects created after calling
  ObjectSpace.reachable_objects_from_root should not be included
  as a returning hash objects. Currently, mswin64 platform has a
  problem because of this behaviour. Should we trace new objects?



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-15 04:42:23 +00:00
a_matsuda c0abb5e5c3 * ext/psych/yaml/emitter.c: Fix typo in the variable name
s/preceeded/preceded/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14 01:19:06 +00:00
akr 4fd53e476e * ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
it may be set before the body.
  Reported by ko1 and mrkn.  [ruby-core:59088] [Bug #9247]

* lib/cgi/core.rb: Ditto.

* lib/drb/ssl.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13 16:11:12 +00:00
mrkn df33325192 * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resulting
precision.

* test/bigdecimal/test_bigdecimal.rb (test_limit): add tests for the above
   change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12 17:02:27 +00:00
mrkn 7d3538db3f * ext/bigdecimal/bigdecimal.c (VpAddAbs): put out a conditional branch from
the inside of while-loop.

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12 17:02:24 +00:00
mrkn 27d53fb5df * ext/bigdecimal/bigdecimal.c (VPrint): be a static function, support another
dump formats, and add more information of the given bigdecimal.

* ext/bigdecimal/bigdecimal.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12 17:02:20 +00:00
a_matsuda 8920ac2972 * doc/contributing.rdoc: [DOC] Fix typo in comments by @dvsuresh [Fixes GH-475]
* ext/openssl/ossl_ssl.c: ditto.
* test/ruby/test_m17n.rb:  ditto.

https://github.com/ruby/ruby/pull/475
[ci-skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12 07:21:19 +00:00
a_matsuda e1db3605fd * ext/win32ole/sample/olegen.rb: Fix typo
* ext/openssl/ossl_asn1.c:  [DOC] Fix typo
* lib/webrick/accesslog.rb:  ditto
* template/yarvarch.ja:  ditto

s/recieve/receive/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11 03:58:07 +00:00
hsbt 3d4ceaaa14 * ext/tk/lib/tkextlib/SUPPORT_STATUS: [DOC] remove link of RAA.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11 03:36:03 +00:00
hsbt c2caf7d30f * ext/racc/cparse/README: [DOC] Use upstream and github link instead of RAA.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11 03:10:54 +00:00
nobu 9a938987cb date_strptime.c: get rid of backtrack explosion
* ext/date/date_strptime.c (date__strptime_internal): unset
  case-insensitive flag for [:alpha:], which already implies both
  cases, to get rid of backtrack explosion.  [ruby-core:58984]
  [Bug #9221]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 14:58:43 +00:00
nobu d5526f3fe5 openssl/digest.rb: check by lambda
* ext/openssl/lib/openssl/digest.rb (initialize): check argument
  size by lambda.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 07:16:03 +00:00
nobu 0ede9926f7 openssl/digest.rb: get rid of deprecated class
* ext/openssl/lib/openssl/digest.rb (digest, hexdigest): create
  new instance and call on it directly, to get rid of deprecated
  class OpenSSL::Digest::Digest.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 07:16:01 +00:00
tmm1 7170baa878 objspace_dump.c: include object's gc flags in dump
* ext/objspace/objspace_dump.c (dump_object): include fstring flag on
  strings. include gc flags (old, remembered, wb_protected) on all objects.
* ext/objspace/objspace_dump.c (Init_objspace_dump): initialize lazy
  IDs before first use.
* gc.c (rb_obj_gc_flags): new function to retrieve object flags
* internal.h (RB_OBJ_GC_FLAGS_MAX): maximum flags allowed for one obj
* test/objspace/test_objspace.rb (test_dump_flags): test for above
* test/objspace/test_objspace.rb (test_trace_object_allocations):
  resolve name before dump (for rb_class_path_cached)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 02:26:09 +00:00
drbrain 4f7c10f06f * ext/.document: Remove curses from documentable directories.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 21:16:19 +00:00
zzak 99e04c1345 * ext/openssl/lib/openssl/digest.rb: Deprecate OpenSSL::Digest::Digest
[Fixes GH-446] https://github.com/ruby/ruby/pull/446


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 19:56:45 +00:00
ktsj 2251a2729a * ext/thread/thread.c: [DOC] add call-seq alias for Queue#enq, #<<, etc.
* ext/thread/thread.c (Init_thread): use rb_define_alias instead of
  rb_alias to document alias.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 15:47:35 +00:00
shugo 9c5b2fd8aa * ext/curses, sample/curses: removed curses.
* NEWS: added an entry for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 04:39:49 +00:00
nobu d3363a96df object_tracing.c: fix allocation from NEWOBJ hook
* ext/objspace/object_tracing.c (newobj_i): use cached class path
  only to get rid object allocation during NEWOBJ hook.
  [ruby-core:58853] [Bug #9212]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 03:26:07 +00:00
nobu 334294d0e2 date_parse.c: get rid of backtrack explosion
* ext/date/date_parse.c (parse_time): unset case-insensitive flag
  for [:alpha:], which already implies both cases, to get rid of
  backtrack explosion.  [ruby-core:58876] [Bug #9221]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 02:14:35 +00:00
drbrain d71eb3108c * ext/.document: Add syslog/lib and thread/thread.c to documentable
items.  [ruby-trunk - Bug #9228]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08 19:44:07 +00:00
mrkn 0727a22c69 * bigdecimal.c (BigDecimal_coerce): convert a Float to a BigDecimal instead
of converting the receiver to a Float.
  [ruby-core:58756] [Bug #9192]

* test/bigdecimal/test_bigdecimal.rb: add tests for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08 11:20:51 +00:00
tmm1 98a74d4dd5 parse.y: use rb_fstring() for strings stored in the symbol table
* parse.y (register_symid_str): use fstrings in symbol table
  [Bug #9171] [ruby-core:58656]
* parse.y (rb_id2str): ditto
* string.c (rb_fstring): create frozen_strings on first usage. this
  allows rb_fstring() calls from the parser (before cString is created)
* string.c (fstring_set_class_i): set klass on fstrings generated
  before cString was defined
* string.c (Init_String): convert frozen_strings table to String
  objects after boot
* ext/-test-/symbol/type.c (bug_sym_id2str): expose rb_id2str()
* test/-ext-/symbol/test_type.rb (module Test_Symbol): verify symbol
  table entries are fstrings

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08 01:39:27 +00:00
a_matsuda 7a9f701692 * ext/tk/lib/tk/canvas.rb: [DOC] Fix typo (s/paramter/parameter/)
* ext/tk/lib/tk/text.rb:  Ditto.
* ext/tk/lib/tkextlib/blt/component.rb:  Ditto.
* ext/tk/lib/tkextlib/blt/tree.rb:  Ditto.
* ext/tk/lib/tkextlib/blt/treeview.rb:  Ditto.
* ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb:  Ditto.
* lib/xmlrpc/server.rb:  Ditto.

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-07 10:27:27 +00:00
mrkn 2308fb170e * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):
treat 0.0 and -0.0 of floating-point numbers specially for an optimization
  and to correctly propagate its signbit to the result.
  [Bug #9214] [ruby-core:58858]

* test/bigdecimal/test_bigdecimal.rb: add tests case for the above change.

* test/bigdecimal/test_bigdecimal_util.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05 16:34:59 +00:00
tmm1 6692436b9f ext/objspace: remove OS.after_gc_start_hook= and move internal test
* ext/objspace/gc_hook.c: remove this file
* ext/-test-/tracepoint/gc_hook.c: new filename for above
* ext/objspace/objspace.c: remove ObjectSpace.after_gc_start_hook=
* test/objspace/test_objspace.rb: remove test
* test/-ext-/tracepoint/test_tracepoint.rb: add above test for
  tracepoint re-entry

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05 09:24:02 +00:00
tmm1 393b9e65e9 gc.c: split GC_END event into GC_END_MARK and GC_END_SWEEP
* include/ruby/ruby.h: remove INTERNAL_EVENT_GC_END and replace with
  two new events: GC_END_MARK and GC_END_SWEEP
* gc.c (gc_after_sweep): emit GC_END_SWEEP after lazy sweep is done
* gc.c (gc_marks_body): emit GC_END_MARK at end of minor/major mark
* ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): tests
  for new events.
* test/-ext-/tracepoint/test_tracepoint.rb (class TestTracepointObj):
  ditto.
* NEWS: remove ObjectSpace.after_gc_*_hook. These are only a sample,
  and will be removed before ruby 2.1.
* ext/objspace/gc_hook.c: remove ObjectSpace.after_gc_end_hook=

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05 04:26:04 +00:00
drbrain e45f56d5db * ext/openssl/lib/openssl/buffering.rb: Return ASCII-8BIT strings from
SSLSocket methods.  [ruby-trunk - Bug #9028]
* test/openssl/test_ssl.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03 01:44:41 +00:00
zzak c4487ee06b * ext/openssl/lib/openssl/buffering.rb: Fix warning in copyright
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01 02:58:50 +00:00
nobu e1a7f50ce6 win32ole.c: correct declaration
* ext/win32ole/win32ole.c (hash2named_arg): correct declaration to fix
  build failure.  a patch by phasis68 (Heesob Park) at
  [ruby-core:58710].  [Bug #9184]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 09:05:48 +00:00
nobu 04ca48fc38 eval.c: determine exit status and signal before finalization
* eval.c (ruby_cleanup): determine exit status and signal to terminate
  before finalization, to get rid of access destroyed T_DATA execption
  object.  [ruby-core:58643] [Bug #9167]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 08:46:41 +00:00
nobu dacc2c2436 vm_eval.c: blockarg
* vm_eval.c (rb_yield_block): implement non-nil block argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 04:21:26 +00:00
nagai 07c15e8b10 * ext/tk/extconf.rb: show the reason of why ignore tclConfig.sh/tkConfig.sh.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 02:46:47 +00:00
nagai b72256f91c * ext/tk/lib/tkextlib/tktable/tktable.rb: fix bug on arguments for Proc object.
* ext/tk/sample/scrollframe.rb: forgot a Module definition.

* ext/tk/extconf.rb: check unsupported version of tclConfig.sh/tkConfig.sh. It is because current Ruby/Tk doesn't support Tcl/Tk8.6.

* ext/tk/extconf.rb: change search step of Tcl/Tk libraries.

* ext/tk/lib/tk/namespace.rb: instance_exec() cannot accept a script string.

* ext/tk/lib/tk/msgcat.rb: bug fix on treating encodings. Now, ext/tk/sample/tkmsgcat-load_rb*.rb will work.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 15:44:25 +00:00
nobu 7566c49068 ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLIST
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
  argument list of rb_block_call_func.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 07:59:14 +00:00
a_matsuda da66677061 * lib/irb/notifier.rb: [Doc] Fix typo
* ext/json/lib/json/common.rb:  Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27 12:56:08 +00:00
tenderlove 599c3a9245 * ext/psych/lib/psych.rb: psych version 2.0.2
* ext/psych/psych.gemspec: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 22:14:34 +00:00
tenderlove 079ff69ca0 * ext/psych/lib/psych/scalar_scanner.rb: fix support for negative
years.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/test_date_time.rb: test for change.
  Fixes: https://github.com/tenderlove/psych/issues/168

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 21:41:48 +00:00
tenderlove 725d6f4970 * ext/psych/lib/psych/scalar_scanner.rb: fix regexp for matching TIME
strings.
* test/psych/test_date_time.rb: test for change.
  Fixes: https://github.com/tenderlove/psych/issues/171

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 19:48:03 +00:00
nobu 94f01c55df should not ignore the rest of recursive constructs
* array.c (rb_ary_hash): should not ignore the rest of recursive
  constructs.
* hash.c (rb_hash_hash): ditto.
* range.c (range_hash): ditto.
* struct.c (rb_struct_hash): ditto.
* test/-ext-/test_recursion.rb (TestRecursion): separate from
  test/ruby/test_thread.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 17:20:16 +00:00
ko1 8ca8d7afb3 * ext/objspace/object_tracing.c (newobj_i): skip class_path if class
is frozen.
  rb_class_path() can modify frozen classes (and causes errors).
  This patch is temporary. We need no-modification/no-allocation
  class path function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 10:26:41 +00:00
ko1 5b40cb6a2c * vm_trace.c: prohibit to specify normal events and internal events
simultaneously.
  I will introduce special care for internal events later.
* ext/-test-/tracepoint/tracepoint.c: test this behavior.
* test/-ext-/tracepoint/test_tracepoint.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 08:41:44 +00:00
tmm1 adcd0174b9 * ext/objspace/objspace_dump.c (dump_append_string_value): Escape
control characters for strict json parsers.
* ext/objspace/objspace_dump.c (objspace_dump): Document File/IO
  output option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 05:27:22 +00:00
nobu 78acdaca3c bigdecimal.gemspec: date
* ext/bigdecimal/bigdecimal.gemspec: revert Gem::Specification#date
  for snapshot/release tarballs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26 01:57:55 +00:00
tmm1 302743d3e7 * NEWS: Add ObjectSpace.after_gc_{start,end}_hook=
* ext/objspace/objspace_dump.c: [DOC] catch up dump/dump_all to r43679

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25 21:46:00 +00:00
zzak b514742374 * ext/bigdecimal/bigdecimal.gemspec: bump BigDecimal to 1.2.3 for
proper release date in RubyGems


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25 05:35:18 +00:00
zzak a7925537d4 * ext/bigdecimal/bigdecimal.gemspec: Remove Gem::Specification#date
We should rely on rubygems to create the date the gem was released
  for each version.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25 05:25:53 +00:00
tmm1 34176b023e * ext/objspace/objspace_dump.c: test fixes and win32 compatibility
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24 00:22:19 +00:00
mrkn 10ca8a4b07 * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
of FIX2INT to avoid conversion error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23 16:08:23 +00:00
mrkn b8bbc1a310 * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.E): Use BigMath.exp.
[Feature #6857] [ruby-core:47130]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23 10:52:40 +00:00
mrkn b09f41587c exp
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23 10:49:36 +00:00
mrkn 926960b01b * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): The signature was
changed to allow us to pass arguments directly.

* ext/bigdecimal/bigdecimal.c (BigDecimal_div3): Added for the role of
  the old BigDecimal_div2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23 10:36:40 +00:00
mrkn 909d14a1db * ext/bigdecimal/bigdecimal.c (BigDecimal_power):
Round the result value only if the precision is given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 13:31:26 +00:00
mrkn 4fb888211a * ext/bigdecimal/bigdecimal.gemspec: version 1.2.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 08:07:43 +00:00
mrkn 15185e875d * ext/bigdecimal/bigdecimal.c (BigDecimal_data_type):
Use RUBY_TYPED_FREE_IMMEDIATELY only if it is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 08:05:58 +00:00
mrkn 2043bb5c34 * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.
[Bug #8818] [ruby-core:56802]

* test/bigdecimal/test_bigdecimal.rb: Add a test for the above fix.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 07:52:17 +00:00
mrkn 5ff5938120 * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Insert rb_thread_check_ints.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 05:55:45 +00:00
mrkn 467c9ec3b7 * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix the inserting points
of RB_GC_GUARDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 05:54:05 +00:00
mrkn 4131c29f87 * ext/bigdecimal/bigdecimal.c: Fix indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 05:50:34 +00:00
nobu 5efbf8a44e * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 05:21:06 +00:00
naruse e103366645 * ext/nkf: merge nkf 2.1.3 2a2f2c5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 05:16:54 +00:00
nobu e71bb2c54e openssl/buffering.rb: call super
* ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#initialize):
  initialize of a module should pass arguments to super.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 03:17:16 +00:00
mrkn b6f664686e * ext/bigdecimal/bigdecimal.c (VpAlloc): Fix the expr to adjust the size
of the digit array.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 12:42:01 +00:00
mrkn ff3e585014 * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix the precision of
the result BigDecimal of sqrt.
  [Bug #5266] [ruby-dev:44450]

* test/bigdecimal/test_bigdecimal.rb: add tests for the above changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 12:37:46 +00:00
zzak 8a53b57584 * ext/digest/bubblebabble/bubblebabble.c: Teach RDoc digest/bubblebabble
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 07:53:39 +00:00
zzak f0dfcefa48 * ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
OpenSSL::Buffering which breaks overview because of RDoc bug


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 06:37:20 +00:00
zzak 1d8d8ff57f * ext/openssl/ossl_engine.c: [DOC] Documentation for OpenSSL::Engine
This patch is based off work by @vbatts in GH-436 completing the
  documentation for this class and its methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 04:37:14 +00:00
zzak 0c873e97da * ext/openssl/lib/openssl/buffering.rb: Remove unused arguments from
OpenSSL::Buffering.new [Fixes GH-445]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 01:46:48 +00:00
naruse 14cab32596 * ext/json: merge JSON 1.8.1.
002ac2771c...e09ffc0d7d
* Remove Rubinius exception since transcoding should be working now.
* Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
  Lafortune <github_rocks@marc-andre.ca>. Thanks!
* Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress
  warning with -Wchar-subscripts and better validate UTF-8 strings.
* Applied patch by ginriki@github to remove unnecessary if.
* Add load/dump interface to JSON::GenericObject to make
  serialize :some_attribute, JSON::GenericObject
  work in Rails active models for convenient
  SomeModel#some_attribute.foo.bar access to serialised JSON data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-20 02:55:08 +00:00
nobu 28849ce257 ext/rbconfig/sizeof: move to an extension library
* common.mk, ext/rbconfig/sizeof: move RbConfig::SIZEOF to an
  extension library to get rid of annoying nmake VPATH rule.

* inits.c (rb_call_inits), miniinit.c (Init_sizes): RbConfig::SIZEOF
  is no loger built-in.

* template/sizes.c.tmpl (Init_sizeof): rename initialization function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-18 14:19:16 +00:00
nobu 91aa8da578 objspace_dump.c: refine output
* ext/objspace/objspace_dump.c (dump_output): allow IO object as
  output, and use Tempfile.create and return open file instead of
  mkstemp() and path name for :file output.
  [ruby-core:58266] [Bug #9102]
* test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please):
  remove temporary output file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14 16:06:09 +00:00
nagachika 6cbe261626 * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of
Rational#to_d without argument. [Bug #8958]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14 14:40:53 +00:00
zzak af5e21292c * ext/thread/thread.c: [DOC] This patch accomplishes the following:
- Teach RDoc about ConditionVariable
  - Teach RDoc about Queue
  - Teach RDoc about SizedQueue
  - Use fully-qualified namespace for Document-method
    This is necessary to separate definitions between classes
  - Fix rdoc bug in call_seq vs. call-seq
  - Correct doc for SizedQueue#pop patch by @jackdanger [Bug #8988]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 17:37:47 +00:00
zzak 62d3853475 * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is required
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 16:12:32 +00:00
nagachika 18358ad8cd Squashed commit of the following:
commit 6895f38bfc3c0ad6bd212b8f9acc3c71384dfcb7
Author: Chikanaga Tomoyuki <nagachika00@gmail.com>
Date:   Thu Nov 14 00:14:00 2013 +0900

    * ChangeLog: fix a typo at r43666

    * ext/openssl/ossl_asn1.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 15:14:59 +00:00
zzak a369b7f7cb * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required
+precision+ argument for Rational#to_d [Bug #8958]
-This line, and those below, will be ignored--

M    ChangeLog
M    ext/bigdecimal/lib/bigdecimal/util.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 10:23:14 +00:00
zzak 4c1e390fa8 * ext/digest/*: [DOC] Fix several typos and broken http links.
Improved examples for Digest overview and fixed a broken example in
  Digest::HMAC overview. This patch also adds a description of
  Digest::SHA256.bubblebabble to the Digest overview.

  Patched by @stomar [Bug #9027]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 10:09:28 +00:00
zzak 1dd8260dfa * ext/openssl/ossl_config.c: [DOC] Document the following:
- OpenSSL::ConfigError
  - OpenSSL::Config::DEFAULT_CONFIG_FILE

  Patched by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 09:34:08 +00:00
zzak 49a9845405 * ext/openssl/ossl_asn1.c: [DOC] Document parts of
OpenSSL::ASN1::ObjectId included a fix for the class overview, which
  previously showed the documentation for Constructive due to missing
  ObjectId overview. This patch also includes a note for Primative.

  Based on a patch by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 09:06:17 +00:00
zzak 75cef5054b * ext/openssl/lib/openssl/config.rb: In #parse use +string+ for +str+
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:21:36 +00:00
zzak 33b63fcf93 * ext/openssl/lib/openssl/*.rb: [DOC] Document the following:
- Integer#to_bn
  - OpenSSL::Buffering module
  - Document deprecated OpenSSL::Digest::Digest compatibility class
  - OpenSSL::Config

  These changes were based on a patch by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:15:48 +00:00
nobu 2019f34bc9 io-console.gemspec: certification
* ext/io/console/io-console.gemspec: add a certification.
  http://www.benjaminfleischer.com/2013/11/08/how-to-sign-your-rubygem-cert/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:08:09 +00:00
tmm1 8f3934261a * internal.h: move common string/hash flags to include file.
* ext/objspace/objspace_dump.c: remove flags shared above.
* hash.c: ditto.
* string.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-11 09:39:13 +00:00
nobu 90b9996523 parse.y: remove "f" suffix [ruby-core:57966] [Feature #9042]
revert r42847 "test_string.rb: add test string encoding"

revert r42846 "parse.y: freeze in advance to reduce objects"

revert r42843 "parse.y: deduplicate frozen string literals"

revert r42780 "test_string.rb: yet another test"

revert r42779 "parse.y: valid suffix word only"

revert r42778 "test_string.rb: remove duplicated code"

revert r42775 "parse.y: force_encoding"

This reverts commit 93ea04ecec.

revert r42773 "Add frozen string literals"

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10 06:13:02 +00:00
nobu 00dab76f20 objspace_dump.c: fix declaration
* ext/objspace/objspace_dump.c (dump_output): fix declaration,
  mkstemp() needs a writable buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 13:34:53 +00:00
nari baf3cf128e * ext/objspace/object_tracing.c: use declarations in internal.h.
* ext/objspace/objspace.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 12:00:04 +00:00
nobu 671707b546 objspace_dump.c: fix portability issue
* ext/objspace/objspace_dump.c (dump_output): fix portability issue.
  mkstemp() may not be available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 06:16:58 +00:00
nobu 90feeb6ab9 objspace_dump.c: extract output option utilities
* ext/objspace/objspace_dump.c (dump_output, dump_result): extract
  output option utility functions from objspace_dump() and
  objspace_dump_all().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 06:16:53 +00:00
nobu a50bbcfecb objspace_dump.c: suppress warnings
* ext/objspace/objspace_dump.c (dump_object): remove unused variables,
  and cast size_t to long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 06:16:48 +00:00
nobu b60079fe95 objspace_dump.c: indent
* ext/objspace/objspace_dump.c: adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 06:16:42 +00:00
zzak c19118417e * ext/dl/cfunc.c: [DOC] fix typo in example [Bug #8944]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 05:29:59 +00:00
tmm1 d0d6e2ecfa * ext/objspace/object_tracing.c: Add experimental methods to dump
objectspace as json: ObjectSpace.dump_all and ObjectSpace.dump(obj).
These methods are useful for debugging reference leaks and memory growth
in large ruby applications. [Bug #9026] [ruby-core:57893] [Fixes GH-423]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08 17:06:55 +00:00
zzak 2cfdbd7d72 * ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stop
By @srawlins [Fixes GH-421] https://github.com/ruby/ruby/pull/421


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07 17:44:43 +00:00
tenderlove 9ae2651d19 * ext/psych/lib/psych/visitors/to_ruby.rb: process merge keys before
reviving objects. Fixes GH psych #168
* test/psych/test_merge_keys.rb: test for change
  https://github.com/tenderlove/psych/issues/168

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 19:15:40 +00:00
nobu 7f23534b1f pty.c: check error of seteuid
* ext/pty/pty.c (chfunc): check error of seteuid and return error
  message, to suppress unused-value warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 08:10:34 +00:00
ko1 d1674ef67b * gc.c: add support to estimate increase of oldspace memory usage.
This is another approach to solve an issue discussed at r43530.
  This feature is diabled as default.
  This feature measures an increment of memory consuption by oldgen
  objects. It measures memory consumption for each objects when
  the object is promoted. However, measurement of memory consumption
  is not accurate now. So that this measurement is `estimation'.
  To implement this feature, move memsize_of() function from
  ext/objspace/objspace.c and expose rb_obj_memsize_of().
  Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to
  measure memory size, so that we ignores T_DATA objects now.
  For example, some functions skip NULL check for pointer.
  The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature,
  and turned off as default.
  We need to compare 3gen GC and this feature carefully.
  (it is possible to enable both feature)
  We need a help to compare them.
* internal.h: expose rb_obj_memsize_of().
* ext/objspace/objspace.c: use rb_obj_memsize_of() function.
* cont.c (fiber_memsize): fix to check NULL.
* variable.c (autoload_memsize): ditto.
* vm.c (vm_memsize): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 04:51:01 +00:00
tenderlove 06c6dcee25 * ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when
testing if a string is binary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 18:25:57 +00:00
tenderlove e0c6dd91a4 * ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
not be considered to be binary.  Fixes Psych / GH 166
  https://github.com/tenderlove/psych/issues/166

* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 18:10:24 +00:00
ko1 c5e08b764e * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only use
safe functions during garbage collection such as xfree().
  On default, T_DATA objects are freed at same points as fianlizers.
  This approach protects issues such as reported by [ruby-dev:35578].
  However, freeing T_DATA objects immediately helps heap usage.
  Most of T_DATA (in other words, most of dfree functions) are safe.
  However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default
  for safety.
* cont.c: ditto.
* dir.c: ditto.
* encoding.c: ditto.
* enumerator.c: ditto.
* error.c: ditto.
* file.c: ditto.
* gc.c: ditto.
* io.c: ditto.
* iseq.c: ditto.
* marshal.c: ditto.
* parse.y: ditto.
* proc.c: ditto.
* process.c: ditto.
* random.c: ditto.
* thread.c: ditto.
* time.c: ditto.
* transcode.c: ditto.
* variable.c: ditto.
* vm.c: ditto.
* vm_backtrace.c: ditto.
* vm_trace.c: ditto.
* ext/bigdecimal/bigdecimal.c: ditto.
* ext/objspace/objspace.c: ditto.
* ext/stringio/stringio.c: ditto.
* ext/strscan/strscan.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 11:16:54 +00:00
akr a69756de67 * ext/readline/readline.c (readline_getc): Consider
NULL as input.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 03:09:00 +00:00
akr d3e84880ad * ext/-test-/file/depend, ext/-test-/postponed_job/depend,
ext/-test-/tracepoint/depend: New files for dependencies.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 12:36:23 +00:00
nobu 8f675f0b89 openssl: work around of dependency
* ext/openssl/depend (ossl.o): work around of dependency of
  thread_native.h, which depends on headers by THREAD_MODEL.
  [ruby-dev:47777]
* ext/openssl/extconf.rb: need THREAD_MODEL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 06:32:24 +00:00
akr 674f14a0bc * common.mk, ext/objspace/depend, ext/coverage/depend,
ext/-test-/debug/depend, ext/date/depend: Update dependencies.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 03:43:17 +00:00
akr d5dad14041 * ext/readline/readline.c: Include ruby/thread.h for
rb_thread_call_without_gvl2.
  (readline_rl_instream, readline_rl_outstream): Record FILE
  structures allocated by this extension.
  (getc_body): New function extracted from readline_getc.
  (getc_func): New function.
  (readline_getc): Use rb_thread_call_without_gvl2 to invoke getc_func.
  [ruby-dev:47033] [Bug #8749]
  (clear_rl_instream, clear_rl_outstream): Close FILE structure
  allocated by this extention reliably.  [ruby-core:57951] [Bug #9040]
  (readline_readline): Use clear_rl_instream and clear_rl_outstream.
  (readline_s_set_input): Set readline_rl_instream.
  (readline_s_set_output): Set readline_rl_outstream.
  (Init_readline): Don't call readline_s_set_input because
  readline_getc doesn't block other threads for any FILE structure now.

  [ruby-dev:47033] [Bug #8749] reported by Nobuhiro IMAI.
  [ruby-core:57951] [Bug #9040] reporeted by Eamonn Webster.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-27 12:04:14 +00:00
nobu 347e748bdd variable.c: real class name
* variable.c (rb_class2name): should return real class name, not
  singleton class or iclass.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 20:24:30 +00:00
nobu d51f0dde89 bug_reporter.c: suppress warnings
* ext/-test-/bug_reporter/bug_reporter.c (sample_bug_reporter): cast
  via uintptr_t to suppress warning cast between pointer and different
  size integer by gcc 4.8.

* ext/-test-/bug_reporter/bug_reporter.c (register_sample_bug_reporter):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 12:49:16 +00:00
ko1 3f28280782 * ext/objspace/object_tracing.c (newobj_i): fix memory leak.
There is possibility to remain info due to missing FREEOBJ event.
  FREEOBJ events are skipped while suppress_tracing state, for example,
  during trace events are invoking.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 05:07:21 +00:00
nobu 6944271c0d bug_reporter.c: suppress warnings
* ext/-test-/bug_reporter/bug_reporter.c (register_sample_bug_reporter):
  cast to suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 01:38:04 +00:00
nobu dee91b534a * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 01:10:35 +00:00
ko1 3304eb208a * ext/objspace/object_tracing.c (newobj_i): add workaround.
some bugs hits this check.
* ext/objspace/object_tracing.c (object_allocations_reporter_i): cast as pointer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 23:09:41 +00:00
zzak 86c24c4430 * ext/curses/curses.c: [DOC] Cleaned up formatting consistency of rdoc
comments for Curses, including period spacing and column width.

  This patch also fixed some typos. Thanks to @postmodern for the patch!
  [Fixes GH-420] https://github.com/ruby/ruby/pull/420


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 22:12:43 +00:00
zzak ccc78addd2 * ext/date/date_core.c: [DOC] plural grammar fixed by @scott113341
Contributed via documenting-ruby.org: documenting-ruby/ruby#16
  https://github.com/documenting-ruby/ruby/pull/16


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 22:01:27 +00:00
zzak 64afa78e8a * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprah
[Fixes GH-418] https://github.com/ruby/ruby/pull/418 based on the
  original discussion from documenting-ruby/ruby#18


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 20:54:23 +00:00
ko1 17e1c7237b * ext/objspace/object_tracing.c: add new method
ObjectSpace.trace_object_allocations_debug_start for GC debugging.
  If you encounter the BUG "... is T_NONE" (and so on) on your
  application, please try this method at the beggining of your app.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 20:21:04 +00:00
zzak 8ead78806c * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 13:36:19 +00:00
ko1 955a38da08 * error.c, internal.h (rb_bug_reporter_add): add a new C-API.
rb_bug_reporter_add() allows to register a function which
  is called at rb_bug() called.
* ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
* ext/-test-/bug_reporter/extconf.rb: ditto.
* test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 08:39:39 +00:00
ko1 ede6826186 * ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.
ObjectSpace.reachable_objects_from_root returns all objects refered
  from root (called "root objects").
  This feature is for deep object analysis.
* test/objspace/test_objspace.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 06:13:41 +00:00
nobu 3976eb12ff mkmf.rb: fix framework option
* lib/mkmf.rb (have_framework): should append framework options to
  $LIBS, not $LDFLAGS.  the former is propagated to exts.mk when
  enable-static-linked-ext.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-14 02:07:51 +00:00
ko1 33ab98f9e6 * ext/objspace/gc_hook.c: prohibit reentrant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 09:13:18 +00:00
ko1 b753b9606e * include/ruby/debug.h,
vm_backtrace.c (rb_profile_frame_full_label): add new C API
  rb_profile_frame_full_label() which returns label with
  qualified method name.
  Note that in future version of Ruby label() may return
  same return value of full_label().
* ext/-test-/debug/profile_frames.c,
  test/-ext-/debug/test_profile_frames.rb: fix a test for this change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09 00:21:51 +00:00
ko1 cff2b2b666 * vm_backtrace.c, include/ruby/debug.h: add new APIs
* VALUE rb_profile_frame_method_name(VALUE frame)
* VALUE rb_profile_frame_qualified_method_name(VALUE frame)
* iseq.c (rb_iseq_klass), internal.h: add new internal function
  rb_iseq_method_name().
* ext/-test-/debug/profile_frames.c (profile_frames),
  test/-ext-/debug/test_profile_frames.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08 12:08:20 +00:00
ko1 ef7df5a414 * ext/-test-/debug/profile_frames.c:
test/-ext-/debug/test_profile_frames.rb: add a test for new C-APIs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 07:35:21 +00:00
zzak 8015397318 * ext/dbm/dbm.c: [DOC] Fix wrong constant name in DBM by @edward
[Fixes GH-409] https://github.com/ruby/ruby/pull/409


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-04 10:56:27 +00:00
nobu 13e60f2bff * ext/thread/thread.c (ALIAS_GLOBAL_CONST): fix typo, GLOBCAL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 18:20:17 +00:00
nobu cb2b598024 * ext/thread/thread.c (Init_thread): move outer module condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 18:20:14 +00:00
mame a6ae6a8b17 * ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.
When a system had no interface, this function used xmalloc for root
  but did not return any reference to it.  This patch fixes it by
  immediately returning an empty array if no interface is found.
  Coverity Scan found this bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 12:41:28 +00:00
nobu 85ab537999 file/stat.c: fix commit miss
* ext/-test-/file/stat.c: extension library to test [Feature #8050].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01 11:57:02 +00:00
zzak e1bb07105f * ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formatting
issues and several duplicate grammar bugs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 14:15:41 +00:00
zzak 8073bd792c * ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix
small grammar typo


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 14:02:31 +00:00
ko1 1d4e3d48c2 * ext/objspace/object_tracing.c: [DOC] add some nots for
ObjectSpace::trace_object_allocations.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 08:29:30 +00:00
ko1 1450e0b5ac * ext/objspace/object_tracing.c: add new 3 methods to control tracing.
* ObjectSpace::trace_object_allocations_start
* ObjectSpace::trace_object_allocations_stop
* ObjectSpace::trace_object_allocations_clear
  And some refactoring.
* test/objspace/test_objspace.rb: add a test for new methods.
* NEWS: add a description for new methods.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 08:17:30 +00:00
nobu 771c8ed338 parse.y: fix inconsistency with literals
* parse.y (rb_id_attrset): fix inconsistency with literals, allow
  ID_ATTRSET and return it itself, but ID_JUNK cannot make ID_ATTRSET.
  and raise a NameError instead of rb_bug() for invalid argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-29 13:56:33 +00:00
shugo 2328b4b29a * ext/curses/extconf.rb: check the size of chtype.
* ext/curses/curses.c (NUM2CH, CH2NUM): use proper macros for
  the size of chtype.

[ruby-core:56090] [Bug #8659]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-27 15:26:19 +00:00
zzak 8603fdcc62 * ext/bigdecimal/bigdecimal.c: [DOC] several fixes by @chastell
This includes fixing the capitalization of Infinity, return value of
  example "BigDecimal.new('NaN') == 0.0", and code style in example.
  [Fixes GH-398] https://github.com/ruby/ruby/pull/398


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:13:59 +00:00
zzak 017a975ec2 * ext/digest/digest.c: [DOC] typo in overview by @chastell
[Fixes GH-399] https://github.com/ruby/ruby/pull/399


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:04:27 +00:00
zzak 12fdf4bc92 * ext/openssl/ossl.c: [DOC] typo in example by @zoranzaric
[Fixes GH-401] https://github.com/ruby/ruby/pull/401


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:01:54 +00:00
nobu 360c66732c win32/registry.rb: size in bytes
* ext/win32/lib/win32/registry.rb (Win32::Registry#write): data size
  is in bytes, not chars.  terminators should be placed automatically.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:41:17 +00:00
nobu 79e880c90d win32/registry.rb: encode name
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): encode
  name.
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_key): ditto.
* ext/win32/lib/win32/registry.rb (Win32::Registry#export_string):
  encode to locale encoding if default internal is not set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:39:41 +00:00
nobu 14695c4c1a win32/registry.rb: fix runtime errors
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumKey):
  size of the name is in WCHARs, not in bytes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:35:12 +00:00
nobu aaccbfeda1 win32/registry.rb: fix runtime errors
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): need
  Constants.
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue):
  size of the name is in WCHARs, not in bytes

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 03:51:14 +00:00
nobu 645257261e tracepoint.c: no empty initializer list
* ext/-test-/tracepoint/tracepoint.c (tracepoint_track_objspace_events):
  C89 disallows empty initializer lists.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-23 08:47:52 +00:00
nobu f856c1237b tracepoint.c: wrap data in a struct
* ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): wrap
  tracepoint tracking data in a struct to be placed on the stack.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-22 20:10:40 +00:00
ktsj d2f4e701f8 * ext/-test-/tracepoint/tracepoint.c (Init_tracepoint): prevent from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-22 11:37:08 +00:00
zzak 0f448061de * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
Based on a patch by Rafal Lisowski [Bug #7348]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 15:24:03 +00:00
zzak 40424c2600 * ext/psych/yaml/yaml.h: [DOC] merge upstream typo fix by @GreenGeorge
https://github.com/tenderlove/psych/pull/161


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 14:51:35 +00:00
nobu aba824fece parse.y: junk sigil only names
* parse.y (intern_str): sigil only names are junk, at least one
  identifier character is needed.  [ruby-dev:47723] [Bug #8928]
* parse.y (rb_enc_symname_type): fix out of bound access.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 06:01:57 +00:00
akr 035917adc1 * ext/-test-/printf/printf.c (printf_test_call): Fix an end of buffer
argument.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 05:16:13 +00:00
nobu 831fe26dec ext/-test-/symbol: move upward
* ext/-test-/symbol/extconf.rb: move the extension object file upward.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 04:53:11 +00:00
nobu 170344b20e vsnprintf.c: initialize cp
* vsnprintf.c (BSD_vfprintf): initialize cp so that size is 0 in the
  commented case.  fix an accidental bug at r16716.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-19 07:25:09 +00:00
tenderlove fed428007c updating psych version
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-18 22:17:15 +00:00
glass 0e7c28a1c3 * ext/socket/mkconstants.rb: define MSG_FASTOPEN.
[ruby-core:57138] [Feature #8897]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-15 15:48:38 +00:00
nobu 3f78d84661 Eliminate less-than-zero checks for unsigned variables
* ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c,
  ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c:
  Eliminate less-than-zero checks for unsigned variables.
  According to section 4.1.5 of C89 standard, size_t is an unsigned
  type.  These checks were found with 'cppcheck' static analysis tool.
  [ruby-core:57117] [Feature #8890]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-12 13:37:11 +00:00
akr 888e5cbbe7 * process.c: Remove spaces between SI prefix and unit to follow
SI brochure.
  http://www.bipm.org/en/si/si_brochure/
  https://www.nmij.jp/library/units/si/

* time.c: Ditto.

* ext/socket/ancdata.c: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-09 12:33:36 +00:00
nobu 3fa0edda05 rat.c: suppress warning
* ext/-test-/rational/rat.c (big): used only if GMP is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-08 10:52:52 +00:00
suke 04976ab678 * ext/win32ole/win32ole.c (folevariant_initialize): check type of
element of array.

* test/win32ole/test_win32ole_variant.rb (test_s_new_ary): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-08 05:06:20 +00:00
nobu 6bca9dc372 thread.c: invert
* ext/thread/thread.c (queue_pop_should_block): the first argument of
  Queue#pop is non_block and inverted for should_block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-07 19:04:39 +00:00
nobu 398c3cab6d thread.c: function cast
* ext/thread/thread.c (queue_sleep): get rid of casting function
  pointer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-07 19:04:37 +00:00
akr dd946739dd * ext/socket/mkconstants.rb (TCP_FASTOPEN): Defined for TCP fast open.
[ruby-core:57048] [Feature #8871] patch by Masaki Matsushita.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-07 01:41:47 +00:00
glass e334bb2ce5 * common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can't
require extension libraries. The patch is from nobu
  (Nobuyoshi Nakada).

* ext/thread/extconf.rb: for build ext/thread/thread.c.

* include/ruby/intern.h: ditto.

* thread.c: ditto.

* lib/thread.rb: removed and replaced by ext/thread/thread.c.

* ext/thread/thread.c: Queue, SizedQueue and ConditionVariable
  implementations in C. This patch is based on patches from panaggio
  (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and  ko1
  (Koichi Sasada). [ruby-core:31513] [Feature #3620]

* test/thread/test_queue.rb (test_queue_thread_raise): add a test for
  ensuring that killed thread should be removed from waiting threads.
  It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06 15:15:07 +00:00
akr 42a3e0dc55 * rational.c: Include gmp.h if GMP is used.
(GMP_GCD_DIGITS): New macro.
  (rb_gcd_gmp): New function.
  (f_gcd_normal): Renamed from f_gcd.
  (rb_gcd_normal): New function.
  (f_gcd): Invoke rb_gcd_gmp or f_gcd_normal.

* internal.h (rb_gcd_normal): Declared.
  (rb_gcd_gmp): Ditto.

* ext/-test-/rational: New directory.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06 12:07:08 +00:00
tenderlove 8579a33966 * ext/psych/lib/psych/visitors/yaml_tree.rb: use double quotes when
strings start with special characters.
  [Fixes GH-157] https://github.com/tenderlove/psych/issues/157

* test/psych/test_string.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-05 17:39:53 +00:00
akr b1b395911c * bignum.c (GMP_DIV_DIGITS): New macro.
(bary_divmod_gmp): New function.
  (rb_big_divrem_gmp): Ditto.
  (bary_divmod_branch): Ditto.
  (bary_divmod): Use bary_divmod_branch.
  (bigdivrem): Ditto.

* internal.h (rb_big_divrem_gmp): Declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-04 23:22:27 +00:00
akr 8f8bf8243d * bignum.c (rb_big_divrem_normal): New function.
* internal.h (rb_big_divrem_normal): Declared.

* ext/-test-/bignum/div.c: New file.

* test/-ext-/bignum/test_div.rb: New file.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-04 16:10:06 +00:00
akr 2583689340 * bignum.c (GMP_STR2BIG_DIGITS): New macro.
(str2big_gmp): New function.
  (rb_cstr_to_inum): Use str2big_gmp for big bignums.
  (rb_str2big_gmp): New function.

* internal.h (rb_str2big_gmp): Declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 11:20:02 +00:00
usa 1b126277ed * ext/win32/lib/win32/registry.rb (Win32::Registry#values): added.
[Feature #7763] [ruby-core:51783]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 10:46:58 +00:00
akr 0b2413b471 * bignum.c (rb_str2big_poweroftwo): New function.
(rb_str2big_normal): Ditto.
  (rb_str2big_karatsuba): Ditto.

* internal.h (rb_str2big_poweroftwo): Declared.
  (rb_str2big_normal): Ditto.
  (rb_str2big_karatsuba): Ditto.

* ext/-test-/bignum/str2big.c: New file.

* test/-ext-/bignum/test_str2big.rb: New file.

* ext/-test-/bignum/depend: Add the dependency for str2big.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 03:50:15 +00:00
akr 1df73dd9ad Reduce NUM2INT invocations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 03:36:18 +00:00