summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-25 00:43:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-25 00:43:06 +0000
commit898fd2ed2ad13d8c18b6a96304a8ea75ffd96b59 (patch)
treead0439504e7fe51616e9757a28e869edca248a87 /ext/fiddle
parent94bdb010f6375e4df6b7f19e4e6f277d56131452 (diff)
use rb_check_arity [ci skip]
* ext: use rb_check_arity and rb_error_arity to raise ArgumentError. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/function.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index e0da8b6..50a2d24 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -144,9 +144,8 @@ function_call(int argc, VALUE argv[], VALUE self)
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
Check_Max_Args("number of arguments", argc);
- if(argc != RARRAY_LENINT(types)) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
- argc, RARRAY_LENINT(types));
+ if (argc != (i = RARRAY_LENINT(types))) {
+ rb_error_arity(argc, i, i);
}
TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);