As Perl_get_arena() is dealing with sizes, use size_t rather than int,
[p5sagit/p5-mst-13.2.git] / universal.c
index e674d50..3fe831c 100644 (file)
@@ -1,7 +1,7 @@
 /*    universal.c
  *
  *    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- *    2005, 2006, by Larry Wall and others
+ *    2005, 2006, 2007 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -69,9 +69,11 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, const HV* const name_stash,
            SV** const svp = (SV**)hv_fetch(hv, name, len, FALSE);
            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);
            }
        }
@@ -112,7 +114,7 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, const HV* const name_stash,
                    if (ckWARN(WARN_MISC))
                        Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                                    "Can't locate package %"SVf" for @%s::ISA",
-                                   (void*)sv, hvname);
+                                   SVfARG(sv), hvname);
                    continue;
                }
                if (isa_lookup(basestash, name, name_stash, len, level + 1)) {
@@ -454,10 +456,10 @@ XS(XS_UNIVERSAL_VERSION)
        if ( vcmp( req, sv ) > 0 )
            Perl_croak(aTHX_ "%s version %"SVf" (%"SVf") required--"
                       "this is only version %"SVf" (%"SVf")", HvNAME_get(pkg),
-                      (void*)vnumify(req),
-                      (void*)vnormal(req),
-                      (void*)vnumify(sv),
-                      (void*)vnormal(sv));
+                      SVfARG(vnumify(req)),
+                      SVfARG(vnormal(req)),
+                      SVfARG(vnumify(sv)),
+                      SVfARG(vnormal(sv)));
     }
 
     if ( SvOK(sv) && sv_derived_from(sv, "version") ) {
@@ -686,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
@@ -984,11 +993,11 @@ XS(XS_PerlIO_get_layers)
                  else {
                       if (namok && argok)
                            XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf"(%"SVf")",
-                                                (void*)*namsvp,
-                                                (void*)*argsvp));
+                                                SVfARG(*namsvp),
+                                                SVfARG(*argsvp)));
                       else if (namok)
                            XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf,
-                                                (void*)*namsvp));
+                                                SVfARG(*namsvp)));
                       else
                            XPUSHs(&PL_sv_undef);
                       nitem++;