Skip to content

Commit 2134cb1

Browse files
committed
Changes based on review.
1 parent 44674a7 commit 2134cb1

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

lib/cext/include/truffleruby/truffleruby.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ MUST_INLINE int rb_tr_scan_args(int argc, VALUE *argv, const char *format, VALUE
385385
}
386386

387387
if (argn < argc) {
388-
rb_error_arity(argc, pre, rest ? UNLIMITED_ARGUMENTS : pre + optional);
388+
rb_error_arity(argc, n_mand, rest ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
389389
}
390390

391391
return argc;

src/main/c/cext/ruby.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,25 +3468,23 @@ VALUE rb_enum_values_pack(int argc, const VALUE *argv) {
34683468
rb_tr_error("rb_enum_values_pack not implemented");
34693469
}
34703470

3471-
static inline VALUE
3472-
rb_arity_error_new(int argc, int min, int max)
3473-
{
3474-
VALUE err_mess = 0;
3475-
if (min == max) {
3471+
static inline VALUE rb_arity_error_new(int argc, int min, int max) {
3472+
VALUE err_mess = 0;
3473+
if (min == max) {
34763474
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d)", argc, min);
3477-
}
3478-
else if (max == UNLIMITED_ARGUMENTS) {
3475+
}
3476+
else if (max == UNLIMITED_ARGUMENTS) {
34793477
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d+)", argc, min);
3480-
}
3481-
else {
3478+
}
3479+
else {
34823480
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d..%d)", argc, min, max);
3483-
}
3484-
return rb_exc_new3(rb_eArgError, err_mess);
3481+
}
3482+
return rb_exc_new3(rb_eArgError, err_mess);
34853483
}
34863484

34873485
NORETURN(void rb_error_arity(int argc, int min, int max))
34883486
{
3489-
rb_exc_raise(rb_arity_error_new(argc, min, max));
3487+
rb_exc_raise(rb_arity_error_new(argc, min, max));
34903488
}
34913489

34923490
void rb_error_untrusted(VALUE obj) {

0 commit comments

Comments
 (0)