summaryrefslogtreecommitdiff
path: root/ext/dl/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/lib')
-rw-r--r--ext/dl/lib/dl/func.rb6
-rw-r--r--ext/dl/lib/dl/value.rb13
2 files changed, 3 insertions, 16 deletions
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index 0ee2df1f23..c5a2dda355 100644
--- a/ext/dl/lib/dl/func.rb
+++ b/ext/dl/lib/dl/func.rb
@@ -6,7 +6,7 @@ require 'dl/value'
require 'thread'
module DL
- class Function
+ class Function < DL::Method
include DL
include ValueUtil
@@ -20,7 +20,7 @@ module DL
end
@args = argtypes
- native_init(@args.reject { |x| x == TYPE_VOID }, cfunc.ctype, abi)
+ super(@cfunc, @args.reject { |x| x == TYPE_VOID }, cfunc.ctype, abi)
end
def to_i()
@@ -35,7 +35,7 @@ module DL
if block_given?
args.find { |a| DL::Function === a }.bind_at_call(&block)
end
- native_call(*args)
+ super
end
def wrap_result(r)
diff --git a/ext/dl/lib/dl/value.rb b/ext/dl/lib/dl/value.rb
index c613afe5cf..cc6da6a7fb 100644
--- a/ext/dl/lib/dl/value.rb
+++ b/ext/dl/lib/dl/value.rb
@@ -36,19 +36,6 @@ module DL
end
end
- def ruby2ffi arg, type
- return arg unless type == TYPE_VOIDP
- case arg
- when nil
- 0
- when CPtr
- arg.to_i
- else
- CPtr[arg].to_i
- end
- end
- private :ruby2ffi
-
def wrap_arg(arg, ty, funcs = [], &block)
funcs ||= []
case arg