tmp = AvARRAY(av) - AvALLOC(av);
Move(AvARRAY(av), AvALLOC(av), AvFILLp(av)+1, SV*);
AvMAX(av) += tmp;
- SvPV_set(av, (char*)AvALLOC(av));
+ AvARRAY(av) = AvALLOC(av);
if (AvREAL(av)) {
while (tmp)
ary[--tmp] = &PL_sv_undef;
ary[--tmp] = &PL_sv_undef;
}
- SvPV_set(av, (char*)AvALLOC(av));
+ AvARRAY(av) = AvALLOC(av);
AvMAX(av) = newmax;
}
}
sv_upgrade((SV *)av, SVt_PVAV);
/* sv_upgrade does AvREAL_only() */
AvALLOC(av) = 0;
- SvPV_set(av, NULL);
+ AvARRAY(av) = NULL;
AvMAX(av) = AvFILLp(av) = -1;
return av;
}
register I32 i;
Newx(ary,size,SV*);
AvALLOC(av) = ary;
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
AvFILLp(av) = AvMAX(av) = size - 1;
for (i = 0; i < size; i++) {
assert (*strp);
extra = AvARRAY(av) - AvALLOC(av);
if (extra) {
AvMAX(av) += extra;
- SvPV_set(av, (char*)AvALLOC(av));
+ AvARRAY(av) = AvALLOC(av);
}
AvFILLp(av) = -1;
}
Safefree(AvALLOC(av));
AvALLOC(av) = NULL;
- SvPV_set(av, NULL);
+ AvARRAY(av) = NULL;
AvMAX(av) = AvFILLp(av) = -1;
}
AvMAX(av) += i;
AvFILLp(av) += i;
- SvPV_set(av, (char*)(AvARRAY(av) - i));
+ AvARRAY(av) = AvARRAY(av) - i;
}
if (num) {
register SV **ary;
/* Make extra elements into a buffer */
AvMAX(av) -= slide;
AvFILLp(av) -= slide;
- SvPV_set(av, (char*)(AvARRAY(av) + slide));
+ AvARRAY(av) = AvARRAY(av) + slide;
}
}
retval = *AvARRAY(av);
if (AvREAL(av))
*AvARRAY(av) = &PL_sv_undef;
- SvPV_set(av, (char*)(AvARRAY(av) + 1));
+ AvARRAY(av) = AvARRAY(av) + 1;
AvMAX(av)--;
AvFILLp(av)--;
if (SvSMAGICAL(av))
#define CLEAR_ARGARRAY(ary) \
STMT_START { \
AvMAX(ary) += AvARRAY(ary) - AvALLOC(ary); \
- SvPV_set(ary, (char*)AvALLOC(ary)); \
+ AvARRAY(ary) = AvALLOC(ary); \
AvFILLp(ary) = -1; \
} STMT_END
AvALLOC(av) = ary;
Copy(strp,ary,size,SV*);
AvREIFY_only(av);
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
AvFILLp(av) = size - 1;
AvMAX(av) = size - 1;
while (size--) {
*dst-- = *src--;
}
dst = AvARRAY(ary);
- SvPV_set(ary, (char*)(AvARRAY(ary) - diff)); /* diff is negative */
+ AvARRAY(ary) = AvARRAY(ary) - diff; /* diff is negative */
AvMAX(ary) += diff;
}
else {
dst = src - diff;
Move(src, dst, offset, SV*);
}
- SvPV_set(ary, (char*)(AvARRAY(ary) - diff));/* diff is positive */
+ AvARRAY(ary) = AvARRAY(ary) - diff;/* diff is positive */
AvMAX(ary) += diff;
AvFILLp(ary) += diff;
}
SV **ary = AvALLOC(av);
if (AvARRAY(av) != ary) {
AvMAX(av) += AvARRAY(av) - AvALLOC(av);
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
if (items >= AvMAX(av) + 1) {
AvMAX(av) = items - 1;
Renew(ary,items+1,SV*);
AvALLOC(av) = ary;
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
}
++mark;
SV **ary = AvALLOC(av);
if (AvARRAY(av) != ary) {
AvMAX(av) += AvARRAY(av) - AvALLOC(av);
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
if (items > AvMAX(av) + 1) {
AvMAX(av) = items - 1;
Renew(ary,items,SV*);
AvALLOC(av) = ary;
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
}
Copy(MARK,AvARRAY(av),items,SV*);
SV** ary = AvALLOC(av);
if (AvARRAY(av) != ary) {
AvMAX(av) += AvARRAY(av) - AvALLOC(av);
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
if (AvMAX(av) < 1) {
AvMAX(av) = 1;
Renew(ary,2,SV*);
- SvPV_set(av, (char*)ary);
+ AvARRAY(av) = ary;
}
}
AvFILLp(av) = 1;
src_ary = AvARRAY((AV*)sstr);
Newxz(dst_ary, AvMAX((AV*)sstr)+1, SV*);
ptr_table_store(PL_ptr_table, src_ary, dst_ary);
- SvPV_set(dstr, (char*)dst_ary);
+ AvARRAY((AV*)dstr) = dst_ary;
AvALLOC((AV*)dstr) = dst_ary;
if (AvREAL((AV*)sstr)) {
while (items-- > 0)
}
}
else {
- SvPV_set(dstr, NULL);
+ AvARRAY((AV*)dstr) = NULL;
AvALLOC((AV*)dstr) = (SV**)NULL;
}
break;
(((XPVNV*)SvANY(sv))->xnv_u.xnv_nv = (val)); } STMT_END
#define SvPV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
+ assert(SvTYPE(sv) != SVt_PVAV); \
assert(SvTYPE(sv) != SVt_PVHV); \
assert(!isGV_with_GP(sv)); \
((sv)->sv_u.svu_pv = (val)); } STMT_END