SV *op;
const char *key;
STRLEN len;
- const OP *oldop = 0;
+ const OP *oldop = NULL;
OP *l;
if (!o)
" MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
if (mg->mg_virtual) {
const MGVTBL * const v = mg->mg_virtual;
- const char *s = 0;
+ const char *s = NULL;
if (v == &PL_vtbl_sv) s = "sv";
else if (v == &PL_vtbl_env) s = "env";
else if (v == &PL_vtbl_envelem) s = "envelem";
{
int n;
- const char *name = 0;
+ const char *name = NULL;
for (n = 0; magic_names[n].name; n++) {
if (mg->mg_type == magic_names[n].type) {
name = magic_names[n].name;
PerlIO_printf(file, " (");
Zero(freq, FREQ_MAX + 1, int);
for (i = 0; (STRLEN)i <= HvMAX(sv); i++) {
- HE* h; int count = 0;
+ HE* h;
+ int count = 0;
for (h = HvARRAY(sv)[i]; h; h = HeNEXT(h))
count++;
if (count > FREQ_MAX)
s |bool |utf8_mg_pos_init |NN SV *sv|NN MAGIC **mgp \
|NN STRLEN **cachep|I32 i|I32 offsetp \
|NN const U8 *s|NN const U8 *start
+s |char * |stringify_regexp|NN SV *sv|NN MAGIC *mg|NULLOK STRLEN *lp
+sn |char * |F0convert |NV nv|NN char *endbuf|NN STRLEN *len
#if defined(PERL_OLD_COPY_ON_WRITE)
sM |void |sv_release_COW |NN SV *sv|NN const char *pvx|STRLEN len|NN SV *after
#endif
sR |char * |tokenize_use |int is_use|NN char *s
s |SV* |new_constant |NULLOK const char *s|STRLEN len|NN const char *key|NN SV *sv \
|NULLOK SV *pv|NULLOK const char *type
-# if defined(DEBUGGING)
-s |int |tokereport |I32 rv
-# endif
s |int |ao |int toketype
-s |void |depcom
s |const char*|incl_perldb
# if defined(PERL_CR_FILTER)
s |I32 |cr_textfilter |int idx|NULLOK SV *sv|int maxlen
s |void |strip_return |NN SV *sv
# endif
+# if defined(DEBUGGING)
+s |int |tokereport |I32 rv
+# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define utf8_mg_pos S_utf8_mg_pos
#define utf8_mg_pos_init S_utf8_mg_pos_init
+#define stringify_regexp S_stringify_regexp
+#define F0convert S_F0convert
#endif
#if defined(PERL_OLD_COPY_ON_WRITE)
#ifdef PERL_CORE
#define find_in_my_stash S_find_in_my_stash
#define tokenize_use S_tokenize_use
#define new_constant S_new_constant
-#endif
-# if defined(DEBUGGING)
-#ifdef PERL_CORE
-#define tokereport S_tokereport
-#endif
-# endif
-#ifdef PERL_CORE
#define ao S_ao
-#define depcom S_depcom
#define incl_perldb S_incl_perldb
#endif
# if defined(PERL_CR_FILTER)
#define strip_return S_strip_return
#endif
# endif
+# if defined(DEBUGGING)
+#ifdef PERL_CORE
+#define tokereport S_tokereport
+#endif
+# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#ifdef PERL_CORE
#define utf8_mg_pos(a,b,c,d,e,f,g,h,i) S_utf8_mg_pos(aTHX_ a,b,c,d,e,f,g,h,i)
#define utf8_mg_pos_init(a,b,c,d,e,f,g) S_utf8_mg_pos_init(aTHX_ a,b,c,d,e,f,g)
+#define stringify_regexp(a,b,c) S_stringify_regexp(aTHX_ a,b,c)
+#define F0convert S_F0convert
#endif
#if defined(PERL_OLD_COPY_ON_WRITE)
#ifdef PERL_CORE
#define find_in_my_stash(a,b) S_find_in_my_stash(aTHX_ a,b)
#define tokenize_use(a,b) S_tokenize_use(aTHX_ a,b)
#define new_constant(a,b,c,d,e,f) S_new_constant(aTHX_ a,b,c,d,e,f)
-#endif
-# if defined(DEBUGGING)
-#ifdef PERL_CORE
-#define tokereport(a) S_tokereport(aTHX_ a)
-#endif
-# endif
-#ifdef PERL_CORE
#define ao(a) S_ao(aTHX_ a)
-#define depcom() S_depcom(aTHX)
#define incl_perldb() S_incl_perldb(aTHX)
#endif
# if defined(PERL_CR_FILTER)
#define strip_return(a) S_strip_return(aTHX_ a)
#endif
# endif
+# if defined(DEBUGGING)
+#ifdef PERL_CORE
+#define tokereport(a) S_tokereport(aTHX_ a)
+#endif
+# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
Newxz(gp, 1, GP);
GvGP(gv) = gp_ref(gp);
#ifdef PERL_DONT_CREATE_GVSV
- GvSV(gv) = 0;
+ GvSV(gv) = NULL;
#else
GvSV(gv) = NEWSV(72,0);
#endif
Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload)
{
register const char *nend;
- const char *nsplit = 0;
+ const char *nsplit = NULL;
GV* gv;
HV* ostash = stash;
I32 sv_type)
{
register const char *name = nambeg;
- register GV *gv = 0;
+ register GV *gv = NULL;
GV**gvp;
I32 len;
register const char *namend;
- HV *stash = 0;
+ HV *stash = NULL;
const I32 no_init = flags & (GV_NOADD_NOINIT | GV_NOINIT);
const I32 no_expand = flags & GV_NOEXPAND;
const I32 add = flags & ~SVf_UTF8 & ~GV_NOADD_NOINIT & ~GV_NOEXPAND;
flags = 0;
}
hek = hv_fetch_common (hv, NULL, key, klen, flags,
- HV_FETCH_JUST_SV | (lval ? HV_FETCH_LVALUE : 0),
+ lval ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) : HV_FETCH_JUST_SV,
Nullsv, 0);
return hek ? &HeVAL(hek) : NULL;
}
#endif
if (!entry && SvREADONLY(hv) && !(action & HV_FETCH_ISEXISTS)) {
- S_hv_notallowed(aTHX_ flags, key, klen,
+ hv_notallowed(flags, key, klen,
"Attempt to access disallowed key '%"SVf"' in"
" a restricted hash");
}
return Nullsv;
if (is_utf8) {
- const char *keysave = key;
+ const char * const keysave = key;
key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8);
if (is_utf8)
{
dVAR;
OP *kid;
- const char* useless = 0;
+ const char* useless = NULL;
SV* sv;
U8 want;
if (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) {
SV* const listsv = newSVpvn("# comment\n",10);
- SV* transv = 0;
+ SV* transv = NULL;
const U8* tend = t + tlen;
const U8* rend = r + rlen;
STRLEN ulen;
else if (repl->op_type == OP_CONST)
curop = repl;
else {
- OP *lastop = 0;
+ OP *lastop = NULL;
for (curop = LINKLIST(repl); curop!=repl; curop = LINKLIST(curop)) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
{
dVAR;
OP *redo;
- OP *next = 0;
+ OP *next = NULL;
OP *listop;
OP *o;
U8 loopflags = 0;
GV *gv;
const char *ps;
STRLEN ps_len;
- register CV *cv=0;
+ register CV *cv = NULL;
SV *const_sv;
I32 gv_fetch_flags;
? cUNOPo : ((UNOP*)cUNOPo->op_first))->op_first;
OP *o2 = prev->op_sibling;
OP *cvop;
- char *proto = 0;
- CV *cv = 0;
- GV *namegv = 0;
+ char *proto = NULL;
+ CV *cv = NULL;
+ GV *namegv = NULL;
int optional = 0;
I32 arg = 0;
I32 contextclass = 0;
- char *e = 0;
+ char *e = NULL;
bool delete_op = 0;
o->op_private |= OPpENTERSUB_HASTARG;
Perl_peep(pTHX_ register OP *o)
{
dVAR;
- register OP* oldop = 0;
+ register OP* oldop = NULL;
if (!o || o->op_opt)
return;
PP(pp_rv2sv)
{
- GV *gv = Nullgv;
+ GV *gv = NULL;
dSP; dTOPss;
if (SvROK(sv)) {
if (!*sv) {
*sv = NEWSV(0,0);
sv_upgrade(*sv, SVt_PVMG);
- sv_magic(*sv, (SV*)av, PERL_MAGIC_arylen, Nullch, 0);
+ sv_magic(*sv, (SV*)av, PERL_MAGIC_arylen, NULL, 0);
}
SETs(*sv);
RETURN;
if (PL_op->op_flags & OPf_MOD || LVRET) {
if (SvTYPE(TARG) < SVt_PVLV) {
sv_upgrade(TARG, SVt_PVLV);
- sv_magic(TARG, Nullsv, PERL_MAGIC_pos, Nullch, 0);
+ sv_magic(TARG, NULL, PERL_MAGIC_pos, NULL, 0);
}
LvTYPE(TARG) = '.';
dSP;
GV *gv;
HV *stash;
- I32 flags = (PL_op->op_flags & OPf_SPECIAL) ? 0
- : ((PL_op->op_private & (OPpLVAL_INTRO|OPpMAY_RETURN_CONSTANT))
- == OPpMAY_RETURN_CONSTANT) ? GV_ADD|GV_NOEXPAND : GV_ADD;
+ const I32 flags = (PL_op->op_flags & OPf_SPECIAL)
+ ? 0
+ : ((PL_op->op_private & (OPpLVAL_INTRO|OPpMAY_RETURN_CONSTANT)) == OPpMAY_RETURN_CONSTANT)
+ ? GV_ADD|GV_NOEXPAND
+ : GV_ADD;
/* We usually try to add a non-existent subroutine in case of AUTOLOAD. */
/* (But not in defined().) */
SV *sv = POPs;
const char * const elem = SvPV_nolen_const(sv);
GV * const gv = (GV*)POPs;
- SV * tmpRef = Nullsv;
+ SV * tmpRef = NULL;
- sv = Nullsv;
+ sv = NULL;
if (elem) {
/* elem will always be NUL terminated. */
const char * const second_letter = elem + 1;
break;
case 'P':
if (strEQ(second_letter, "ACKAGE")) {
- const HEK *hek = HvNAME_HEK(GvSTASH(gv));
+ const HEK * const hek = HvNAME_HEK(GvSTASH(gv));
sv = hek ? newSVhek(hek) : newSVpvn("__ANON__", 8);
}
break;
SvSCREAM_on(sv);
/* piggyback on m//g magic */
- sv_magic(sv, Nullsv, PERL_MAGIC_regex_global, Nullch, 0);
+ sv_magic(sv, NULL, PERL_MAGIC_regex_global, NULL, 0);
RETPUSHYES;
}
default:
if (SvTYPE(sv) >= SVt_PV && SvPVX_const(sv) && SvLEN(sv)) {
SvPV_free(sv);
- SvPV_set(sv, Nullch);
+ SvPV_set(sv, NULL);
SvLEN_set(sv, 0);
}
SvOK_off(sv);
} else if (!ahigh && !bhigh) {
/* eg 32 bit is at most 0xFFFF * 0xFFFF == 0xFFFE0001
so the unsigned multiply cannot overflow. */
- UV product = alow * blow;
+ const UV product = alow * blow;
if (auvok == buvok) {
/* -ve * -ve or +ve * +ve gives a +ve result. */
SP--;
if (count < 1)
SvCUR_set(TARG, 0);
else {
- STRLEN max = (UV)count * len;
+ const STRLEN max = (UV)count * len;
if (len > ((MEM_SIZE)~0)/count)
Perl_croak(aTHX_ oom_string_extend);
MEM_WRAP_CHECK_1(max, char, oom_string_extend);
{
const IV shift = POPi;
if (PL_op->op_private & HINT_INTEGER) {
- IV i = TOPi;
+ const IV i = TOPi;
SETi(i << shift);
}
else {
- UV u = TOPu;
+ const UV u = TOPu;
SETu(u << shift);
}
RETURN;
SETn(-SvNV(sv));
else if (SvPOKp(sv)) {
STRLEN len;
- const char *s = SvPV_const(sv, len);
+ const char * const s = SvPV_const(sv, len);
if (isIDFIRST(*s)) {
sv_setpvn(TARG, "-", 1);
sv_catsv(TARG, sv);
if (SvTYPE(TARG) < SVt_PVLV) {
sv_upgrade(TARG, SVt_PVLV);
- sv_magic(TARG, Nullsv, PERL_MAGIC_substr, Nullch, 0);
+ sv_magic(TARG, NULL, PERL_MAGIC_substr, NULL, 0);
}
else
SvOK_off(TARG);
TARG = sv_newmortal();
if (SvTYPE(TARG) < SVt_PVLV) {
sv_upgrade(TARG, SVt_PVLV);
- sv_magic(TARG, Nullsv, PERL_MAGIC_vec, Nullch, 0);
+ sv_magic(TARG, NULL, PERL_MAGIC_vec, NULL, 0);
}
LvTYPE(TARG) = 'v';
if (LvTARG(TARG) != src) {
dSP; dTARGET;
SV *big;
SV *little;
- SV *temp = Nullsv;
+ SV *temp = NULL;
I32 offset;
I32 retval;
const char *tmps;
dSP; dTARGET;
SV *big;
SV *little;
- SV *temp = Nullsv;
+ SV *temp = NULL;
STRLEN blen;
STRLEN llen;
I32 offset;
register char *m = cx->sb_m;
char *orig = cx->sb_orig;
register REGEXP * const rx = cx->sb_rx;
- SV *nsv = Nullsv;
+ SV *nsv = NULL;
REGEXP *old = PM_GETRE(pm);
if(old != rx) {
if(old)
if (SvTYPE(sv) < SVt_PVMG)
SvUPGRADE(sv, SVt_PVMG);
if (!(mg = mg_find(sv, PERL_MAGIC_regex_global))) {
- sv_magic(sv, Nullsv, PERL_MAGIC_regex_global, Nullch, 0);
+ sv_magic(sv, NULL, PERL_MAGIC_regex_global, NULL, 0);
mg = mg_find(sv, PERL_MAGIC_regex_global);
}
i = m - orig;
*rsp = (void*)p;
}
- *p++ = PTR2UV(RX_MATCH_COPIED(rx) ? rx->subbeg : Nullch);
+ *p++ = PTR2UV(RX_MATCH_COPIED(rx) ? rx->subbeg : NULL);
RX_MATCH_COPIED_off(rx);
#ifdef PERL_OLD_COPY_ON_WRITE
*p++ = PTR2UV(rx->saved_copy);
- rx->saved_copy = Nullsv;
+ rx->saved_copy = NULL;
#endif
*p++ = rx->nparens;
register char *t;
const char *f;
register I32 arg;
- register SV *sv = Nullsv;
- const char *item = Nullch;
+ register SV *sv = NULL;
+ const char *item = NULL;
I32 itemsize = 0;
I32 fieldsize = 0;
I32 lines = 0;
- bool chopspace = (strchr(PL_chopset, ' ') != Nullch);
- const char *chophere = Nullch;
- char *linemark = Nullch;
+ bool chopspace = (strchr(PL_chopset, ' ') != NULL);
+ const char *chophere = NULL;
+ char *linemark = NULL;
NV value;
bool gotsome = FALSE;
STRLEN len;
? (SvCUR(tmpForm) * (IN_BYTES ? 1 : 3) + 1) : 0;
bool item_is_utf8 = FALSE;
bool targ_is_utf8 = FALSE;
- SV * nsv = Nullsv;
+ SV * nsv = NULL;
OP * parseres = 0;
const char *fmt;
bool oneline;
if (PL_in_eval & EVAL_KEEPERR) {
static const char prefix[] = "\t(in cleanup) ";
SV * const err = ERRSV;
- const char *e = Nullch;
+ const char *e = NULL;
if (!SvPOK(err))
sv_setpvn(err,"",0);
else if (SvCUR(err) >= sizeof(prefix)+msglen-1) {
e = SvPV_const(err, len);
e += len - msglen;
if (*e != *message || strNE(e,message))
- e = Nullch;
+ e = NULL;
}
if (!e) {
SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
/* So is ccstack[dbcxix]. */
if (isGV(cvgv)) {
SV * const sv = NEWSV(49, 0);
- gv_efullname3(sv, cvgv, Nullch);
+ gv_efullname3(sv, cvgv, NULL);
PUSHs(sv_2mortal(sv));
PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
}
POPSUB(cx,sv); /* release CV and @_ ... */
}
else
- sv = Nullsv;
+ sv = NULL;
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVESUB(sv);
SV **newsp;
PMOP *newpm;
SV **mark;
- SV *sv = Nullsv;
+ SV *sv = NULL;
if (PL_op->op_flags & OPf_SPECIAL) {
if (autogv && (cv = GvCV(autogv)))
goto retry;
tmpstr = sv_newmortal();
- gv_efullname3(tmpstr, gv, Nullch);
+ gv_efullname3(tmpstr, gv, NULL);
DIE(aTHX_ "Goto undefined subroutine &%"SVf"",tmpstr);
}
DIE(aTHX_ "Goto undefined subroutine");
(void)SvIOK_on(sv);
SvIV_set(sv, PTR2IV(cv)); /* Do it the quickest way */
} else {
- gv_efullname3(sv, CvGV(cv), Nullch);
+ gv_efullname3(sv, CvGV(cv), NULL);
}
if ( PERLDB_GOTO
&& (gotocv = get_cv("DB::goto", FALSE)) ) {
S_check_type_and_open(pTHX_ const char *name, const char *mode)
{
Stat_t st;
- int st_rc;
- st_rc = PerlLIO_stat(name, &st);
+ const int st_rc = PerlLIO_stat(name, &st);
if (st_rc < 0) {
return Nullfp;
}
SV *sv;
const char *name;
STRLEN len;
- const char *tryname = Nullch;
- SV *namesv = Nullsv;
+ const char *tryname = NULL;
+ SV *namesv = NULL;
const I32 gimme = GIMME_V;
- PerlIO *tryrsfp = 0;
int filter_has_file = 0;
- GV *filter_child_proc = 0;
- SV *filter_state = 0;
- SV *filter_sub = 0;
- SV *hook_sv = 0;
+ PerlIO *tryrsfp = NULL;
+ GV *filter_child_proc = NULL;
+ SV *filter_state = NULL;
+ SV *filter_sub = NULL;
+ SV *hook_sv = NULL;
SV *encoding;
OP *op;
I32 i;
#ifdef VMS
char *unixname;
- if ((unixname = tounixspec(name, Nullch)) != Nullch)
+ if ((unixname = tounixspec(name, NULL)) != NULL)
#endif
{
namesv = NEWSV(806, 0);
Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%"UVxf"/%s",
PTR2UV(SvRV(dirsv)), name);
tryname = SvPVX_const(namesv);
- tryrsfp = 0;
+ tryrsfp = NULL;
ENTER;
SAVETMPS;
(void)SvREFCNT_inc(filter_state);
}
- if (tryrsfp == 0) {
- tryrsfp = PerlIO_open("/dev/null",
- PERL_SCRIPT_MODE);
+ if (!tryrsfp) {
+ tryrsfp = PerlIO_open("/dev/null", PERL_SCRIPT_MODE);
}
}
SP--;
filter_has_file = 0;
if (filter_child_proc) {
SvREFCNT_dec(filter_child_proc);
- filter_child_proc = 0;
+ filter_child_proc = NULL;
}
if (filter_state) {
SvREFCNT_dec(filter_state);
- filter_state = 0;
+ filter_state = NULL;
}
if (filter_sub) {
SvREFCNT_dec(filter_sub);
- filter_sub = 0;
+ filter_sub = NULL;
}
}
else {
#else
# ifdef VMS
char *unixdir;
- if ((unixdir = tounixpath(dir, Nullch)) == Nullch)
+ if ((unixdir = tounixpath(dir, NULL)) == NULL)
continue;
sv_setpv(namesv, unixdir);
sv_catpv(namesv, unixname);
else
PL_compiling.cop_warnings = pWARN_STD ;
SAVESPTR(PL_compiling.cop_io);
- PL_compiling.cop_io = Nullsv;
+ PL_compiling.cop_io = NULL;
if (filter_sub || filter_child_proc) {
- SV * const datasv = filter_add(S_run_user_filter, Nullsv);
+ SV * const datasv = filter_add(S_run_user_filter, NULL);
IoLINES(datasv) = filter_has_file;
IoFMT_GV(datasv) = (GV *)filter_child_proc;
IoTOP_GV(datasv) = (GV *)filter_state;
/* Store and reset encoding. */
encoding = PL_encoding;
- PL_encoding = Nullsv;
+ PL_encoding = NULL;
op = DOCATCH(doeval(gimme, NULL, Nullcv, PL_curcop->cop_seq));
OP *ret;
CV* runcv;
U32 seq;
- HV *saved_hh = 0;
+ HV *saved_hh = NULL;
if (PL_op->op_private & OPpEVAL_HAS_HH) {
saved_hh = (HV*) SvREFCNT_inc(POPs);
PP(pp_leavetry)
{
dVAR; dSP;
- register SV **mark;
SV **newsp;
PMOP *newpm;
I32 gimme;
if (gimme == G_VOID)
SP = newsp;
else if (gimme == G_SCALAR) {
+ register SV **mark;
MARK = newsp + 1;
if (MARK <= SP) {
if (SvFLAGS(TOPs) & (SVs_PADTMP|SVs_TEMP))
}
else {
/* in case LEAVE wipes old return values */
+ register SV **mark;
for (mark = newsp + 1; mark <= SP; mark++) {
if (!(SvFLAGS(*mark) & (SVs_PADTMP|SVs_TEMP))) {
*mark = sv_mortalcopy(*mark);
SAVETMPS;
if (PL_op->op_targ == 0) {
- SV **defsv_p = &GvSV(PL_defgv);
+ SV ** const defsv_p = &GvSV(PL_defgv);
*defsv_p = newSVsv(POPs);
SAVECLEARSV(*defsv_p);
}
tied = TRUE;
}
else if (SvTIED_mg((SV *) other_hv, PERL_MAGIC_tied)) {
- HV * temp = other_hv;
+ HV * const temp = other_hv;
other_hv = (HV *) this;
this = (SV *) temp;
tied = TRUE;
(void) hv_iterinit((HV *) this);
while ( (he = hv_iternext((HV *) this)) ) {
I32 key_len;
- char *key = hv_iterkey(he, &key_len);
+ char * const key = hv_iterkey(he, &key_len);
++ this_key_count;
RETPUSHYES;
}
else if (SM_OTHER_REF(PVAV)) {
- AV *other_av = (AV *) SvRV(other);
- I32 other_len = av_len(other_av) + 1;
+ AV * const other_av = (AV *) SvRV(other);
+ const I32 other_len = av_len(other_av) + 1;
I32 i;
if (HvUSEDKEYS((HV *) this) != other_len)
RETPUSHNO;
for(i = 0; i < other_len; ++i) {
- SV **svp = av_fetch(other_av, i, FALSE);
+ SV ** const svp = av_fetch(other_av, i, FALSE);
char *key;
STRLEN key_len;
RETPUSHYES;
}
else if (SM_OTHER_REGEX) {
- PMOP *matcher = make_matcher(other_regex);
+ PMOP * const matcher = make_matcher(other_regex);
HE *he;
(void) hv_iterinit((HV *) this);
RETPUSHNO;
else {
I32 i;
- I32 other_len = av_len(other_av);
+ const I32 other_len = av_len(other_av);
if (Nullhv == seen_this) {
seen_this = newHV();
(void) sv_2mortal((SV *) seen_other);
}
for(i = 0; i <= other_len; ++i) {
- SV **this_elem = av_fetch((AV *)this, i, FALSE);
- SV **other_elem = av_fetch(other_av, i, FALSE);
-
+ SV * const * const this_elem = av_fetch((AV *)this, i, FALSE);
+ SV * const * const other_elem = av_fetch(other_av, i, FALSE);
+
if (!this_elem || !other_elem) {
if (this_elem || other_elem)
RETPUSHNO;
}
}
else if (SM_OTHER_REGEX) {
- PMOP *matcher = make_matcher(other_regex);
+ PMOP * const matcher = make_matcher(other_regex);
+ const I32 this_len = av_len((AV *) this);
I32 i;
- I32 this_len = av_len((AV *) this);
for(i = 0; i <= this_len; ++i) {
- SV ** svp = av_fetch((AV *)this, i, FALSE);
+ SV * const * const svp = av_fetch((AV *)this, i, FALSE);
if (svp && matcher_matches_sv(matcher, *svp)) {
destroy_matcher(matcher);
RETPUSHYES;
I32 i;
for(i = 0; i <= AvFILL((AV *) this); ++i) {
- SV ** svp = av_fetch((AV *)this, i, FALSE);
+ SV * const * const svp = av_fetch((AV *)this, i, FALSE);
if (!svp)
continue;
RETPUSHNO;
}
else if (SvPOK(other)) {
+ const I32 this_len = av_len((AV *) this);
I32 i;
- I32 this_len = av_len((AV *) this);
for(i = 0; i <= this_len; ++i) {
- SV ** svp = av_fetch((AV *)this, i, FALSE);
+ SV * const * const svp = av_fetch((AV *)this, i, FALSE);
if (!svp)
continue;
RETPUSHNO;
}
else if (SM_REGEX) {
- PMOP *matcher = make_matcher(this_regex);
+ PMOP * const matcher = make_matcher(this_regex);
PUTBACK;
PUSHs(matcher_matches_sv(matcher, other)
{
STRLEN len;
register char *s = SvPV_force(sv, len);
- register char *send = s + len;
- register char *base = Nullch;
+ register char * const send = s + len;
+ register char *base = NULL;
register I32 skipspaces = 0;
bool noblank = FALSE;
bool repeat = FALSE;
maxops += 10;
}
s = base;
- base = Nullch;
+ base = NULL;
Newx(fops, maxops, U32);
fpc = fops;
}
Copy(fops, s, arg, U32);
Safefree(fops);
- sv_magic(sv, Nullsv, PERL_MAGIC_fm, Nullch, 0);
+ sv_magic(sv, NULL, PERL_MAGIC_fm, NULL, 0);
SvCOMPILED_on(sv);
if (unchopnum && repeat)
PP(pp_aelemfast)
{
dSP;
- AV *av = PL_op->op_flags & OPf_SPECIAL ?
+ AV * const av = PL_op->op_flags & OPf_SPECIAL ?
(AV*)PAD_SV(PL_op->op_targ) : GvAV(cGVOP_gv);
const U32 lval = PL_op->op_flags & OPf_MOD;
SV** const svp = av_fetch(av, PL_op->op_private, lval);
if ((global = dynpm->op_pmflags & PMf_GLOBAL)) {
rx->startp[0] = -1;
if (SvTYPE(TARG) >= SVt_PVMG && SvMAGIC(TARG)) {
- MAGIC* mg = mg_find(TARG, PERL_MAGIC_regex_global);
+ MAGIC* const mg = mg_find(TARG, PERL_MAGIC_regex_global);
if (mg && mg->mg_len >= 0) {
if (!(rx->reganch & ROPT_GPOS_SEEN))
rx->endp[0] = rx->startp[0] = mg->mg_len;
continue;
}
} else if (SvUTF8(sv)) { /* OP_READLINE, OP_RCATLINE */
- const U8 *s = (const U8*)SvPVX_const(sv) + offset;
+ const U8 * const s = (const U8*)SvPVX_const(sv) + offset;
const STRLEN len = SvCUR(sv) - offset;
const U8 *f;
dSP;
HE* he;
SV **svp;
- SV *keysv = POPs;
- HV *hv = (HV*)POPs;
+ SV * const keysv = POPs;
+ HV * const hv = (HV*)POPs;
const U32 lval = PL_op->op_flags & OPf_MOD || LVRET;
const U32 defer = PL_op->op_private & OPpLVAL_DEFER;
SV *sv;
RETPUSHNO;
if (SvMAGICAL(av) || AvREIFY(av)) {
- SV ** const svp = av_fetch(av, --cx->blk_loop.iterix, FALSE);
+ SV * const * const svp = av_fetch(av, --cx->blk_loop.iterix, FALSE);
sv = svp ? *svp : Nullsv;
}
else {
RETPUSHNO;
if (SvMAGICAL(av) || AvREIFY(av)) {
- SV ** const svp = av_fetch(av, ++cx->blk_loop.iterix, FALSE);
+ SV * const * const svp = av_fetch(av, ++cx->blk_loop.iterix, FALSE);
sv = svp ? *svp : Nullsv;
}
else {
PP(pp_chdir)
{
dSP; dTARGET;
- const char *tmps = 0;
+ const char *tmps = NULL;
GV *gv = NULL;
if( MAXARG == 1 ) {
__attribute__nonnull__(pTHX_6)
__attribute__nonnull__(pTHX_7);
+STATIC char * S_stringify_regexp(pTHX_ SV *sv, MAGIC *mg, STRLEN *lp)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
+STATIC char * S_F0convert(NV nv, char *endbuf, STRLEN *len)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
+
#if defined(PERL_OLD_COPY_ON_WRITE)
STATIC void S_sv_release_COW(pTHX_ SV *sv, const char *pvx, STRLEN len, SV *after)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_3)
__attribute__nonnull__(pTHX_4);
-# if defined(DEBUGGING)
-STATIC int S_tokereport(pTHX_ I32 rv);
-# endif
STATIC int S_ao(pTHX_ int toketype);
-STATIC void S_depcom(pTHX);
STATIC const char* S_incl_perldb(pTHX);
# if defined(PERL_CR_FILTER)
STATIC I32 S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);
__attribute__nonnull__(pTHX_1);
# endif
+# if defined(DEBUGGING)
+STATIC int S_tokereport(pTHX_ I32 rv);
+# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
- regnode *noper = NEXTOPER( cur );
+ regnode * const noper = NEXTOPER( cur );
const U8 *uc = (U8*)STRING( noper );
const U8 * const e = uc + STR_LEN( noper );
STRLEN foldlen = 0;
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
- regnode *noper = NEXTOPER( cur );
- U8 *uc = (U8*)STRING( noper );
- const U8 * const e = uc + STR_LEN( noper );
- U32 state = 1; /* required init */
- U16 charid = 0; /* sanity init */
- U8 *scan = (U8*)NULL; /* sanity init */
- STRLEN foldlen = 0; /* required init */
- U8 foldbuf[ UTF8_MAXBYTES_CASE + 1 ];
-
-
- for ( ; uc < e ; uc += len ) {
-
- TRIE_READ_CHAR;
-
- if ( uvc < 256 ) {
- charid = trie->charmap[ uvc ];
- } else {
- SV** svpp=(SV**)NULL;
- svpp = hv_fetch( trie->widecharmap, (char*)&uvc, sizeof( UV ), 0);
- if ( !svpp ) {
- charid = 0;
- } else {
- charid=(U16)SvIV( *svpp );
- }
- }
- if ( charid ) {
+ regnode * const noper = NEXTOPER( cur );
+ U8 *uc = (U8*)STRING( noper );
+ const U8 * const e = uc + STR_LEN( noper );
+ U32 state = 1; /* required init */
+ U16 charid = 0; /* sanity init */
+ U8 *scan = (U8*)NULL; /* sanity init */
+ STRLEN foldlen = 0; /* required init */
+ U8 foldbuf[ UTF8_MAXBYTES_CASE + 1 ];
+
+ for ( ; uc < e ; uc += len ) {
+
+ TRIE_READ_CHAR;
+
+ if ( uvc < 256 ) {
+ charid = trie->charmap[ uvc ];
+ } else {
+ SV** const svpp = hv_fetch( trie->widecharmap, (char*)&uvc, sizeof( UV ), 0);
+ if ( !svpp ) {
+ charid = 0;
+ } else {
+ charid=(U16)SvIV( *svpp );
+ }
+ }
+ if ( charid ) {
- U16 check;
- U32 newstate = 0;
+ U16 check;
+ U32 newstate = 0;
- charid--;
- if ( !trie->states[ state ].trans.list ) {
- TRIE_LIST_NEW( state );
- }
- for ( check = 1; check <= TRIE_LIST_USED( state ); check++ ) {
- if ( TRIE_LIST_ITEM( state, check ).forid == charid ) {
- newstate = TRIE_LIST_ITEM( state, check ).newstate;
- break;
- }
- }
- if ( ! newstate ) {
- newstate = next_alloc++;
- TRIE_LIST_PUSH( state, charid, newstate );
- transcount++;
+ charid--;
+ if ( !trie->states[ state ].trans.list ) {
+ TRIE_LIST_NEW( state );
+ }
+ for ( check = 1; check <= TRIE_LIST_USED( state ); check++ ) {
+ if ( TRIE_LIST_ITEM( state, check ).forid == charid ) {
+ newstate = TRIE_LIST_ITEM( state, check ).newstate;
+ break;
+ }
+ }
+ if ( ! newstate ) {
+ newstate = next_alloc++;
+ TRIE_LIST_PUSH( state, charid, newstate );
+ transcount++;
+ }
+ state = newstate;
+ } else {
+ Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %"IVdf, uvc );
}
- state = newstate;
- } else {
- Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %"IVdf, uvc );
- }
- /* charid is now 0 if we dont know the char read, or nonzero if we do */
- }
+ /* charid is now 0 if we dont know the char read, or nonzero if we do */
+ }
- if ( !trie->states[ state ].wordnum ) {
- /* we havent inserted this word into the structure yet. */
- trie->states[ state ].wordnum = ++curword;
+ if ( !trie->states[ state ].wordnum ) {
+ /* we havent inserted this word into the structure yet. */
+ trie->states[ state ].wordnum = ++curword;
- DEBUG_r({
- /* store the word for dumping */
- SV* tmp = newSVpvn( STRING( noper ), STR_LEN( noper ) );
- if ( UTF ) SvUTF8_on( tmp );
- av_push( trie->words, tmp );
- });
+ DEBUG_r({
+ /* store the word for dumping */
+ SV* tmp = newSVpvn( STRING( noper ), STR_LEN( noper ) );
+ if ( UTF ) SvUTF8_on( tmp );
+ av_push( trie->words, tmp );
+ });
- } else {
- /* Its a dupe. So ignore it. */
- }
+ } else {
+ /* Its a dupe. So ignore it. */
+ }
} /* end second pass */
U16 idx;
for( idx = 2 ; idx <= TRIE_LIST_USED( state ) ; idx++ ) {
- if ( TRIE_LIST_ITEM( state, idx).forid < minid ) {
- minid=TRIE_LIST_ITEM( state, idx).forid;
- } else if ( TRIE_LIST_ITEM( state, idx).forid > maxid ) {
- maxid=TRIE_LIST_ITEM( state, idx).forid;
- }
+ const U16 forid = TRIE_LIST_ITEM( state, idx).forid;
+ if ( forid < minid ) {
+ minid=forid;
+ } else if ( forid > maxid ) {
+ maxid=forid;
+ }
}
if ( transcount < tp + maxid - minid + 1) {
transcount *= 2;
}
} else {
for ( idx=1; idx <= TRIE_LIST_USED( state ) ; idx++ ) {
- U32 tid = base - trie->uniquecharcount + TRIE_LIST_ITEM( state, idx ).forid;
+ const U32 tid = base - trie->uniquecharcount + TRIE_LIST_ITEM( state, idx ).forid;
trie->trans[ tid ].next = TRIE_LIST_ITEM( state, idx ).newstate;
trie->trans[ tid ].check = state;
}
for ( cur = first ; cur < last ; cur = regnext( cur ) ) {
- regnode *noper = NEXTOPER( cur );
+ regnode * const noper = NEXTOPER( cur );
const U8 *uc = (U8*)STRING( noper );
const U8 * const e = uc + STR_LEN( noper );
if ( uvc < 256 ) {
charid = trie->charmap[ uvc ];
} else {
- SV** svpp=(SV**)NULL;
- svpp = hv_fetch( trie->widecharmap, (char*)&uvc, sizeof( UV ), 0);
- if ( !svpp ) {
- charid = 0;
- } else {
- charid=(U16)SvIV( *svpp );
- }
+ SV* const * const svpp = hv_fetch( trie->widecharmap, (char*)&uvc, sizeof( UV ), 0);
+ charid = svpp ? (U16)SvIV(*svpp) : 0;
}
if ( charid ) {
charid--;
while (scan && OP(scan) != END && scan < last) {
/* Peephole optimizer: */
DEBUG_OPTIMISE_r({
- SV *mysv=sv_newmortal();
+ SV * const mysv=sv_newmortal();
regprop( mysv, scan);
PerlIO_printf(Perl_debug_log, "%*speep: %s (0x%08"UVXf")\n",
(int)depth*2, "", SvPV_nolen_const(mysv), PTR2UV(scan));
}
else if (stringok) {
const int oldl = STR_LEN(scan);
- regnode *nnext = regnext(n);
+ regnode * const nnext = regnext(n);
if (oldl + STR_LEN(n) > U8_MAX)
break;
another valid sequence of UTF-8 bytes.
*/
- char *s0 = STRING(scan), *s, *t;
- char *s1 = s0 + STR_LEN(scan) - 1, *s2 = s1 - 4;
+ char * const s0 = STRING(scan), *s, *t;
+ char * const s1 = s0 + STR_LEN(scan) - 1;
+ char * const s2 = s1 - 4;
const char * const t0 = "\xcc\x88\xcc\x81";
const char * const t1 = t0 + 3;
U32 count=0;
#ifdef DEBUGGING
- SV *mysv = sv_newmortal(); /* for dumping */
+ SV * const mysv = sv_newmortal(); /* for dumping */
#endif
/* var tail is used because there may be a TAIL
regop in the way. Ie, the exacts will point to the
}
else if (OP(scan) == EXACT) {
I32 l = STR_LEN(scan);
- UV uc = *((U8*)STRING(scan));
+ UV uc;
if (UTF) {
const U8 * const s = (U8*)STRING(scan);
l = utf8_length(s, s + l);
uc = utf8_to_uvchr(s, NULL);
+ } else {
+ uc = *((U8*)STRING(scan));
}
min += l;
if (flags & SCF_DO_SUBSTR) { /* Update longest substr. */
if (data && fl & (SF_HAS_PAR|SF_IN_PAR))
pars++;
if (flags & SCF_DO_SUBSTR) {
- SV *last_str = Nullsv;
+ SV *last_str = NULL;
int counted = mincount != 0;
if (data->last_end > 0 && mincount != 0) { /* Ends with a string. */
REGC((U8)REG_MAGIC, (char*)RExC_emit);
#endif
if (reg(pRExC_state, 0, &flags) == NULL) {
- RExC_precomp = Nullch;
+ RExC_precomp = NULL;
return(NULL);
}
DEBUG_COMPILE_r(PerlIO_printf(Perl_debug_log, "size %"IVdf" ", (IV)RExC_size));
r->precomp = savepvn(RExC_precomp, r->prelen);
r->subbeg = NULL;
#ifdef PERL_OLD_COPY_ON_WRITE
- r->saved_copy = Nullsv;
+ r->saved_copy = NULL;
#endif
r->reganch = pm->op_pmflags & PMf_COMPILETIME;
r->nparens = RExC_npar - 1; /* set early to validate backrefs */
if (SvUTF8(data.longest_float)) {
r->float_utf8 = data.longest_float;
- r->float_substr = Nullsv;
+ r->float_substr = NULL;
} else {
r->float_substr = data.longest_float;
- r->float_utf8 = Nullsv;
+ r->float_utf8 = NULL;
}
r->float_min_offset = data.offset_float_min;
r->float_max_offset = data.offset_float_max;
}
else {
remove_float:
- r->float_substr = r->float_utf8 = Nullsv;
+ r->float_substr = r->float_utf8 = NULL;
SvREFCNT_dec(data.longest_float);
longest_float_length = 0;
}
if (SvUTF8(data.longest_fixed)) {
r->anchored_utf8 = data.longest_fixed;
- r->anchored_substr = Nullsv;
+ r->anchored_substr = NULL;
} else {
r->anchored_substr = data.longest_fixed;
- r->anchored_utf8 = Nullsv;
+ r->anchored_utf8 = NULL;
}
r->anchored_offset = data.offset_fixed;
t = (data.flags & SF_FIX_BEFORE_EOL /* Can't have SEOL and MULTI */
fbm_compile(data.longest_fixed, t ? FBMcf_TAIL : 0);
}
else {
- r->anchored_substr = r->anchored_utf8 = Nullsv;
+ r->anchored_substr = r->anchored_utf8 = NULL;
SvREFCNT_dec(data.longest_fixed);
longest_fixed_length = 0;
}
data.last_closep = &last_close;
minlen = study_chunk(pRExC_state, &scan, &fake, scan + RExC_size, &data, SCF_DO_STCLASS_AND|SCF_WHILEM_VISITED_POS,0);
r->check_substr = r->check_utf8 = r->anchored_substr = r->anchored_utf8
- = r->float_substr = r->float_utf8 = Nullsv;
+ = r->float_substr = r->float_utf8 = NULL;
if (!(data.start_class->flags & ANYOF_EOS)
&& !cl_is_anything(data.start_class))
{
if (op == '{' && regcurly(RExC_parse)) {
parse_start = RExC_parse; /* MJD */
next = RExC_parse + 1;
- maxpos = Nullch;
+ maxpos = NULL;
while (isDIGIT(*next) || *next == ',') {
if (*next == ',') {
if (maxpos)
IV namedclass;
char *rangebegin = 0;
bool need_class = 0;
- SV *listsv = Nullsv;
+ SV *listsv = NULL;
register char *e;
UV n;
bool optimize_invert = TRUE;
Perl_regdump(pTHX_ regexp *r)
{
#ifdef DEBUGGING
- SV *sv = sv_newmortal();
+ SV * const sv = sv_newmortal();
(void)dumpuntil(r->program, r->program + 1, NULL, sv, 0);
{
char *s = savesvpv(lv);
- char *origs = s;
+ char * const origs = s;
while(*s && *s != '\n') s++;
{
dVAR;
#ifdef DEBUGGING
- SV *dsv = PERL_DEBUG_PAD_ZERO(0);
- SV *re_debug_flags=get_sv(RE_DEBUG_FLAGS,0);
+ SV * const dsv = PERL_DEBUG_PAD_ZERO(0);
+ SV * const re_debug_flags=get_sv(RE_DEBUG_FLAGS,0);
#endif
if (!r || (--r->refcnt > 0))
return;
DEBUG_r(if (re_debug_flags && (SvIV(re_debug_flags) & RE_DEBUG_COMPILE)) {
- const char *s = (r->reganch & ROPT_UTF8)
+ const char * const s = (r->reganch & ROPT_UTF8)
? pv_uni_display(dsv, (U8*)r->precomp, r->prelen, 60, UNI_DISPLAY_REGEX)
: pv_display(dsv, r->precomp, r->prelen, 0, 60);
const int len = SvCUR(dsv);
Perl_croak(aTHX_ "panic: pregfree comppad");
PAD_SAVE_LOCAL(old_comppad,
/* Watch out for global destruction's random ordering. */
- (SvTYPE(new_comppad) == SVt_PVAV) ?
- new_comppad : Null(PAD *)
+ (SvTYPE(new_comppad) == SVt_PVAV) ? new_comppad : NULL
);
OP_REFCNT_LOCK;
refcnt = OpREFCNT_dec((OP_4tree*)r->data->data[n]);
break;
case 't':
{
- reg_trie_data *trie=(reg_trie_data*)r->data->data[n];
+ reg_trie_data * const trie=(reg_trie_data*)r->data->data[n];
U32 refcount;
OP_REFCNT_LOCK;
refcount = --trie->refcount;
SAVEVPTR(PL_reg_oldcurpm); /* from regexec.c */
SAVEVPTR(PL_reg_curpm); /* from regexec.c */
SAVEPPTR(PL_reg_oldsaved); /* old saved substr during match */
- PL_reg_oldsaved = Nullch;
+ PL_reg_oldsaved = NULL;
SAVEI32(PL_reg_oldsavedlen); /* old length of saved substr during match */
PL_reg_oldsavedlen = 0;
#ifdef PERL_OLD_COPY_ON_WRITE
SAVESPTR(PL_nrs);
- PL_nrs = Nullsv;
+ PL_nrs = NULL;
#endif
SAVEI32(PL_reg_maxiter); /* max wait until caching pos */
PL_reg_maxiter = 0;
SAVEI32(PL_reg_leftiter); /* wait until caching pos */
PL_reg_leftiter = 0;
SAVEGENERICPV(PL_reg_poscache); /* cache of pos of WHILEM */
- PL_reg_poscache = Nullch;
+ PL_reg_poscache = NULL;
SAVEI32(PL_reg_poscache_size); /* size of pos cache of WHILEM */
PL_reg_poscache_size = 0;
SAVEPPTR(PL_regprecomp); /* uncompiled string. */
SAVEI32(PL_regnpar); /* () count. */
SAVEI32(PL_regsize); /* from regexec.c */
- {
- /* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
- REGEXP *rx;
-
- if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
+ /* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
+ if (PL_curpm) {
+ const REGEXP * const rx = PM_GETRE(PL_curpm);
+ if (rx) {
U32 i;
for (i = 1; i <= rx->nparens; i++) {
- GV *mgv;
char digits[TYPE_CHARS(long)];
const STRLEN len = my_sprintf(digits, "%lu", (long)i);
- if ((mgv = gv_fetchpvn_flags(digits, len, 0, SVt_PV)))
+ GV * const mgv = gv_fetchpvn_flags(digits, len, 0, SVt_PV);
+ if (mgv)
save_scalar(mgv);
}
}
(SVs_OBJECT|SVf_OK|SVs_GMG|SVs_SMG|SVs_RMG))
== (SVs_OBJECT|SVs_SMG))
&& (mg = mg_find(referent, PERL_MAGIC_qr))) {
- return S_stringify_regexp(aTHX_ sv, mg, lp);
+ return stringify_regexp(sv, mg, lp);
} else {
const char *const typestr = sv_reftype(referent, 0);
sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted);
}
-/* private function for use in sv_vcatpvfn via the EXPECT_NUMBER macro */
-
STATIC I32
S_expect_number(pTHX_ char** pattern)
{
}
return var;
}
-#define EXPECT_NUMBER(pattern, var) (var = S_expect_number(aTHX_ &pattern))
-static char *
-F0convert(NV nv, char *endbuf, STRLEN *len)
+STATIC char *
+S_F0convert(NV nv, char *endbuf, STRLEN *len)
{
const int neg = nv < 0;
UV uv;
STRLEN zeros = 0;
bool has_precis = FALSE;
STRLEN precis = 0;
- I32 osvix = svix;
+ const I32 osvix = svix;
bool is_utf8 = FALSE; /* is this item utf8? */
#ifdef HAS_LDBL_SPRINTF_BUG
/* This is to try to fix a bug with irix/nonstop-ux/powerux and
STRLEN n = 0;
if (*q == '-')
sv = *q++;
- EXPECT_NUMBER(q, n);
+ n = expect_number(&q);
if (*q++ == 'p') {
if (sv) { /* SVf */
if (n) {
q = r;
}
- if (EXPECT_NUMBER(q, width)) {
+ if ( (width = expect_number(&q)) ) {
if (*q == '$') {
++q;
efix = width;
tryasterisk:
if (*q == '*') {
q++;
- if (EXPECT_NUMBER(q, ewix))
+ if ( (ewix = expect_number(&q)) )
if (*q++ != '$')
goto unknown;
asterisk = TRUE;
{
if( *q == '0' )
fill = *q++;
- EXPECT_NUMBER(q, width);
+ width = expect_number(&q);
}
if (vectorize) {
q++;
if (*q == '*') {
q++;
- if (EXPECT_NUMBER(q, epix) && *q++ != '$')
+ if ( ((epix = expect_number(&q))) && (*q++ != '$') )
goto unknown;
/* XXX: todo, support specified precision parameter */
if (epix)
if (mg->mg_type == PERL_MAGIC_overload_table &&
AMT_AMAGIC((AMT*)mg->mg_ptr))
{
- AMT * const amtp = (AMT*)mg->mg_ptr;
+ const AMT * const amtp = (AMT*)mg->mg_ptr;
AMT * const namtp = (AMT*)nmg->mg_ptr;
I32 i;
for (i = 1; i < NofAMmeth; i++) {
Perl_ptr_table_clear(pTHX_ PTR_TBL_t *tbl)
{
if (tbl && tbl->tbl_items) {
- register PTR_TBL_ENT_t **array = tbl->tbl_ary;
+ register PTR_TBL_ENT_t * const * const array = tbl->tbl_ary;
UV riter = tbl->tbl_max;
do {
ptr_table_store(PL_ptr_table, cxs, ncxs);
while (ix >= 0) {
- PERL_CONTEXT *cx = &cxs[ix];
- PERL_CONTEXT *ncx = &ncxs[ix];
+ PERL_CONTEXT * const cx = &cxs[ix];
+ PERL_CONTEXT * const ncx = &ncxs[ix];
ncx->cx_type = cx->cx_type;
if (CxTYPE(cx) == CXt_SUBST) {
Perl_croak(aTHX_ "Cloning substitution context is unimplemented");
#define yylval (*PL_yylvalp)
static const char ident_too_long[] = "Identifier too long";
+static const char commaless_variable_list[] = "comma-less variable list";
static void restore_rsfp(pTHX_ void *f);
#ifndef PERL_NO_UTF16_FILTER
}
/*
- * depcom
- * Deprecate a comma-less variable list.
- */
-
-STATIC void
-S_depcom(pTHX)
-{
- deprecate_old("comma-less variable list");
-}
-
-/*
* experimental text filters for win32 carriage-returns, utf16-to-utf8 and
* utf16-to-utf8-reversed.
*/
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
PL_expect = XTERM;
- depcom();
+ deprecate_old(commaless_variable_list);
return REPORT(','); /* grandfather non-comma-format format */
}
}
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
PL_expect = XTERM;
- depcom();
+ deprecate_old(commaless_variable_list);
return REPORT(','); /* grandfather non-comma-format format */
}
else
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
PL_expect = XTERM;
- depcom();
+ deprecate_old(commaless_variable_list);
return REPORT(','); /* grandfather non-comma-format format */
}
else
GV* gv;
GV** gvp;
HV* hv = NULL;
- SV* subgen = Nullsv;
+ SV* subgen = NULL;
const char *hvname;
/* A stash/class can go by many names (ie. User == main::User), so
bool
Perl_sv_derived_from(pTHX_ SV *sv, const char *name)
{
- const char *type = Nullch;
+ const char *type = NULL;
HV *stash = NULL;
HV *name_stash;
sv = nsv;
if ( !sv_derived_from(sv, "version"))
upg_version(sv);
- undef = Nullch;
+ undef = NULL;
}
else {
sv = (SV*)&PL_sv_undef;