Turn *_for_cv into classmethods.
Florian Ragwitz [Sat, 25 Oct 2008 10:51:35 +0000 (10:51 +0000)]
BeginLift.xs
lib/Devel/BeginLift.pm

index cf92144..9794747 100644 (file)
@@ -103,13 +103,13 @@ MODULE = Devel::BeginLift  PACKAGE = Devel::BeginLift
 PROTOTYPES: DISABLE
 
 UV
-setup_for_cv (CV *cv)
+setup_for_cv (class, CV *cv)
   CODE:
     RETVAL = (UV)hook_op_check_entersubforcv (cv, lift_cb, NULL);
   OUTPUT:
     RETVAL
 
 void
-teardown_for_cv (UV id)
+teardown_for_cv (class, UV id)
   CODE:
     hook_op_check_entersubforcv_remove ((hook_op_check_id)id);
index 67ff298..b940966 100644 (file)
@@ -28,7 +28,7 @@ sub setup_for {
   my ($class, $target, $args) = @_;
   $lift{$target} ||= [];
   push @{ $lift{$target} }, map {
-    setup_for_cv($_);
+    $class->setup_for_cv($_);
   } map {
     ref $_ eq 'CODE'
       ? $_
@@ -38,7 +38,7 @@ sub setup_for {
 
 sub teardown_for {
   my ($class, $target) = @_;
-  teardown_for_cv($_) for @{ $lift{$target} };
+  $class->teardown_for_cv($_) for @{ $lift{$target} };
   delete $lift{$target};
 }