Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3005
|
|
|
|
* Fix a typo
* Fix typos in st.[ch]
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Commit e91c39f1c0f7d5e670266d9593d533fd444957f6 deleted definition of it.
Though I'm not sure if we can delete public API like this, it no longer
works nontheless. Having declaration without definiton is worse than
having nothing at all. Just delete the declartion too.
|
|
This compile-time option has been broken for years (at least since
commit 49369ef17316cd5d5819b038f286e1d951972b52, according to git
bisect). Let's delete codes that no longer works.
Notes:
Merged: https://github.com/ruby/ruby/pull/2925
|
|
Comma at the end of enum is allowed in C since C99. We can use them
internally. However when it comes to extension libraries, they could be
written in different C++ versions. We cannot assume sometihng. Public
headers shall keep compatibilities.
|
|
|
|
This was related to $SAFE, and was deprecated in 2.7. I missed it
earlier when removing the other $SAFE-related code.
Notes:
Merged: https://github.com/ruby/ruby/pull/2899
|
|
|
|
|
|
1. By substituting `n_var` with its initializer, `0 < n_var` is
equivalent to `argc > argi + n_trail`.
2. As `argi` is non-negative, so `argi + n_trail >= n_trail`, and
the above expression is equivalent to `argc > n_trail`.
3. Therefore, `f_last` is always false, and `last_hash` is no
longer used.
Notes:
Merged: https://github.com/ruby/ruby/pull/2873
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Creative use of `@copydoc` Doxygen command and abusing its half-broken C
parser let us delete some lines of documentations, while preserving
document coverages.
|
|
C++ keyword `nullptr` represents a null pointer (note also that NULL is
an integer in C++ due to its design flaw). Its type is `std::nullptr_t`,
defined in <cstddef> standard header. Why not support it when the
backend implementation can take a null pointer as an argument.
|
|
|
|
It was unable for rb_define_global_function to take VALUE(*)(int argc,
const VLAUE *argv, VALUE self) -style function. Test added.
|
|
rb_f_notimplement should be accepted for all possible arities.
Test provided for that.
|
|
The `using engine<...snip...>::define;` line already defines this
function. We don't have to repeat.
|
|
Add missing `*`.
|
|
This macro is no longer useful. Just expand it.
Notes:
Merged: https://github.com/ruby/ruby/pull/2864
|
|
Case of __cplusplus is handled in cxxanyargs.hpp now. These deleted
codes no longer reachable.
Notes:
Merged: https://github.com/ruby/ruby/pull/2864
|
|
C++ (and myself) hates macros. If we could do the same thing in both
preprocessor and template, we shall choose template. This particular
part of the ruby header is one of such situations.
Notes:
Merged: https://github.com/ruby/ruby/pull/2864
|
|
Would like to edit them in forthcoming commit.
Notes:
Merged: https://github.com/ruby/ruby/pull/2864
|
|
These were all deprecated in Ruby 2.7.
Notes:
Merged: https://github.com/ruby/ruby/pull/2845
|
|
Inside the block where `RB_METHOD_DEFINITION_DECL` family are
defined.
|
|
It is no longer used due to beae6cbf0fd8b6619e5212552de98022d4c4d4d4.
Coverity Scan found this.
|
|
Due to beae6cbf0fd8b6619e5212552de98022d4c4d4d4, the variable last_idx
is no longer changed and always -1. This change simplifies the code by
removing the variable. Coverity Scan pointed out this.
|
|
This removes the warnings added in 2.7, and changes the behavior
so that a final positional hash is not treated as keywords or
vice-versa.
To handle the arg_setup_block splat case correctly with keyword
arguments, we need to check if we are taking a keyword hash.
That case didn't have a test, but it affects real-world code,
so add a test for it.
This removes rb_empty_keyword_given_p() and related code, as
that is not needed in Ruby 3. The empty keyword case is the
same as the no keyword case in Ruby 3.
This changes rb_scan_args to implement keyword argument
separation for C functions when the : character is used.
For backwards compatibility, it returns a duped hash.
This is a bad idea for performance, but not duping the hash
breaks at least Enumerator::ArithmeticSequence#inspect.
Instead of having RB_PASS_CALLED_KEYWORDS be a number,
simplify the code by just making it be rb_keyword_given_p().
Notes:
Merged: https://github.com/ruby/ruby/pull/2794
|
|
This is tentative. For the sake of simplicity we partially revert
commits e9cb552ec96, ee85a6e72b and 51edb300425. Will decouple them
once again when we are ready.
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
|
|
|
|
warnings
|
|
(old)
test.rb:4: warning: The last argument is used as the keyword parameter
test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call?
(new)
test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call
test.rb:1: warning: The called method `foo' is defined here
|
|
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
|
|
... like we do so for struct timeval at several hundreds of lines above.
Depending on OS/Compiler, this can be the first place for the struct to
appear. To make sure the struct is global, we need a forward
declaration at this point.
|
|
rb_eval_cmd takes a safe level, and now that $SAFE is deprecated,
it should be deprecated as well.
Replace with rb_eval_cmd_kw, which takes a keyword flag. Switch
the two callers to this function.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
This removes the related tests, and puts the related specs behind
version guards. This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.
This modifies some internal functions that took a safe level argument
to no longer take the argument.
rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.
One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd. We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
These functions are the same, so remove one.
Co-authored-by: John Hawthorn <john@hawthorn.email>
|
|
Apply __attribute__((__returns_nonnull__)) when available.
|
|
clang also supports __attribute__((__alloc_size__)) so why not use
it when the compiler says it does.
|
|
|
|
Coverity Scan complains it.
|
|
Limit strict function signature check with RUBY_METHOD_FUNC in C++
to bundled libraries only. [Bug #16271]
|
|
|
|
This macro is used here before defined in ruby.h.
|
|
Make them gcc friendly. Note that realloc canot be __malloc__
attributed, according to the GCC manual.
Notes:
Merged: https://github.com/ruby/ruby/pull/2540
|
|
There is no need for these in Ruby 3.0, and the plan is to
remove them.
|
|
to suppress the following warning:
```
compiling cxxanyargs.cpp
In file included from cxxanyargs.cpp:1:
In file included from ../../.././include/ruby/ruby.h:2150:
../../.././include/ruby/intern.h:56:19: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
../../.././include/ruby/intern.h:56:36: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
```
|
|
Currently, there is not a way to create a sized enumerator in C
with a different set of arguments than provided by Ruby, and
correctly handle keyword arguments. This function allows that.
The need for this is fairly uncommon, but it occurs at least in
Enumerator.produce, which takes arugments from Ruby but calls
rb_enumeratorize_with_size with a different set of arguments.
Notes:
Merged: https://github.com/ruby/ruby/pull/2509
|
|
This adds rb_funcall_passing_block_kw, rb_funcallv_public_kw,
and rb_yield_splat_kw. This functions are necessary to easily
handle cases where rb_funcall_passing_block, rb_funcallv_public,
and rb_yield_splat are currently used and a keyword argument
separation warning is raised.
Notes:
Merged: https://github.com/ruby/ruby/pull/2507
|
|
This fixes instance_exec and similar methods. It also fixes
Enumerator::Yielder#yield, rb_yield_block, and a couple of cases
with Proc#{<<,>>}.
This support requires the addition of rb_yield_values_kw, similar to
rb_yield_values2, for passing the keyword flag.
Unlike earlier attempts at this, this does not modify the rb_block_call_func
type or add a separate function type. The functions of type
rb_block_call_func are called by Ruby with a separate VM frame, and we can
get the keyword flag information from the VM frame flags, so it doesn't need
to be passed as a function argument.
These changes require the following VM functions accept a keyword flag:
* vm_yield_with_cref
* vm_yield
* vm_yield_with_block
Notes:
Merged: https://github.com/ruby/ruby/pull/2493
|