This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Silence a warning from Module::CoreList that occurs when the module version is
[perl5.git] / universal.c
index 7cbaaf7..251fbac 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 STATIC bool
-S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
+S_isa_lookup(pTHX_ HV *stash, const char *name, const HV* const name_stash,
              int len, int level)
 {
     dVAR;
@@ -45,7 +45,7 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
 
     /* A stash/class can go by many names (ie. User == main::User), so 
        we compare the stash itself just in case */
-    if (name_stash && (stash == name_stash))
+    if (name_stash && ((const HV *)stash == name_stash))
         return TRUE;
 
     hvname = HvNAME_get(stash);
@@ -66,11 +66,14 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
        && (hv = GvHV(gv)))
     {
        if (SvIV(subgen) == (IV)PL_sub_generation) {
-           SV* sv;
            SV** const svp = (SV**)hv_fetch(hv, name, len, FALSE);
-           if (svp && (sv = *svp) != (SV*)&PL_sv_undef) {
-               DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
-                                 name, hvname) );
+           if (svp) {
+               SV * const sv = *svp;
+#ifdef DEBUGGING
+               if (sv != &PL_sv_undef)
+                   DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
+                                   name, hvname) );
+#endif
                return (sv == &PL_sv_yes);
            }
        }
@@ -685,7 +688,14 @@ XS(XS_version_qv)
            if ( SvNOK(ver) ) /* may get too much accuracy */
            {
                char tbuf[64];
-               const STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVgf, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+               char *loc = setlocale(LC_NUMERIC, "C");
+#endif
+               STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVgf, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+               setlocale(LC_NUMERIC, loc);
+#endif
+               while (tbuf[len-1] == '0' && len > 0) len--;
                version = savepvn(tbuf, len);
            }
            else