This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In B.xs, refactor make_warnings_object() to take a COP * instead of STRLEN *.
authorNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 09:13:27 +0000 (09:13 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 09:13:27 +0000 (09:13 +0000)
ext/B/B.xs

index 9e995ef..cfc0517 100644 (file)
@@ -291,8 +291,9 @@ make_temp_object(pTHX_ SV *temp)
 }
 
 static SV *
-make_warnings_object(pTHX_ STRLEN *warnings)
+make_warnings_object(pTHX_ const COP *const cop)
 {
+    const STRLEN *const warnings = cop->cop_warnings;
     const char *type = 0;
     dMY_CXT;
     IV iv = sizeof(specialsv_list)/sizeof(SV*);
@@ -1276,7 +1277,7 @@ COP_warnings(o)
        B::COP  o
        PPCODE:
 #if PERL_VERSION >= 9
-       ST(0) = make_warnings_object(aTHX_ o->cop_warnings);
+       ST(0) = make_warnings_object(aTHX_ o);
 #else
        ST(0) = make_sv_object(aTHX_ NULL, o->cop_warnings);
 #endif