mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Bugfix for DL::Types::encode_type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
84c2c9ac5b
commit
c103eb6793
1 changed files with 9 additions and 7 deletions
|
@ -15,6 +15,8 @@ module DL
|
|||
["PDWORD", "unsigned long *", nil, nil, nil, nil],
|
||||
["WORD", "unsigned short", nil, nil, nil, nil],
|
||||
["PWORD", "unsigned int *", nil, nil, nil, nil],
|
||||
["BYTE", "unsigned char", nil, nil, nil, nil],
|
||||
["PBYTE", "unsigned char *", nil, nil, nil, nil],
|
||||
["BOOL", "ibool", nil, nil, nil, nil],
|
||||
["ATOM", "int", nil, nil, nil, nil],
|
||||
["BYTE", "unsigned char", nil, nil, nil, nil],
|
||||
|
@ -95,9 +97,9 @@ module DL
|
|||
["long", "L", nil, nil, nil, nil],
|
||||
["float", "F", nil, nil, nil, nil],
|
||||
["double", "D", nil, nil, nil, nil],
|
||||
[/char\s*\*/,"S",nil, nil, nil, nil],
|
||||
[/.+\*/, "P", nil, nil, nil, nil],
|
||||
[/.+\[\]/, "a", nil, nil, nil, nil],
|
||||
[/^char\s*\*$/,"S",nil, nil, nil, nil],
|
||||
[/^.+\*$/, "P", nil, nil, nil, nil],
|
||||
[/^.+\[\]$/, "a", nil, nil, nil, nil],
|
||||
["void", "0", nil, nil, nil, nil],
|
||||
]
|
||||
|
||||
|
@ -120,10 +122,10 @@ module DL
|
|||
senc = nil
|
||||
sdec = nil
|
||||
@TYDEFS.each{|t1,t2,c1,c2,c3,c4|
|
||||
if( t1.is_a?(String) )
|
||||
t1 = Regexp.new("^" + t1 + "$")
|
||||
end
|
||||
if( t1 =~ ty )
|
||||
# if( t1.is_a?(String) )
|
||||
# t1 = Regexp.new("^" + t1 + "$")
|
||||
# end
|
||||
if( (t1.is_a?(Regexp) && (t1 =~ ty)) || (t1 == ty) )
|
||||
ty = ty.gsub(t1,t2)
|
||||
if( enc )
|
||||
if( c1 )
|
||||
|
|
Loading…
Reference in a new issue