suppress warnings: uninitialized variables
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9207474f04
commit
b1b7c389fb
@ -79,6 +79,7 @@ module DL
|
|||||||
end
|
end
|
||||||
|
|
||||||
def sizeof(ty)
|
def sizeof(ty)
|
||||||
|
@type_alias ||= nil
|
||||||
case ty
|
case ty
|
||||||
when String
|
when String
|
||||||
ty = parse_ctype(ty, @type_alias).abs()
|
ty = parse_ctype(ty, @type_alias).abs()
|
||||||
@ -128,6 +129,7 @@ module DL
|
|||||||
private :parse_bind_options
|
private :parse_bind_options
|
||||||
|
|
||||||
def extern(signature, *opts)
|
def extern(signature, *opts)
|
||||||
|
@type_alias ||= nil
|
||||||
symname, ctype, argtype = parse_signature(signature, @type_alias)
|
symname, ctype, argtype = parse_signature(signature, @type_alias)
|
||||||
opt = parse_bind_options(opts)
|
opt = parse_bind_options(opts)
|
||||||
f = import_function(symname, ctype, argtype, opt[:call_type])
|
f = import_function(symname, ctype, argtype, opt[:call_type])
|
||||||
@ -150,6 +152,7 @@ module DL
|
|||||||
end
|
end
|
||||||
|
|
||||||
def bind(signature, *opts, &blk)
|
def bind(signature, *opts, &blk)
|
||||||
|
@type_alias ||= nil
|
||||||
name, ctype, argtype = parse_signature(signature, @type_alias)
|
name, ctype, argtype = parse_signature(signature, @type_alias)
|
||||||
h = parse_bind_options(opts)
|
h = parse_bind_options(opts)
|
||||||
case h[:callback_type]
|
case h[:callback_type]
|
||||||
@ -183,6 +186,7 @@ module DL
|
|||||||
#
|
#
|
||||||
# MyStruct = struct ['int i', 'char c']
|
# MyStruct = struct ['int i', 'char c']
|
||||||
def struct(signature)
|
def struct(signature)
|
||||||
|
@type_alias ||= nil
|
||||||
tys, mems = parse_struct_signature(signature, @type_alias)
|
tys, mems = parse_struct_signature(signature, @type_alias)
|
||||||
DL::CStructBuilder.create(CStruct, tys, mems)
|
DL::CStructBuilder.create(CStruct, tys, mems)
|
||||||
end
|
end
|
||||||
@ -191,6 +195,7 @@ module DL
|
|||||||
#
|
#
|
||||||
# MyUnion = union ['int i', 'char c']
|
# MyUnion = union ['int i', 'char c']
|
||||||
def union(signature)
|
def union(signature)
|
||||||
|
@type_alias ||= nil
|
||||||
tys, mems = parse_struct_signature(signature, @type_alias)
|
tys, mems = parse_struct_signature(signature, @type_alias)
|
||||||
DL::CStructBuilder.create(CUnion, tys, mems)
|
DL::CStructBuilder.create(CUnion, tys, mems)
|
||||||
end
|
end
|
||||||
@ -216,7 +221,8 @@ module DL
|
|||||||
end
|
end
|
||||||
|
|
||||||
def handler
|
def handler
|
||||||
@handler or raise "call dlload before importing symbols and functions"
|
defined?(@handler) or raise "call dlload before importing symbols and functions"
|
||||||
|
@handler
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_symbol(name)
|
def import_symbol(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user