summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>1999-09-07 13:30:18 +0100
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-07 12:49:15 +0000
commit427181846486e3aa5034a647dc1922377185f4c0 (patch)
tree77214104959f745247da88a35a1ff858eede7f44 /sv.c
parentf8d4b9aa3df7268ea9f1bdecfb17864f5f71ae93 (diff)
downloadperl-427181846486e3aa5034a647dc1922377185f4c0.tar.gz
Fix pointer casts.
To: perl5-porters@perl.org Subject: [ID 19990907.004] [PATCH perl5.005_61] compiler warnings with -Duse64bits Message-Id: <199909071130.MAA11435@tempest.npl.co.uk> p4raw-id: //depot/cfgperl@4100
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sv.c b/sv.c
index 1f0d1a7b83..956f3b961a 100644
--- a/sv.c
+++ b/sv.c
@@ -612,8 +612,8 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt)
pv = (char*)SvRV(sv);
cur = 0;
len = 0;
- iv = (IV)pv;
- nv = (NV)(unsigned long)pv;
+ iv = (IV)PTR_CAST pv;
+ nv = (NV)(PTRV)pv;
del_XRV(SvANY(sv));
magic = 0;
stash = 0;
@@ -1077,7 +1077,7 @@ Perl_sv_2iv(pTHX_ register SV *sv)
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
return SvIV(tmpstr);
- return (IV)SvRV(sv);
+ return (IV)PTR_CAST SvRV(sv);
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
@@ -1113,7 +1113,7 @@ Perl_sv_2iv(pTHX_ register SV *sv)
#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
"0x%" PERL_PRIx64 " 2iv(%" PERL_PRIu64 " => %" PERL_PRId64 ") (as unsigned)\n",
- (UV)sv,
+ (UV)PTR_CAST sv,
(UV)SvUVX(sv), (IV)SvUVX(sv)));
#else
DEBUG_c(PerlIO_printf(Perl_debug_log,
@@ -1222,7 +1222,7 @@ Perl_sv_2uv(pTHX_ register SV *sv)
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
return SvUV(tmpstr);
- return (UV)SvRV(sv);
+ return (UV)PTR_CAST SvRV(sv);
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
@@ -1393,7 +1393,7 @@ Perl_sv_2nv(pTHX_ register SV *sv)
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)))
return SvNV(tmpstr);
- return (NV)(unsigned long)SvRV(sv);
+ return (NV)(PTRV)SvRV(sv);
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
@@ -1777,7 +1777,7 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
else
sv_setpv(tsv, s);
#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", (UV)sv);
+ Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", (UV)PTR_CAST sv);
#else
Perl_sv_catpvf(aTHX_ tsv, "(0x%lx)", (unsigned long)sv);
#endif
@@ -3691,7 +3691,7 @@ Perl_sv_inc(pTHX_ register SV *sv)
IV i;
if (SvAMAGIC(sv) && AMG_CALLun(sv,inc))
return;
- i = (IV)SvRV(sv);
+ i = (IV)PTR_CAST SvRV(sv);
sv_unref(sv);
sv_setiv(sv, i);
}
@@ -3791,7 +3791,7 @@ Perl_sv_dec(pTHX_ register SV *sv)
IV i;
if (SvAMAGIC(sv) && AMG_CALLun(sv,dec))
return;
- i = (IV)SvRV(sv);
+ i = (IV)PTR_CAST SvRV(sv);
sv_unref(sv);
sv_setiv(sv, i);
}
@@ -4395,7 +4395,7 @@ Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv)
SvSETMAGIC(rv);
}
else
- sv_setiv(newSVrv(rv,classname), (IV)pv);
+ sv_setiv(newSVrv(rv,classname), (IV)PTR_CAST pv);
return rv;
}
@@ -4898,9 +4898,9 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
case 'p':
if (args)
- uv = (UV)va_arg(*args, void*);
+ uv = (UV)PTR_CAST va_arg(*args, void*);
else
- uv = (svix < svmax) ? (UV)svargs[svix++] : 0;
+ uv = (svix < svmax) ? (UV)PTR_CAST svargs[svix++] : 0;
base = 16;
goto integer;