}
# Split this type into its components
- my($n, $p, $d) = $a =~ /^ ( \w+ (?: \s+ \w+ )* ) # type name => $n
+ my($n, $p, $d) = $a =~ /^ ( (?: " [^"]* " ) # literal string type => $n
+ | (?: \w+ (?: \s+ \w+ )* ) # name of type => $n
+ )
\s*
( \** ) # optional pointer(s) => $p
(?: \s* \b const \b \s* )? # opt. const
# Certain types, like 'void', get remapped.
$n = $tmap{$n} || $n;
- # Use a literal of our choosing for non-format functions
- if ($n =~ /\bconst\s+char\b/ and $p eq '*' and !$f->{'flags'}{'f'}) {
- push @arg, '"foo"';
+ if ($n =~ / ^ " [^"]* " $/x) { # Use the literal string, literally
+ push @arg, $n;
}
else {
my $v = 'arg' . $i++; # Argument number
if( s/\b(?:char|double|float|int|long|short|signed|unsigned|void)\b//g ) {
/^ \s* (\w+) \s* $/x and $name = $1; # Similarly for these
}
+ elsif (/^ \s* " [^"]+ " \s+ (\w+) \s* $/x) { # A literal string (is special)
+ $name = $1;
+ }
else {
/^ \s* \w+ \s+ (\w+) \s* $/x and $name = $1; # Everything else.
}