summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2016-06-02ruby.h: reduce repeated calcuationsnobu
* include/ruby/ruby.h (rb_scan_args_{hash,block}_idx): reduce repeated index calcuations. * include/ruby/ruby.h (rb_scan_args_end_idx): unused right now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28* addr2line.c: drop to support ATARI ST platform. It was discontinuedhsbt
more than two decades ago. [fix GH-1350] Patch by @cremno * include/ruby/ruby.h: ditto. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27fix non-static rb_scan_argsnobu
* include/ruby/ruby.h (rb_scan_args): remove nul padding which caused syntax error if fmt is not a string literal. * include/ruby/ruby.h (rb_scan_args_verify): suppress array-bounds warnings by old clang. * include/ruby/ruby.h (rb_scan_args0): make extractor macros inline functions, which do not varidate the format and are unnecessary to be expanded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27ruby.h: fix parameter namenobu
* include/ruby/ruby.h (rb_scan_args): fix macro parameter name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26ruby.h: fix for old clangnobu
* include/ruby/ruby.h (rb_scan_args): add nul padding here to apply to all references. * include/ruby/ruby.h (rb_scan_args_verify): move length mismatch check outside conditional operators. Since old clang cannot optimize away string literal dereference by an immediate index, e.g., ""[0], and both of true and false side expressions are compiled and warned unintentionally. With such old compilers, the check in rb_scan_args() does not work but may result unpredictable value if the format is wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26ruby.h: suppress warningsnobu
* include/ruby/ruby.h (rb_scan_args_count): add filler nul bytes to suppress array-bounds warnings by old clang. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26ruby.h: count and verifynobu
* include/ruby/ruby.h (rb_scan_args_count): verify length with counting variables together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26revert r55171nobu
Revert r55171, "ruby.h: fix clang warnings", it did fix array-bounds warnings, but caused string-plus-int warnings instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26ruby.h: fix clang warningsnobu
* include/ruby/ruby.h (rb_scan_args0): use pointer dereference forms instead of array forms, to get rid of warnings by clang. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25ruby.h: rb_scan_args_validatenobu
* include/ruby/ruby.h (rb_scan_args_validate): move failed condition to the terminal. [ruby-core:75714] [Bug #12426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24ruby.h: optimize rb_scan_args_setnobu
* include/ruby/ruby.h (rb_scan_args_set): check the arity after adjusting argc for an option hash, for optimization in simpler cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24ruby.h: rb_scan_args_verifynobu
* include/ruby/ruby.h (rb_scan_args_verify): verify the format to scan if no invalid chars and variable argument length matching, at the compile time if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24defines.h: fallback ERRORFUNC and WARNINGFUNCnobu
* include/ruby/defines.h (ERRORFUNC, WARNINGFUNC): add fallback definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23missing.h: isfinitenobu
* include/ruby/missing.h (isfinite): move from numeric.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23revert error attributesnobu
* include/ruby/ruby.h (rb_scan_args0): revert error attributes, which may not be optimized away in readline extension library. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23make compile error if possiblenobu
* include/ruby/ruby.h (rb_scan_args0): make compile error if the format is wrong or does not match with the variable argument length if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23fatal error if variable argument length mismatchnobu
* include/ruby/ruby.h (rb_scan_args0): raise fatal error if variable argument length does not match, it is a bug in the code which uses rb_scan_args, not a runtime error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 * include/ruby/oniguruma.h: Extend OnigEncodingTypeDefine to define aduerst
new encoding primitive 'case_map' for case mapping * enc/utf-8.c, utf_16be/le.c, utf_32be/le.c: add onigenc_unicode_case_map as case_map primitive * enc/ascii.c, big5.c, cp949.c, emacs_mule.c, euc_jp/kr/tw.c, gb18030.c, gbk.c, iso_8859_1/2/3/4/5/6/7/8/9/10/11/13/14/15/16.c, koi8_r/u.c, shift_jis.c, us_ascii.c, windows_1250/1251/1252.c: add onigenc_not_support_case_map as case_map primitive git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22* include/ruby/ruby.h (rb_scan_args): use original rb_scan_argsnaruse
when fmt is dynamic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22* class.c (rb_scan_args): moved to bottom of the file to make thenaruse
effect of `#undef rb_scan_args` the minimum. * include/ruby/ruby.h (rb_scan_args): overwrite only if GCC and optimized. Visual C++ 14 or later can compile it but make it conservative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21Revert r50102naruse
This reverts "* include/ruby/ruby.h (rb_scan_args): don't use ALWAYS_INLINE with" This rb_scan_args macro is GCCism. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21* include/ruby/ruby.h (rb_scan_args): don't use ALWAYS_INLINE withusa
`inline`. if gcc needs this duplication, do in ALWAYS_INLINE macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21* include/ruby/ruby.h (rb_scan_args): use __VA_ARGS__ instead ofnaruse
va_arg to allow compilers optimize more aggressive. https://gustedt.wordpress.com/2011/07/10/avoid-writing-va_arg-functions/ rb_scan_args is now expected to be statically resolved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20Use RB_GNUC_EXTENSION_BLOCK instead of __extension__ngoto
* include/ruby/defines.h (RB_GNUC_EXTENSION, RB_GNUC_EXTENSION_BLOCK): macros for skipping __extension__ on non-GCC compilers. * eval_error.c (warn_print): use RB_GNUC_EXTENSION_BLOCK instead of __extension__ because __extension__ is a GNU extension. Fix compile error on Solaris 10 with Oracle Solaris Studio 12.x. [Bug #12397] [ruby-dev:49629]. * internal.h (rb_fstring_cstr, rb_fstring_enc_cstr): ditto * include/ruby/encoding.h (rb_enc_str_new, rb_enc_str_new_cstr): ditto * include/ruby/intern.h (rb_str_new, rb_str_new_cstr, rb_usascii_str_new, rb_utf8_str_new, rb_tainted_str_new_cstr, rb_usascii_str_new_cstr, rb_utf8_str_new_cstr, rb_external_str_new_cstr, rb_locale_str_new_cstr, rb_str_buf_new_cstr, rb_str_cat_cstr, rb_exc_new_cstr): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55082 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-17[Feature #12005] Unify Fixnum and Bignum into Integerakr
* [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-16* include/ruby/oniguruma.h: Introducing ONIG_CASE_MAPPING compilationduerst
switch * include/ruby/oniguruma.h, enc/unicode.h: Using ONIG_CASE_MAPPING compilation switch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-12defines.h: avoid redefinitionnobu
* include/ruby/defines.h (GCC_VERSION_SINCE): get rid of re-definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-12fix typo in r54988naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-12include/ruby/defines.h (GCC_VERSION_SINCE): moved from internal.hnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-12Use HAVE_BUILTIN___BUILTIN_CONSTANT_Pnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* include/ruby/{defines,ruby}.h: need to define function attributesusa
alternatives in defines.h instead of ruby.h, because they are used in oniguruma.h and the header used without including ruby.h at encoding library sources. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* include/ruby/ruby.h (CONSTFUNC, PUREFUNC): fixed build errors onusa
non-gcc build environments introduced at r54952. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54955 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-08intern.h: suppress warningsnobu
* include/ruby/intern.h (rb_disable_super, rb_enable_super): remove NORETURN. these do nothing but just return. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02* win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements newusa
truncate alternative which accepts UTF-8 path. * file.c (truncate): use above function. [Bug #12340] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30revert UNALIGNED_WORD_ACCESS for GCC6naruse
Released GCC 6.0 fixed the issue. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69291 [ruby-core:72211] [Bug #11831] [Bug #11979] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-23* include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELYnaruse
by user side to improve generallity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-23* include/ruby/ruby.h (RB_LIKELY): use prefix in ruby.h.naruse
* intern.h (LIKELY): define with RB_LIKELY. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22* include/ruby/ruby.h (rb_mul_size_overflow): added to handlenaruse
mul overflow efficiently. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): use rb_mul_size_overflow and avoid division where it can define DSIZE_T. * gc.c (xmalloc2_size): moved from ruby.h and use rb_mul_size_overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22* variable.c: use uint32_t instead of long to avoid confusion aboutnaruse
the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-21* gc.c (rb_alloc_tmp_buffer_with_count): added like xmalloc2 tonaruse
avoid duplicated check of size. * gc.c (ruby_xmalloc2): added to keep separate layers. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): added to check the size more statically. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-21* include/ruby/ruby.h (LIKELY): moved from internal.h.naruse
* include/ruby/ruby.h (UNLIKELY): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-21* gc.c (objspace_malloc_prepare): remove size check because it isnaruse
used by objspace_xmalloc and objspace_xcalloc. objspace_xmalloc introduces its own check in this commit. objspace_xcalloc checks with xmalloc2_size (ruby_xmalloc2_size). * gc.c (objspace_xmalloc0): common xmalloc function. * gc.c (objspace_xmalloc): introduce its own size check. * gc.c (objspace_xmalloc2): separated from ruby_xmalloc2 to clarify the layer who has the responsibility to check the size. * gc.c (objspace_xrealloc): remove duplicated size check. * gc.c (ruby_xmalloc2): use objspace_xmalloc2. * include/ruby/ruby.h (ruby_xmalloc2_size): follow the size limit as SSIZE_MAX. Note that ISO C says size_t is unsigned integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-02rb_check_arity returns argc nownobu
* include/ruby/intern.h (rb_check_arity): returns argc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-29* include/ruby/ruby.h (rb_isupper, rb_islower, rb_isalpha, rb_isdigit,naruse
rb_isalnum, rb_isxdigit, rb_isblank, rb_isspace, rb_isblank, rb_iscntrl, rb_isprint, rb_ispunct, rb_isgraph, rb_tolower, rb_toupper): use inline function to avoid function call. * include/ruby/ruby.h (rb_isascii): use inline function to clarify the logic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-22* include/ruby/oniguruma.h: Additional flag for characters that are titlecase.duerst
* enc/unicode/case-folding.rb, casefold.h: Using above flag in data. * enc/unicode.c: Marking capitalized character as unmodified if it is already titlecase. * test/ruby/enc/test_case_mapping.rb: Tests for above functionality. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-19* include/ruby/intern.h (rb_big_odd_p, rb_big_even_p): move tomrkn
internal.h so that they are exported only for ruby itself. * internal.h (rb_big_odd_p, rb_big_even_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-18* include/ruby/intern.h (rb_big_hash): Move to internal.h.mrkn
* internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e