Make some functions static
[gitmo/Mouse.git] / xs-src / Mouse.xs
index 627eabd..27f871c 100644 (file)
@@ -150,7 +150,7 @@ mouse_class_update_xc(pTHX_ SV* const metaclass PERL_UNUSED_DECL, HV* const stas
     sv_setuv(MOUSE_xc_gen(xc), mro_get_pkg_gen(stash));
 }
 
-AV*
+static AV*
 mouse_get_xc(pTHX_ SV* const metaclass) {
     AV* xc;
     SV* gen;
@@ -202,7 +202,7 @@ mouse_get_xc(pTHX_ SV* const metaclass) {
     return xc;
 }
 
-HV*
+static HV*
 mouse_buildargs(pTHX_ SV* metaclass, SV* const klass, I32 ax, I32 items) {
     HV* args;
 
@@ -237,7 +237,7 @@ mouse_buildargs(pTHX_ SV* metaclass, SV* const klass, I32 ax, I32 items) {
     return args;
 }
 
-void
+static void
 mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const args, bool const ignore_triggers) {
     AV* const xc    = mouse_get_xc(aTHX_ meta);
     AV* const attrs = MOUSE_xc_attrall(xc);
@@ -419,14 +419,16 @@ CODE:
 
     set_slot(methods, name, code); /* $self->{methods}{$name} = $code */
 
-    /* TODO: name the CODE ref if it's anonymous */
-    //code_entity = (CV*)SvRV(code_ref);
-    //if(CvANON(code_entity)
-    //    && CvGV(code_entity) /* a cv under construction has no gv */ ){
+    /* name the CODE ref if it's anonymous */
+    {
+        CV* const code_entity = (CV*)SvRV(code_ref);
+        if(CvANON(code_entity)
+            && CvGV(code_entity) /* a cv under construction has no gv */ ){
 
-    //    CvGV(code_entity) = gv;
-    //    CvANON_off(code_entity);
-    //}
+            CvGV(code_entity) = gv;
+            CvANON_off(code_entity);
+        }
+    }
 }
 
 MODULE = Mouse  PACKAGE = Mouse::Meta::Class