cx->sb_s = s, \
cx->sb_m = m, \
cx->sb_strend = strend, \
- cx->sb_rxres = Null(void*), \
+ cx->sb_rxres = NULL, \
cx->sb_rx = rx, \
cx->cx_type = CXt_SUBST; \
rxres_save(&cx->sb_rxres, rx)
*/
I32 i, stack_min, stack_max, mark_min, mark_max;
- const PERL_CONTEXT *cx_n;
+ const PERL_CONTEXT *cx_n = NULL;
const PERL_SI *si_n;
- cx_n = Null(PERL_CONTEXT*);
-
/* there's a separate stack per SI, so only search
* this one */
si_n = si;
i = ix;
- cx_n = Null(PERL_CONTEXT*);
+ cx_n = NULL;
for (;;) {
i++;
if (i > si_n->si_cxix) {
{
dVAR;
register IO * const io = GvIOn(gv);
- PerlIO *saveifp = Nullfp;
- PerlIO *saveofp = Nullfp;
+ PerlIO *saveifp = NULL;
+ PerlIO *saveofp = NULL;
int savefd = -1;
char savetype = IoTYPE_CLOSED;
int writing = 0;
"Warning: unable to close filehandle %s properly.\n",
GvENAME(gv));
}
- IoOFP(io) = IoIFP(io) = Nullfp;
+ IoOFP(io) = IoIFP(io) = NULL;
}
if (as_raw) {
*s = 'w';
if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,s,fd,0,0,NULL,0,svp))) {
PerlIO_close(fp);
- IoIFP(io) = Nullfp;
+ IoIFP(io) = NULL;
goto say_false;
}
}
PL_lastfd = -1;
PL_filemode = 0;
if (!GvAV(gv))
- return Nullfp;
+ return NULL;
while (av_len(GvAV(gv)) >= 0) {
STRLEN oldlen;
sv = av_shift(GvAV(gv));
sv_setsv(GvSVn(gv),sv);
SvSETMAGIC(GvSV(gv));
PL_oldname = SvPVx(GvSV(gv), oldlen);
- if (do_open(gv,PL_oldname,oldlen,PL_inplace!=0,O_RDONLY,0,Nullfp)) {
+ if (do_open(gv,PL_oldname,oldlen,PL_inplace!=0,O_RDONLY,0,NULL)) {
if (PL_inplace) {
TAINT_PROPER("inplace open");
if (oldlen == 1 && *PL_oldname == '-') {
(void)PerlLIO_unlink(SvPVX_const(sv));
(void)PerlLIO_rename(PL_oldname,SvPVX_const(sv));
do_open(gv,(char*)SvPVX_const(sv),SvCUR(sv),PL_inplace!=0,
- O_RDONLY,0,Nullfp);
+ O_RDONLY,0,NULL);
#endif /* DOSISH */
#else
(void)UNLINK(SvPVX_const(sv));
SETERRNO(0,0); /* in case sprintf set errno */
#ifdef VMS
if (!do_open(PL_argvoutgv,(char*)SvPVX_const(sv),SvCUR(sv),
- PL_inplace!=0,O_WRONLY|O_CREAT|O_TRUNC,0,Nullfp))
+ PL_inplace!=0,O_WRONLY|O_CREAT|O_TRUNC,0,NULL))
#else
if (!do_open(PL_argvoutgv,(char*)SvPVX_const(sv),SvCUR(sv),
PL_inplace!=0,O_WRONLY|O_CREAT|OPEN_EXCL,0666,
- Nullfp))
+ NULL))
#endif
{
if (ckWARN_d(WARN_INPLACE))
GV *oldout = (GV*)av_pop(PL_argvout_stack);
setdefout(oldout);
SvREFCNT_dec(oldout);
- return Nullfp;
+ return NULL;
}
setdefout(gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO));
}
- return Nullfp;
+ return NULL;
}
/* explicit renamed to avoid C++ conflict -- kja */
retval = (PerlIO_close(IoIFP(io)) != EOF && !prev_err);
}
}
- IoOFP(io) = IoIFP(io) = Nullfp;
+ IoOFP(io) = IoIFP(io) = NULL;
}
else if (not_implicit) {
SETERRNO(EBADF,SS_IVCHAN);
{
dVAR;
Safefree(PL_Argv);
- PL_Argv = Null(char **);
+ PL_Argv = NULL;
Safefree(PL_Cmd);
PL_Cmd = NULL;
}
#endif /* !DOSISH */
#endif /* MACOS_TRADITIONAL */
(void)do_open(PL_last_in_gv, (char*)SvPVX_const(tmpcmd), SvCUR(tmpcmd),
- FALSE, O_RDONLY, 0, Nullfp);
+ FALSE, O_RDONLY, 0, NULL);
fp = IoIFP(io);
#endif /* !VMS */
LEAVE;
SvUTF8_off(sv);
if (DO_UTF8(*sarg))
SvUTF8_on(sv);
- sv_vsetpvfn(sv, pat, patlen, Null(va_list*), sarg + 1, len - 1, &do_taint);
+ sv_vsetpvfn(sv, pat, patlen, NULL, sarg + 1, len - 1, &do_taint);
SvSETMAGIC(sv);
if (do_taint)
SvTAINTED_on(sv);
he = HeNEXT(he);
del_HE(ohe);
}
- PL_hv_fetch_ent_mh = Nullhe;
+ PL_hv_fetch_ent_mh = NULL;
}
#if defined(USE_ITHREADS)
HE *ret;
if (!e)
- return Nullhe;
+ return NULL;
/* look for it in the table first */
ret = (HE*)ptr_table_fetch(PL_ptr_table, e);
if (ret)
Newx(k, HEK_BASESIZE + sizeof(SV*), char);
HeKEY_hek(entry) = (HEK*)k;
}
- HeNEXT(entry) = Nullhe;
+ HeNEXT(entry) = NULL;
HeSVKEY_set(entry, keysv);
HeVAL(entry) = sv;
sv_upgrade(sv, SVt_PVLV);
if (!HvARRAY(hv) && !needs_store) {
if (flags & HVhek_FREEKEY)
Safefree(key);
- return Nullhe;
+ return NULL;
}
#ifdef ENV_IS_CASELESS
else if (mg_find((SV*)hv, PERL_MAGIC_env)) {
masked_flags = (flags & HVhek_MASK);
#ifdef DYNAMIC_ENV_FETCH
- if (!HvARRAY(hv)) entry = Null(HE*);
+ if (!HvARRAY(hv)) entry = NULL;
else
#endif
{
hv_free_ent(hv, entry);
}
iter->xhv_riter = -1; /* HvRITER(hv) = -1 */
- iter->xhv_eiter = Null(HE*); /* HvEITER(hv) = Null(HE*) */
+ iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
/* There are now no allocated pointers in the aux structure. */
iter = HvAUX(hv);
iter->xhv_riter = -1; /* HvRITER(hv) = -1 */
- iter->xhv_eiter = Null(HE*); /* HvEITER(hv) = Null(HE*) */
+ iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
iter->xhv_name = 0;
iter->xhv_backreferences = 0;
return iter;
hv_free_ent(hv, entry);
}
iter->xhv_riter = -1; /* HvRITER(hv) = -1 */
- iter->xhv_eiter = Null(HE*); /* HvEITER(hv) = Null(HE*) */
+ iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
} else {
hv_auxinit(hv);
}
SvREFCNT_dec(HeVAL(entry));
Safefree(HeKEY_hek(entry));
del_HE(entry);
- iter->xhv_eiter = Null(HE*); /* HvEITER(hv) = Null(HE*) */
- return Null(HE*);
+ iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
+ return NULL;
}
#ifdef DYNAMIC_ENV_FETCH /* set up %ENV for iteration */
if (!entry && SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
/* these used to be in global before 5.004_68 */
PERLVARI(Iprofiledata, U32 *, NULL) /* table of ops, counts */
-PERLVARI(Irsfp, PerlIO * VOL, Nullfp) /* current source file pointer */
+PERLVARI(Irsfp, PerlIO * VOL, NULL) /* current source file pointer */
PERLVARI(Irsfp_filters, AV *, NULL) /* keeps active source filters */
PERLVAR(Icompiling, COP) /* compiling/done executing marker */
SvPV_nolen_const((SV*)((mg)->mg_ptr)) : \
(const char*)(mg)->mg_ptr)
-#define SvTIED_mg(sv,how) \
- (SvRMAGICAL(sv) ? mg_find((sv),(how)) : Null(MAGIC*))
+#define SvTIED_mg(sv,how) (SvRMAGICAL(sv) ? mg_find((sv),(how)) : NULL)
#define SvTIED_obj(sv,mg) \
((mg)->mg_obj ? (mg)->mg_obj : sv_2mortal(newRV(sv)))
SvREFCNT_dec(sv);
}
SvREFCNT_dec((SV*)CvPADLIST(cv));
- CvPADLIST(cv) = Null(PADLIST*);
+ CvPADLIST(cv) = NULL;
}
SV **name_svp;
offset = pad_findlex(name, PL_compcv, PL_cop_seqmax, 1,
- Null(SV**), &out_sv, &out_flags);
+ NULL, &out_sv, &out_flags);
if (offset != NOT_IN_PAD)
return offset;
SV *out_sv;
int out_flags;
return pad_findlex("$_", find_runcv(NULL), PL_curcop->cop_seq, 1,
- Null(SV**), &out_sv, &out_flags);
+ NULL, &out_sv, &out_flags);
}
/*
/* out_capture non-null means caller wants us to capture lex; in
* addition we capture ourselves unless it's an ANON/format */
new_capturep = out_capture ? out_capture :
- CvLATE(cv) ? Null(SV**) : &new_capture;
+ CvLATE(cv) ? NULL : &new_capture;
offset = pad_findlex(name, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv), 1,
new_capturep, out_name_sv, out_flags);
PL_comppad_name = ocomppad_name;
PL_comppad = ocomppad;
- PL_curpad = ocomppad ? AvARRAY(ocomppad) : Null(SV **);
+ PL_curpad = ocomppad ? AvARRAY(ocomppad) : NULL;
}
return new_offset;
}
#define PAD_SAVE_SETNULLPAD() SAVECOMPPAD(); \
- PL_comppad = Null(PAD*); PL_curpad = Null(SV**); \
+ PL_comppad = NULL; PL_curpad = NULL; \
DEBUG_Xv(PerlIO_printf(Perl_debug_log, "Pad set_null\n"));
#define PAD_SAVE_LOCAL(opad,npad) \
opad = PL_comppad; \
PL_comppad = (npad); \
- PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \
+ PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
"Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \
PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
#define PAD_RESTORE_LOCAL(opad) \
PL_comppad = opad; \
- PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \
+ PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
#define PAD_CLONE_VARS(proto_perl, param) \
PL_comppad = (AV *) ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad); \
- PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \
+ PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
PL_comppad_name = av_dup(proto_perl->Icomppad_name, param); \
PL_comppad_name_fill = proto_perl->Icomppad_name_fill; \
PL_comppad_name_floor = proto_perl->Icomppad_name_floor; \
if(PL_rsfp) {
(void)PerlIO_close(PL_rsfp);
- PL_rsfp = Nullfp;
+ PL_rsfp = NULL;
}
/* Filters for program text */
dVAR;
PerlIO *tmpfp;
tmpfp = PL_rsfp;
- PL_rsfp = Nullfp;
+ PL_rsfp = NULL;
lex_start(PL_linestr);
PL_rsfp = tmpfp;
PL_subname = newSVpvs("main");
dSP;
register PMOP *pm = (PMOP*)cLOGOP->op_other;
SV *tmpstr;
- MAGIC *mg = Null(MAGIC*);
+ MAGIC *mg = NULL;
/* prevent recompiling under /o and ithreads. */
#if defined(USE_ITHREADS)
{
if (PM_GETRE(pm)) {
ReREFCNT_dec(PM_GETRE(pm));
- PM_SETRE(pm, Null(REGEXP*)); /* crucial if regcomp aborts */
+ PM_SETRE(pm, NULL); /* crucial if regcomp aborts */
}
if (PL_op->op_flags & OPf_SPECIAL)
PL_reginterp_cnt = I32_MAX; /* Mark as safe. */
}
#endif
Safefree(p);
- *rsp = Null(void*);
+ *rsp = NULL;
}
}
Stat_t st;
const int st_rc = PerlLIO_stat(name, &st);
if (st_rc < 0) {
- return Nullfp;
+ return NULL;
}
if(S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) {
if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
PerlIO_close(IoOFP(io));
}
- IoIFP(io) = Nullfp;
- IoOFP(io) = Nullfp;
+ IoIFP(io) = NULL;
+ IoOFP(io) = NULL;
}
}
relem = firstrelem;
lelem = firstlelem;
- ary = Null(AV*);
- hash = Null(HV*);
+ ary = NULL;
+ hash = NULL;
while (lelem <= lastlelem) {
TAINT_NOT; /* Each item stands on its own, taintwise. */
RETURN;
}
}
- fp = Nullfp;
+ fp = NULL;
if (io) {
fp = IoIFP(io);
if (!fp) {
IoLINES(io) = 0;
if (av_len(GvAVn(PL_last_in_gv)) < 0) {
IoFLAGS(io) &= ~IOf_START;
- do_open(PL_last_in_gv,"-",1,FALSE,O_RDONLY,0,Nullfp);
+ do_open(PL_last_in_gv,"-",1,FALSE,O_RDONLY,0,NULL);
sv_setpvn(GvSVn(PL_last_in_gv), "-", 1);
SvSETMAGIC(GvSV(PL_last_in_gv));
fp = IoIFP(io);
}
}
- SETs(method_common(sv, Null(U32*)));
+ SETs(method_common(sv, NULL));
RETURN;
}
}
tmps = SvPV_const(sv, len);
- ok = do_openn(gv, tmps, len, FALSE, O_RDONLY, 0, Nullfp, MARK+1, (SP-MARK));
+ ok = do_openn(gv, tmps, len, FALSE, O_RDONLY, 0, NULL, MARK+1, (SP-MARK));
SP = ORIGMARK;
if (ok)
PUSHi( (I32)PL_forkprocess );
timebuf.tv_usec = (long)(value * 1000000.0);
}
else
- tbuf = Null(struct timeval*);
+ tbuf = NULL;
for (i = 1; i <= 3; i++) {
sv = SP[i];
/* Need TIEHANDLE method ? */
const char * const tmps = SvPV_const(sv, len);
/* FIXME? do_open should do const */
- if (do_open(gv, tmps, len, TRUE, mode, perm, Nullfp)) {
+ if (do_open(gv, tmps, len, TRUE, mode, perm, NULL)) {
IoLINES(GvIOp(gv)) = 0;
PUSHs(&PL_sv_yes);
}
if ((IoFLAGS(io) & IOf_START) && av_len(GvAVn(gv)) < 0) {
IoLINES(io) = 0;
IoFLAGS(io) &= ~IOf_START;
- do_open(gv, "-", 1, FALSE, O_RDONLY, 0, Nullfp);
+ do_open(gv, "-", 1, FALSE, O_RDONLY, 0, NULL);
sv_setpvn(GvSV(gv), "-", 1);
SvSETMAGIC(GvSV(gv));
}
const unsigned int func = POPu;
const int optype = PL_op->op_type;
GV * const gv = (GV*)POPs;
- IO * const io = gv ? GvIOn(gv) : Null(IO*);
+ IO * const io = gv ? GvIOn(gv) : NULL;
char *s;
IV retval;
if (gv && (io = GvIO(gv)))
fp = IoIFP(io);
else {
- fp = Nullfp;
+ fp = NULL;
io = NULL;
}
/* XXX Looks to me like io is always NULL at this point */
{
dVAR; dSP; dTARGET;
#ifdef BIG_TIME
- XPUSHn( time(Null(Time_t*)) );
+ XPUSHn( time(NULL) );
#else
- XPUSHi( time(Null(Time_t*)) );
+ XPUSHi( time(NULL) );
#endif
RETURN;
}
SSPUSHPTR(oav);
SSPUSHINT(SAVEt_AV);
- GvAV(gv) = Null(AV*);
+ GvAV(gv) = NULL;
av = GvAVn(gv);
if (SvMAGIC(oav))
mg_localize((SV*)oav, (SV*)av);
SSPUSHPTR(ohv = GvHVn(gv));
SSPUSHINT(SAVEt_HV);
- GvHV(gv) = Null(HV*);
+ GvHV(gv) = NULL;
hv = GvHVn(gv);
if (SvMAGIC(ohv))
mg_localize((SV*)ohv, (SV*)hv);
if (PL_comppad)
PL_curpad = AvARRAY(PL_comppad);
else
- PL_curpad = Null(SV**);
+ PL_curpad = NULL;
break;
case SAVEt_PADSV:
{
SvFLAGS(sv) |= SVf_BREAK;
if (PL_comppad == (AV*)sv) {
PL_comppad = NULL;
- PL_curpad = Null(SV**);
+ PL_curpad = NULL;
}
SvREFCNT_dec(sv);
}
dVAR;
register SV *sv;
new_SV(sv);
- sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
return sv;
}
void
Perl_sv_vsetpvf(pTHX_ SV *sv, const char* pat, va_list* args)
{
- sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
}
/*
void
Perl_sv_vsetpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
{
- sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
SvSETMAGIC(sv);
}
void
Perl_sv_vcatpvf(pTHX_ SV *sv, const char* pat, va_list* args)
{
- sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vcatpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
}
/*
void
Perl_sv_vcatpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
{
- sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vcatpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
SvSETMAGIC(sv);
}
const char *eptr = NULL;
STRLEN elen = 0;
SV *vecsv = NULL;
- const U8 *vecstr = Null(U8*);
+ const U8 *vecstr = NULL;
STRLEN veclen = 0;
char c = 0;
int i;
}
}
else {
- /* Copy the Null */
+ /* Copy the NULL */
if (SvTYPE(dstr) == SVt_RV)
SvRV_set(dstr, NULL);
else
PL_localizing = proto_perl->Tlocalizing;
PL_errors = sv_dup_inc(proto_perl->Terrors, param);
- PL_hv_fetch_ent_mh = Nullhe;
+ PL_hv_fetch_ent_mh = NULL;
PL_modcount = proto_perl->Tmodcount;
PL_lastgotoprobe = NULL;
PL_dumpindent = proto_perl->Tdumpindent;
PerlIO_clearerr(PL_rsfp);
else
(void)PerlIO_close(PL_rsfp);
- PL_rsfp = Nullfp;
+ PL_rsfp = NULL;
return s;
}
PerlIO_clearerr(PL_rsfp);
else
(void)PerlIO_close(PL_rsfp);
- PL_rsfp = Nullfp;
+ PL_rsfp = NULL;
PL_doextract = FALSE;
}
if (!PL_in_eval && (PL_minus_n || PL_minus_p)) {
}
}
#endif
- PL_rsfp = Nullfp;
+ PL_rsfp = NULL;
}
goto fake_eof;
}
pkg = gv_stashsv(ST(0), FALSE);
}
- gvp = pkg ? (GV**)hv_fetchs(pkg, "VERSION", FALSE) : Null(GV**);
+ gvp = pkg ? (GV**)hv_fetchs(pkg, "VERSION", FALSE) : NULL;
if (gvp && isGV(gv = *gvp) && (sv = GvSV(gv)) && SvOK(sv)) {
SV * const nsv = sv_newmortal();
Perl_vform(pTHX_ const char *pat, va_list *args)
{
SV * const sv = mess_alloc();
- sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
return SvPVX(sv);
}
taint_proper("Insecure %s%s", "EXEC");
}
if (PerlProc_pipe(p) < 0)
- return Nullfp;
+ return NULL;
/* Try for another pipe pair for error return */
if (PerlProc_pipe(pp) >= 0)
did_pipes = 1;
PerlLIO_close(pp[0]);
PerlLIO_close(pp[1]);
}
- return Nullfp;
+ return NULL;
}
sleep(5);
}
pid2 = wait4pid(pid, &status, 0);
} while (pid2 == -1 && errno == EINTR);
errno = errkid; /* Propagate errno from kid */
- return Nullfp;
+ return NULL;
}
}
if (did_pipes)
taint_proper("Insecure %s%s", "EXEC");
}
if (PerlProc_pipe(p) < 0)
- return Nullfp;
+ return NULL;
if (doexec && PerlProc_pipe(pp) >= 0)
did_pipes = 1;
while ((pid = PerlProc_fork()) < 0) {
}
if (!doexec)
Perl_croak(aTHX_ "Can't fork");
- return Nullfp;
+ return NULL;
}
sleep(5);
}
#ifdef PERL_USES_PL_PIDSTATUS
hv_clear(PL_pidstatus); /* we have no children */
#endif
- return Nullfp;
+ return NULL;
#undef THIS
#undef THAT
}
pid2 = wait4pid(pid, &status, 0);
} while (pid2 == -1 && errno == EINTR);
errno = errkid; /* Propagate errno from kid */
- return Nullfp;
+ return NULL;
}
}
if (did_pipes)
goto finish;
#endif
#if !defined(HAS_WAITPID) && defined(HAS_WAIT4)
- result = wait4((pid==-1)?0:pid,statusp,flags,Null(struct rusage *));
+ result = wait4((pid==-1)?0:pid,statusp,flags,NULL);
goto finish;
#endif
#ifdef PERL_USES_PL_PIDSTATUS
result = &PL_vtbl_utf8;
break;
default:
- result = Null(MGVTBL*);
+ result = NULL;
break;
}
return (MGVTBL*)result;