#ifdef USE_ITHREADS
# define CopFILE(c) ((c)->cop_file)
# define CopFILEGV(c) (CopFILE(c) \
- ? gv_fetchfile(CopFILE(c)) : Nullgv)
+ ? gv_fetchfile(CopFILE(c)) : NULL)
# ifdef NETWARE
# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
# endif
# define CopFILESV(c) (CopFILE(c) \
- ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
+ ? GvSV(gv_fetchfile(CopFILE(c))) : NULL)
# define CopFILEAV(c) (CopFILE(c) \
? GvAV(gv_fetchfile(CopFILE(c))) : NULL)
# ifdef DEBUGGING
# define CopFILEGV(c) ((c)->cop_filegv)
# define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
# define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
-# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
+# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : NULL)
# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : NULL)
# ifdef DEBUGGING
# define CopFILEAVx(c) (assert(CopFILEGV(c)), GvAV(CopFILEGV(c)))
# define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
# define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
# define CopSTASH_free(c)
-# define CopFILE_free(c) (SvREFCNT_dec(CopFILEGV(c)),(CopFILEGV(c) = Nullgv))
+# define CopFILE_free(c) (SvREFCNT_dec(CopFILEGV(c)),(CopFILEGV(c) = NULL))
#endif /* USE_ITHREADS */
} \
sv = (SV*)cx->blk_sub.cv; \
if (sv && (CvDEPTH((CV*)sv) = cx->blk_sub.olddepth)) \
- sv = Nullsv; \
+ sv = NULL; \
} STMT_END
#define LEAVESUB(sv) \
STMT_START { \
cx->blk_eval.old_in_eval = PL_in_eval; \
cx->blk_eval.old_op_type = PL_op->op_type; \
- cx->blk_eval.old_namesv = (n ? newSVpv(n,0) : Nullsv); \
+ cx->blk_eval.old_namesv = (n ? newSVpv(n,0) : NULL); \
cx->blk_eval.old_eval_root = PL_eval_root; \
cx->blk_eval.cur_text = PL_linestr; \
cx->blk_eval.cv = NULL; /* set by doeval(), as applicable */ \
if ((cx->blk_loop.iterdata = (idata))) \
cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx)); \
else \
- cx->blk_loop.itersave = Nullsv;
+ cx->blk_loop.itersave = NULL;
#else
# define CxITERVAR(c) ((c)->blk_loop.itervar)
# define CX_ITERDATA_SET(cx,ivar) \
if ((cx->blk_loop.itervar = (SV**)(ivar))) \
cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx)); \
else \
- cx->blk_loop.itersave = Nullsv;
+ cx->blk_loop.itersave = NULL;
#endif
#define PUSHLOOP(cx, dat, s) \
cx->blk_loop.redo_op = cLOOP->op_redoop; \
cx->blk_loop.next_op = cLOOP->op_nextop; \
cx->blk_loop.last_op = cLOOP->op_lastop; \
- cx->blk_loop.iterlval = Nullsv; \
+ cx->blk_loop.iterlval = NULL; \
cx->blk_loop.iterary = NULL; \
cx->blk_loop.iterix = -1; \
CX_ITERDATA_SET(cx,dat);
return PL_laststatval;
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- PL_statgv = Nullgv;
+ PL_statgv = NULL;
sv_setpvn(PL_statname,"", 0);
return (PL_laststatval = -1);
}
}
s = SvPV_const(sv, len);
- PL_statgv = Nullgv;
+ PL_statgv = NULL;
sv_setpvn(PL_statname, s, len);
s = SvPVX_const(PL_statname); /* s now NUL-terminated */
PL_laststype = OP_STAT;
Perl_croak(aTHX_ no_prev_lstat);
PL_laststype = OP_LSTAT;
- PL_statgv = Nullgv;
+ PL_statgv = NULL;
sv = POPs;
PUTBACK;
if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVGV && ckWARN(WARN_IO)) {
STRLEN len;
char *s;
char *temp_buffer = NULL;
- SV* svrecode = Nullsv;
+ SV* svrecode = NULL;
if (RsSNARF(PL_rs))
return 0;
if (PL_op->op_flags & OPf_MOD || LVRET) { /* lvalue */
dTARGET; /* make sure to clear its target here */
if (SvTYPE(TARG) == SVt_PVLV)
- LvTARG(TARG) = Nullsv;
+ LvTARG(TARG) = NULL;
PUSHs(TARG);
}
RETURN;
if (PL_op->op_flags & OPf_MOD || LVRET) { /* lvalue */
if (SvTYPE(TARG) < SVt_PVLV) {
sv_upgrade(TARG, SVt_PVLV);
- sv_magic(TARG, Nullsv, PERL_MAGIC_nkeys, NULL, 0);
+ sv_magic(TARG, NULL, PERL_MAGIC_nkeys, NULL, 0);
}
LvTYPE(TARG) = 'k';
if (LvTARG(TARG) != (SV*)keys) {
AV * const comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
sv = *av_fetch(comppad, o->op_targ, FALSE);
} else
- sv = Nullsv;
+ sv = NULL;
if (sv)
PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
else
#if !defined(PERL_CORE)
# define sv_setptrobj(rv,ptr,name) sv_setref_iv(rv,name,PTR2IV(ptr))
-# define sv_setptrref(rv,ptr) sv_setref_iv(rv,Nullch,PTR2IV(ptr))
+# define sv_setptrref(rv,ptr) sv_setref_iv(rv,NULL,PTR2IV(ptr))
#endif
#if !defined(PERL_CORE) && !defined(PERL_NOCOMPAT)
GV *gv;
if (!PL_defstash)
- return Nullgv;
+ return NULL;
tmplen = strlen(name) + 2;
if (tmplen < sizeof smallbuf)
sv_setpvn(GvSV(gv), name, tmplen - 2);
#endif
if (PERLDB_LINE)
- hv_magic(GvHVn(gv_AVadd(gv)), Nullgv, PERL_MAGIC_dbfile);
+ hv_magic(GvHVn(gv_AVadd(gv)), NULL, PERL_MAGIC_dbfile);
}
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
gvp = (GV**)hv_fetch(stash, name, len, (level >= 0));
if (!gvp)
- topgv = Nullgv;
+ topgv = NULL;
else {
topgv = *gvp;
if (SvTYPE(topgv) != SVt_PVGV)
STRLEN packname_len;
if (len == S_autolen && strnEQ(name, S_autoload, S_autolen))
- return Nullgv;
+ return NULL;
if (stash) {
if (SvTYPE(stash) < SVt_PVHV) {
packname = SvPV_const((SV*)stash, packname_len);
}
}
if (!(gv = gv_fetchmeth(stash, S_autoload, S_autolen, FALSE)))
- return Nullgv;
+ return NULL;
cv = GvCV(gv);
if (!(CvROOT(cv) || CvXSUB(cv)))
- return Nullgv;
+ return NULL;
/*
* Inheriting AUTOLOAD for non-methods works ... for now.
ENTER;
save_scalar(gv); /* keep the value of $! */
Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
- newSVpvs("Errno"), Nullsv);
+ newSVpvs("Errno"), NULL);
LEAVE;
SPAGAIN;
stash = gv_stashpvs("Errno", FALSE);
if (!stash)
stash = PL_defstash;
if (!stash || !SvREFCNT(stash)) /* symbol table under destruction */
- return Nullgv;
+ return NULL;
len = name_cursor - name;
if (len > 0) {
tmpbuf[len++] = ':';
tmpbuf[len] = '\0';
gvp = (GV**)hv_fetch(stash,tmpbuf,len,add);
- gv = gvp ? *gvp : Nullgv;
+ gv = gvp ? *gvp : NULL;
if (gv && gv != (GV*)&PL_sv_undef) {
if (SvTYPE(gv) != SVt_PVGV)
gv_init(gv, stash, tmpbuf, len, (add & GV_ADDMULTI));
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
if (!gv || gv == (GV*)&PL_sv_undef)
- return Nullgv;
+ return NULL;
if (!(stash = GvHV(gv)))
stash = GvHV(gv) = newHV();
stash = GvHV(gv_fetchpvn_flags("<none>::", 8, GV_ADDMULTI, SVt_PVHV));
}
else
- return Nullgv;
+ return NULL;
}
if (!SvREFCNT(stash)) /* symbol table under destruction */
- return Nullgv;
+ return NULL;
gvp = (GV**)hv_fetch(stash,name,len,add);
if (!gvp || *gvp == (GV*)&PL_sv_undef)
- return Nullgv;
+ return NULL;
gv = *gvp;
if (SvTYPE(gv) == SVt_PVGV) {
if (add) {
if (strEQ(name2, "VERLOAD")) {
HV* const hv = GvHVn(gv);
GvMULTI_on(gv);
- hv_magic(hv, Nullgv, PERL_MAGIC_overload);
+ hv_magic(hv, NULL, PERL_MAGIC_overload);
}
break;
case 'S':
}
GvMULTI_on(gv);
hv = GvHVn(gv);
- hv_magic(hv, Nullgv, PERL_MAGIC_sig);
+ hv_magic(hv, NULL, PERL_MAGIC_sig);
for (i = 1; i < SIG_SIZE; i++) {
SV * const * const init = hv_fetch(hv, PL_sig_name[i], strlen(PL_sig_name[i]), 1);
if (init)
case '-':
{
AV* const av = GvAVn(gv);
- sv_magic((SV*)av, Nullsv, PERL_MAGIC_regdata, NULL, 0);
+ sv_magic((SV*)av, NULL, PERL_MAGIC_regdata, NULL, 0);
SvREADONLY_on(av);
goto magicalize;
}
}
hek = hv_fetch_common (hv, NULL, key, klen, flags,
lval ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) : HV_FETCH_JUST_SV,
- Nullsv, 0);
+ NULL, 0);
return hek ? &HeVAL(hek) : NULL;
}
Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
{
return hv_fetch_common(hv, keysv, NULL, 0, 0,
- (lval ? HV_FETCH_LVALUE : 0), Nullsv, hash);
+ (lval ? HV_FETCH_LVALUE : 0), NULL, hash);
}
STATIC HE *
const char * const nkey = strupr(savepvn(key,klen));
/* Note that this fetch is for nkey (the uppercased
key) whereas the store is for key (the original) */
- entry = hv_fetch_common(hv, Nullsv, nkey, klen,
+ entry = hv_fetch_common(hv, NULL, nkey, klen,
HVhek_FREEKEY, /* free nkey */
0 /* non-LVAL fetch */,
- Nullsv /* no value */,
+ NULL /* no value */,
0 /* compute hash */);
if (!entry && (action & HV_FETCH_LVALUE)) {
/* This call will free key if necessary.
int masked_flags;
if (!hv)
- return Nullsv;
+ return NULL;
if (keysv) {
if (k_flags & HVhek_FREEKEY)
SV *sv;
entry = hv_fetch_common(hv, keysv, key, klen,
k_flags & ~HVhek_FREEKEY, HV_FETCH_LVALUE,
- Nullsv, hash);
+ NULL, hash);
sv = entry ? HeVAL(entry) : NULL;
if (sv) {
if (SvMAGICAL(sv)) {
sv_unmagic(sv, PERL_MAGIC_tiedelem);
return sv;
}
- return Nullsv; /* element cannot be deleted */
+ return NULL; /* element cannot be deleted */
}
#ifdef ENV_IS_CASELESS
else if (mg_find((SV*)hv, PERL_MAGIC_env)) {
}
xhv = (XPVHV*)SvANY(hv);
if (!HvARRAY(hv))
- return Nullsv;
+ return NULL;
if (is_utf8) {
const char * const keysave = key;
Safefree(key);
if (d_flags & G_DISCARD)
- sv = Nullsv;
+ sv = NULL;
else {
sv = sv_2mortal(HeVAL(entry));
HeVAL(entry) = &PL_sv_placeholder;
if (k_flags & HVhek_FREEKEY)
Safefree(key);
- return Nullsv;
+ return NULL;
}
STATIC void
/* what follows was the moral equivalent of:
if ((Svp = hv_fetch(PL_strtab, tmpsv, FALSE, hash))) {
- if (--*Svp == Nullsv)
+ if (--*Svp == NULL)
hv_delete(PL_strtab, str, len, G_DISCARD, hash);
} */
xhv = (XPVHV*)SvANY(PL_strtab);
/* what follows is the moral equivalent of:
if (!(Svp = hv_fetch(PL_strtab, str, len, FALSE)))
- hv_store(PL_strtab, str, len, Nullsv, hash);
+ hv_store(PL_strtab, str, len, NULL, hash);
Can't rehash the shared string table, so not sure if it's worth
counting the number of entries in the linked list
described elsewhere in this document.
=for apidoc Am|SV*|HeSVKEY|HE* he
-Returns the key as an C<SV*>, or C<Nullsv> if the hash entry does not
+Returns the key as an C<SV*>, or C<NULL> if the hash entry does not
contain an C<SV*> key.
=for apidoc Am|SV*|HeSVKEY_force|HE* he
#define HeSVKEY(he) ((HeKEY(he) && \
HeKLEN(he) == HEf_SVKEY) ? \
- HeKEY_sv(he) : Nullsv)
+ HeKEY_sv(he) : NULL)
#define HeSVKEY_force(he) (HeKEY(he) ? \
((HeKLEN(he) == HEf_SVKEY) ? \
PERLVARI(Idef_layerlist, PerlIO_list_t *,NULL)
#endif
-PERLVARI(Iencoding, SV*, Nullsv) /* character encoding */
+PERLVARI(Iencoding, SV*, NULL) /* character encoding */
PERLVAR(Idebug_pad, struct perl_debug_pad) /* always needed because of the re extension */
if (lc && lc->decimal_point) {
if (lc->decimal_point[0] == '.' && lc->decimal_point[1] == 0) {
SvREFCNT_dec(PL_numeric_radix_sv);
- PL_numeric_radix_sv = Nullsv;
+ PL_numeric_radix_sv = NULL;
}
else {
if (PL_numeric_radix_sv)
}
}
else
- PL_numeric_radix_sv = Nullsv;
+ PL_numeric_radix_sv = NULL;
# endif /* HAS_LOCALECONV */
#endif /* USE_LOCALE_NUMERIC */
}
void
Perl_sv_taint(pTHX_ SV *sv)
{
- sv_magic((sv), Nullsv, PERL_MAGIC_taint, NULL, 0);
+ sv_magic((sv), NULL, PERL_MAGIC_taint, NULL, 0);
}
/* sv_2iv() is now a macro using Perl_sv_2iv_flags();
Perl_magic_getdefelem(pTHX_ SV *sv, MAGIC *mg)
{
dVAR;
- SV *targ = Nullsv;
+ SV *targ = NULL;
if (LvTARGLEN(sv)) {
if (mg->mg_obj) {
SV * const ahv = LvTARG(sv);
LvTARG(sv) = SvREFCNT_inc(targ);
LvTARGLEN(sv) = 0;
SvREFCNT_dec(mg->mg_obj);
- mg->mg_obj = Nullsv;
+ mg->mg_obj = NULL;
mg->mg_flags &= ~MGf_REFCOUNTED;
}
}
{
dVAR;
MAGIC *mg;
- SV *value = Nullsv;
+ SV *value = NULL;
if (!LvTARGLEN(sv) || !(mg = mg_find(sv, PERL_MAGIC_defelem)))
return;
else {
AV* const av = (AV*)LvTARG(sv);
if ((I32)LvTARGLEN(sv) < 0 && (I32)LvTARGOFF(sv) > AvFILL(av))
- LvTARG(sv) = Nullsv; /* array can't be extended */
+ LvTARG(sv) = NULL; /* array can't be extended */
else {
SV** const svp = av_fetch(av, LvTARGOFF(sv), TRUE);
if (!svp || (value = *svp) == &PL_sv_undef)
LvTARG(sv) = value;
LvTARGLEN(sv) = 0;
SvREFCNT_dec(mg->mg_obj);
- mg->mg_obj = Nullsv;
+ mg->mg_obj = NULL;
mg->mg_flags &= ~MGf_REFCOUNTED;
}
PL_encoding = newSVsv(sv);
}
else {
- PL_encoding = Nullsv;
+ PL_encoding = NULL;
}
}
break;
PL_ors_sv = newSVsv(sv);
}
else {
- PL_ors_sv = Nullsv;
+ PL_ors_sv = NULL;
}
break;
case ',':
PL_ofs_sv = newSVsv(sv);
}
else {
- PL_ofs_sv = Nullsv;
+ PL_ofs_sv = NULL;
}
break;
case '[':
dTHX;
#endif
dSP;
- GV *gv = Nullgv;
- SV *sv = Nullsv;
+ GV *gv = NULL;
+ SV *sv = NULL;
SV * const tSv = PL_Sv;
CV *cv = NULL;
OP *myop = PL_op;
}
#else
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
#endif
}
break;
case OP_METHOD_NAMED:
case OP_CONST:
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
#ifdef USE_ITHREADS
/** Bug #15654
Even if op_clear does a pad_free for the target of the op,
case OP_TRANS:
if (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) {
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
}
else {
Safefree(cPVOPo->op_pv);
Perl_load_module(aTHX_ PERL_LOADMOD_IMPORT_OPS,
newSVpvs(ATTRSMODULE),
- Nullsv, prepend_elem(OP_LIST,
+ NULL, prepend_elem(OP_LIST,
newSVOP(OP_CONST, 0, newSVpv(stashpv,0)),
prepend_elem(OP_LIST,
newSVOP(OP_CONST, 0,
{
dVAR;
OP *doop;
- GV *gv = Nullgv;
+ GV *gv = NULL;
if (!force_builtin) {
gv = gv_fetchpvs("do", GV_NOTQUAL, SVt_PVCV);
if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) {
GV * const * const gvp = (GV**)hv_fetchs(PL_globalstash, "do", FALSE);
- gv = gvp ? *gvp : Nullgv;
+ gv = gvp ? *gvp : NULL;
}
}
cPADOPx(tmpop)->op_padix = 0; /* steal it */
#else
pm->op_pmreplroot = (OP*)cSVOPx(tmpop)->op_sv;
- cSVOPx(tmpop)->op_sv = Nullsv; /* steal it */
+ cSVOPx(tmpop)->op_sv = NULL; /* steal it */
#endif
pm->op_pmflags |= PMf_ONCE;
tmpop = cUNOPo->op_first; /* to list (nulled) */
LEAVE;
}
SvPOK_off((SV*)cv); /* forget prototype */
- CvGV(cv) = Nullgv;
+ CvGV(cv) = NULL;
pad_undef(cv);
{
if (((!p != !SvPOK(cv)) || (p && strNE(p, SvPVX_const(cv)))) && ckWARN_d(WARN_PROTOTYPE)) {
SV* const msg = sv_newmortal();
- SV* name = Nullsv;
+ SV* name = NULL;
if (gv)
gv_efullname3(name = sv_newmortal(), gv, NULL);
Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
{
dVAR;
- SV *sv = Nullsv;
+ SV *sv = NULL;
if (!o)
- return Nullsv;
+ return NULL;
if (o->op_type == OP_LINESEQ && cLISTOPo->op_first)
o = cLISTOPo->op_first->op_sibling;
if (type == OP_LEAVESUB || type == OP_RETURN)
break;
if (sv)
- return Nullsv;
+ return NULL;
if (type == OP_CONST && cSVOPo->op_sv)
sv = cSVOPo->op_sv;
else if (cv && type == OP_CONST) {
sv = PAD_BASE_SV(CvPADLIST(cv), o->op_targ);
if (!sv)
- return Nullsv;
+ return NULL;
}
else if (cv && type == OP_PADSV) {
if (CvCONST(cv)) { /* newly cloned anon */
/* the candidate should have 1 ref from this pad and 1 ref
* from the parent */
if (!sv || SvREFCNT(sv) != 2)
- return Nullsv;
+ return NULL;
sv = newSVsv(sv);
SvREADONLY_on(sv);
return sv;
}
}
else {
- return Nullsv;
+ return NULL;
}
}
return sv;
#endif
if (!block || !ps || *ps || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS))
- const_sv = Nullsv;
+ const_sv = NULL;
else
const_sv = op_const_sv(block, NULL);
Perl_ck_anoncode(pTHX_ OP *o)
{
cSVOPo->op_targ = pad_add_anon(cSVOPo->op_sv, o->op_type);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
return o;
}
OP *op = ((BINOP*)kid)->op_first;
name = NULL;
if (op) {
- SV *tmpstr = Nullsv;
+ SV *tmpstr = NULL;
const char * const a =
kid->op_type == OP_AELEM ?
"[]" : "{}";
GV *glob_gv;
ENTER;
Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
- newSVpvs("File::Glob"), Nullsv, Nullsv, Nullsv);
+ newSVpvs("File::Glob"), NULL, NULL, NULL);
gv = gv_fetchpvs("CORE::GLOBAL::glob", 0, SVt_PVCV);
glob_gv = gv_fetchpvs("File::Glob::csh_glob", 0, SVt_PVCV);
GvCV(gv) = GvCV(glob_gv);
sv = newSVpvn_share(method, SvCUR(sv), 0);
}
else {
- kSVOP->op_sv = Nullsv;
+ kSVOP->op_sv = NULL;
}
cmop = newSVOP(OP_METHOD_NAMED, 0, sv);
op_free(o);
Perl_ck_require(pTHX_ OP *o)
{
dVAR;
- GV* gv = Nullgv;
+ GV* gv = NULL;
if (o->op_flags & OPf_KIDS) { /* Shall we supply missing .pm? */
SVOP * const kid = (SVOP*)cUNOPo->op_first;
gv = gv_fetchpvs("require", GV_NOTQUAL, SVt_PVCV);
if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) {
GV * const * const gvp = (GV**)hv_fetchs(PL_globalstash, "require", FALSE);
- gv = gvp ? *gvp : Nullgv;
+ gv = gvp ? *gvp : NULL;
}
}
/* XXX I don't know how this isn't readonly already. */
SvREADONLY_on(PAD_SVl(ix));
}
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
o->op_targ = ix;
}
#endif
AvREIFY_only(a0);
}
else {
- av_store(pad, 0, Nullsv);
+ av_store(pad, 0, NULL);
}
AvREAL_off(padlist);
CV * const innercv = (CV*)curpad[ix];
U32 inner_rc = SvREFCNT(innercv);
assert(inner_rc);
- namepad[ix] = Nullsv;
+ namepad[ix] = NULL;
SvREFCNT_dec(namesv);
if (SvREFCNT(comppad) < 2) { /* allow for /(?{ sub{} })/ */
- curpad[ix] = Nullsv;
+ curpad[ix] = NULL;
SvREFCNT_dec(innercv);
inner_rc--;
}
/* our ? */
if ((SvFLAGS(*out_name_sv) & SVpad_OUR)) {
- *out_capture = Nullsv;
+ *out_capture = NULL;
return offset;
}
if (warn && ckWARN(WARN_CLOSURE))
Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
"Variable \"%s\" is not available", name);
- *out_capture = Nullsv;
+ *out_capture = NULL;
}
/* real value */
if (ckWARN(WARN_CLOSURE))
Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
"Variable \"%s\" is not available", name);
- *out_capture = Nullsv;
+ *out_capture = NULL;
}
}
if (!*out_capture) {
/* extend curpad to match namepad */
if (AvFILLp(PL_comppad_name) < AvFILLp(PL_comppad))
- av_store(PL_comppad_name, AvFILLp(PL_comppad), Nullsv);
+ av_store(PL_comppad_name, AvFILLp(PL_comppad), NULL);
if (type == padtidy_SUBCLONE) {
SV * const * const namep = AvARRAY(PL_comppad_name);
* pad are anonymous subs.
* The rest are created anew during cloning.
*/
- if (!((namesv = namep[ix]) != Nullsv &&
+ if (!((namesv = namep[ix]) != NULL &&
namesv != &PL_sv_undef &&
*SvPVX_const(namesv) == '&'))
{
SvREFCNT_dec(PL_curpad[ix]);
- PL_curpad[ix] = Nullsv;
+ PL_curpad[ix] = NULL;
}
}
}
for (ix = 1; ix <= AvFILLp(pad_name); ix++) {
const SV *namesv = pname[ix];
if (namesv && namesv == &PL_sv_undef) {
- namesv = Nullsv;
+ namesv = NULL;
}
if (namesv) {
if (SvFAKE(namesv))
outpad = AvARRAY(AvARRAY(CvPADLIST(outside))[depth]);
for (ix = fpad; ix > 0; ix--) {
- SV* const namesv = (ix <= fname) ? pname[ix] : Nullsv;
- SV *sv = Nullsv;
+ SV* const namesv = (ix <= fname) ? pname[ix] : NULL;
+ SV *sv = NULL;
if (namesv && namesv != &PL_sv_undef) { /* lexical */
if (SvFAKE(namesv)) { /* lexical from outside? */
sv = outpad[(I32)SvNVX(namesv)];
if (ckWARN(WARN_CLOSURE))
Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
"Variable \"%s\" is not available", SvPVX_const(namesv));
- sv = Nullsv;
+ sv = NULL;
}
else {
assert(!SvPADSTALE(sv));
#define PAD_BASE_SV(padlist, po) \
(AvARRAY(padlist)[1]) \
- ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : Nullsv;
+ ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : NULL;
#define PAD_SET_CUR_NOSAVE(padlist,n) \
sv_clean_objs();
PL_sv_objcount = 0;
if (PL_defoutgv && !SvREFCNT(PL_defoutgv))
- PL_defoutgv = Nullgv; /* may have been freed */
+ PL_defoutgv = NULL; /* may have been freed */
}
/* unhook hooks which will soon be, or use, destroyed data */
SvREFCNT_dec(PL_warnhook);
- PL_warnhook = Nullsv;
+ PL_warnhook = NULL;
SvREFCNT_dec(PL_diehook);
- PL_diehook = Nullsv;
+ PL_diehook = NULL;
/* call exit list functions */
while (PL_exitlistlen-- > 0)
#endif /* !PERL_MICRO */
/* reset so print() ends up where we expect */
- setdefout(Nullgv);
+ setdefout(NULL);
#ifdef USE_ITHREADS
/* the syntax tree is shared between clones
if (PL_e_script) {
SvREFCNT_dec(PL_e_script);
- PL_e_script = Nullsv;
+ PL_e_script = NULL;
}
PL_perldb = 0;
/* magical thingies */
SvREFCNT_dec(PL_ofs_sv); /* $, */
- PL_ofs_sv = Nullsv;
+ PL_ofs_sv = NULL;
SvREFCNT_dec(PL_ors_sv); /* $\ */
- PL_ors_sv = Nullsv;
+ PL_ors_sv = NULL;
SvREFCNT_dec(PL_rs); /* $/ */
- PL_rs = Nullsv;
+ PL_rs = NULL;
PL_multiline = 0; /* $* */
Safefree(PL_osname); /* $^O */
PL_osname = NULL;
SvREFCNT_dec(PL_statname);
- PL_statname = Nullsv;
- PL_statgv = Nullgv;
+ PL_statname = NULL;
+ PL_statgv = NULL;
/* defgv, aka *_ should be taken care of elsewhere */
/* clean up after study() */
SvREFCNT_dec(PL_lastscream);
- PL_lastscream = Nullsv;
+ PL_lastscream = NULL;
Safefree(PL_screamfirst);
PL_screamfirst = 0;
Safefree(PL_screamnext);
PL_initav = NULL;
/* shortcuts just get cleared */
- PL_envgv = Nullgv;
- PL_incgv = Nullgv;
- PL_hintgv = Nullgv;
- PL_errgv = Nullgv;
- PL_argvgv = Nullgv;
- PL_argvoutgv = Nullgv;
- PL_stdingv = Nullgv;
- PL_stderrgv = Nullgv;
- PL_last_in_gv = Nullgv;
- PL_replgv = Nullgv;
- PL_DBgv = Nullgv;
- PL_DBline = Nullgv;
- PL_DBsub = Nullgv;
- PL_DBsingle = Nullsv;
- PL_DBtrace = Nullsv;
- PL_DBsignal = Nullsv;
- PL_DBassertion = Nullsv;
+ PL_envgv = NULL;
+ PL_incgv = NULL;
+ PL_hintgv = NULL;
+ PL_errgv = NULL;
+ PL_argvgv = NULL;
+ PL_argvoutgv = NULL;
+ PL_stdingv = NULL;
+ PL_stderrgv = NULL;
+ PL_last_in_gv = NULL;
+ PL_replgv = NULL;
+ PL_DBgv = NULL;
+ PL_DBline = NULL;
+ PL_DBsub = NULL;
+ PL_DBsingle = NULL;
+ PL_DBtrace = NULL;
+ PL_DBsignal = NULL;
+ PL_DBassertion = NULL;
PL_DBcv = NULL;
PL_dbargs = NULL;
PL_debstash = NULL;
SvREFCNT_dec(PL_preambleav);
PL_preambleav = NULL;
SvREFCNT_dec(PL_subname);
- PL_subname = Nullsv;
+ PL_subname = NULL;
SvREFCNT_dec(PL_linestr);
- PL_linestr = Nullsv;
+ PL_linestr = NULL;
#ifdef PERL_USES_PL_PIDSTATUS
SvREFCNT_dec(PL_pidstatus);
PL_pidstatus = NULL;
#endif
SvREFCNT_dec(PL_toptarget);
- PL_toptarget = Nullsv;
+ PL_toptarget = NULL;
SvREFCNT_dec(PL_bodytarget);
- PL_bodytarget = Nullsv;
- PL_formtarget = Nullsv;
+ PL_bodytarget = NULL;
+ PL_formtarget = NULL;
/* free locale stuff */
#ifdef USE_LOCALE_COLLATE
Safefree(PL_numeric_name);
PL_numeric_name = NULL;
SvREFCNT_dec(PL_numeric_radix_sv);
- PL_numeric_radix_sv = Nullsv;
+ PL_numeric_radix_sv = NULL;
#endif
/* clear utf8 character classes */
SvREFCNT_dec(PL_utf8_tofold);
SvREFCNT_dec(PL_utf8_idstart);
SvREFCNT_dec(PL_utf8_idcont);
- PL_utf8_alnum = Nullsv;
- PL_utf8_alnumc = Nullsv;
- PL_utf8_ascii = Nullsv;
- PL_utf8_alpha = Nullsv;
- PL_utf8_space = Nullsv;
- PL_utf8_cntrl = Nullsv;
- PL_utf8_graph = Nullsv;
- PL_utf8_digit = Nullsv;
- PL_utf8_upper = Nullsv;
- PL_utf8_lower = Nullsv;
- PL_utf8_print = Nullsv;
- PL_utf8_punct = Nullsv;
- PL_utf8_xdigit = Nullsv;
- PL_utf8_mark = Nullsv;
- PL_utf8_toupper = Nullsv;
- PL_utf8_totitle = Nullsv;
- PL_utf8_tolower = Nullsv;
- PL_utf8_tofold = Nullsv;
- PL_utf8_idstart = Nullsv;
- PL_utf8_idcont = Nullsv;
+ PL_utf8_alnum = NULL;
+ PL_utf8_alnumc = NULL;
+ PL_utf8_ascii = NULL;
+ PL_utf8_alpha = NULL;
+ PL_utf8_space = NULL;
+ PL_utf8_cntrl = NULL;
+ PL_utf8_graph = NULL;
+ PL_utf8_digit = NULL;
+ PL_utf8_upper = NULL;
+ PL_utf8_lower = NULL;
+ PL_utf8_print = NULL;
+ PL_utf8_punct = NULL;
+ PL_utf8_xdigit = NULL;
+ PL_utf8_mark = NULL;
+ PL_utf8_toupper = NULL;
+ PL_utf8_totitle = NULL;
+ PL_utf8_tolower = NULL;
+ PL_utf8_tofold = NULL;
+ PL_utf8_idstart = NULL;
+ PL_utf8_idcont = NULL;
if (!specialWARN(PL_compiling.cop_warnings))
SvREFCNT_dec(PL_compiling.cop_warnings);
- PL_compiling.cop_warnings = Nullsv;
+ PL_compiling.cop_warnings = NULL;
if (!specialCopIO(PL_compiling.cop_io))
SvREFCNT_dec(PL_compiling.cop_io);
- PL_compiling.cop_io = Nullsv;
+ PL_compiling.cop_io = NULL;
CopFILE_free(&PL_compiling);
CopSTASH_free(&PL_compiling);
PL_defstash = 0;
SvREFCNT_dec(hv);
SvREFCNT_dec(PL_curstname);
- PL_curstname = Nullsv;
+ PL_curstname = NULL;
/* clear queued errors */
SvREFCNT_dec(PL_errors);
- PL_errors = Nullsv;
+ PL_errors = NULL;
FREETMPS;
if (destruct_level >= 2 && ckWARN_d(WARN_INTERNAL)) {
#endif
/* sv_undef needs to stay immortal until after PerlIO_cleanup
- as currently layers use it rather than Nullsv as a marker
+ as currently layers use it rather than NULL as a marker
for no arg - and will try and SvREFCNT_dec it.
*/
SvREFCNT(&PL_sv_undef) = 0;
PL_bitcount = NULL;
Safefree(PL_psig_pend);
PL_psig_pend = (int*)NULL;
- PL_formfeed = Nullsv;
+ PL_formfeed = NULL;
nuke_stacks();
PL_tainting = FALSE;
PL_taint_warn = FALSE;
SvPV_free(PL_mess_sv);
Safefree(SvANY(PL_mess_sv));
Safefree(PL_mess_sv);
- PL_mess_sv = Nullsv;
+ PL_mess_sv = NULL;
}
return STATUS_EXIT;
}
PL_preprocess = FALSE;
if (PL_e_script) {
SvREFCNT_dec(PL_e_script);
- PL_e_script = Nullsv;
+ PL_e_script = NULL;
}
if (PL_do_undump)
gv = gv_fetchpv(name, create, SVt_PV);
if (gv)
return GvSV(gv);
- return Nullsv;
+ return NULL;
}
/*
s++;
if (PL_ors_sv) {
SvREFCNT_dec(PL_ors_sv);
- PL_ors_sv = Nullsv;
+ PL_ors_sv = NULL;
}
if (isDIGIT(*s)) {
I32 flags = 0;
HV *hv;
GvMULTI_on(PL_envgv);
hv = GvHVn(PL_envgv);
- hv_magic(hv, Nullgv, PERL_MAGIC_env);
+ hv_magic(hv, NULL, PERL_MAGIC_env);
#ifndef PERL_MICRO
#ifdef USE_ENVIRON_ARRAY
/* Note that if the supplied env parameter is actually a copy
bool canrelocate)
{
dVAR;
- SV *subdir = Nullsv;
+ SV *subdir = NULL;
const char *p = dir;
if (!p || !*p)
if (PL_e_script) {
SvREFCNT_dec(PL_e_script);
- PL_e_script = Nullsv;
+ PL_e_script = NULL;
}
POPSTACK_TO(PL_mainstack);
int i;
list = PerlIO_list_alloc(aTHX);
for (i=0; i < proto->cur; i++) {
- SV *arg = Nullsv;
+ SV *arg = NULL;
if (proto->array[i].arg)
arg = PerlIO_sv_dup(aTHX_ proto->array[i].arg,param);
PerlIO_list_push(aTHX_ list, proto->array[i].funcs, arg);
/*
* The two SVs are magically freed by load_module
*/
- Perl_load_module(aTHX_ 0, pkgsv, Nullsv, layer, Nullsv);
+ Perl_load_module(aTHX_ 0, pkgsv, NULL, layer, NULL);
PL_in_load_module--;
LEAVE;
return PerlIO_find_layer(aTHX_ name, len, 0);
dVAR;
if (!PL_known_layers)
PL_known_layers = PerlIO_list_alloc(aTHX);
- PerlIO_list_push(aTHX_ PL_known_layers, tab, Nullsv);
+ PerlIO_list_push(aTHX_ PL_known_layers, tab, NULL);
PerlIO_debug("define %s %p\n", tab->name, (void*)tab);
}
/* Legacy binmode is now _defined_ as being equivalent to pushing :raw
So code that used to be here is now in PerlIORaw_pushed().
*/
- return PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_raw), NULL, Nullsv) ? TRUE : FALSE;
+ return PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_raw), NULL, NULL) ? TRUE : FALSE;
}
}
* Save the position as current head considers it
*/
const Off_t old = PerlIO_tell(f);
- PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_pending), "r", Nullsv);
+ PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_pending), "r", NULL);
PerlIOSelf(f, PerlIOBuf)->posn = old;
return PerlIOBuf_unread(aTHX_ f, vbuf, count);
}
PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param)
{
if (!arg)
- return Nullsv;
+ return NULL;
#ifdef sv_dup
if (param) {
return sv_dup(arg, param);
if (self->Getarg)
arg = (*self->Getarg)(aTHX_ o, param, flags);
else {
- arg = Nullsv;
+ arg = NULL;
}
f = PerlIO_push(aTHX_ f, self, PerlIO_modestr(o,buf), arg);
if (arg) {
}
fclose(f2);
}
- if ((f = PerlIO_push(aTHX_(f = PerlIO_allocate(aTHX)), PERLIO_FUNCS_CAST(&PerlIO_stdio), mode, Nullsv))) {
+ if ((f = PerlIO_push(aTHX_(f = PerlIO_allocate(aTHX)), PERLIO_FUNCS_CAST(&PerlIO_stdio), mode, NULL))) {
s = PerlIOSelf(f, PerlIOStdio);
s->stdio = stdio;
}
PerlIO *f2;
/* De-link any lower layers so new :stdio sticks */
*f = NULL;
- if ((f2 = PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_stdio), buf, Nullsv))) {
+ if ((f2 = PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_stdio), buf, NULL))) {
PerlIOStdio *s = PerlIOSelf((f = f2), PerlIOStdio);
s->stdio = stdio;
/* Link previous lower layers under new one */
if (stdio) {
if ((f = PerlIO_push(aTHX_(PerlIO_allocate(aTHX)),
PERLIO_FUNCS_CAST(&PerlIO_stdio),
- "w+", Nullsv))) {
+ "w+", NULL))) {
PerlIOStdio * const s = PerlIOSelf(f, PerlIOStdio);
if (s)
#endif /* ifndef PERLIO_NOT_STDIO */
#endif /* PERLIO_IS_STDIO */
-#define specialCopIO(sv) ((sv) == Nullsv)
+#define specialCopIO(sv) ((sv) == NULL)
/* ----------- fill in things that have not got #define'd ---------- */
PL_op->op_type = OP_ENTEREVAL;
PL_op->op_flags = 0; /* Avoid uninit warning. */
PUSHBLOCK(cx, CXt_EVAL|(IN_PERL_COMPILETIME ? 0 : CXp_REAL), SP);
- PUSHEVAL(cx, 0, Nullgv);
+ PUSHEVAL(cx, 0, NULL);
if (runtime)
rop = doeval(G_SCALAR, startop, runcv, PL_curcop->cop_seq);
/* switch to eval mode */
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, name, Nullgv);
+ PUSHEVAL(cx, name, NULL);
cx->blk_eval.retop = PL_op->op_next;
SAVECOPLINE(&PL_compiling);
runcv = find_runcv(&seq);
PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), SP);
- PUSHEVAL(cx, 0, Nullgv);
+ PUSHEVAL(cx, 0, NULL);
cx->blk_eval.retop = PL_op->op_next;
/* prepare to compile string */
/* Do a smart match */
PP(pp_smartmatch)
{
- return do_smartmatch(Nullhv, Nullhv);
+ return do_smartmatch(NULL, NULL);
}
/* This version of do_smartmatch() implements the following
I32 i;
const I32 other_len = av_len(other_av);
- if (Nullhv == seen_this) {
+ if (NULL == seen_this) {
seen_this = newHV();
(void) sv_2mortal((SV *) seen_this);
}
- if (Nullhv == seen_other) {
+ if (NULL == seen_other) {
seen_this = newHV();
(void) sv_2mortal((SV *) seen_other);
}
IoLINES(datasv) = 0;
if (filter_child_proc) {
SvREFCNT_dec(filter_child_proc);
- IoFMT_GV(datasv) = Nullgv;
+ IoFMT_GV(datasv) = NULL;
}
if (filter_state) {
SvREFCNT_dec(filter_state);
- IoTOP_GV(datasv) = Nullgv;
+ IoTOP_GV(datasv) = NULL;
}
if (filter_sub) {
SvREFCNT_dec(filter_sub);
- IoBOTTOM_GV(datasv) = Nullgv;
+ IoBOTTOM_GV(datasv) = NULL;
}
filter_del(S_run_user_filter);
}
rx->subbeg = savepvn(t, strend - t);
#ifdef PERL_OLD_COPY_ON_WRITE
- rx->saved_copy = Nullsv;
+ rx->saved_copy = NULL;
#endif
}
rx->sublen = strend - t;
if (SvMAGICAL(av) || AvREIFY(av)) {
SV * const * const svp = av_fetch(av, --cx->blk_loop.iterix, FALSE);
- sv = svp ? *svp : Nullsv;
+ sv = svp ? *svp : NULL;
}
else {
sv = AvARRAY(av)[--cx->blk_loop.iterix];
if (SvMAGICAL(av) || AvREIFY(av)) {
SV * const * const svp = av_fetch(av, ++cx->blk_loop.iterix, FALSE);
- sv = svp ? *svp : Nullsv;
+ sv = svp ? *svp : NULL;
}
else {
sv = AvARRAY(av)[++cx->blk_loop.iterix];
}
if (sv && SvIS_FREED(sv)) {
- *itersvp = Nullsv;
+ *itersvp = NULL;
Perl_croak(aTHX_ "Use of freed value in iteration");
}
SV *lv = cx->blk_loop.iterlval;
if (lv && SvREFCNT(lv) > 1) {
SvREFCNT_dec(lv);
- lv = Nullsv;
+ lv = NULL;
}
if (lv)
SvREFCNT_dec(LvTARG(lv));
#ifdef PERL_OLD_COPY_ON_WRITE
bool is_cow;
#endif
- SV *nsv = Nullsv;
+ SV *nsv = NULL;
/* known replacement string? */
- dstr = (pm->op_pmflags & PMf_CONST) ? POPs : Nullsv;
+ dstr = (pm->op_pmflags & PMf_CONST) ? POPs : NULL;
if (PL_op->op_flags & OPf_STACKED)
TARG = POPs;
else if (PL_op->op_private & OPpTARGET_MY)
lv = sv_newmortal();
sv_upgrade(lv, SVt_PVLV);
LvTYPE(lv) = 'y';
- sv_magic(lv, Nullsv, PERL_MAGIC_defelem, NULL, 0);
+ sv_magic(lv, NULL, PERL_MAGIC_defelem, NULL, 0);
LvTARG(lv) = SvREFCNT_inc(av);
LvTARGOFF(lv) = elem;
LvTARGLEN(lv) = 1;
HV* stash;
STRLEN namelen;
const char* packname = NULL;
- SV *packsv = Nullsv;
+ SV *packsv = NULL;
STRLEN packlen;
const char * const name = SvPV_const(meth, namelen);
SV * const sv = *(PL_stack_base + TOPMARK + 1);
SV *fromstr;
STRLEN fromlen;
I32 len;
- SV *lengthcode = Nullsv;
+ SV *lengthcode = NULL;
I32 datumtype = symptr->code;
howlen_t howlen = symptr->howlen;
char *start = SvPVX(cat);
p2 = SP;
for (i=0; i < max; i++) {
SV **svp = av_fetch(av, i, FALSE);
- *SP++ = (svp) ? *svp : Nullsv;
+ *SP++ = (svp) ? *svp : NULL;
}
}
else {
#define tryCALL_AMAGICbin(left,right,meth) \
(PL_amagic_generation && (SvAMAGIC(left)||SvAMAGIC(right))) \
? amagic_call(left, right, CAT2(meth,_amg), 0) \
- : Nullsv;
+ : NULL;
static I32
S_amagic_ncmp(pTHX_ register SV *a, register SV *b)
IO *io;
PerlIO *fp;
MAGIC *mg;
- SV *discp = Nullsv;
+ SV *discp = NULL;
if (MAXARG < 1)
RETPUSHUNDEF;
SvTYPE(varsv) == SVt_PVHV))
Perl_croak(aTHX_
"Self-ties of arrays and hashes are not supported");
- sv_magic(varsv, (SvRV(sv) == varsv ? Nullsv : sv), how, NULL, 0);
+ sv_magic(varsv, (SvRV(sv) == varsv ? NULL : sv), how, NULL, 0);
}
LEAVE;
SP = PL_stack_base + markoff;
goto do_fstat;
}
sv_setpv(PL_statname, SvPV_nolen_const(sv));
- PL_statgv = Nullgv;
+ PL_statgv = NULL;
PL_laststype = PL_op->op_type;
if (PL_op->op_type == OP_LSTAT)
PL_laststatval = PerlLIO_lstat(SvPV_nolen_const(PL_statname), &PL_statcache);
dSP;
int fd;
GV *gv;
- SV *tmpsv = Nullsv;
+ SV *tmpsv = NULL;
STACKED_FTEST_CHECK;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
gv = (GV*)SvRV(POPs);
else
- gv = Nullgv;
+ gv = NULL;
if (gv) {
EXTEND(SP, 1);
else {
sv = POPs;
really_filename:
- PL_statgv = Nullgv;
+ PL_statgv = NULL;
PL_laststype = OP_STAT;
sv_setpv(PL_statname, SvPV_nolen_const(sv));
if (!(fp = PerlIO_open(SvPVX_const(PL_statname), "r"))) {
value = (I32)do_aexec5(really, MARK, SP, pp[1], did_pipes);
}
else if (SP - MARK != 1)
- value = (I32)do_aexec5(Nullsv, MARK, SP, pp[1], did_pipes);
+ value = (I32)do_aexec5(NULL, MARK, SP, pp[1], did_pipes);
else {
value = (I32)do_exec3(SvPVx_nolen(sv_mortalcopy(*SP)), pp[1], did_pipes);
}
}
else if (SP - MARK != 1) {
# if defined(WIN32) || defined(OS2) || defined(__SYMBIAN32__)
- value = (I32)do_aspawn(Nullsv, MARK, SP);
+ value = (I32)do_aspawn(NULL, MARK, SP);
# else
- value = (I32)do_aspawn(Nullsv, (void **)MARK, (void **)SP);
+ value = (I32)do_aspawn(NULL, (void **)MARK, (void **)SP);
# endif
}
else {
}
else if (SP - MARK != 1)
#ifdef VMS
- value = (I32)vms_do_aexec(Nullsv, MARK, SP);
+ value = (I32)vms_do_aexec(NULL, MARK, SP);
#else
# ifdef __OPEN_VM
{
- (void ) do_aspawn(Nullsv, MARK, SP);
+ (void ) do_aspawn(NULL, MARK, SP);
value = 0;
}
# else
- value = (I32)do_aexec(Nullsv, MARK, SP);
+ value = (I32)do_aexec(NULL, MARK, SP);
# endif
#endif
else {
SvREFCNT_dec(do_utf8 ? prog->check_utf8 : prog->check_substr);
if (do_utf8 ? prog->check_substr : prog->check_utf8)
SvREFCNT_dec(do_utf8 ? prog->check_substr : prog->check_utf8);
- prog->check_substr = prog->check_utf8 = Nullsv; /* disable */
- prog->float_substr = prog->float_utf8 = Nullsv; /* clear */
- check = Nullsv; /* abort */
+ prog->check_substr = prog->check_utf8 = NULL; /* disable */
+ prog->float_substr = prog->float_utf8 = NULL; /* clear */
+ check = NULL; /* abort */
s = strpos;
/* XXXX This is a remnant of the old implementation. It
looks wasteful, since now INTUIT can use many
PL_reg_ganch = strbeg;
}
- if (!(flags & REXEC_CHECKED) && (prog->check_substr != Nullsv || prog->check_utf8 != Nullsv)) {
+ if (!(flags & REXEC_CHECKED) && (prog->check_substr != NULL || prog->check_utf8 != NULL)) {
re_scream_pos_data d;
d.scream_olds = &scream_olds;
"Did not find anchored character...\n")
);
}
- else if (prog->anchored_substr != Nullsv
- || prog->anchored_utf8 != Nullsv
- || ((prog->float_substr != Nullsv || prog->float_utf8 != Nullsv)
+ else if (prog->anchored_substr != NULL
+ || prog->anchored_utf8 != NULL
+ || ((prog->float_substr != NULL || prog->float_utf8 != NULL)
&& prog->float_max_offset < strend - s)) {
SV *must;
I32 back_max;
}
else {
dontbother = 0;
- if (prog->float_substr != Nullsv || prog->float_utf8 != Nullsv) {
+ if (prog->float_substr != NULL || prog->float_utf8 != NULL) {
/* Trim the end. */
char *last;
SV* float_real;
const I32 myfloor = PL_tmps_floor;
while (PL_tmps_ix > myfloor) { /* clean up after last statement */
SV* const sv = PL_tmps_stack[PL_tmps_ix];
- PL_tmps_stack[PL_tmps_ix--] = Nullsv;
+ PL_tmps_stack[PL_tmps_ix--] = NULL;
if (sv && sv != &PL_sv_undef) {
SvTEMP_off(sv);
SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
*/
svp[i] = svp[fill];
}
- svp[fill] = Nullsv;
+ svp[fill] = NULL;
AvFILLp(av) = fill - 1;
}
}
(UV)SvFLAGS(referrer));
}
- *svp = Nullsv;
+ *svp = NULL;
}
svp++;
}
STRLEN cur2;
I32 eq = 0;
char *tpv = NULL;
- SV* svrecode = Nullsv;
+ SV* svrecode = NULL;
if (!sv1) {
pv1 = "";
const char *pv1, *pv2;
char *tpv = NULL;
I32 cmp;
- SV *svrecode = Nullsv;
+ SV *svrecode = NULL;
if (!sv1) {
pv1 = "";
if (SvTYPE(old) == SVTYPEMASK) {
if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ packWARN(WARN_INTERNAL), "semi-panic: attempt to dup freed string");
- return Nullsv;
+ return NULL;
}
new_SV(sv);
/* SV_GMAGIC is the default for sv_setv()
Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
{
dVAR;
- GV *gv = Nullgv;
+ GV *gv = NULL;
CV *cv = NULL;
if (!sv)
- return *st = NULL, *gvp = Nullgv, NULL;
+ return *st = NULL, *gvp = NULL, NULL;
switch (SvTYPE(sv)) {
case SVt_PVCV:
*st = CvSTASH(sv);
- *gvp = Nullgv;
+ *gvp = NULL;
return (CV*)sv;
case SVt_PVHV:
case SVt_PVAV:
*st = NULL;
- *gvp = Nullgv;
+ *gvp = NULL;
return NULL;
case SVt_PVGV:
gv = (GV*)sv;
sv = SvRV(sv);
if (SvTYPE(sv) == SVt_PVCV) {
cv = (CV*)sv;
- *gvp = Nullgv;
+ *gvp = NULL;
*st = CvSTASH(cv);
return cv;
}
STRLEN origlen;
I32 svix = 0;
static const char nullstr[] = "(null)";
- SV *argsv = Nullsv;
+ SV *argsv = NULL;
bool has_utf8 = DO_UTF8(sv); /* has the result utf8? */
const bool pat_utf8 = has_utf8; /* the pattern is in utf8? */
- SV *nsv = Nullsv;
+ SV *nsv = NULL;
/* Times 4: a decimal digit takes more than 3 binary digits.
* NV_DIG: mantissa takes than many decimal digits.
* Plus 32: Playing safe. */
const char *eptr = NULL;
STRLEN elen = 0;
- SV *vecsv = Nullsv;
+ SV *vecsv = NULL;
const U8 *vecstr = Null(U8*);
STRLEN veclen = 0;
char c = 0;
else
ret->subbeg = NULL;
#ifdef PERL_OLD_COPY_ON_WRITE
- ret->saved_copy = Nullsv;
+ ret->saved_copy = NULL;
#endif
ptr_table_store(PL_ptr_table, r, ret);
/* don't dup if copying back - CvGV isn't refcounted, so the
* duped GV may never be freed. A bit of a hack! DAPM */
CvGV(dstr) = (param->flags & CLONEf_JOIN_IN) ?
- Nullgv : gv_dup(CvGV(dstr), param) ;
+ NULL : gv_dup(CvGV(dstr), param) ;
if (!(param->flags & CLONEf_COPY_STACKS)) {
CvDEPTH(dstr) = 0;
}
PL_nice_chunk_size = 0;
PL_sv_count = 0;
PL_sv_objcount = 0;
- PL_sv_root = Nullsv;
- PL_sv_arenaroot = Nullsv;
+ PL_sv_root = NULL;
+ PL_sv_arenaroot = NULL;
PL_debug = proto_perl->Idebug;
PL_preambleav = av_dup_inc(proto_perl->Ipreambleav, param);
PL_laststatval = proto_perl->Ilaststatval;
PL_laststype = proto_perl->Ilaststype;
- PL_mess_sv = Nullsv;
+ PL_mess_sv = NULL;
PL_ors_sv = sv_dup_inc(proto_perl->Iors_sv, param);
PL_op = proto_perl->Top;
- PL_Sv = Nullsv;
+ PL_Sv = NULL;
PL_Xpv = (XPV*)NULL;
PL_na = proto_perl->Tna;
PL_screamfirst = NULL;
PL_screamnext = NULL;
PL_maxscream = -1; /* reinits on demand */
- PL_lastscream = Nullsv;
+ PL_lastscream = NULL;
PL_watchaddr = NULL;
PL_watchok = NULL;
PL_reg_call_cc = (struct re_cc_state*)NULL;
PL_reg_re = (regexp*)NULL;
PL_reg_ganch = NULL;
- PL_reg_sv = Nullsv;
+ PL_reg_sv = NULL;
PL_reg_match_utf8 = FALSE;
PL_reg_magic = (MAGIC*)NULL;
PL_reg_oldpos = 0;
PL_reg_oldsaved = NULL;
PL_reg_oldsavedlen = 0;
#ifdef PERL_OLD_COPY_ON_WRITE
- PL_nrs = Nullsv;
+ PL_nrs = NULL;
#endif
PL_reg_maxiter = 0;
PL_reg_leftiter = 0;
if (!hv || SvMAGICAL(hv) || !HvARRAY(hv) ||
(HvTOTALKEYS(hv) > FUV_MAX_SEARCH_SIZE))
- return Nullsv;
+ return NULL;
array = HvARRAY(hv);
HeVAL(entry) == &PL_sv_placeholder)
continue;
if (!HeKEY(entry))
- return Nullsv;
+ return NULL;
if (HeKLEN(entry) == HEf_SVKEY)
return sv_mortalcopy(HeKEY_sv(entry));
return sv_2mortal(newSVpvn(HeKEY(entry), HeKLEN(entry)));
}
}
- return Nullsv;
+ return NULL;
}
/* Look for an entry in the array whose value has the same SV as val;
AV *av;
if (!cv || !CvPADLIST(cv))
- return Nullsv;
+ return NULL;
av = (AV*)(*av_fetch(CvPADLIST(cv), 0, FALSE));
sv = *av_fetch(av, targ, FALSE);
/* SvLEN in a pad name is not to be trusted */
if (!obase || (match && (!uninit_sv || uninit_sv == &PL_sv_undef ||
uninit_sv == &PL_sv_placeholder)))
- return Nullsv;
+ return NULL;
switch (obase->op_type) {
const bool pad = (obase->op_type == OP_PADAV || obase->op_type == OP_PADHV);
const bool hash = (obase->op_type == OP_PADHV || obase->op_type == OP_RV2HV);
I32 index = 0;
- SV *keysv = Nullsv;
+ SV *keysv = NULL;
int subscript_type = FUV_SUBSCRIPT_WITHIN;
if (pad) { /* @lex, %lex */
sv = PAD_SVl(obase->op_targ);
- gv = Nullgv;
+ gv = NULL;
}
else {
if (cUNOPx(obase)->op_first->op_type == OP_GV) {
case OP_PADSV:
if (match && PAD_SVl(obase->op_targ) != uninit_sv)
break;
- return varname(Nullgv, '$', obase->op_targ,
- Nullsv, 0, FUV_SUBSCRIPT_NONE);
+ return varname(NULL, '$', obase->op_targ,
+ NULL, 0, FUV_SUBSCRIPT_NONE);
case OP_GVSV:
gv = cGVOPx_gv(obase);
if (!gv || (match && GvSV(gv) != uninit_sv))
break;
- return varname(gv, '$', 0, Nullsv, 0, FUV_SUBSCRIPT_NONE);
+ return varname(gv, '$', 0, NULL, 0, FUV_SUBSCRIPT_NONE);
case OP_AELEMFAST:
if (obase->op_flags & OPf_SPECIAL) { /* lexical array */
if (!svp || *svp != uninit_sv)
break;
}
- return varname(Nullgv, '$', obase->op_targ,
- Nullsv, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
+ return varname(NULL, '$', obase->op_targ,
+ NULL, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
}
else {
gv = cGVOPx_gv(obase);
break;
}
return varname(gv, '$', 0,
- Nullsv, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
+ NULL, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
}
break;
/* $a[uninit_expr] or $h{uninit_expr} */
return find_uninit_var(cBINOPx(obase)->op_last, uninit_sv, match);
- gv = Nullgv;
+ gv = NULL;
o = cBINOPx(obase)->op_first;
kid = cBINOPx(obase)->op_last;
/* get the av or hv, and optionally the gv */
- sv = Nullsv;
+ sv = NULL;
if (o->op_type == OP_PADAV || o->op_type == OP_PADHV) {
sv = PAD_SV(o->op_targ);
}
return varname(gv, '%', o->op_targ,
cSVOPx_sv(kid), 0, FUV_SUBSCRIPT_HASH);
else
- return varname(gv, '@', o->op_targ, Nullsv,
+ return varname(gv, '@', o->op_targ, NULL,
SvIV(cSVOPx_sv(kid)), FUV_SUBSCRIPT_ARRAY);
}
else {
const I32 index = S_find_array_subscript(aTHX_ (AV*)sv, uninit_sv);
if (index >= 0)
return varname(gv, '@', o->op_targ,
- Nullsv, index, FUV_SUBSCRIPT_ARRAY);
+ NULL, index, FUV_SUBSCRIPT_ARRAY);
}
if (match)
break;
return varname(gv,
(o->op_type == OP_PADAV || o->op_type == OP_RV2AV)
? '@' : '%',
- o->op_targ, Nullsv, 0, FUV_SUBSCRIPT_WITHIN);
+ o->op_targ, NULL, 0, FUV_SUBSCRIPT_WITHIN);
}
break;
if (match && GvSV(gv) != uninit_sv)
break;
return varname(gv, '$', 0,
- Nullsv, 0, FUV_SUBSCRIPT_NONE);
+ NULL, 0, FUV_SUBSCRIPT_NONE);
}
/* other possibilities not handled are:
* open $x; or open my $x; should return '${*$x}'
}
break;
}
- return Nullsv;
+ return NULL;
}
{
dVAR;
if (PL_op) {
- SV* varname = Nullsv;
+ SV* varname = NULL;
if (uninit_sv) {
varname = find_uninit_var(PL_op, uninit_sv,0);
if (varname)
=cut
*/
-#define sv_taint(sv) sv_magic((sv), Nullsv, PERL_MAGIC_taint, NULL, 0)
+#define sv_taint(sv) sv_magic((sv), NULL, PERL_MAGIC_taint, NULL, 0)
#define SvTAINTED(sv) (SvMAGICAL(sv) && sv_tainted(sv))
#define SvTAINTED_on(sv) STMT_START{ if(PL_tainting){sv_taint(sv);} }STMT_END
PERLVAR(Tstatbuf, Stat_t)
PERLVAR(Tstatcache, Stat_t) /* _ */
PERLVAR(Tstatgv, GV *)
-PERLVARI(Tstatname, SV *, Nullsv)
+PERLVARI(Tstatname, SV *, NULL)
#ifdef HAS_TIMES
PERLVAR(Ttimesbuf, struct tms)
PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */
PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */
-PERLVARI(Terrors, SV *, Nullsv) /* outstanding queued errors */
+PERLVARI(Terrors, SV *, NULL) /* outstanding queued errors */
/* statics "owned" by various functions */
PERLVAR(Tav_fetch_sv, SV *) /* unused as of change #19268 */
*PL_lex_casestack = '\0';
PL_lex_dojoin = 0;
PL_lex_starts = 0;
- PL_lex_stuff = Nullsv;
- PL_lex_repl = Nullsv;
+ PL_lex_stuff = NULL;
+ PL_lex_repl = NULL;
PL_lex_inpat = 0;
PL_nexttoke = 0;
PL_lex_inwhat = 0;
sv = nsv;
}
yylval.opval = (OP*)newSVOP(op_type, 0, sv);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
/* Allow <FH> // "foo" */
if (op_type == OP_READLINE)
PL_expect = XTERMORDORDOR;
SAVEGENERICPV(PL_lex_casestack);
PL_linestr = PL_lex_stuff;
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart
= SvPVX(PL_linestr);
}
else {
PL_lex_state = LEX_INTERPCONCAT;
- PL_lex_repl = Nullsv;
+ PL_lex_repl = NULL;
}
return ',';
}
}
res = newSVpvn(s + 1, e - s - 1);
res = new_constant( NULL, 0, "charnames",
- res, Nullsv, "\\N{...}" );
+ res, NULL, "\\N{...}" );
if (has_utf8)
sv_utf8_upgrade(res);
str = SvPV_const(res,len);
if (s > PL_bufptr) {
if ( PL_hints & ( PL_lex_inpat ? HINT_NEW_RE : HINT_NEW_STRING ) )
sv = new_constant(start, s - start, (PL_lex_inpat ? "qr" : "q"),
- sv, Nullsv,
+ sv, NULL,
( PL_lex_inwhat == OP_TRANS
? "tr"
: ( (PL_lex_inwhat == OP_SUBST && !PL_lex_inpat)
{
dVAR;
if (!funcp)
- return Nullsv;
+ return NULL;
if (!PL_rsfp_filters)
PL_rsfp_filters = newAV();
{
if (PL_bufptr != PL_bufend)
Perl_croak(aTHX_ "Bad evalled substitution pattern");
- PL_lex_repl = Nullsv;
+ PL_lex_repl = NULL;
}
/* FALLTHROUGH */
case LEX_INTERPCONCAT:
attrs = append_elem(OP_LIST, attrs,
newSVOP(OP_CONST, 0, sv));
SvREFCNT_dec(PL_lex_stuff);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
}
else {
if (len == 6 && strnEQ(s, "unique", len)) {
Perl_warner(aTHX_ packWARN(WARN_MISC),
"dump() better written as CORE::dump()");
}
- gv = Nullgv;
+ gv = NULL;
gvp = 0;
if (hgv && tmp != KEY_x && tmp != KEY_CORE
&& ckWARN(WARN_AMBIGUOUS)) /* never ambiguous */
PL_tokenbuf);
len -= 2;
PL_tokenbuf[len] = '\0';
- gv = Nullgv;
+ gv = NULL;
gvp = 0;
}
else {
}
if (PL_lex_stuff) {
SvREFCNT_dec(PL_lex_stuff);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
}
PL_expect = XTERM;
TOKEN('(');
if (have_proto) {
PL_nextval[PL_nexttoke].opval =
(OP*)newSVOP(OP_CONST, 0, PL_lex_stuff);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
force_next(THING);
}
if (!have_name) {
if (!s) {
if (PL_lex_stuff) {
SvREFCNT_dec(PL_lex_stuff);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
}
Perl_croak(aTHX_ "Substitution replacement not terminated");
}
if (!s) {
if (PL_lex_stuff) {
SvREFCNT_dec(PL_lex_stuff);
- PL_lex_stuff = Nullsv;
+ PL_lex_stuff = NULL;
}
Perl_croak(aTHX_ "Transliteration replacement not terminated");
}
register char *d; /* destination in temp buffer */
register char *e; /* end of temp buffer */
NV nv; /* number read, as a double */
- SV *sv = Nullsv; /* place to put the converted number */
+ SV *sv = NULL; /* place to put the converted number */
bool floatit; /* boolean: int or float? */
const char *lastub = NULL; /* position of last underbar */
static char const number_too_long[] = "Number too long";
}
if (just_zero && (PL_hints & HINT_NEW_INTEGER))
sv = new_constant(start, s - start, "integer",
- sv, Nullsv, NULL);
+ sv, NULL, NULL);
else if (PL_hints & HINT_NEW_BINARY)
- sv = new_constant(start, s - start, "binary", sv, Nullsv, NULL);
+ sv = new_constant(start, s - start, "binary", sv, NULL, NULL);
}
break;
(PL_hints & HINT_NEW_INTEGER) )
sv = new_constant(PL_tokenbuf, d - PL_tokenbuf,
(floatit ? "float" : "integer"),
- sv, Nullsv, NULL);
+ sv, NULL, NULL);
break;
/* if it starts with a v, it could be a v-string */
ENTER;
errsv_save = newSVsv(ERRSV);
Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn(pkg,pkg_len),
- Nullsv);
+ NULL);
if (!SvTRUE(ERRSV))
sv_setsv(ERRSV, errsv_save);
SvREFCNT_dec(errsv_save);
s--, i++;
}
}
- sv_magic(sv, Nullsv, PERL_MAGIC_bm, NULL, 0); /* deep magic */
+ sv_magic(sv, NULL, PERL_MAGIC_bm, NULL, 0); /* deep magic */
SvVALID_on(sv);
s = (const unsigned char*)(SvPVX_const(sv)); /* deeper magic */
save_re_context();
SAVESPTR(PL_stderrgv);
- PL_stderrgv = Nullgv;
+ PL_stderrgv = NULL;
PUSHSTACKi(PERLSI_MAGIC);
}
}
#endif
- do_aexec5(Nullsv, args-1, args-1+n, pp[1], did_pipes);
+ do_aexec5(NULL, args-1, args-1+n, pp[1], did_pipes);
PerlProc__exit(1);
#undef THIS
#undef THAT
#define G_WARN_ONCE 8 /* set if 'once' ever enabled */
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
-#define pWARN_STD Nullsv
-#define pWARN_ALL (Nullsv+1) /* use warnings 'all' */
-#define pWARN_NONE (Nullsv+2) /* no warnings 'all' */
+#define pWARN_STD NULL
+#define pWARN_ALL (NULL+1) /* use warnings 'all' */
+#define pWARN_NONE (NULL+2) /* no warnings 'all' */
#define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \
(x) == pWARN_NONE)