s |OP* |doparseform |SV *sv
sn |bool |num_overflow |NV value|I32 fldsize|I32 frcsize
s |I32 |dopoptoeval |I32 startingblock
-s |I32 |dopoptolabel |char *label
+s |I32 |dopoptolabel |const char *label
s |I32 |dopoptoloop |I32 startingblock
s |I32 |dopoptosub |I32 startingblock
s |I32 |dopoptosub_at |PERL_CONTEXT* cxstk|I32 startingblock
s |void |save_lines |AV *array|SV *sv
s |OP* |doeval |int gimme|OP** startop|CV* outside|U32 seq
s |PerlIO *|doopen_pm |const char *name|const char *mode
-s |bool |path_is_absolute|char *name
+s |bool |path_is_absolute|const char *name
#endif
#if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
Es |U8* |reghop3 |U8 *pos|I32 off|U8 *lim
Es |U8* |reghopmaybe |U8 *pos|I32 off
Es |U8* |reghopmaybe3 |U8 *pos|I32 off|U8 *lim
-Es |char* |find_byclass |regexp * prog|regnode *c|char *s|char *strend|char *startpos|I32 norun
+Es |char* |find_byclass |regexp * prog|regnode *c|char *s|char *strend|I32 norun
Es |void |to_utf8_substr |regexp * prog
Es |void |to_byte_substr |regexp * prog
#endif
#define reghopmaybe3(a,b,c) S_reghopmaybe3(aTHX_ a,b,c)
#endif
#if defined(PERL_CORE) || defined(PERL_EXT)
-#define find_byclass(a,b,c,d,e,f) S_find_byclass(aTHX_ a,b,c,d,e,f)
+#define find_byclass(a,b,c,d,e) S_find_byclass(aTHX_ a,b,c,d,e)
#endif
#if defined(PERL_CORE) || defined(PERL_EXT)
#define to_utf8_substr(a) S_to_utf8_substr(aTHX_ a)
/* The following permits -d:Mod to accepts arguments following an =
in the fashion that -MSome::Mod does. */
if (*s == ':' || *s == '=') {
- char *start;
+ const char *start;
SV *sv;
sv = newSVpv("use Devel::", 0);
start = ++s;
(void)f;
(void)buf;
Perl_croak(aTHX_ "Don't know how to get file name");
+ return Nullch;
#endif
}
};
STATIC I32
-S_dopoptolabel(pTHX_ char *label)
+S_dopoptolabel(pTHX_ const char *label)
{
register I32 i;
- register PERL_CONTEXT *cx;
for (i = cxstack_ix; i >= 0; i--) {
- cx = &cxstack[i];
+ register const PERL_CONTEXT *cx = &cxstack[i];
switch (CxTYPE(cx)) {
case CXt_SUBST:
case CXt_SUB:
I32
Perl_block_gimme(pTHX)
{
- I32 cxix;
-
- cxix = dopoptosub(cxstack_ix);
+ const I32 cxix = dopoptosub(cxstack_ix);
if (cxix < 0)
return G_VOID;
I32
Perl_is_lvalue_sub(pTHX)
{
- I32 cxix;
-
- cxix = dopoptosub(cxstack_ix);
+ const I32 cxix = dopoptosub(cxstack_ix);
assert(cxix >= 0); /* We should only be called from inside subs */
if (cxstack[cxix].blk_sub.lval && CvLVALUE(cxstack[cxix].blk_sub.cv))
S_dopoptosub_at(pTHX_ PERL_CONTEXT *cxstk, I32 startingblock)
{
I32 i;
- register PERL_CONTEXT *cx;
for (i = startingblock; i >= 0; i--) {
- cx = &cxstk[i];
+ register const PERL_CONTEXT *cx = &cxstk[i];
switch (CxTYPE(cx)) {
default:
continue;
S_dopoptoeval(pTHX_ I32 startingblock)
{
I32 i;
- register PERL_CONTEXT *cx;
for (i = startingblock; i >= 0; i--) {
- cx = &cxstack[i];
+ register const PERL_CONTEXT *cx = &cxstack[i];
switch (CxTYPE(cx)) {
default:
continue;
S_dopoptoloop(pTHX_ I32 startingblock)
{
I32 i;
- register PERL_CONTEXT *cx;
for (i = startingblock; i >= 0; i--) {
- cx = &cxstack[i];
+ register const PERL_CONTEXT *cx = &cxstack[i];
switch (CxTYPE(cx)) {
case CXt_SUBST:
case CXt_SUB:
void
Perl_dounwind(pTHX_ I32 cxix)
{
- register PERL_CONTEXT *cx;
I32 optype;
while (cxstack_ix > cxix) {
SV *sv;
- cx = &cxstack[cxstack_ix];
+ register PERL_CONTEXT *cx = &cxstack[cxstack_ix];
DEBUG_l(PerlIO_printf(Perl_debug_log, "Unwinding block %ld, type %s\n",
(long) cxstack_ix, PL_block_type[CxTYPE(cx)]));
/* Note: we don't need to restore the base context info till the end. */
if (PL_in_eval & EVAL_KEEPERR) {
static const char prefix[] = "\t(in cleanup) ";
SV *err = ERRSV;
- char *e = Nullch;
+ const char *e = Nullch;
if (!SvPOK(err))
sv_setpv(err,"");
else if (SvCUR(err) >= sizeof(prefix)+msglen-1) {
PERL_SI *top_si = PL_curstackinfo;
I32 dbcxix;
I32 gimme;
- char *stashname;
+ const char *stashname;
SV *sv;
I32 count = 0;
&& CopSTASH_eq(PL_curcop, PL_debstash))
{
AV *ary = cx->blk_sub.argarray;
- int off = AvARRAY(ary) - AvALLOC(ary);
+ const int off = AvARRAY(ary) - AvALLOC(ary);
if (!PL_dbargs) {
GV* tmpgv;
STATIC void
S_save_lines(pTHX_ AV *array, SV *sv)
{
- register char *s = SvPVX(sv);
- register char *send = SvPVX(sv) + SvCUR(sv);
- register char *t;
+ register const char *s = SvPVX(sv);
+ register const char *send = SvPVX(sv) + SvCUR(sv);
+ register const char *t;
register I32 line = 1;
while (s && s < send) {
S_docatch(pTHX_ OP *o)
{
int ret;
- OP *oldop = PL_op;
+ OP * const oldop = PL_op;
OP *retop;
volatile PERL_SI *cursi = PL_curstackinfo;
dJMPENV;
CV*
Perl_find_runcv(pTHX_ U32 *db_seqp)
{
- I32 ix;
PERL_SI *si;
- PERL_CONTEXT *cx;
if (db_seqp)
*db_seqp = PL_curcop->cop_seq;
for (si = PL_curstackinfo; si; si = si->si_prev) {
+ I32 ix;
for (ix = si->si_cxix; ix >= 0; ix--) {
- cx = &(si->si_cxstack[ix]);
+ const PERL_CONTEXT *cx = &(si->si_cxstack[ix]);
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
CV *cv = cx->blk_sub.cv;
/* skip DB:: code */
lex_end();
LEAVE;
if (optype == OP_REQUIRE) {
- char* msg = SvPVx(ERRSV, n_a);
+ const char* msg = SvPVx(ERRSV, n_a);
SV *nsv = cx->blk_eval.old_namesv;
(void)hv_store(GvHVn(PL_incgv), SvPVX(nsv), SvCUR(nsv),
&PL_sv_undef, 0);
*msg ? msg : "Unknown error\n");
}
else if (startop) {
- char* msg = SvPVx(ERRSV, n_a);
+ const char* msg = SvPVx(ERRSV, n_a);
POPBLOCK(cx,PL_curpm);
POPEVAL(cx);
(*msg ? msg : "Unknown error\n"));
}
else {
- char* msg = SvPVx(ERRSV, n_a);
+ const char* msg = SvPVx(ERRSV, n_a);
if (!*msg) {
sv_setpv(ERRSV, "Compilation error");
}
if (namelen > 3 && strEQ(name + namelen - 3, ".pm")) {
SV *pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c');
- char *pmc = SvPV_nolen(pmcsv);
+ const char * const pmc = SvPV_nolen(pmcsv);
Stat_t pmstat;
Stat_t pmcstat;
if (PerlLIO_stat(pmc, &pmcstat) < 0) {
I32 gimme;
register PERL_CONTEXT *cx;
OP *retop;
- U8 save_flags = PL_op -> op_flags;
+ const U8 save_flags = PL_op -> op_flags;
I32 optype;
POPBLOCK(cx,newpm);
while (*s == '#')
s++;
if (*s == '.') {
- char *f;
- s++;
- f = s;
+ const char * const f = ++s;
while (*s == '#')
s++;
arg |= 256 + (s - f);
while (*s == '#')
s++;
if (*s == '.') {
- char *f;
- s++;
- f = s;
+ const char * const f = ++s;
while (*s == '#')
s++;
arg |= 256 + (s - f);
/* perhaps someone can come up with a better name for
this? it is not really "absolute", per se ... */
static bool
-S_path_is_absolute(pTHX_ char *name)
+S_path_is_absolute(pTHX_ const char *name)
{
if (PERL_FILE_IS_ABSOLUTE(name)
#ifdef MACOS_TRADITIONAL
STATIC OP* S_doparseform(pTHX_ SV *sv);
STATIC bool S_num_overflow(NV value, I32 fldsize, I32 frcsize);
STATIC I32 S_dopoptoeval(pTHX_ I32 startingblock);
-STATIC I32 S_dopoptolabel(pTHX_ char *label);
+STATIC I32 S_dopoptolabel(pTHX_ const char *label);
STATIC I32 S_dopoptoloop(pTHX_ I32 startingblock);
STATIC I32 S_dopoptosub(pTHX_ I32 startingblock);
STATIC I32 S_dopoptosub_at(pTHX_ PERL_CONTEXT* cxstk, I32 startingblock);
STATIC void S_save_lines(pTHX_ AV *array, SV *sv);
STATIC OP* S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq);
STATIC PerlIO * S_doopen_pm(pTHX_ const char *name, const char *mode);
-STATIC bool S_path_is_absolute(pTHX_ char *name);
+STATIC bool S_path_is_absolute(pTHX_ const char *name);
#endif
#if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
STATIC U8* S_reghop3(pTHX_ U8 *pos, I32 off, U8 *lim);
STATIC U8* S_reghopmaybe(pTHX_ U8 *pos, I32 off);
STATIC U8* S_reghopmaybe3(pTHX_ U8 *pos, I32 off, U8 *lim);
-STATIC char* S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *startpos, I32 norun);
+STATIC char* S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, I32 norun);
STATIC void S_to_utf8_substr(pTHX_ regexp * prog);
STATIC void S_to_byte_substr(pTHX_ regexp * prog);
#endif
}
} else {
while (i < 6)
- PL_colors[i++] = "";
+ PL_colors[i++] = (char *)"";
}
PL_colorset = 1;
}
regstclass does not come from lookahead... */
/* If regstclass takes bytelength more than 1: If charlength==1, OK.
This leaves EXACTF only, which is dealt with in find_byclass(). */
- U8* str = (U8*)STRING(prog->regstclass);
- int cl_l = (PL_regkind[(U8)OP(prog->regstclass)] == EXACT
+ const U8* str = (U8*)STRING(prog->regstclass);
+ const int cl_l = (PL_regkind[(U8)OP(prog->regstclass)] == EXACT
? CHR_DIST(str+STR_LEN(prog->regstclass), str)
: 1);
char *endpos = (prog->anchored_substr || prog->anchored_utf8 || ml_anch)
? HOP3c(HOP3c(check_at, -start_shift, strbeg),
cl_l, strend)
: strend);
- char *startpos = strbeg;
t = s;
cache_re(prog);
- s = find_byclass(prog, prog->regstclass, s, endpos, startpos, 1);
+ s = find_byclass(prog, prog->regstclass, s, endpos, 1);
if (!s) {
#ifdef DEBUGGING
const char *what = 0;
/* We know what class REx starts with. Try to find this position... */
STATIC char *
-S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *startpos, I32 norun)
+S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, I32 norun)
{
I32 doevery = (prog->reganch & ROPT_SKIP) == 0;
char *m;
len0, len0, s0,
len1, len1, s1);
});
- if (find_byclass(prog, c, s, strend, startpos, 0))
+ if (find_byclass(prog, c, s, strend, 0))
goto got_it;
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Contradicts stclass...\n"));
}
}
else {
STRLEN len;
- char *little = SvPV(float_real, len);
+ const char * const little = SvPV(float_real, len);
if (SvTAIL(float_real)) {
if (memEQ(strend - len + 1, little, len - 1))
static void
restore_pos(pTHX_ void *arg)
{
+ (void)arg; /* unused */
if (PL_reg_eval_set) {
if (PL_reg_oldsaved) {
PL_reg_re->subbeg = PL_reg_oldsaved;
void S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8);
-char *
+STATIC char *
S_vdie_croak_common(pTHX_ const char* pat, va_list* args, STRLEN* msglen,
I32* utf8)
{