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

32681 Коммитов

Автор SHA1 Сообщение Дата
nobu ef82e52776 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 03:52:22 +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
akr bc3d736f43 * process.c (rb_clock_gettime): Support times() based monotonic clock.
(rb_clock_getres): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 03:10:41 +00:00
akr c048ad23b6 * bignum.c (str2big_scan_digits): Extracted from rb_cstr_to_inum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 03:03:32 +00:00
usa 736f97b278 * win32/win32.c (rb_w32_select_with_thread): rounding up the fraction of
tv_usec instead of rounding down.
  this change is an experiment to get rid of failures on vc10-x64 CI.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 02:28:14 +00:00
usa 61ce3f5744 * win32/win32.c (do_select): constify timeout.
* win32/win32.c (rb_w32_select_with_thread): constify 10ms wait and
  0ms wait structs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 02:02:05 +00:00
nobu f7754943be internal.h: parenthesize argument
* internal.h (bit_length): parenthesize cast operands of a macro
  argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 01:17:36 +00:00
usa 6d18cc288a * test/openssl/test_pair.rb
(OpenSSL::TestPair#test_write_nonblock_no_exceptions): on some CIs
  such as Debian 6.0, Ubuntu 10.04, CentOS and vc10-x64 (maybe depend
  on OpenSSL version), writing to SSLSocket after SSL_ERROR_WANT_WRITE
  causes SSL_ERROR_SSL "bad write retry".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 01:08:09 +00:00
naruse 853c346dde * enc/trans/utf8_mac-tbl.rb: update conversion table to recent OS X.
Previous table is used on Mac OS X 10.1 or prior.
  This table is used on 10.2 or later. [ruby-dev:47680]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 23:36:01 +00:00
knu c68596aef1 Retain behavior of Numeric#step when nil is given as second argument.
* numeric.c (NUM_STEP_SCAN_ARGS): On sencond thought, keep
  Numeral#step backward compatible in that it raises TypeError
  when nil is given as second argument.

* test/ruby/test_float.rb (TestFloat#test_num2dbl): Revert.

* test/ruby/test_numeric.rb (TestNumeric#test_step): Fix test
  cases for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 22:54:58 +00:00
akr 0c3d124571 * bignum.c (bytes_2comp): Define it only for little endian
environment.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 22:41:07 +00:00
knu 7cc26c722c Fix and add tests for Numeric#step.
* test/ruby/test_float.rb (TestFloat#test_num2dbl): Allow nil as
  step, as with the keyword argument.

* test/ruby/test_numeric.rb (TestNumeric#test_step): Add tests for
  nil as step or limit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 22:39:24 +00:00
knu 4993cf9e24 Numeral#step should raise TypeError if a non-numeric parameter is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 22:39:22 +00:00
akr 3065dd71e8 * internal.h (bit_length): Add casts to fix complation error with
clang 3.0 -Werror,-Wshorten-64-to-32.
  [ruby-dev:47687] reported by SASADA Koichi.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 22:29:48 +00:00
svn 69d0f84bfa * 2013-09-03
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 18:21:21 +00:00
ko1 41234c5ca3 * vm_insnhelper.c (vm_search_super_method): use ci->argc instead of
ci->orig_argc. ci->argc can be changed by splat arguments.
  [ruby-list:49575]
  This fix should be applied to Ruby 2.0.0 seriese.
* test/ruby/test_super.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 18:21:13 +00:00
knu fd4b5b8dc8 Enhance Numeric#step.
* numeric.c (num_step): Default the limit argument to infinity and
  allow it to be omitted.  Keyword arguments (by: and to:) are
  introduced for ease of use. [Feature #8838] [ruby-dev:47662]
  [ruby-dev:42194]

* numeric.c (num_step): Optimize for infinite loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 14:56:06 +00:00
nobu a94833eb50 test_string.rb: yet another test
* test/ruby/test_string.rb (TestString#test_frozen_string_adjacent):
  option is allowed after the last string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 14:56:03 +00:00
nobu 306cf3ac03 parse.y: valid suffix word only
* parse.y (parser_str_options): use valid suffix word only, as well as
  numeric literal, for the backward comatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 14:46:25 +00:00
nobu 57d06d7b3f test_string.rb: remove duplicated code
* test/ruby/test_string.rb (TestString#test_frozen_dstring): remove
  duplicated assertion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 14:33:56 +00:00
akr 1d7611ff48 * bignum.c (ISDIGIT): Unused macro removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 13:56:23 +00:00
akr 5f61a592e9 * bignum.c (str2big_poweroftwo): Extracted from rb_cstr_to_inum.
(str2big_normal): Ditto.
  (str2big_karatsuba): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 13:52:05 +00:00
nobu 93ea04ecec parse.y: force_encoding
* parse.y (str_suffix_gen): String#b creates new string object, use
  force_encoding instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 08:53:40 +00:00
charliesome a056098cb7 * NEWS: Add note about frozen string literals
* compile.c (case_when_optimizable_literal): optimize NODE_LIT strings
  in when clauses of case statements

* ext/ripper/eventids2.c: add tSTRING_SUFFIX

* parse.y: add 'f' suffix on string literals for frozen strings

* test/ripper/test_scanner_events.rb: add scanner tests

* test/ruby/test_string.rb: add frozen string tests

[Feature #8579] [ruby-core:55699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 07:11:41 +00:00
knu 78c75d91ae Add forgotton [DOC].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 05:48:36 +00:00
knu 1b4addb445 Process#setproctitle,argv0: Fix and improve rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 05:42:02 +00:00
mrkn 01983c97a9 * NEWS: fix description of number literal suffixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 05:16:39 +00:00
charliesome 0732ed367c * test/rake/test_rake_rules.rb: add space after string literal to
prevent conflict with string options syntax "foo"opts

* test/rss/rss-assertions.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 05:08:20 +00:00
akr dd9c8b88af * test/ruby/test_bignum.rb (test_interrupt_during_to_s): Disable it
when GMP is used.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 03:29:16 +00:00
akr 0effd06122 * bignum.c (Init_Bignum): Define Bignum::GMP_VERSION when GMP is used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 22:04:35 +00:00
akr c48e169fb9 * bignum.c (big2str_generic): Reduce arguments.
(big2str_gmp): Ditto.
  (rb_big2str1): Follow the above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 16:47:20 +00:00
akr a3e3cce183 Fix funciton name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 16:06:20 +00:00
svn 0b8c55f7f3 * 2013-09-02
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 15:09:12 +00:00
akr 8a108ffc21 * process.c (get_mach_timebase_info): Extracted from rb_clock_gettime.
(rb_clock_gettime): Use get_mach_timebase_info.
  (rb_clock_getres): Support MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 15:09:06 +00:00
akr b64c2c348f * bignum.c (GMP_BIG2STR_DIGITS): New constant.
(big2str_gmp): New function.
  (rb_big2str1): Use big2str_gmp for big bignums.

* internal.h (rb_big2str_gmp): Declared.

* ext/-test-/bignum/big2str.c (big2str_gmp): New method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 14:34:53 +00:00
akr 4dd7a13a0a * bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of
mpz_inits and mpz_clears.
  Older GMP don't have them.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 13:38:49 +00:00
akr 28130c1c63 * test/net/http/test_http.rb (test_bind_to_local_port): Choose an open
port more reliably.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 12:19:15 +00:00
nobu ed5de3814a * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 11:38:40 +00:00
akr 7dd1604603 * bignum.c (big2str_base_poweroftwo): Renamed from
big2str_base_powerof2.
  (rb_big2str_poweroftwo): New function for test.
  (big2str_generic): Extracted from rb_big2str1.
  (rb_big2str_generic): New function for test.

* internal.h (rb_big2str_poweroftwo): Declared.
  (rb_big2str_generic): Ditto.

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

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



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 11:35:57 +00:00
nobu cec97f40f6 process.c: suppress warning
* process.c (rb_clock_getres): move conditionally used variable to the
  proper block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 09:04:10 +00:00
akr 34004844cd * bignum.c (big2str_2bdigits): Renamed from big2str_orig.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 06:21:52 +00:00
akr 6fe40011a8 * bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion,
SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 04:03:32 +00:00
akr c9b3571ceb * bignum.c (maxpow_in_bdigit): Removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 02:39:05 +00:00
akr e8d8e0696f Add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 01:57:45 +00:00
akr 77f245e62e * numeric.c (rb_fix_bit_length): Moved from bignum.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 01:31:16 +00:00
akr a0a0b61b68 [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 01:00:15 +00:00
akr 7bb549d6b5 * internal.h (bit_length): Moved from bignum.c.
(nlz_int): Ditto.
  (nlz_long): Ditto.
  (nlz_long_long): Ditto.
  (nlz_int128): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 00:57:00 +00:00
akr 8bd7af6794 * bignum.c (bit_length): Renamed from bitsize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31 18:34:42 +00:00
akr 4ac5f5710e updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31 15:12:39 +00:00