pv = (char*)SvRV(sv);
cur = 0;
len = 0;
- iv = (IV)PTR_CAST pv;
- nv = (NV)(PTRV)pv;
+ iv = PTR2IV(pv);
+ nv = PTR2NV(pv);
del_XRV(SvANY(sv));
magic = 0;
stash = 0;
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
return SvIV(tmpstr);
- return (IV)PTR_CAST SvRV(sv);
+ return PTR2IV(SvRV(sv));
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
"0x%" PERL_PRIx64 " 2iv(%" PERL_PRIu64 " => %" PERL_PRId64 ") (as unsigned)\n",
- (UV)PTR_CAST sv,
+ PTR2UV(sv),
(UV)SvUVX(sv), (IV)SvUVX(sv)));
#else
DEBUG_c(PerlIO_printf(Perl_debug_log,
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
return SvUV(tmpstr);
- return (UV)PTR_CAST SvRV(sv);
+ return PTR2UV(SvRV(sv));
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)))
return SvNV(tmpstr);
- return (NV)(PTRV)SvRV(sv);
+ return PTR2NV(SvRV(sv));
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
else
sv_setpv(tsv, s);
#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", (UV)PTR_CAST sv);
+ Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", PTR2UV(sv));
#else
Perl_sv_catpvf(aTHX_ tsv, "(0x%lx)", (unsigned long)sv);
#endif
IV i;
if (SvAMAGIC(sv) && AMG_CALLun(sv,inc))
return;
- i = (IV)PTR_CAST SvRV(sv);
+ i = PTR2IV(SvRV(sv));
sv_unref(sv);
sv_setiv(sv, i);
}
IV i;
if (SvAMAGIC(sv) && AMG_CALLun(sv,dec))
return;
- i = (IV)PTR_CAST SvRV(sv);
+ i = PTR2IV(SvRV(sv));
sv_unref(sv);
sv_setiv(sv, i);
}
SvSETMAGIC(rv);
}
else
- sv_setiv(newSVrv(rv,classname), (IV)PTR_CAST pv);
+ sv_setiv(newSVrv(rv,classname), PTR2IV(pv));
return rv;
}
case 'p':
if (args)
- uv = (UV)PTR_CAST va_arg(*args, void*);
+ uv = PTR2UV(va_arg(*args, void*));
else
- uv = (svix < svmax) ? (UV)PTR_CAST svargs[svix++] : 0;
+ uv = (svix < svmax) ? PTR2UV(svargs[svix++]) : 0;
base = 16;
goto integer;
dig = uv & 1;
*--eptr = '0' + dig;
} while (uv >>= 1);
- if (alt && *eptr != '0')
- *--eptr = '0';
+ if (alt) {
+ esignbuf[esignlen++] = '0';
+ esignbuf[esignlen++] = 'b';
+ }
break;
default: /* it had better be ten or less */
do {