Off_t
Perl_do_tell(pTHX_ GV *gv)
{
- register IO *io = 0;
+ register IO *io = NULL;
register PerlIO *fp;
if (gv && (io = GvIO(gv)) && (fp = IoIFP(io))) {
bool
Perl_do_seek(pTHX_ GV *gv, Off_t pos, int whence)
{
- register IO *io = 0;
+ register IO *io = NULL;
register PerlIO *fp;
if (gv && (io = GvIO(gv)) && (fp = IoIFP(io))) {
Off_t
Perl_do_sysseek(pTHX_ GV *gv, Off_t pos, int whence)
{
- register IO *io = 0;
+ register IO *io = NULL;
register PerlIO *fp;
if (gv && (io = GvIO(gv)) && (fp = IoIFP(io)))
S_do_trans_count_utf8(pTHX_ SV *sv)
{
const U8 *s;
- const U8 *start = 0, *send;
+ const U8 *start = NULL;
+ const U8 *send;
I32 matches = 0;
STRLEN len;
bool is_utf8 = FALSE;
int k_flags = 0;
const char * const save = str;
- struct shared_he *he = 0;
+ struct shared_he *he = NULL;
if (hek) {
/* Find the shared he which is just before us in memory. */
register const char * const s = MgPV_nolen_const(mg);
PERL_UNUSED_ARG(sv);
if (*s == '_') {
- SV** svp = 0;
+ SV** svp = NULL;
if (strEQ(s,"__DIE__"))
svp = &PL_diehook;
else if (strEQ(s,"__WARN__"))
Perl_croak(aTHX_ "No such hook: %s", s);
if (svp && *svp) {
SV * const to_dec = *svp;
- *svp = 0;
+ *svp = NULL;
SvREFCNT_dec(to_dec);
}
}
{
dVAR;
I32 i;
- SV** svp = 0;
+ SV** svp = NULL;
/* Need to be careful with SvREFCNT_dec(), because that can have side
* effects (due to closures). We must make sure that the new disposition
* is in place before it is called.
*/
- SV* to_dec = 0;
+ SV* to_dec = NULL;
STRLEN len;
#ifdef HAS_SIGPROCMASK
sigset_t set, save;
i = 0;
if (*svp) {
to_dec = *svp;
- *svp = 0;
+ *svp = NULL;
}
}
else {
const char *tmps;
const I32 arybase = PL_curcop->cop_arybase;
SV *repl_sv = NULL;
- const char *repl = 0;
+ const char *repl = NULL;
STRLEN repl_len;
const int num_args = PL_op->op_private & 7;
bool repl_need_utf8_upgrade = FALSE;
I32 newlen;
I32 after;
I32 diff;
- SV **tmparyval = 0;
+ SV **tmparyval = NULL;
const MAGIC * const mg = SvTIED_mg((SV*)ary, PERL_MAGIC_tied);
if (mg) {
bool item_is_utf8 = FALSE;
bool targ_is_utf8 = FALSE;
SV * nsv = NULL;
- OP * parseres = 0;
+ OP * parseres = NULL;
const char *fmt;
bool oneline;
PP(pp_goto)
{
dVAR; dSP;
- OP *retop = 0;
+ OP *retop = NULL;
I32 ix;
register PERL_CONTEXT *cx;
#define GOTO_DEPTH 64
OP *enterops[GOTO_DEPTH];
- const char *label = 0;
+ const char *label = NULL;
const bool do_dump = (PL_op->op_type == OP_DUMP);
static const char must_have_label[] = "goto must have label";
label = cPVOP->op_pv;
if (label && *label) {
- OP *gotoprobe = 0;
+ OP *gotoprobe = NULL;
bool leaving_eval = FALSE;
bool in_block = FALSE;
- PERL_CONTEXT *last_eval_cx = 0;
+ PERL_CONTEXT *last_eval_cx = NULL;
/* find label */
bool postspace = FALSE;
U32 *fops;
register U32 *fpc;
- U32 *linepc = 0;
+ U32 *linepc = NULL;
register I32 arg;
bool ischop;
bool unchopnum = FALSE;
I32 i;
int magic;
int duplicates = 0;
- SV **firsthashrelem = 0; /* "= 0" keeps gcc 2.95 quiet */
+ SV **firsthashrelem = NULL; /* "= 0" keeps gcc 2.95 quiet */
PL_delaymagic = DM_DELAY; /* catch simultaneous items */
}
else {
if (global) {
- MAGIC* mg = 0;
+ MAGIC* mg;
if (SvTYPE(TARG) >= SVt_PVMG && SvMAGIC(TARG))
mg = mg_find(TARG, PERL_MAGIC_regex_global);
+ else
+ mg = NULL;
if (!mg) {
sv_magic(TARG, (SV*)0, PERL_MAGIC_regex_global, Nullch, 0);
mg = mg_find(TARG, PERL_MAGIC_regex_global);
AV* av = NULL;
HV *stash;
GV *gv;
- CV *cv = 0;
+ CV *cv = NULL;
I32 gimme = GIMME;
OP* const nextop = PL_op->op_next;
I32 overloading = 0;
register regnode *ret; /* Will be the head of the group. */
register regnode *br;
register regnode *lastbr;
- register regnode *ender = 0;
+ register regnode *ender = NULL;
register I32 parno = 0;
- I32 flags, oregflags = RExC_flags, have_branch = 0, open = 0;
+ I32 flags;
+ const I32 oregflags = RExC_flags;
+ I32 have_branch = 0;
+ I32 open = 0;
/* for (?g), (?gc), and (?o) warnings; warning
about (?c) will warn about (?g) -- japhy */
- I32 wastedflags = 0x00,
- wasted_o = 0x01,
- wasted_g = 0x02,
- wasted_gc = 0x02 | 0x04,
- wasted_c = 0x04;
+ I32 wastedflags = 0x00;
+ const I32 wasted_o = 0x01;
+ const I32 wasted_g = 0x02;
+ const I32 wasted_gc = 0x02 | 0x04;
+ const I32 wasted_c = 0x04;
char * parse_start = RExC_parse; /* MJD */
char * const oregcomp_parse = RExC_parse;
STATIC regnode *
S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp)
{
- register regnode *ret = 0;
+ register regnode *ret = NULL;
I32 flags;
char *parse_start = RExC_parse;
register regnode *ret;
STRLEN numlen;
IV namedclass;
- char *rangebegin = 0;
+ char *rangebegin = NULL;
bool need_class = 0;
SV *listsv = NULL;
register char *e;
UV n;
bool optimize_invert = TRUE;
- AV* unicode_alternate = 0;
+ AV* unicode_alternate = NULL;
#ifdef EBCDIC
UV literal_endpoint = 0;
#endif
s = find_byclass(prog, prog->regstclass, s, endpos, 1);
if (!s) {
#ifdef DEBUGGING
- const char *what = 0;
+ const char *what = NULL;
#endif
if (endpos == strend) {
DEBUG_EXECUTE_r( PerlIO_printf(Perl_debug_log,
I32 unwind = 0;
/* used by the trie code */
- SV *sv_accept_buff = 0; /* accepting states we have traversed */
- reg_trie_accepted *accept_buff = 0; /* "" */
+ SV *sv_accept_buff = NULL; /* accepting states we have traversed */
+ reg_trie_accepted *accept_buff = NULL; /* "" */
reg_trie_data *trie; /* what trie are we using right now */
U32 accepted = 0; /* how many accepting states we have seen*/
if (dtype >= SVt_PV) {
if (dtype == SVt_PVGV) {
SV * const sref = SvREFCNT_inc(SvRV(sstr));
- SV *dref = 0;
+ SV *dref = NULL;
const int intro = GvINTRO(dstr);
#ifdef GV_UNIQUE_CHECK
start = (U8*)SvPV_const(sv, len);
if (len) {
STRLEN boffset = 0;
- STRLEN *cache = 0;
+ STRLEN *cache = NULL;
const U8 *s = start;
I32 uoffset = *offsetp;
const U8 * const send = s + len;
- MAGIC *mg = 0;
- bool found = FALSE;
+ MAGIC *mg = NULL;
+ bool found = utf8_mg_pos(sv, &mg, &cache, 0, offsetp, *offsetp, &s, start, send);
- if (utf8_mg_pos(sv, &mg, &cache, 0, offsetp, *offsetp, &s, start, send))
- found = TRUE;
if (!found && uoffset > 0) {
while (s < send && uoffset--)
s += UTF8SKIP(s);
{
/*The big, slow, and stupid way. */
#ifdef USE_HEAP_INSTEAD_OF_STACK /* Even slower way. */
- STDCHAR *buf = 0;
+ STDCHAR *buf = NULL;
Newx(buf, 8192, STDCHAR);
assert(buf);
#else
break;
case SVt_PVHV:
{
- HEK *hvname = 0;
+ HEK *hvname = NULL;
if (HvARRAY((HV*)sstr)) {
STRLEN i = 0;
keylookup: {
I32 tmp;
I32 orig_keyword = 0;
- GV *gv = Nullgv;
- GV **gvp = 0;
+ GV *gv = NULL;
+ GV **gvp = NULL;
PL_bufptr = s;
s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len);
}
if (tmp < 0) { /* second-class keyword? */
- GV *ogv = Nullgv; /* override (winner) */
- GV *hgv = Nullgv; /* hidden (loser) */
+ GV *ogv = NULL; /* override (winner) */
+ GV *hgv = NULL; /* hidden (loser) */
if (PL_expect != XOPERATOR && (*s != ':' || s[1] != ':')) {
CV *cv;
if ((gv = gv_fetchpv(PL_tokenbuf, 0, SVt_PVCV)) &&
NV nv; /* number read, as a double */
SV *sv = Nullsv; /* place to put the converted number */
bool floatit; /* boolean: int or float? */
- const char *lastub = 0; /* position of last underbar */
+ const char *lastub = NULL; /* position of last underbar */
static char const number_too_long[] = "Number too long";
/* We use the first character to decide what type of number this is */
{
register const U8 *p1 = (const U8*)s1;
register const U8 *p2 = (const U8*)s2;
- register const U8 *f1 = 0, *f2 = 0;
- register U8 *e1 = 0, *q1 = 0;
- register U8 *e2 = 0, *q2 = 0;
+ register const U8 *f1 = NULL;
+ register U8 *f2 = NULL;
+ register U8 *e1 = NULL;
+ register U8 *q1 = NULL;
+ register U8 *e2 = NULL;
+ register U8 *q2 = NULL;
STRLEN n1 = 0, n2 = 0;
U8 foldbuf1[UTF8_MAXBYTES_CASE+1];
U8 foldbuf2[UTF8_MAXBYTES_CASE+1];
where = (Malloc_t)((char*)where-sTHX);
size += sTHX;
if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
- /* int *nowhere = NULL; *nowhere = 0; */
Perl_croak_nocontext("panic: realloc from wrong pool");
}
# ifdef PERL_POISON
#ifdef PERL_TRACK_MEMPOOL
where = (Malloc_t)((char*)where-sTHX);
if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
- /* int *nowhere = NULL; *nowhere = 0; */
Perl_croak_nocontext("panic: free from wrong pool");
}
# ifdef PERL_POISON