'ni-s' => 'Nick Ing-Simmons <nick@ing-simmons.net>',
'p5p' => 'perl5-porters <perl5-porters@perl.org>',
'perlfaq' => 'perlfaq-workers <perlfaq-workers@perl.org>',
- 'petdance' => 'Andy Lester <petdance@cpan.org>',
+ 'petdance' => 'Andy Lester <andy@petdance.com>',
'pmqs' => 'Paul Marquess <pmqs@cpan.org>',
'pvhp' => 'Peter Prymmer <pvhp@best.com>',
'rclamp' => 'Richard Clamp <rclamp@cpan.org>',
int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs,
I32 num_svs)
{
+ (void)num_svs;
return do_openn(gv, name, len, as_raw, rawmode, rawperm,
supplied_fp, &svs, 1);
}
|O_TRUNC
#endif
;
- int modifyingmode = O_WRONLY|O_RDWR|O_CREAT|appendtrunc;
+ const int modifyingmode = O_WRONLY|O_RDWR|O_CREAT|appendtrunc;
int ismodifying;
if (num_svs != 0) {
&& s > cmd + 1 && s[-1] == '2' && isSPACE(s[-2])
&& (!s[3] || isSPACE(s[3])))
{
- char *t = s + 3;
+ const char *t = s + 3;
while (*t && isSPACE(*t))
++t;
goto doshell;
}
{
- int e = errno;
-
if (ckWARN(WARN_EXEC))
Perl_warner(aTHX_ packWARN(WARN_EXEC), "Can't exec \"%s\": %s",
PL_Argv[0], Strerror(errno));
if (do_report) {
+ int e = errno;
PerlLIO_write(fd, (void*)&e, sizeof(int));
PerlLIO_close(fd);
}
Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
{
register I32 val;
- register I32 val2;
register I32 tot = 0;
const char *what;
char *s;
what = "chown";
APPLY_TAINT_PROPER();
if (sp - mark > 2) {
+ register I32 val2;
val = SvIVx(*++mark);
val2 = SvIVx(*++mark);
APPLY_TAINT_PROPER();
I32
Perl_do_ipcget(pTHX_ I32 optype, SV **mark, SV **sp)
{
- key_t key;
- I32 n, flags;
+ key_t key = (key_t)SvNVx(*++mark);
+ const I32 n = (optype == OP_MSGGET) ? 0 : SvIVx(*++mark);
+ const I32 flags = SvIVx(*++mark);
+ (void)sp;
- key = (key_t)SvNVx(*++mark);
- n = (optype == OP_MSGGET) ? 0 : SvIVx(*++mark);
- flags = SvIVx(*++mark);
SETERRNO(0,0);
switch (optype)
{
{
SV *astr;
char *a;
- I32 id, n, cmd, infosize, getinfo;
+ I32 infosize, getinfo;
I32 ret = -1;
+ const I32 id = SvIVx(*++mark);
+ const I32 n = (optype == OP_SEMCTL) ? SvIVx(*++mark) : 0;
+ const I32 cmd = SvIVx(*++mark);
+ (void)sp;
- id = SvIVx(*++mark);
- n = (optype == OP_SEMCTL) ? SvIVx(*++mark) : 0;
- cmd = SvIVx(*++mark);
astr = *++mark;
infosize = 0;
getinfo = (cmd == IPC_STAT);
#ifdef HAS_MSG
SV *mstr;
char *mbuf;
- I32 id, msize, flags;
+ I32 msize, flags;
STRLEN len;
+ const I32 id = SvIVx(*++mark);
+ (void)sp;
- id = SvIVx(*++mark);
mstr = *++mark;
flags = SvIVx(*++mark);
mbuf = SvPV(mstr, len);
SV *mstr;
char *mbuf;
long mtype;
- I32 id, msize, flags, ret;
+ I32 msize, flags, ret;
STRLEN len;
+ const I32 id = SvIVx(*++mark);
+ (void)sp;
- id = SvIVx(*++mark);
mstr = *++mark;
/* suppress warning when reading into undef var --jhi */
if (! SvOK(mstr))
#ifdef HAS_SEM
SV *opstr;
char *opbuf;
- I32 id;
STRLEN opsize;
+ const I32 id = SvIVx(*++mark);
+ (void)sp;
- id = SvIVx(*++mark);
opstr = *++mark;
opbuf = SvPV(opstr, opsize);
if (opsize < 3 * SHORTSIZE
SETERRNO(0,0);
/* We can't assume that sizeof(struct sembuf) == 3 * sizeof(short). */
{
- int nsops = opsize / (3 * sizeof (short));
+ const int nsops = opsize / (3 * sizeof (short));
int i = nsops;
short *ops = (short *) opbuf;
short *o = ops;
#ifdef HAS_SHM
SV *mstr;
char *mbuf, *shm;
- I32 id, mpos, msize;
+ I32 mpos, msize;
STRLEN len;
struct shmid_ds shmds;
+ const I32 id = SvIVx(*++mark);
+ (void)sp;
- id = SvIVx(*++mark);
mstr = *++mark;
mpos = SvIVx(*++mark);
msize = SvIVx(*++mark);
}
void
-Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, PMOP *pm)
+Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
{
char ch;
/* An op sequencer. We visit the ops in the order they're to execute. */
STATIC void
-sequence(pTHX_ register OP *o)
+sequence(pTHX_ register const OP *o)
{
SV *op;
char *key;
STRLEN len;
static UV seq;
- OP *oldop = 0,
- *l;
+ const OP *oldop = 0;
+ OP *l;
if (!Sequence)
Sequence = newHV();
}
STATIC UV
-sequence_num(pTHX_ OP *o)
+sequence_num(pTHX_ const OP *o)
{
SV *op,
**seq;
}
void
-Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
+Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
{
UV seq;
sequence(aTHX_ o);
}
void
-Perl_op_dump(pTHX_ OP *o)
+Perl_op_dump(pTHX_ const OP *o)
{
do_op_dump(0, Perl_debug_log, o);
}
};
void
-Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
+Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
{
for (; mg; mg = mg->mg_moremagic) {
Perl_dump_indent(aTHX_ level, file,
}
void
-Perl_magic_dump(pTHX_ MAGIC *mg)
+Perl_magic_dump(pTHX_ const MAGIC *mg)
{
do_magic_dump(0, Perl_debug_log, mg, 0, 0, 0, 0);
}
}
I32
-Perl_debop(pTHX_ OP *o)
+Perl_debop(pTHX_ const OP *o)
{
- AV *padlist, *comppad;
CV *cv;
SV *sv;
/* print the lexical's name */
cv = deb_curcv(cxstack_ix);
if (cv) {
- padlist = CvPADLIST(cv);
- comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
+ AV *padlist = CvPADLIST(cv);
+ AV *comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
sv = *av_fetch(comppad, o->op_targ, FALSE);
} else
sv = Nullsv;
p |OP* |append_elem |I32 optype|OP* head|OP* tail
p |OP* |append_list |I32 optype|LISTOP* first|LISTOP* last
p |I32 |apply |I32 type|SV** mark|SV** sp
-ApM |void |apply_attrs_string|char *stashpv|CV *cv|char *attrstr|STRLEN len
+ApM |void |apply_attrs_string|const char *stashpv|CV *cv|const char *attrstr|STRLEN len
Apd |void |av_clear |AV* ar
Apd |SV* |av_delete |AV* ar|I32 key|I32 flags
Apd |bool |av_exists |AV* ar|I32 key
p |void |cv_ckproto |const CV* cv|const GV* gv|const char* p
pd |CV* |cv_clone |CV* proto
Apd |SV* |cv_const_sv |CV* cv
-p |SV* |op_const_sv |OP* o|CV* cv
+p |SV* |op_const_sv |const OP* o|CV* cv
Apd |void |cv_undef |CV* cv
Ap |void |cx_dump |PERL_CONTEXT* cs
Ap |SV* |filter_add |filter_t funcp|SV* datasv
Afp |void |deb |const char* pat|...
Ap |void |vdeb |const char* pat|va_list* args
Ap |void |debprofdump
-Ap |I32 |debop |OP* o
+Ap |I32 |debop |const OP* o
Ap |I32 |debstack
Ap |I32 |debstackptrs
Ap |char* |delimcpy |char* to|const char* toend|const char* from \
#endif
Ap |void |dump_form |const GV* gv
Ap |void |gv_dump |GV* gv
-Ap |void |op_dump |OP* arg
+Ap |void |op_dump |const OP* arg
Ap |void |pmop_dump |PMOP* pm
Ap |void |dump_packsubs |const HV* stash
Ap |void |dump_sub |const GV* gv
Ap |void |do_gv_dump |I32 level|PerlIO *file|const char *name|GV *sv
Ap |void |do_gvgv_dump |I32 level|PerlIO *file|const char *name|GV *sv
Ap |void |do_hv_dump |I32 level|PerlIO *file|const char *name|HV *sv
-Ap |void |do_magic_dump |I32 level|PerlIO *file|MAGIC *mg|I32 nest \
+Ap |void |do_magic_dump |I32 level|PerlIO *file|const MAGIC *mg|I32 nest \
|I32 maxnest|bool dumpops|STRLEN pvlim
-Ap |void |do_op_dump |I32 level|PerlIO *file|OP *o
-Ap |void |do_pmop_dump |I32 level|PerlIO *file|PMOP *pm
+Ap |void |do_op_dump |I32 level|PerlIO *file|const OP *o
+Ap |void |do_pmop_dump |I32 level|PerlIO *file|const PMOP *pm
Ap |void |do_sv_dump |I32 level|PerlIO *file|SV *sv|I32 nest \
|I32 maxnest|bool dumpops|STRLEN pvlim
-Ap |void |magic_dump |MAGIC *mg
+Ap |void |magic_dump |const MAGIC *mg
Ap |void |reginitcolors
Apd |char* |sv_2pv_nolen |SV* sv
Apd |char* |sv_2pvutf8_nolen|SV* sv
Ap |GP* |gp_dup |GP* gp|CLONE_PARAMS* param
Ap |MAGIC* |mg_dup |MAGIC* mg|CLONE_PARAMS* param
Ap |SV* |sv_dup |SV* sstr|CLONE_PARAMS* param
+Ap |void |rvpv_dup |SV* dstr|SV *sstr|CLONE_PARAMS* param
#if defined(HAVE_INTERP_INTERN)
Ap |void |sys_intern_dup |struct interp_intern* src \
|struct interp_intern* dst
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
-s |I32 |list_assignment|OP *o
-s |void |bad_type |I32 n|const char *t|const char *name|OP *kid
+s |I32 |list_assignment|const OP *o
+s |void |bad_type |I32 n|const char *t|const char *name|const OP *kid
s |void |cop_free |COP *cop
s |OP* |modkids |OP *o|I32 type
-s |void |no_bareword_allowed|OP *o
+s |void |no_bareword_allowed|const OP *o
s |OP* |no_fh_allowed |OP *o
s |OP* |scalarboolean |OP *o
s |OP* |too_few_arguments|OP *o|const char* name
s |OP* |newDEFSVOP
s |OP* |new_logop |I32 type|I32 flags|OP **firstp|OP **otherp
s |void |simplify_sort |OP *o
-s |bool |is_handle_constructor |OP *o|I32 argnum
+s |bool |is_handle_constructor |const OP *o|I32 argnum
s |char* |gv_ename |GV *gv
-s |bool |scalar_mod_type|OP *o|I32 type
+s |bool |scalar_mod_type|const OP *o|I32 type
s |OP * |my_kid |OP *o|OP *attrs|OP **imopsp
s |OP * |dup_attrlist |OP *o
s |void |apply_attrs |HV *stash|SV *target|OP *attrs|bool for_my
#define gp_dup Perl_gp_dup
#define mg_dup Perl_mg_dup
#define sv_dup Perl_sv_dup
+#define rvpv_dup Perl_rvpv_dup
#if defined(HAVE_INTERP_INTERN)
#define sys_intern_dup Perl_sys_intern_dup
#endif
#define gp_dup(a,b) Perl_gp_dup(aTHX_ a,b)
#define mg_dup(a,b) Perl_mg_dup(aTHX_ a,b)
#define sv_dup(a,b) Perl_sv_dup(aTHX_ a,b)
+#define rvpv_dup(a,b,c) Perl_rvpv_dup(aTHX_ a,b,c)
#if defined(HAVE_INTERP_INTERN)
#define sys_intern_dup(a,b) Perl_sys_intern_dup(aTHX_ a,b)
#endif
Perl_gp_dup
Perl_mg_dup
Perl_sv_dup
+Perl_rvpv_dup
Perl_sys_intern_dup
Perl_ptr_table_new
Perl_ptr_table_fetch
{
union pstun un;
s = SvPV(sv, len);
- un.pst_command = s;
+ un.pst_command = (char *)s;
pstat(PSTAT_SETCMD, un, len, 0, 0);
}
#endif
}
STATIC void
-S_bad_type(pTHX_ I32 n, const char *t, const char *name, OP *kid)
+S_bad_type(pTHX_ I32 n, const char *t, const char *name, const OP *kid)
{
yyerror(Perl_form(aTHX_ "Type of arg %d to %s must be %s (not %s)",
(int)n, name, t, OP_DESC(kid)));
}
STATIC void
-S_no_bareword_allowed(pTHX_ OP *o)
+S_no_bareword_allowed(pTHX_ const OP *o)
{
qerror(Perl_mess(aTHX_
"Bareword \"%"SVf"\" not allowed while \"strict subs\" in use",
void
Perl_op_free(pTHX_ OP *o)
{
- register OP *kid, *nextkid;
OPCODE type;
PADOFFSET refcnt;
}
if (o->op_flags & OPf_KIDS) {
+ register OP *kid, *nextkid;
for (kid = cUNOPo->op_first; kid; kid = nextkid) {
nextkid = kid->op_sibling; /* Get before next freeing kid */
op_free(kid);
OP *
Perl_linklist(pTHX_ OP *o)
{
- register OP *kid;
if (o->op_next)
return o->op_next;
/* establish postfix order */
if (cUNOPo->op_first) {
+ register OP *kid;
o->op_next = LINKLIST(cUNOPo->op_first);
for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling) {
if (kid->op_sibling)
{
if (o->op_type == OP_SASSIGN && cBINOPo->op_first->op_type == OP_CONST) {
if (ckWARN(WARN_SYNTAX)) {
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
OP *
Perl_listkids(pTHX_ OP *o)
{
- OP *kid;
if (o && o->op_flags & OPf_KIDS) {
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
list(kid);
}
OP *
Perl_scalarseq(pTHX_ OP *o)
{
- OP *kid;
-
if (o) {
if (o->op_type == OP_LINESEQ ||
o->op_type == OP_SCOPE ||
o->op_type == OP_LEAVE ||
o->op_type == OP_LEAVETRY)
{
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) {
if (kid->op_sibling) {
scalarvoid(kid);
STATIC OP *
S_modkids(pTHX_ OP *o, I32 type)
{
- OP *kid;
if (o && o->op_flags & OPf_KIDS) {
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
mod(kid, type);
}
}
STATIC bool
-S_scalar_mod_type(pTHX_ OP *o, I32 type)
+S_scalar_mod_type(pTHX_ const OP *o, I32 type)
{
switch (type) {
case OP_SASSIGN:
}
STATIC bool
-S_is_handle_constructor(pTHX_ OP *o, I32 argnum)
+S_is_handle_constructor(pTHX_ const OP *o, I32 argnum)
{
switch (o->op_type) {
case OP_PIPE_OP:
OP *
Perl_refkids(pTHX_ OP *o, I32 type)
{
- OP *kid;
if (o && o->op_flags & OPf_KIDS) {
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
ref(kid, type);
}
*/
void
-Perl_apply_attrs_string(pTHX_ char *stashpv, CV *cv,
- char *attrstr, STRLEN len)
+Perl_apply_attrs_string(pTHX_ const char *stashpv, CV *cv,
+ const char *attrstr, STRLEN len)
{
OP *attrs = Nullop;
while (len) {
for (; isSPACE(*attrstr) && len; --len, ++attrstr) ;
if (len) {
- char *sstr = attrstr;
+ const char *sstr = attrstr;
for (; !isSPACE(*attrstr) && len; --len, ++attrstr) ;
attrs = append_elem(OP_LIST, attrs,
newSVOP(OP_CONST, 0,
STATIC OP *
S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
{
- OP *kid;
I32 type;
if (!o || PL_error_count)
type = o->op_type;
if (type == OP_LIST) {
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
my_kid(kid, attrs, imopsp);
} else if (type == OP_UNDEF) {
OP*
Perl_block_end(pTHX_ I32 floor, OP *seq)
{
- int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
+ const int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
OP* retval = scalarseq(seq);
LEAVE_SCOPE(floor);
PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
STATIC OP *
S_newDEFSVOP(pTHX)
{
- I32 offset = pad_findmy("$_");
+ const I32 offset = pad_findmy("$_");
if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS(offset) & SVpad_OUR) {
return newSVREF(newGVOP(OP_GV, 0, PL_defgv));
}
Perl_gen_constant_list(pTHX_ register OP *o)
{
register OP *curop;
- I32 oldtmps_floor = PL_tmps_floor;
+ const I32 oldtmps_floor = PL_tmps_floor;
list(o);
if (PL_error_count)
void
Perl_package(pTHX_ OP *o)
{
- char *name;
+ const char *name;
STRLEN len;
save_hptr(&PL_curstash);
}
}
{
- line_t ocopline = PL_copline;
- COP *ocurcop = PL_curcop;
- int oexpect = PL_expect;
+ const line_t ocopline = PL_copline;
+ COP * const ocurcop = PL_curcop;
+ const int oexpect = PL_expect;
utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
veop, modname, imop);
}
STATIC I32
-S_list_assignment(pTHX_ register OP *o)
+S_list_assignment(pTHX_ register const OP *o)
{
if (!o)
return TRUE;
o = cUNOPo->op_first;
if (o->op_type == OP_COND_EXPR) {
- I32 t = list_assignment(cLOGOPo->op_first->op_sibling);
- I32 f = list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
+ const I32 t = list_assignment(cLOGOPo->op_first->op_sibling);
+ const I32 f = list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
if (t && f)
return TRUE;
}
else {
/* check for C<my $x if 0>, or C<my($x,$y) if 0> */
- OP *o2 = other;
+ const OP *o2 = other;
if ( ! (o2->op_type == OP_LIST
&& (( o2 = cUNOPx(o2)->op_first))
&& o2->op_type == OP_PUSHMARK
else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS) &&
type != OP_DOR) /* [#24076] Don't warn for <FH> err FOO. */
{
- OP *k1 = ((UNOP*)first)->op_first;
- OP *k2 = k1->op_sibling;
+ const OP *k1 = ((UNOP*)first)->op_first;
+ const OP *k2 = k1->op_sibling;
OPCODE warnop = 0;
switch (first->op_type)
{
break;
}
if (warnop) {
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Value of %s%s can be \"0\"; test with defined()",
*/
SV *
-Perl_op_const_sv(pTHX_ OP *o, CV *cv)
+Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
{
SV *sv = Nullsv;
Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
{
STRLEN n_a;
- char *name;
- char *aname;
+ const char *name;
+ const char *aname;
GV *gv;
char *ps;
register CV *cv=0;
const_sv = op_const_sv(block, Nullcv);
if (cv) {
- bool exists = CvROOT(cv) || CvXSUB(cv);
+ const bool exists = CvROOT(cv) || CvXSUB(cv);
#ifdef GV_UNIQUE_CHECK
if (exists && GvUNIQUE(gv)) {
|| (CvCONST(cv)
&& (!const_sv || sv_cmp(cv_const_sv(cv), const_sv))))
{
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
op_free(block);
block = Nullop;
if (name) {
- char *s = strrchr(name, ':');
+ const char *s = strrchr(name, ':');
s = s ? s+1 : name;
if (strEQ(s, "BEGIN")) {
const char not_safe[] =
}
if (name || aname) {
- char *s;
- char *tname = (name ? name : aname);
+ const char *s;
+ const char *tname = (name ? name : aname);
if (PERLDB_SUBLINE && PL_curstash != PL_debstash) {
SV *sv = NEWSV(0,0);
goto done;
if (strEQ(s, "BEGIN") && !PL_error_count) {
- I32 oldscope = PL_scopestack_ix;
+ const I32 oldscope = PL_scopestack_ix;
ENTER;
SAVECOPFILE(&PL_compiling);
SAVECOPLINE(&PL_compiling);
/* already defined (or promised) */
if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
&& strEQ(HvNAME(GvSTASH(CvGV(cv))), "autouse"))) {
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
GvMULTI_on(gv);
if ((cv = GvFORM(gv))) {
if (ckWARN(WARN_REDEFINE)) {
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
|| o->op_type == OP_BIT_AND
|| o->op_type == OP_BIT_XOR))
{
- OP * left = cBINOPo->op_first;
- OP * right = left->op_sibling;
+ const OP * left = cBINOPo->op_first;
+ const OP * right = left->op_sibling;
if ((OP_IS_NUMCOMPARE(left->op_type) &&
(left->op_flags & OPf_PARENS) == 0) ||
(OP_IS_NUMCOMPARE(right->op_type) &&
OP *
Perl_ck_concat(pTHX_ OP *o)
{
- OP *kid = cUNOPo->op_first;
+ const OP *kid = cUNOPo->op_first;
if (kid->op_type == OP_CONCAT && !(kid->op_private & OPpTARGET_MY) &&
!(kUNOP->op_first->op_flags & OPf_MOD))
o->op_flags |= OPf_STACKED;
if (o->op_flags & OPf_KIDS) {
OP* newop;
OP* kid;
- OPCODE type = o->op_type;
+ const OPCODE type = o->op_type;
o = modkids(ck_fun(o), type);
kid = cUNOPo->op_first;
newop = kUNOP->op_first->op_sibling;
OP *
Perl_ck_eof(pTHX_ OP *o)
{
- I32 type = o->op_type;
+ const I32 type = o->op_type;
if (o->op_flags & OPf_KIDS) {
if (cLISTOPo->op_first->op_type == OP_STUB) {
OP *
Perl_ck_exec(pTHX_ OP *o)
{
- OP *kid;
if (o->op_flags & OPf_STACKED) {
+ OP *kid;
o = ck_fun(o);
kid = cUNOPo->op_first->op_sibling;
if (kid->op_type == OP_RV2GV)
OP *
Perl_ck_ftst(pTHX_ OP *o)
{
- I32 type = o->op_type;
+ const I32 type = o->op_type;
if (o->op_flags & OPf_REF) {
/* nothing */
OP *
Perl_ck_fun(pTHX_ OP *o)
{
- register OP *kid;
- OP **tokid;
- OP *sibl;
- I32 numargs = 0;
- int type = o->op_type;
+ const int type = o->op_type;
register I32 oa = PL_opargs[type] >> OASHIFT;
if (o->op_flags & OPf_STACKED) {
}
if (o->op_flags & OPf_KIDS) {
- tokid = &cLISTOPo->op_first;
- kid = cLISTOPo->op_first;
+ OP **tokid = &cLISTOPo->op_first;
+ register OP *kid = cLISTOPo->op_first;
+ OP *sibl;
+ I32 numargs = 0;
+
if (kid->op_type == OP_PUSHMARK ||
(kid->op_type == OP_NULL && kid->op_targ == OP_PUSHMARK))
{
else if (op->op_type == OP_PADAV
|| op->op_type == OP_PADHV) {
/* lexicalvar $a[] or $h{} */
- char *padname =
+ const char *padname =
PAD_COMPNAME_PV(op->op_targ);
if (padname)
tmpstr =
{
LOGOP *gwop;
OP *kid;
- OPCODE type = o->op_type == OP_GREPSTART ? OP_GREPWHILE : OP_MAPWHILE;
+ const OPCODE type = o->op_type == OP_GREPSTART ? OP_GREPWHILE : OP_MAPWHILE;
I32 offset;
o->op_ppaddr = PL_ppaddr[OP_GREPSTART];
OP *
Perl_ck_lfun(pTHX_ OP *o)
{
- OPCODE type = o->op_type;
+ const OPCODE type = o->op_type;
return modkids(ck_fun(o), type);
}
OP *
Perl_ck_rfun(pTHX_ OP *o)
{
- OPCODE type = o->op_type;
+ const OPCODE type = o->op_type;
return refkids(ck_fun(o), type);
}
Perl_ck_match(pTHX_ OP *o)
{
if (o->op_type != OP_QR) {
- I32 offset = pad_findmy("$_");
+ const I32 offset = pad_findmy("$_");
if (offset != NOT_IN_PAD && !(PAD_COMPNAME_FLAGS(offset) & SVpad_OUR)) {
o->op_targ = offset;
o->op_private |= OPpTARGET_MY;
OP *
Perl_ck_return(pTHX_ OP *o)
{
- OP *kid;
if (CvLVALUE(PL_compcv)) {
+ OP *kid;
for (kid = cLISTOPo->op_first->op_sibling; kid; kid = kid->op_sibling)
mod(kid, OP_LEAVESUBLV);
}
OP *
Perl_ck_shift(pTHX_ OP *o)
{
- I32 type = o->op_type;
+ const I32 type = o->op_type;
if (!(o->op_flags & OPf_KIDS)) {
OP *argop;
Perl_ck_join(pTHX_ OP *o)
{
if (ckWARN(WARN_SYNTAX)) {
- OP *kid = cLISTOPo->op_first->op_sibling;
+ const OP *kid = cLISTOPo->op_first->op_sibling;
if (kid && kid->op_type == OP_MATCH) {
- const char *pmstr = "STRING";
- if (PM_GETRE(kPMOP))
- pmstr = PM_GETRE(kPMOP)->precomp;
+ const REGEXP *re = PM_GETRE(kPMOP);
+ const char *pmstr = re ? re->precomp : "STRING";
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"/%s/ should probably be written as \"%s\"",
pmstr, pmstr);
break;
case ']':
if (contextclass) {
- char *p = proto;
- char s = *p;
+ char *p = proto;
+ const char s = *p;
contextclass = 0;
*p = '\0';
while (*--p != '[');
* Despite being a "constant", the SV is written to,
* for reference counts, sv_upgrade() etc. */
if (cSVOP->op_sv) {
- PADOFFSET ix = pad_alloc(OP_CONST, SVs_PADTMP);
+ const PADOFFSET ix = pad_alloc(OP_CONST, SVs_PADTMP);
if (o->op_type == OP_CONST && SvPADTMP(cSVOPo->op_sv)) {
/* If op_sv is already a PADTMP then it is being used by
* some pad, so make a copy. */
o->op_next->op_sibling->op_type != OP_EXIT &&
o->op_next->op_sibling->op_type != OP_WARN &&
o->op_next->op_sibling->op_type != OP_DIE) {
- line_t oldline = CopLINE(PL_curcop);
+ const line_t oldline = CopLINE(PL_curcop);
CopLINE_set(PL_curcop, CopLINE((COP*)o->op_next));
Perl_warner(aTHX_ packWARN(WARN_EXEC),
int euid = PerlProc_geteuid();
int gid = PerlProc_getgid();
int egid = PerlProc_getegid();
+ (void)envp;
#ifdef VMS
uid |= gid << 16;
&& (argv[1][1] == 't' || argv[1][1] == 'T') )
return 1;
return 0;
- (void)envp;
}
STATIC void
PERL_CALLCONV OP* Perl_append_elem(pTHX_ I32 optype, OP* head, OP* tail);
PERL_CALLCONV OP* Perl_append_list(pTHX_ I32 optype, LISTOP* first, LISTOP* last);
PERL_CALLCONV I32 Perl_apply(pTHX_ I32 type, SV** mark, SV** sp);
-PERL_CALLCONV void Perl_apply_attrs_string(pTHX_ char *stashpv, CV *cv, char *attrstr, STRLEN len);
+PERL_CALLCONV void Perl_apply_attrs_string(pTHX_ const char *stashpv, CV *cv, const char *attrstr, STRLEN len);
PERL_CALLCONV void Perl_av_clear(pTHX_ AV* ar);
PERL_CALLCONV SV* Perl_av_delete(pTHX_ AV* ar, I32 key, I32 flags);
PERL_CALLCONV bool Perl_av_exists(pTHX_ AV* ar, I32 key);
PERL_CALLCONV void Perl_cv_ckproto(pTHX_ const CV* cv, const GV* gv, const char* p);
PERL_CALLCONV CV* Perl_cv_clone(pTHX_ CV* proto);
PERL_CALLCONV SV* Perl_cv_const_sv(pTHX_ CV* cv);
-PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ OP* o, CV* cv);
+PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ const OP* o, CV* cv);
PERL_CALLCONV void Perl_cv_undef(pTHX_ CV* cv);
PERL_CALLCONV void Perl_cx_dump(pTHX_ PERL_CONTEXT* cs);
PERL_CALLCONV SV* Perl_filter_add(pTHX_ filter_t funcp, SV* datasv);
__attribute__format__(__printf__,pTHX_1,pTHX_2);
PERL_CALLCONV void Perl_vdeb(pTHX_ const char* pat, va_list* args);
PERL_CALLCONV void Perl_debprofdump(pTHX);
-PERL_CALLCONV I32 Perl_debop(pTHX_ OP* o);
+PERL_CALLCONV I32 Perl_debop(pTHX_ const OP* o);
PERL_CALLCONV I32 Perl_debstack(pTHX);
PERL_CALLCONV I32 Perl_debstackptrs(pTHX);
PERL_CALLCONV char* Perl_delimcpy(pTHX_ char* to, const char* toend, const char* from, const char* fromend, int delim, I32* retlen);
#endif
PERL_CALLCONV void Perl_dump_form(pTHX_ const GV* gv);
PERL_CALLCONV void Perl_gv_dump(pTHX_ GV* gv);
-PERL_CALLCONV void Perl_op_dump(pTHX_ OP* arg);
+PERL_CALLCONV void Perl_op_dump(pTHX_ const OP* arg);
PERL_CALLCONV void Perl_pmop_dump(pTHX_ PMOP* pm);
PERL_CALLCONV void Perl_dump_packsubs(pTHX_ const HV* stash);
PERL_CALLCONV void Perl_dump_sub(pTHX_ const GV* gv);
PERL_CALLCONV void Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv);
PERL_CALLCONV void Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv);
PERL_CALLCONV void Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, const char *name, HV *sv);
-PERL_CALLCONV void Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
-PERL_CALLCONV void Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o);
-PERL_CALLCONV void Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, PMOP *pm);
+PERL_CALLCONV void Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
+PERL_CALLCONV void Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o);
+PERL_CALLCONV void Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, const PMOP *pm);
PERL_CALLCONV void Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
-PERL_CALLCONV void Perl_magic_dump(pTHX_ MAGIC *mg);
+PERL_CALLCONV void Perl_magic_dump(pTHX_ const MAGIC *mg);
PERL_CALLCONV void Perl_reginitcolors(pTHX);
PERL_CALLCONV char* Perl_sv_2pv_nolen(pTHX_ SV* sv);
PERL_CALLCONV char* Perl_sv_2pvutf8_nolen(pTHX_ SV* sv);
PERL_CALLCONV GP* Perl_gp_dup(pTHX_ GP* gp, CLONE_PARAMS* param);
PERL_CALLCONV MAGIC* Perl_mg_dup(pTHX_ MAGIC* mg, CLONE_PARAMS* param);
PERL_CALLCONV SV* Perl_sv_dup(pTHX_ SV* sstr, CLONE_PARAMS* param);
+PERL_CALLCONV void Perl_rvpv_dup(pTHX_ SV* dstr, SV *sstr, CLONE_PARAMS* param);
#if defined(HAVE_INTERP_INTERN)
PERL_CALLCONV void Perl_sys_intern_dup(pTHX_ struct interp_intern* src, struct interp_intern* dst);
#endif
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
-STATIC I32 S_list_assignment(pTHX_ OP *o);
-STATIC void S_bad_type(pTHX_ I32 n, const char *t, const char *name, OP *kid);
+STATIC I32 S_list_assignment(pTHX_ const OP *o);
+STATIC void S_bad_type(pTHX_ I32 n, const char *t, const char *name, const OP *kid);
STATIC void S_cop_free(pTHX_ COP *cop);
STATIC OP* S_modkids(pTHX_ OP *o, I32 type);
-STATIC void S_no_bareword_allowed(pTHX_ OP *o);
+STATIC void S_no_bareword_allowed(pTHX_ const OP *o);
STATIC OP* S_no_fh_allowed(pTHX_ OP *o);
STATIC OP* S_scalarboolean(pTHX_ OP *o);
STATIC OP* S_too_few_arguments(pTHX_ OP *o, const char* name);
STATIC OP* S_newDEFSVOP(pTHX);
STATIC OP* S_new_logop(pTHX_ I32 type, I32 flags, OP **firstp, OP **otherp);
STATIC void S_simplify_sort(pTHX_ OP *o);
-STATIC bool S_is_handle_constructor(pTHX_ OP *o, I32 argnum);
+STATIC bool S_is_handle_constructor(pTHX_ const OP *o, I32 argnum);
STATIC char* S_gv_ename(pTHX_ GV *gv);
-STATIC bool S_scalar_mod_type(pTHX_ OP *o, I32 type);
+STATIC bool S_scalar_mod_type(pTHX_ const OP *o, I32 type);
STATIC OP * S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp);
STATIC OP * S_dup_attrlist(pTHX_ OP *o);
STATIC void S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my);
screamer2:
if (rslen) {
- register STDCHAR *bpe = buf + sizeof(buf);
+ const register STDCHAR *bpe = buf + sizeof(buf);
bp = buf;
while ((i = PerlIO_getc(fp)) != EOF && (*bp++ = (STDCHAR)i) != rslast && bp < bpe)
; /* keep reading */
{
dXSARGS;
SV *sv;
- char *name;
+ const char *name;
STRLEN n_a;
+ (void)cv;
if (items != 2)
Perl_croak(aTHX_ "Usage: UNIVERSAL::isa(reference, kind)");
|| (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv))))
XSRETURN_UNDEF;
- name = (char *)SvPV(ST(1),n_a);
+ name = (const char *)SvPV(ST(1),n_a);
ST(0) = boolSV(sv_derived_from(sv, name));
XSRETURN(1);
{
dXSARGS;
SV *sv;
- char *name;
+ const char *name;
SV *rv;
HV *pkg = NULL;
STRLEN n_a;
+ (void)cv;
if (items != 2)
Perl_croak(aTHX_ "Usage: UNIVERSAL::can(object-ref, method)");
|| (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv))))
XSRETURN_UNDEF;
- name = (char *)SvPV(ST(1),n_a);
+ name = (const char *)SvPV(ST(1),n_a);
rv = &PL_sv_undef;
if (SvROK(sv)) {
GV *gv;
SV *sv;
const char *undef;
+ (void)cv;
if (SvROK(ST(0))) {
sv = (SV*)SvRV(ST(0));
XS(XS_version_new)
{
dXSARGS;
+ (void)cv;
if (items > 3)
Perl_croak(aTHX_ "Usage: version::new(class, version)");
SP -= items;
XS(XS_version_stringify)
{
dXSARGS;
+ (void)cv;
if (items < 1)
Perl_croak(aTHX_ "Usage: version::stringify(lobj, ...)");
SP -= items;
XS(XS_version_numify)
{
dXSARGS;
+ (void)cv;
if (items < 1)
Perl_croak(aTHX_ "Usage: version::numify(lobj, ...)");
SP -= items;
XS(XS_version_vcmp)
{
dXSARGS;
+ (void)cv;
if (items < 1)
Perl_croak(aTHX_ "Usage: version::vcmp(lobj, ...)");
SP -= items;
XS(XS_version_boolean)
{
dXSARGS;
+ (void)cv;
if (items < 1)
Perl_croak(aTHX_ "Usage: version::boolean(lobj, ...)");
SP -= items;
SV * lobj;
if (sv_derived_from(ST(0), "version")) {
+ /* XXX If tmp serves a purpose, explain it. */
SV *tmp = SvRV(ST(0));
lobj = tmp;
}
XS(XS_version_noop)
{
dXSARGS;
+ (void)cv;
if (items < 1)
Perl_croak(aTHX_ "Usage: version::noop(lobj, ...)");
{
XS(XS_version_is_alpha)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: version::is_alpha(lobj)");
SP -= items;
SV *lobj;
if (sv_derived_from(ST(0), "version")) {
+ /* XXX If tmp serves a purpose, explain it. */
SV *tmp = SvRV(ST(0));
lobj = tmp;
}
else
Perl_croak(aTHX_ "lobj is not of type version");
{
- I32 len = av_len((AV *)lobj);
- I32 digit = SvIVX(*av_fetch((AV *)lobj, len, 0));
+ const I32 len = av_len((AV *)lobj);
+ const I32 digit = SvIVX(*av_fetch((AV *)lobj, len, 0));
if ( digit < 0 )
XSRETURN_YES;
else
XS(XS_version_qv)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: version::qv(ver)");
SP -= items;
XS(XS_utf8_is_utf8)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: utf8::is_utf8(sv)");
{
- SV * sv = ST(0);
+ const SV *sv = ST(0);
{
if (SvUTF8(sv))
XSRETURN_YES;
XS(XS_utf8_valid)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: utf8::valid(sv)");
{
SV * sv = ST(0);
{
STRLEN len;
- char *s = SvPV(sv,len);
- if (!SvUTF8(sv) || is_utf8_string((U8*)s,len))
+ const char *s = SvPV(sv,len);
+ if (!SvUTF8(sv) || is_utf8_string((const U8*)s,len))
XSRETURN_YES;
else
XSRETURN_NO;
XS(XS_utf8_encode)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: utf8::encode(sv)");
{
XS(XS_utf8_decode)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: utf8::decode(sv)");
{
SV * sv = ST(0);
- bool RETVAL;
-
- RETVAL = sv_utf8_decode(sv);
+ const bool RETVAL = sv_utf8_decode(sv);
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
XS(XS_utf8_upgrade)
{
dXSARGS;
+ (void)cv;
if (items != 1)
Perl_croak(aTHX_ "Usage: utf8::upgrade(sv)");
{
XS(XS_utf8_downgrade)
{
dXSARGS;
+ (void)cv;
if (items < 1 || items > 2)
Perl_croak(aTHX_ "Usage: utf8::downgrade(sv, failok=0)");
{
SV * sv = ST(0);
- bool failok;
- bool RETVAL;
-
- if (items < 2)
- failok = 0;
- else {
- failok = (int)SvIV(ST(1));
- }
+ const bool failok = (items < 2) ? 0 : (int)SvIV(ST(1));
+ const bool RETVAL = sv_utf8_downgrade(sv, failok);
- RETVAL = sv_utf8_downgrade(sv, failok);
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
XS(XS_utf8_native_to_unicode)
{
dXSARGS;
- UV uv = SvUV(ST(0));
+ const UV uv = SvUV(ST(0));
+ (void)cv;
if (items > 1)
Perl_croak(aTHX_ "Usage: utf8::native_to_unicode(sv)");
XS(XS_utf8_unicode_to_native)
{
dXSARGS;
- UV uv = SvUV(ST(0));
+ const UV uv = SvUV(ST(0));
+ (void)cv;
if (items > 1)
Perl_croak(aTHX_ "Usage: utf8::unicode_to_native(sv)");
{
dXSARGS;
SV *sv = SvRV(ST(0));
+ (void)cv;
+
if (items == 1) {
if (SvREADONLY(sv))
XSRETURN_YES;
{
dXSARGS;
SV *sv = SvRV(ST(0));
+ (void)cv;
+
if (items == 1)
XSRETURN_IV(SvREFCNT(sv) - 1); /* Minus the ref created for us. */
else if (items == 2) {
{
dXSARGS;
HV *hv = (HV *) SvRV(ST(0));
+ (void)cv;
+
if (items != 1)
Perl_croak(aTHX_ "Usage: UNIVERSAL::hv_clear_placeholders(hv)");
hv_clear_placeholders(hv);
XS(XS_Regexp_DESTROY)
{
-
+ (void)cv;
}
XS(XS_PerlIO_get_layers)
{
dXSARGS;
+ (void)cv;
if (items < 1 || items % 2 == 0)
Perl_croak(aTHX_ "Usage: PerlIO_get_layers(filehandle[,args])");
#ifdef USE_PERLIO
SV **varp = svp;
SV **valp = svp + 1;
STRLEN klen;
- char *key = SvPV(*varp, klen);
+ const char *key = SvPV(*varp, klen);
switch (*key) {
case 'i':
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
dMARK; dAX;
+ (void)cv;
XSRETURN_UV(PERL_HASH_SEED);
}
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
dMARK; dAX;
+ (void)cv;
XSRETURN_UV(PL_rehash_seed);
}
XS(XS_Internals_HvREHASH) /* Subject to change */
{
dXSARGS;
+ (void)cv;
if (SvROK(ST(0))) {
- HV *hv = (HV *) SvRV(ST(0));
+ const HV *hv = (HV *) SvRV(ST(0));
if (items == 1 && SvTYPE(hv) == SVt_PVHV) {
if (HvREHASH(hv))
XSRETURN_YES;
{
dXSARGS;
const char file[] = __FILE__;
+ (void)cv;
if( items > 1 )
Perl_croak(aTHX_ "Usage: attributes::bootstrap $module");
{
dXSARGS;
SV *rv, *sv;
+ (void)cv;
if (items < 1) {
usage:
dXSARGS;
SV *rv, *sv;
cv_flags_t cvflags;
+ (void)cv;
if (items != 1) {
usage:
dXSARGS;
SV *rv, *sv;
dXSTARG;
+ (void)cv;
if (items != 1) {
usage:
sv_setsv(TARG, &PL_sv_no); /* unblessed lexical */
#endif
else {
- HV *stash = Nullhv;
+ const HV *stash = Nullhv;
switch (SvTYPE(sv)) {
case SVt_PVCV:
if (CvGV(sv) && isGV(CvGV(sv)) && GvSTASH(CvGV(sv)))
dXSARGS;
SV *rv, *sv;
dXSTARG;
+ (void)cv;
if (items != 1) {
usage:
XS(XS_attributes__warn_reserved)
{
dXSARGS;
+ (void)cv;
if (items != 0) {
Perl_croak(aTHX_