void
Perl_av_extend(pTHX_ AV *av, I32 key)
{
+ MAGIC *mg;
+
assert(av);
- MAGIC * const mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied);
+ mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied);
if (mg) {
dSP;
ENTER;
register I32 key;
assert(av);
-
-/* XXX Should av_clear really be NN? */
#ifdef DEBUGGING
if (SvREFCNT(av) == 0 && ckWARN_d(WARN_DEBUGGING)) {
Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), "Attempt to clear deleted array");
}
if (nest < maxnest && !HvEITER_get(sv)) { /* Try to preserve iterator */
HE *he;
- HV *hv = (HV*)sv;
+ HV * const hv = (HV*)sv;
int count = maxnest - nest;
hv_iterinit(hv);
SV *elt, *keysv;
const char *keypv;
STRLEN len;
- U32 hash = HeHASH(he);
+ const U32 hash = HeHASH(he);
keysv = hv_iterkeysv(he);
keypv = SvPV_const(keysv, len);
p |OP* |append_list |I32 optype|NULLOK LISTOP* first|NULLOK LISTOP* last
p |I32 |apply |I32 type|NN SV** mark|NN SV** sp
ApM |void |apply_attrs_string|NN const char *stashpv|NN CV *cv|NN const char *attrstr|STRLEN len
-Apd |void |av_clear |NULLOK AV* ar
-Apd |SV* |av_delete |NULLOK AV* ar|I32 key|I32 flags
-ApdR |bool |av_exists |NULLOK AV* ar|I32 key
+Apd |void |av_clear |NN AV* ar
+Apd |SV* |av_delete |NN AV* ar|I32 key|I32 flags
+ApdR |bool |av_exists |NN AV* ar|I32 key
Apd |void |av_extend |NN AV* ar|I32 key
pR |AV* |av_fake |I32 size|NN SV** svp
-ApdR |SV** |av_fetch |NULLOK AV* ar|I32 key|I32 lval
+ApdR |SV** |av_fetch |NN AV* ar|I32 key|I32 lval
Apd |void |av_fill |NN AV* ar|I32 fill
ApdR |I32 |av_len |NN const AV* ar
ApdR |AV* |av_make |I32 size|NN SV** svp
-Apd |SV* |av_pop |NULLOK AV* ar
-Apd |void |av_push |NULLOK AV* ar|NN SV* val
+Apd |SV* |av_pop |NN AV* ar
+Apd |void |av_push |NN AV* ar|NN SV* val
p |void |av_reify |NN AV* ar
-ApdR |SV* |av_shift |NULLOK AV* ar
-Apd |SV** |av_store |NULLOK AV* ar|I32 key|NULLOK SV* val
-Apd |void |av_undef |NULLOK AV* ar
-Apd |void |av_unshift |NULLOK AV* ar|I32 num
+ApdR |SV* |av_shift |NN AV* ar
+Apd |SV** |av_store |NN AV* ar|I32 key|NULLOK SV* val
+Apd |void |av_undef |NN AV* ar
+Apd |void |av_unshift |NN AV* ar|I32 num
Apo |SV** |av_arylen_p |NN AV* av
pR |OP* |bind_match |I32 type|NN OP* left|NN OP* pat
pR |OP* |block_end |I32 floor|NULLOK OP* seq
{
SV * const sv = GvSVn(gv);
if (!sv_derived_from(PL_patchlevel, "version"))
- (void *)upg_version(PL_patchlevel);
+ upg_version(PL_patchlevel);
GvSV(gv) = vnumify(PL_patchlevel);
SvREADONLY_on(GvSV(gv));
SvREFCNT_dec(sv);
return s;
case 'v':
if (!sv_derived_from(PL_patchlevel, "version"))
- (void *)upg_version(PL_patchlevel);
+ upg_version(PL_patchlevel);
#if !defined(DGUX)
PerlIO_printf(PerlIO_stdout(),
Perl_form(aTHX_ "\nThis is perl, %"SVf" built for %s",
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
-PERL_CALLCONV void Perl_av_clear(pTHX_ AV* ar);
-PERL_CALLCONV SV* Perl_av_delete(pTHX_ AV* ar, I32 key, I32 flags);
+PERL_CALLCONV void Perl_av_clear(pTHX_ AV* ar)
+ __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV SV* Perl_av_delete(pTHX_ AV* ar, I32 key, I32 flags)
+ __attribute__nonnull__(pTHX_1);
+
PERL_CALLCONV bool Perl_av_exists(pTHX_ AV* ar, I32 key)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_av_extend(pTHX_ AV* ar, I32 key)
__attribute__nonnull__(pTHX_1);
__attribute__nonnull__(pTHX_2);
PERL_CALLCONV SV** Perl_av_fetch(pTHX_ AV* ar, I32 key, I32 lval)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_av_fill(pTHX_ AV* ar, I32 fill)
__attribute__nonnull__(pTHX_1);
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV SV* Perl_av_pop(pTHX_ AV* ar);
+PERL_CALLCONV SV* Perl_av_pop(pTHX_ AV* ar)
+ __attribute__nonnull__(pTHX_1);
+
PERL_CALLCONV void Perl_av_push(pTHX_ AV* ar, SV* val)
+ __attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
PERL_CALLCONV void Perl_av_reify(pTHX_ AV* ar)
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV SV* Perl_av_shift(pTHX_ AV* ar)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV SV** Perl_av_store(pTHX_ AV* ar, I32 key, SV* val)
+ __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void Perl_av_undef(pTHX_ AV* ar)
+ __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void Perl_av_unshift(pTHX_ AV* ar, I32 num)
+ __attribute__nonnull__(pTHX_1);
-PERL_CALLCONV SV** Perl_av_store(pTHX_ AV* ar, I32 key, SV* val);
-PERL_CALLCONV void Perl_av_undef(pTHX_ AV* ar);
-PERL_CALLCONV void Perl_av_unshift(pTHX_ AV* ar, I32 num);
PERL_CALLCONV SV** Perl_av_arylen_p(pTHX_ AV* av)
__attribute__nonnull__(pTHX_1);
{
dVAR;
if (!sv)
- return sv;
+ return NULL;
if (SvREADONLY(sv) && SvIMMORTAL(sv))
return sv;
EXTEND_MORTAL(1);
register SV *sv;
if (!old)
- return Nullsv;
+ return NULL;
if (SvTYPE(old) == SVTYPEMASK) {
if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ packWARN(WARN_INTERNAL), "semi-panic: attempt to dup freed string");
PL_regex_padav = newAV();
{
const I32 len = av_len((AV*)proto_perl->Iregex_padav);
- SV** const regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
+ SV* const * const regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
IV i;
av_push(PL_regex_padav,
sv_dup_inc(regexen[0],param));
for(i = 1; i <= len; i++) {
- if(SvREPADTMP(regexen[i])) {
- av_push(PL_regex_padav, sv_dup_inc(regexen[i], param));
- } else {
- av_push(PL_regex_padav,
- SvREFCNT_inc(
- newSViv(PTR2IV(re_dup(INT2PTR(REGEXP *,
- SvIVX(regexen[i])), param)))
- ));
- }
+ const SV * const regex = regexen[i];
+ SV * const sv =
+ SvREPADTMP(regex)
+ ? sv_dup_inc(regex, param)
+ : SvREFCNT_inc(
+ newSViv(PTR2IV(re_dup(
+ INT2PTR(REGEXP *, SvIVX(regex)), param))))
+ ;
+ av_push(PL_regex_padav, sv);
}
}
PL_regex_pad = AvARRAY(PL_regex_padav);
/* update debugger info */
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV *sv = NEWSV(88,0);
+ SV * const sv = NEWSV(88,0);
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);