perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject svn commit: r1213841 - /perl/modperl/trunk/lib/ModPerl/WrapXS.pm
Date Tue, 13 Dec 2011 18:34:16 GMT
Author: gozer
Date: Tue Dec 13 18:34:16 2011
New Revision: 1213841

URL: http://svn.apache.org/viewvc?rev=1213841&view=rev
Log:
When generating XS code, include var = var; declarations on the arguments,
since we don't know if they will be used, and we want to keep -Wall builds
succeeding.


Modified:
    perl/modperl/trunk/lib/ModPerl/WrapXS.pm

Modified: perl/modperl/trunk/lib/ModPerl/WrapXS.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/WrapXS.pm?rev=1213841&r1=1213840&r2=1213841&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/WrapXS.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/WrapXS.pm Tue Dec 13 18:34:16 2011
@@ -155,9 +155,16 @@ EOF
 
             my $retval = $return_type eq 'void' ?
               ["", ""] : ["RETVAL = ", "OUTPUT:\n    RETVAL\n"];
-
+            
+            my $avoid_warning = "";
+            if (@$args and not $passthru) {
+                $avoid_warning = "    /* avoiding -Wall warnings */\n";
+                $avoid_warning .= join "\n",
+                    (map "    $_->{name} = $_->{name};", @$args), "";
+            }
             $code .= <<EOF;
     CODE:
+$avoid_warning
     $retval->[0]$dispatch($thx$parms);
 
     $retval->[1]



Mime
View raw message