X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=embed.pl;h=1e51aaa6fcb5d7f7eb4b664e050f99354c134f59;hb=6d7fb585cd8ad83f4523191641999603aa48eb76;hp=2ef42aa99465a081ea747f7cb3255bdc77fa55f4;hpb=2b10efc65b3c9f7954b63da8917689cb9bab0804;p=p5sagit%2Fp5-mst-13.2.git diff --git a/embed.pl b/embed.pl index 2ef42aa..1e51aaa 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; }