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:
ttate 2003-11-08 14:38:15 +00:00
Родитель 84c2c9ac5b
Коммит c103eb6793
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -15,6 +15,8 @@ module DL
["PDWORD", "unsigned long *", nil, nil, nil, nil], ["PDWORD", "unsigned long *", nil, nil, nil, nil],
["WORD", "unsigned short", nil, nil, nil, nil], ["WORD", "unsigned short", nil, nil, nil, nil],
["PWORD", "unsigned int *", 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], ["BOOL", "ibool", nil, nil, nil, nil],
["ATOM", "int", nil, nil, nil, nil], ["ATOM", "int", nil, nil, nil, nil],
["BYTE", "unsigned char", nil, nil, nil, nil], ["BYTE", "unsigned char", nil, nil, nil, nil],
@ -95,9 +97,9 @@ module DL
["long", "L", nil, nil, nil, nil], ["long", "L", nil, nil, nil, nil],
["float", "F", nil, nil, nil, nil], ["float", "F", nil, nil, nil, nil],
["double", "D", nil, nil, nil, nil], ["double", "D", nil, nil, nil, nil],
[/char\s*\*/,"S",nil, nil, nil, nil], [/^char\s*\*$/,"S",nil, nil, nil, nil],
[/.+\*/, "P", nil, nil, nil, nil], [/^.+\*$/, "P", nil, nil, nil, nil],
[/.+\[\]/, "a", nil, nil, nil, nil], [/^.+\[\]$/, "a", nil, nil, nil, nil],
["void", "0", nil, nil, nil, nil], ["void", "0", nil, nil, nil, nil],
] ]
@ -120,10 +122,10 @@ module DL
senc = nil senc = nil
sdec = nil sdec = nil
@TYDEFS.each{|t1,t2,c1,c2,c3,c4| @TYDEFS.each{|t1,t2,c1,c2,c3,c4|
if( t1.is_a?(String) ) # if( t1.is_a?(String) )
t1 = Regexp.new("^" + t1 + "$") # t1 = Regexp.new("^" + t1 + "$")
end # end
if( t1 =~ ty ) if( (t1.is_a?(Regexp) && (t1 =~ ty)) || (t1 == ty) )
ty = ty.gsub(t1,t2) ty = ty.gsub(t1,t2)
if( enc ) if( enc )
if( c1 ) if( c1 )