Further tweaks to perluniintro.pod
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index b24c83e..d5cb295 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -133,13 +133,6 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
        CvGV(GvCV(gv)) = gv;
        CvFILE_set_from_cop(GvCV(gv), PL_curcop);
        CvSTASH(GvCV(gv)) = PL_curstash;
-#ifdef USE_5005THREADS
-       CvOWNER(GvCV(gv)) = 0;
-       if (!CvMUTEXP(GvCV(gv))) {
-           New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
-           MUTEX_INIT(CvMUTEXP(GvCV(gv)));
-       }
-#endif /* USE_5005THREADS */
        if (proto) {
            sv_setpv((SV*)GvCV(gv), proto);
            Safefree(proto);
@@ -496,7 +489,6 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
          "Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated",
             HvNAME(stash), (int)len, name);
 
-#ifndef USE_5005THREADS
     if (CvXSUB(cv)) {
         /* rather than lookup/init $AUTOLOAD here
          * only to have the XSUB do another lookup for $AUTOLOAD
@@ -508,7 +500,6 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
         SvCUR(cv) = len;
         return gv;
     }
-#endif
 
     /*
      * Given &FOO::AUTOLOAD, set $FOO::AUTOLOAD to desired function name.
@@ -520,16 +511,10 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
     vargv = *(GV**)hv_fetch(varstash, autoload, autolen, TRUE);
     ENTER;
 
-#ifdef USE_5005THREADS
-    sv_lock((SV *)varstash);
-#endif
     if (!isGV(vargv))
        gv_init(vargv, varstash, autoload, autolen, FALSE);
     LEAVE;
     varsv = GvSV(vargv);
-#ifdef USE_5005THREADS
-    sv_lock(varsv);
-#endif
     sv_setpv(varsv, HvNAME(stash));
     sv_catpvn(varsv, "::", 2);
     sv_catpvn(varsv, name, len);
@@ -766,10 +751,8 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
                  : sv_type == SVt_PVAV ? "@"
                  : sv_type == SVt_PVHV ? "%"
                  : ""), name));
-           stash = PL_nullstash;
        }
-       else
-           return Nullgv;
+       return Nullgv;
     }
 
     if (!SvREFCNT(stash))      /* symbol table under destruction */
@@ -1077,15 +1060,7 @@ Perl_gv_fullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain)
 void
 Perl_gv_fullname3(pTHX_ SV *sv, GV *gv, const char *prefix)
 {
-    HV *hv = GvSTASH(gv);
-    if (!hv) {
-       (void)SvOK_off(sv);
-       return;
-    }
-    sv_setpv(sv, prefix ? prefix : "");
-    sv_catpv(sv,HvNAME(hv));
-    sv_catpvn(sv,"::", 2);
-    sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv));
+    gv_fullname4(sv, gv, prefix, TRUE);
 }
 
 void
@@ -1100,10 +1075,7 @@ Perl_gv_efullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain)
 void
 Perl_gv_efullname3(pTHX_ SV *sv, GV *gv, const char *prefix)
 {
-    GV *egv = GvEGV(gv);
-    if (!egv)
-       egv = gv;
-    gv_fullname3(sv, egv, prefix);
+    gv_efullname4(sv, gv, prefix, TRUE);
 }
 
 /* XXX compatibility with versions <= 5.003. */
@@ -1283,7 +1255,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash)
 
   if (mg && amtp->was_ok_am == PL_amagic_generation
       && amtp->was_ok_sub == PL_sub_generation)
-      return AMT_OVERLOADED(amtp);
+      return (bool)AMT_OVERLOADED(amtp);
   sv_unmagic((SV*)stash, PERL_MAGIC_overload_table);
 
   DEBUG_o( Perl_deb(aTHX_ "Recalcing overload magic in package %s\n",HvNAME(stash)) );