summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-12-07 04:08:18 -0600
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-12-07 15:46:46 +0000
commitc48640ec958027811b711ad07ca27c7f6b7ebbe0 (patch)
tree2a16e0aace6f08da989ff401aead9a437eecc6a8 /embed.pl
parentf506ffab3a9790503594078dbe049cd53fe08007 (diff)
downloadperl-c48640ec958027811b711ad07ca27c7f6b7ebbe0.tar.gz
All args in embed.fnc should be named
Message-ID: <20051207160818.GA13465@petdance.com> p4raw-id: //depot/perl@26296
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl29
1 files changed, 9 insertions, 20 deletions
diff --git a/embed.pl b/embed.pl
index 2ef42aa994..1e51aaa6fc 100755
--- a/embed.pl
+++ b/embed.pl
@@ -124,26 +124,6 @@ sub munge_c_files () {
} '/dev/null', '', '';
local $^I = '.bak';
while (<>) {
-# if (/^#\s*include\s+"perl.h"/) {
-# my $file = uc $ARGV;
-# $file =~ s/\./_/g;
-# print "#define PERL_IN_$file\n";
-# }
-# s{^(\w+)\s*\(}
-# {
-# my $f = $1;
-# my $repl = "$f(";
-# if (exists $functions->{$f}) {
-# my $flags = $functions->{$f}[0];
-# $repl = "Perl_$repl" if $flags =~ /p/;
-# unless ($flags =~ /n/) {
-# $repl .= "pTHX";
-# $repl .= "_ " if @{$functions->{$f}} > 3;
-# }
-# warn("$ARGV:$.:$repl\n");
-# }
-# $repl;
-# }e;
s{(\b(\w+)[ \t]*\([ \t]*(?!aTHX))}
{
my $repl = $1;
@@ -201,6 +181,15 @@ sub write_protos {
}
push( @nonnull, $n ) if ( $arg =~ s/\s*\bNN\b\s+// );
$arg =~ s/\s*\bNULLOK\b\s+//; # strip NULLOK with no effect
+
+ # Make sure each arg has at least a type and a var name.
+ # An arg of "int" is valid C, but want it to be "int foo".
+ my $temp_arg = $arg;
+ $temp_arg =~ s/\*//g;
+ $temp_arg =~ s/\s*\bstruct\b\s*/ /g;
+ if ( ($temp_arg ne "...") && ($temp_arg !~ /\w+\s+\w+/) ) {
+ warn "$func: $arg doesn't have a name\n";
+ }
}
$ret .= join ", ", @args;
}