summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
2016-06-08string.c (rb_str_ascii_casemap): fix compile error.kazu
error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-08* string.c: Revert previous commit (possibility of endless loop).duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-08* string.c: Special-case :ascii option in rb_str_upcase_bang.duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-08* string.c: New static function rb_str_ascii_casemap; special-casingduerst
:ascii option in rb_str_upcase_bang and rb_str_downcase_bang. * regenc.c: Fix a bug (wrong use of unnecessary slack at end of string). * regenc.h -> include/ruby/oniguruma.h: Move declaration of onigenc_ascii_only_case_map so that it is visible in string.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07* string.c (rb_str_upcase_bang, rb_str_capitalize_bang,duerst
rb_str_swapcase_bang): Switch to use primitive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07* string.c (rb_str_downcase_bang): Switch to use primitive except ifduerst
conversion can be done ASCII-only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-06* string.c: Added UTF-16BE/LE and UTF-32BE/LE to supported encodingsduerst
for Unicode case mapping. * test/ruby/enc/test_case_comprehensive.rb: Tests for above functionality; fixed an encoding issue in assertion error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-06* string.c Change rb_str_casemap to use encoding primitiveduerst
case_map instead of directly calling onigenc_unicode_case_map. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-05* string.c: Remove :lithuanian guard for Unicode case mapping.duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-04crypt.h: remove initializednobu
* missing/crypt.h (struct crypt_data): remove unnecessary member "initialized". * missing/crypt.c (des_setkey_r): nothing to be initialized in crypt_data. * configure.in (struct crypt_data): check for "initialized" in struct crypt_data, which may be only in glibc, and isn't on AIX at least. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-02* string.c: Raise ArgumentError when invalid string is detected induerst
case mapping methods. * enc/unicode.c: Check for invalid string and signal with negative length value. * test/ruby/enc/test_case_mapping.rb: Add tests for above. * test/ruby/test_m17n_comb.rb: Add a message to clarify test failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-01string.c: fallback to crypt_rnobu
* string.c: prefer crypt_r to crypt iff system crypt nor crypt_r are not provided. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-01use system cryptnobu
* configure.in: revert r55237. replace crypt, not crypt_r, and check if crypt is broken more. * missing/crypt.c: move crypt_r.c * string.c (rb_str_crypt): use crypt_r if provided by the system. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-01use crypt_rnobu
* string.c (rb_str_crypt): use reentrant crypt_r. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-31Revert r55225naruse
Run test-all before large commit: "* string.c: Activate full Unicode case mapping for UTF-8 by removing" This reverts commit 3fb0fcd1e881c1f6dd74db73a64e8623208acb77. http://rubyci.s3.amazonaws.com/centos5-64/ruby-trunk/log/20160531T013303Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-31* string.c: Activate full Unicode case mapping for UTF-8 by removingduerst
the protective check for the presence of an option. Update documentation. * test/ruby/enc/test_case_comprehensive.rb: Adjust tests for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30* string.c: Document current behavior for other case mapping methodsduerst
on String. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30* string.c: Document current situation for String#downcase. [ci skip]duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30string.c: return reallocated pointernobu
* string.c (str_fill_term): return new pointer reallocated by filling terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30string.c: get rid of unnecessary empty stringnobu
* string.c (str_substr, rb_str_aref): refactor not to create unnecessary empty string. * string.c (str_byte_substr, str_byte_aref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30string.c: check in the ordernobu
* string.c (rb_str_aref_m, rb_str_byteslice): check arguments in the left-to-right order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27transcode.c: scrub in the given encodingnobu
* transcode.c (str_transcode0): scrub in the given encoding when the source encoding is given, not in the encoding of the receiver. [ruby-core:75732] [Bug #12431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18string.c: integer overflownobu
* string.c (rb_str_modify_expand): check integer overflow. [ruby-core:75592] [Bug #12390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18ruby.h: RB_INTEGER_TYPE_Pnobu
* include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and underlying inline function to check if the object is an Integer (Fixnum or Bignum). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* configure.in: check function attirbute const and pure,naruse
and define CONSTFUNC and PUREFUNC if available. Note that I don't add those options as default because it still shows many false-positive (it seems not to consider longjmp). * vm_eval.c (stack_check): get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-05* string.c (rb_str_sub): Fix a special match variable name.yui-knk
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-03* string.c (count_utf8_lead_bytes_with_word): Use __builtin_popcountnaruse
only if it can use SSE 4.2 POPCNT whose latency is 3 cycle. * internal.h (rb_popcount64): use __builtin_popcountll because now it is in fast path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02string.c: shortcutnobu
* string.c (rb_str_concat): shortcut concatenation to ASCII-8BIT as well as US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02string.c: fix docnobu
* string.c (rb_str_concat): [DOC] fix the indefinite article, for replacement from Fixnum to Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02string.c: fix bracesnobu
* string.c (search_nonascii): fix braces unmatched by a preprocessing condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01fix mixed declaration on non UNALIGNED_WORD_ACCESSnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01fix for where UNALIGNED_WORD_ACCESS is not allowednaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01Use WORDS_BIGENDIANnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30* string.c (search_nonascii): use nlz on big endian environments.naruse
* internal.h (nlz_intpr): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30More optimization for r54854's search_nonasciinaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30* string.c (search_nonascii): unroll and use ntznaruse
* configure.in (__builtin_ctz): check. * configure.in (__builtin_ctzll): check. * internal.h (rb_popcount32): defined for ntz_int32. it can use __builtin_popcount but this function is not used on GCC environment because it uses __builtin_ctz. When another function uses this, using __builtin_popcount should be re-considered. * internal.h (rb_popcount64): ditto. * internal.h (ntz_int32): defined for ntz_intptr. * internal.h (ntz_int64): defined for ntz_intptr. * internal.h (ntz_intptr): defined as ntz for uintptr_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-05string.c: rb_str_concat_literalsnobu
* string.c (rb_str_concat_literals): concatenate literal string fragments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21string.c: skip invalid char gapnobu
* string.c (enc_succ_alnum_char): try to skip an invalid character gap between GREEK CAPITAL RHO and SIGMA. [ruby-core:74478] [Bug #12204] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-18string.c: Symbol#matchnobu
* string.c (sym_match_m): delegate to String#match but not String#=~. [ruby-core:72864] [Bug #11991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-17string.c: fix rb_str_initnobu
* string.c (rb_str_init): fix segfault and memory leak, consider wide char encoding terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-17Additional fix and tests for r53851naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-17remove unnecessary declaration so that rdoc worksnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-17fix rubyspec error from r53850naruse
http://rubyci.s3.amazonaws.com/tk2-243-31075/ruby-trunk/log/20160217T061402Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-17* string.c (rb_str_init): introduce String.new(capacity: size)naruse
[Feature #12024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08* string.c, enc/unicode.c: Disassociating ONIGENC_CASE_FOLD flag fromduerst
ONIGENC_CASE_DOWNCASE. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08string.c: remove magic numbernobu
* string.c (rb_str_dump): share same string literal instead of a magic number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08string.c: use encoding indexnobu
* string.c (rb_external_str_with_enc, rb_str_concat, rb_str_dump): use encoding index as shortcut without rb_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04fstring_enc_newnobu
* string.c (rb_fstring_enc_new, rb_fstring_enc_cstr): functions to make fstring with encoding. * re.c (rb_reg_initialize): make fstring without copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-03* string.c (str_new_frozen): if the given string is embeddedablenaruse
but not embedded, embed a new copied string. [Bug #11946] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02* re.c: Introduce RREGEXP_PTR.naruse
patch by dbussink. partially merge https://github.com/ruby/ruby/pull/497 * include/ruby/ruby.h: ditto. * gc.c: ditto. * ext/strscan/strscan.c: ditto. * parse.y: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e