Skip to content

Commit

Permalink
[ruby/fiddle] Add support for more "short" variants
Browse files Browse the repository at this point in the history
  • Loading branch information
kou authored and hsbt committed Jun 28, 2023
1 parent ebf14d0 commit 731d277
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ext/fiddle/lib/fiddle/cparser.rb
Expand Up @@ -175,14 +175,20 @@ def parse_ctype(ty, tymap=nil)
/\A(?:signed\s+)?int\s+long(?:\s+\w+)?\z/,
/\Along(?:\s+int)?\s+signed(?:\s+\w+)?\z/
return TYPE_LONG
when /\Aunsigned\s+short(?:\s+int\s+)?(?:\s+\w+)?\z/,
/\Aunsigned\s+int\s+short(?:\s+\w+)?\z/,
/\Ashort(?:\s+int)?\s+unsigned(?:\s+\w+)?\z/,
/\Aint\s+unsigned\s+short(?:\s+\w+)?\z/,
/\A(?:int\s+)?short\s+unsigned(?:\s+\w+)?\z/
return TYPE_USHORT
when /\A(?:signed\s+)?short(?:\s+int\s+)?(?:\s+\w+)?\z/,
/\A(?:signed\s+)?int\s+short(?:\s+\w+)?\z/,
/\Aint\s+(?:signed\s+)?short(?:\s+\w+)?\z/
return TYPE_SHORT
when /\A(?:signed\s+)?int(?:\s+\w+)?\z/
return TYPE_INT
when /\A(?:unsigned\s+int|uint)(?:\s+\w+)?\z/
return TYPE_UINT
when /\A(?:signed\s+)?short(?:\s+int\s+)?(?:\s+\w+)?\z/
return TYPE_SHORT
when /\Aunsigned\s+short(?:\s+int\s+)?(?:\s+\w+)?\z/
return TYPE_USHORT
when /\A(?:signed\s+)?char(?:\s+\w+)?\z/
return TYPE_CHAR
when /\Aunsigned\s+char(?:\s+\w+)?\z/
Expand Down

0 comments on commit 731d277

Please sign in to comment.