pos = s;
if ( qv )
- (void)hv_stores((HV *)hv, "qv", newSViv(qv));
+ (void)hv_stores(MUTABLE_HV(hv), "qv", newSViv(qv));
if ( alpha )
- (void)hv_stores((HV *)hv, "alpha", newSViv(alpha));
+ (void)hv_stores(MUTABLE_HV(hv), "alpha", newSViv(alpha));
if ( !qv && width < 3 )
- (void)hv_stores((HV *)hv, "width", newSViv(width));
+ (void)hv_stores(MUTABLE_HV(hv), "width", newSViv(width));
while (isDIGIT(*pos))
pos++;
/* need to save off the current version string for later */
if ( vinf ) {
SV * orig = newSVpvn("v.Inf", sizeof("v.Inf")-1);
- (void)hv_stores((HV *)hv, "original", orig);
- (void)hv_stores((HV *)hv, "vinf", newSViv(1));
+ (void)hv_stores(MUTABLE_HV(hv), "original", orig);
+ (void)hv_stores(MUTABLE_HV(hv), "vinf", newSViv(1));
}
else if ( s > start ) {
SV * orig = newSVpvn(start,s-start);
/* need to insert a v to be consistent */
sv_insert(orig, 0, 0, "v", 1);
}
- (void)hv_stores((HV *)hv, "original", orig);
+ (void)hv_stores(MUTABLE_HV(hv), "original", orig);
}
else {
- (void)hv_stores((HV *)hv, "original", newSVpvn("0",1));
+ (void)hv_stores(MUTABLE_HV(hv), "original", newSVpvn("0",1));
av_push(av, newSViv(0));
}
/* And finally, store the AV in the hash */
- (void)hv_stores((HV *)hv, "version", newRV_noinc((SV *)av));
+ (void)hv_stores(MUTABLE_HV(hv), "version", newRV_noinc((SV *)av));
/* fix RT#19517 - special case 'undef' as string */
if ( *s == 'u' && strEQ(s,"undef") ) {
ver = SvRV(ver);
/* Begin copying all of the elements */
- if ( hv_exists((HV *)ver, "qv", 2) )
- (void)hv_stores((HV *)hv, "qv", newSViv(1));
+ if ( hv_exists(MUTABLE_HV(ver), "qv", 2) )
+ (void)hv_stores(MUTABLE_HV(hv), "qv", newSViv(1));
- if ( hv_exists((HV *)ver, "alpha", 5) )
- (void)hv_stores((HV *)hv, "alpha", newSViv(1));
+ if ( hv_exists(MUTABLE_HV(ver), "alpha", 5) )
+ (void)hv_stores(MUTABLE_HV(hv), "alpha", newSViv(1));
- if ( hv_exists((HV*)ver, "width", 5 ) )
+ if ( hv_exists(MUTABLE_HV(ver), "width", 5 ) )
{
- const I32 width = SvIV(*hv_fetchs((HV*)ver, "width", FALSE));
- (void)hv_stores((HV *)hv, "width", newSViv(width));
+ const I32 width = SvIV(*hv_fetchs(MUTABLE_HV(ver), "width", FALSE));
+ (void)hv_stores(MUTABLE_HV(hv), "width", newSViv(width));
}
- if ( hv_exists((HV*)ver, "original", 8 ) )
+ if ( hv_exists(MUTABLE_HV(ver), "original", 8 ) )
{
- SV * pv = *hv_fetchs((HV*)ver, "original", FALSE);
- (void)hv_stores((HV *)hv, "original", newSVsv(pv));
+ SV * pv = *hv_fetchs(MUTABLE_HV(ver), "original", FALSE);
+ (void)hv_stores(MUTABLE_HV(hv), "original", newSVsv(pv));
}
- sav = (AV *)SvRV(*hv_fetchs((HV*)ver, "version", FALSE));
+ sav = (AV *)SvRV(*hv_fetchs(MUTABLE_HV(ver), "version", FALSE));
/* This will get reblessed later if a derived class*/
for ( key = 0; key <= av_len(sav); key++ )
{
av_push(av, newSViv(rev));
}
- (void)hv_stores((HV *)hv, "version", newRV_noinc((SV *)av));
+ (void)hv_stores(MUTABLE_HV(hv), "version", newRV_noinc((SV *)av));
return rv;
}
#ifdef SvVOK
/* see if the appropriate elements exist */
if ( SvTYPE(vs) == SVt_PVHV
- && hv_exists((HV*)vs, "version", 7)
- && (sv = SvRV(*hv_fetchs((HV*)vs, "version", FALSE)))
+ && hv_exists(MUTABLE_HV(vs), "version", 7)
+ && (sv = SvRV(*hv_fetchs(MUTABLE_HV(vs), "version", FALSE)))
&& SvTYPE(sv) == SVt_PVAV )
return TRUE;
else
Perl_croak(aTHX_ "Invalid version object");
/* see if various flags exist */
- if ( hv_exists((HV*)vs, "alpha", 5 ) )
+ if ( hv_exists(MUTABLE_HV(vs), "alpha", 5 ) )
alpha = TRUE;
- if ( hv_exists((HV*)vs, "width", 5 ) )
- width = SvIV(*hv_fetchs((HV*)vs, "width", FALSE));
+ if ( hv_exists(MUTABLE_HV(vs), "width", 5 ) )
+ width = SvIV(*hv_fetchs(MUTABLE_HV(vs), "width", FALSE));
else
width = 3;
/* attempt to retrieve the version array */
- if ( !(av = (AV *)SvRV(*hv_fetchs((HV*)vs, "version", FALSE)) ) ) {
+ if ( !(av = (AV *)SvRV(*hv_fetchs(MUTABLE_HV(vs), "version", FALSE)) ) ) {
sv_catpvs(sv,"0");
return sv;
}
if ( !vverify(vs) )
Perl_croak(aTHX_ "Invalid version object");
- if ( hv_exists((HV*)vs, "alpha", 5 ) )
+ if ( hv_exists(MUTABLE_HV(vs), "alpha", 5 ) )
alpha = TRUE;
- av = (AV *)SvRV(*hv_fetchs((HV*)vs, "version", FALSE));
+ av = (AV *)SvRV(*hv_fetchs(MUTABLE_HV(vs), "version", FALSE));
len = av_len(av);
if ( len == -1 )
if ( !vverify(vs) )
Perl_croak(aTHX_ "Invalid version object");
- if (hv_exists((HV*)vs, "original", sizeof("original") - 1)) {
+ if (hv_exists(MUTABLE_HV(vs), "original", sizeof("original") - 1)) {
SV *pv;
- pv = *hv_fetchs((HV*)vs, "original", FALSE);
+ pv = *hv_fetchs(MUTABLE_HV(vs), "original", FALSE);
if ( SvPOK(pv) )
return newSVsv(pv);
else
return &PL_sv_undef;
}
else {
- if ( hv_exists((HV *)vs, "qv", 2) )
+ if ( hv_exists(MUTABLE_HV(vs), "qv", 2) )
return vnormal(vs);
else
return vnumify(vs);
Perl_croak(aTHX_ "Invalid version object");
/* get the left hand term */
- lav = (AV *)SvRV(*hv_fetchs((HV*)lhv, "version", FALSE));
- if ( hv_exists((HV*)lhv, "alpha", 5 ) )
+ lav = (AV *)SvRV(*hv_fetchs(MUTABLE_HV(lhv), "version", FALSE));
+ if ( hv_exists(MUTABLE_HV(lhv), "alpha", 5 ) )
lalpha = TRUE;
/* and the right hand term */
- rav = (AV *)SvRV(*hv_fetchs((HV*)rhv, "version", FALSE));
- if ( hv_exists((HV*)rhv, "alpha", 5 ) )
+ rav = (AV *)SvRV(*hv_fetchs(MUTABLE_HV(rhv), "version", FALSE));
+ if ( hv_exists(MUTABLE_HV(rhv), "alpha", 5 ) )
ralpha = TRUE;
l = av_len(lav);