summaryrefslogtreecommitdiff
path: root/ext/dl/lib
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-08 14:38:15 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-08 14:38:15 +0000
commitc103eb6793b69d98a5e135ad4ddef09db364ec5b (patch)
treeb2e469b94fdcaf72d1c2112f0ffabf2cb1a583ec /ext/dl/lib
parent84c2c9ac5ba0815efd234ac187743feb221c15b3 (diff)
Bugfix for DL::Types::encode_type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib')
-rw-r--r--ext/dl/lib/dl/types.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/dl/lib/dl/types.rb b/ext/dl/lib/dl/types.rb
index e4d79ecf03c..b9a235f3b49 100644
--- a/ext/dl/lib/dl/types.rb
+++ b/ext/dl/lib/dl/types.rb
@@ -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 )