make -Dpv display OP names ons the parser stack
[p5sagit/p5-mst-13.2.git] / universal.c
index 8802cb2..705573e 100644 (file)
@@ -111,7 +111,7 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
                    if (ckWARN(WARN_MISC))
                        Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                                    "Can't locate package %"SVf" for @%s::ISA",
-                                   sv, hvname);
+                                   (void*)sv, hvname);
                    continue;
                }
                if (isa_lookup(basestash, name, name_stash, len, level + 1)) {
@@ -130,9 +130,9 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
 
 =for apidoc sv_derived_from
 
-Returns a boolean indicating whether the SV is derived from the specified
-class.  This is the function that implements C<UNIVERSAL::isa>.  It works
-for class names as well as for objects.
+Returns a boolean indicating whether the SV is derived from the specified class
+I<at the C level>.  To check derivation at the Perl level, call C<isa()> as a
+normal Perl method.
 
 =cut
 */
@@ -382,8 +382,11 @@ 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),
-                   vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
+                      "this is only version %"SVf" (%"SVf")", HvNAME_get(pkg),
+                      (void*)vnumify(req),
+                      (void*)vnormal(req),
+                      (void*)vnumify(sv),
+                      (void*)vnormal(sv));
     }
 
     if ( SvOK(sv) && sv_derived_from(sv, "version") ) {
@@ -412,11 +415,8 @@ XS(XS_version_new)
 
        if ( items == 1 ) {
            /* no parameter provided */
-           if ( sv_isobject(ST(0)) ) {
-               /* copy existing object */
-               vs = ST(0);
-           }
-           else {
+           if ( sv_isobject(ST(0)) )
+           {
                /* create empty object */
                vs = sv_newmortal();
                sv_setpvn(vs,"",0);
@@ -619,7 +619,7 @@ XS(XS_version_qv)
            if ( SvNOK(ver) ) /* may get too much accuracy */
            {
                char tbuf[64];
-               const STRLEN len = my_sprintf(tbuf,"%.9"NVgf, SvNVX(ver));
+               const STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVgf, SvNVX(ver));
                version = savepvn(tbuf, len);
            }
            else
@@ -917,9 +917,11 @@ XS(XS_PerlIO_get_layers)
                  else {
                       if (namok && argok)
                            XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf"(%"SVf")",
-                                              *namsvp, *argsvp));
+                                                (void*)*namsvp,
+                                                (void*)*argsvp));
                       else if (namok)
-                           XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf, *namsvp));
+                           XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf,
+                                                (void*)*namsvp));
                       else
                            XPUSHs(&PL_sv_undef);
                       nitem++;