#ifdef DEBUGGING
-static char * si_names[] = {
+static const char * si_names[] = {
"UNKNOWN",
"UNDEF",
"MAIN",
* (with the PERL_MAGIC_ prefixed stripped)
*/
-static struct { char type; char *name; } magic_names[] = {
+static struct { const char type; const char *name; } magic_names[] = {
{ PERL_MAGIC_sv, "sv(\\0)" },
{ PERL_MAGIC_arylen, "arylen(#)" },
{ PERL_MAGIC_glob, "glob(*)" },
Perl_dump_indent(aTHX_ level, file,
" MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
if (mg->mg_virtual) {
- MGVTBL *v = mg->mg_virtual;
- char *s = 0;
+ const MGVTBL * const v = mg->mg_virtual;
+ const char *s = 0;
if (v == &PL_vtbl_sv) s = "sv";
else if (v == &PL_vtbl_env) s = "env";
else if (v == &PL_vtbl_envelem) s = "envelem";
Ap |I32 |debstackptrs
Ap |char* |delimcpy |char* to|char* toend|char* from \
|char* fromend|int delim|I32* retlen
-p |void |deprecate |char* s
-p |void |deprecate_old |char* s
+p |void |deprecate |const char* s
+p |void |deprecate_old |const char* s
Afp |OP* |die |const char* pat|...
p |OP* |vdie |const char* pat|va_list* args
p |OP* |die_where |const char* message|STRLEN msglen
Ap |OP* |newSLICEOP |I32 flags|OP* subscript|OP* listop
Ap |OP* |newSTATEOP |I32 flags|char* label|OP* o
Ap |CV* |newSUB |I32 floor|OP* o|OP* proto|OP* block
-Apd |CV* |newXS |char* name|XSUBADDR_t f|char* filename
+Apd |CV* |newXS |const char* name|XSUBADDR_t f|const char* filename
Apd |AV* |newAV
Ap |OP* |newAVREF |OP* o
Ap |OP* |newBINOP |I32 type|I32 flags|OP* first|OP* last
|I32 whileline|OP* expr|OP* block|OP* cont
Ap |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems
-Ap |char* |scan_vstring |char *vstr|SV *sv
+Ap |char* |scan_vstring |const char *vstr|SV *sv
Apd |char* |scan_version |char *vstr|SV *sv|bool qv
Apd |SV* |new_version |SV *ver
Apd |SV* |upg_version |SV *ver
p |OP* |scalarvoid |OP* o
Apd |NV |scan_bin |char* start|STRLEN len|STRLEN* retlen
Apd |NV |scan_hex |char* start|STRLEN len|STRLEN* retlen
-Ap |char* |scan_num |char* s|YYSTYPE *lvalp
+Ap |char* |scan_num |const char* s|YYSTYPE *lvalp
Apd |NV |scan_oct |char* start|STRLEN len|STRLEN* retlen
p |OP* |scope |OP* o
Ap |char* |screaminstr |SV* bigsv|SV* littlesv|I32 start_shift \
#if defined(USE_LOCALE_COLLATE)
Apd |char* |sv_collxfrm |SV* sv|STRLEN* nxp
#endif
-Ap |OP* |sv_compile_2op |SV* sv|OP** startp|char* code|PAD** padp
+Ap |OP* |sv_compile_2op |SV* sv|OP** startp|const char* code|PAD** padp
Apd |int |getcwd_sv |SV* sv
Apd |void |sv_dec |SV* sv
Ap |void |sv_dump |SV* sv
Apd |char* |sv_recode_to_utf8 |SV* sv|SV *encoding
Apd |bool |sv_cat_decode |SV* dsv|SV *encoding|SV *ssv|int *offset \
|char* tstr|int tlen
-Apd |char* |sv_reftype |SV* sv|int ob
+Apd |const char*|sv_reftype |const SV* sv|int ob
Apd |void |sv_replace |SV* sv|SV* nsv
Apd |void |sv_report_used
Apd |void |sv_reset |char* s|HV* stash
p |void |watch |char** addr
Ap |I32 |whichsig |const char* sig
p |void |write_to_stderr|const char* message|int msglen
-p |int |yyerror |char* s
+p |int |yyerror |const char* s
p |int |yylex
p |int |yyparse
-p |int |yywarn |char* s
+p |int |yywarn |const char* s
#if defined(MYMALLOC)
Ap |void |dump_mstats |char* s
Ap |int |get_mstats |perl_mstats_t *buf|int buflen|int level
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
s |I32 |list_assignment|OP *o
-s |void |bad_type |I32 n|char *t|char *name|OP *kid
+s |void |bad_type |I32 n|const char *t|const char *name|OP *kid
s |void |cop_free |COP *cop
s |OP* |modkids |OP *o|I32 type
s |void |no_bareword_allowed|OP *o
s |OP* |no_fh_allowed |OP *o
s |OP* |scalarboolean |OP *o
-s |OP* |too_few_arguments|OP *o|char* name
-s |OP* |too_many_arguments|OP *o|char* name
+s |OP* |too_few_arguments|OP *o|const char* name
+s |OP* |too_many_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
#if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
s |OP* |docatch |OP *o
s |void* |docatch_body
-s |OP* |dofindlabel |OP *o|char *label|OP **opstack|OP **oplimit
+s |OP* |dofindlabel |OP *o|const char *label|OP **opstack|OP **oplimit
s |OP* |doparseform |SV *sv
sn |bool |num_overflow |NV value|I32 fldsize|I32 frcsize
s |I32 |dopoptoeval |I32 startingblock
Es |I32 |study_chunk |struct RExC_state_t*|regnode **scanp|I32 *deltap \
|regnode *last|struct scan_data_t *data \
|U32 flags|U32 depth
-Es |I32 |add_data |struct RExC_state_t*|I32 n|char *s
+Es |I32 |add_data |struct RExC_state_t*|I32 n|const char *s
rs |void|re_croak2 |const char* pat1|const char* pat2|...
Es |I32 |regpposixcc |struct RExC_state_t*|I32 value
Es |void |checkposixcc |struct RExC_state_t*
|int allow_package|STRLEN *slp
s |char* |skipspace |char *s
s |char* |swallow_bom |U8 *s
-s |void |checkcomma |char *s|char *name|char *what
-s |void |force_ident |char *s|int kind
+s |void |checkcomma |char *s|char *name|const char *what
+s |void |force_ident |const char *s|int kind
s |void |incline |char *s
s |int |intuit_method |char *s|GV *gv
s |int |intuit_more |char *s
s |I32 |lop |I32 f|int x|char *s
s |void |missingterm |char *s
-s |void |no_op |char *what|char *s
+s |void |no_op |const char *what|char *s
s |void |set_csh
s |I32 |sublex_done
s |I32 |sublex_push
s |SV* |new_constant |const char *s|STRLEN len|const char *key|SV *sv \
|SV *pv|const char *type
# if defined(DEBUGGING)
-s |int |tokereport |char *s|I32 rv
+s |int |tokereport |const char *s|I32 rv
# endif
s |int |ao |int toketype
s |void |depcom
-s |char* |incl_perldb
+s |const char*|incl_perldb
#if 0
s |I32 |utf16_textfilter|int idx|SV *sv|int maxlen
s |I32 |utf16rev_textfilter|int idx|SV *sv|int maxlen
(v = (MEM_WRAP_CHECK(n,t), (c*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))))
#define Safefree(d) safefree((Malloc_t)(d))
-#define Move(s,d,n,t) (MEM_WRAP_CHECK(n,t), (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t)))
-#define Copy(s,d,n,t) (MEM_WRAP_CHECK(n,t), (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t)))
+#define Move(s,d,n,t) (MEM_WRAP_CHECK(n,t), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
+#define Copy(s,d,n,t) (MEM_WRAP_CHECK(n,t), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Zero(d,n,t) (MEM_WRAP_CHECK(n,t), (void)memzero((char*)(d), (n) * sizeof(t)))
-#define MoveD(s,d,n,t) (MEM_WRAP_CHECK(n,t), memmove((char*)(d),(char*)(s), (n) * sizeof(t)))
-#define CopyD(s,d,n,t) (MEM_WRAP_CHECK(n,t), memcpy((char*)(d),(char*)(s), (n) * sizeof(t)))
+#define MoveD(s,d,n,t) (MEM_WRAP_CHECK(n,t), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
+#define CopyD(s,d,n,t) (MEM_WRAP_CHECK(n,t), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#ifdef HAS_MEMSET
#define ZeroD(d,n,t) (MEM_WRAP_CHECK(n,t), memzero((char*)(d), (n) * sizeof(t)))
#else
(v = (c*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))
#define Safefree(d) safefree((Malloc_t)(d))
-#define Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t))
-#define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
+#define Move(s,d,n,t) (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t))
+#define Copy(s,d,n,t) (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t))
#define Zero(d,n,t) (void)memzero((char*)(d), (n) * sizeof(t))
-#define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
-#define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
+#define MoveD(s,d,n,t) memmove((char*)(d),(const char*)(s), (n) * sizeof(t))
+#define CopyD(s,d,n,t) memcpy((char*)(d),(const char*)(s), (n) * sizeof(t))
#ifdef HAS_MEMSET
#define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
#else
}
STATIC OP *
-S_too_few_arguments(pTHX_ OP *o, char *name)
+S_too_few_arguments(pTHX_ OP *o, const char *name)
{
yyerror(Perl_form(aTHX_ "Not enough arguments for %s", name));
return o;
}
STATIC OP *
-S_too_many_arguments(pTHX_ OP *o, char *name)
+S_too_many_arguments(pTHX_ OP *o, const char *name)
{
yyerror(Perl_form(aTHX_ "Too many arguments for %s", name));
return o;
}
STATIC void
-S_bad_type(pTHX_ I32 n, char *t, char *name, OP *kid)
+S_bad_type(pTHX_ I32 n, const char *t, const char *name, OP *kid)
{
yyerror(Perl_form(aTHX_ "Type of arg %d to %s must be %s (not %s)",
(int)n, name, t, OP_DESC(kid)));
OP *
Perl_scalarkids(pTHX_ OP *o)
{
- OP *kid;
if (o && o->op_flags & OPf_KIDS) {
+ OP *kid;
for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
scalar(kid);
}
*/
CV *
-Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
+Perl_newXS(pTHX_ const char *name, XSUBADDR_t subaddr, const char *filename)
{
GV *gv = gv_fetchpv(name ? name :
(PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
PL_op_desc[(o)->op_type])
#ifndef DOINIT
-EXT char *PL_op_name[];
+EXT const char *PL_op_name[];
#else
-EXT char *PL_op_name[] = {
+EXT const char *PL_op_name[] = {
"null",
"stub",
"scalar",
#endif
#ifndef DOINIT
-EXT char *PL_op_desc[];
+EXT const char *PL_op_desc[];
#else
-EXT char *PL_op_desc[] = {
+EXT const char *PL_op_desc[] = {
"null operation",
"stub",
"scalar",
PL_op_desc[(o)->op_type])
#ifndef DOINIT
-EXT char *PL_op_name[];
+EXT const char *PL_op_name[];
#else
-EXT char *PL_op_name[] = {
+EXT const char *PL_op_name[] = {
END
for (@ops) {
print <<END;
#ifndef DOINIT
-EXT char *PL_op_desc[];
+EXT const char *PL_op_desc[];
#else
-EXT char *PL_op_desc[] = {
+EXT const char *PL_op_desc[] = {
END
for (@ops) {
/* This message really ought to be max 23 lines.
* Removed -h because the user already knows that option. Others? */
- static char *usage_msg[] = {
+ static const char *usage_msg[] = {
"-0[octal] specify record separator (\\0, if no argument)",
"-a autosplit mode with -n or -p (splits $_ into @F)",
"-C[number/list] enables the listed Unicode features",
int
Perl_get_debug_opts(pTHX_ char **s, bool givehelp)
{
- static char *usage_msgd[] = {
+ static const char *usage_msgd[] = {
" Debugging flag values: (see also -d)",
" p Tokenizing and parsing (with v, displays parse stack)",
" s Stack snapshots (with v, displays all stacks)",
int i = 0;
if (isALPHA(**s)) {
/* if adding extra options, remember to update DEBUG_MASK */
- static char debopts[] = "psltocPmfrxu HXDSTRJvCAq";
+ static const char debopts[] = "psltocPmfrxu HXDSTRJvCAq";
for (; isALNUM(**s); (*s)++) {
char *d = strchr(debopts,**s);
Returns a string describing what the SV is a reference to.
- char* sv_reftype(SV* sv, int ob)
+ const char* sv_reftype(const SV* sv, int ob)
=for hackers
Found in file sv.c
SV *tmpstr;
STRLEN len;
MAGIC *mg = Null(MAGIC*);
-
+
/* prevent recompiling under /o and ithreads. */
#if defined(USE_ITHREADS)
if (pm->op_pmflags & PMf_KEEP && PM_GETRE(pm)) {
SV *nsv = Nullsv;
REGEXP *old = PM_GETRE(pm);
if(old != rx) {
- if(old)
+ if(old)
ReREFCNT_dec(old);
PM_SETRE(pm,rx);
}
}
cx->sb_m = m = rx->startp[0] + orig;
if (m > s) {
- if (DO_UTF8(dstr) && !SvUTF8(cx->sb_targ))
+ if (DO_UTF8(dstr) && !SvUTF8(cx->sb_targ))
sv_catpvn_utf8_upgrade(dstr, s, m - s, nsv);
else
sv_catpvn(dstr, s, m-s);
bool targ_is_utf8 = FALSE;
SV * nsv = Nullsv;
OP * parseres = 0;
- char *fmt;
+ const char *fmt;
bool oneline;
if (!SvMAGICAL(tmpForm) || !SvCOMPILED(tmpForm)) {
for (;;) {
DEBUG_f( {
- char *name = "???";
+ const char *name = "???";
arg = -1;
switch (*fpc) {
case FF_LITERAL: arg = fpc[1]; name = "LITERAL"; break;
case FF_MORE: name = "MORE"; break;
case FF_LINEMARK: name = "LINEMARK"; break;
case FF_END: name = "END"; break;
- case FF_0DECIMAL: name = "0DECIMAL"; break;
+ case FF_0DECIMAL: name = "0DECIMAL"; break;
case FF_LINESNGL: name = "LINESNGL"; break;
}
if (arg >= 0)
item = s = SvPV(sv, len);
itemsize = len;
if ((item_is_utf8 = DO_UTF8(sv)))
- itemsize = sv_len_utf8(sv);
+ itemsize = sv_len_utf8(sv);
if (itemsize) {
bool chopped = FALSE;
gotsome = TRUE;
gotsome = TRUE;
value = SvNV(sv);
/* overflow evidence */
- if (num_overflow(value, fieldsize, arg)) {
+ if (num_overflow(value, fieldsize, arg)) {
arg = fieldsize;
while (arg--)
*t++ = '#';
* irrelevant. --jhi */
if (shift < count)
shift = count; /* Avoid shifting too often --Ben Tilly */
-
+
EXTEND(SP,shift);
src = SP;
dst = (SP += shift);
while (items-- > 0)
*dst-- = SvTEMP(TOPs) ? POPs : sv_mortalcopy(POPs);
}
- else {
+ else {
/* scalar context: we don't care about which values map returns
* (we use undef here). And so we certainly don't want to do mortal
* copies of meaningless values. */
else {
dTOPss;
SV *targ = PAD_SV(PL_op->op_targ);
- int flip = 0;
+ int flip = 0;
- if (PL_op->op_private & OPpFLIP_LINENUM) {
+ if (PL_op->op_private & OPpFLIP_LINENUM) {
if (GvIO(PL_last_in_gv)) {
flip = SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv));
}
GV *gv = gv_fetchpv(".", TRUE, SVt_PV);
if (gv && GvSV(gv)) flip = SvIV(sv) == SvIV(GvSV(gv));
}
- } else {
- flip = SvTRUE(sv);
- }
- if (flip) {
+ } else {
+ flip = SvTRUE(sv);
+ }
+ if (flip) {
sv_setiv(PAD_SV(cUNOP->op_first->op_targ), 1);
if (PL_op->op_flags & OPf_SPECIAL) {
sv_setiv(targ, 1);
/* Control. */
-static char *context_name[] = {
+static const char *context_name[] = {
"pseudo-block",
"subroutine",
"eval",
if (message) {
if (PL_in_eval & EVAL_KEEPERR) {
- static char prefix[] = "\t(in cleanup) ";
+ static const char prefix[] = "\t(in cleanup) ";
SV *err = ERRSV;
char *e = Nullch;
if (!SvPOK(err))
PP(pp_reset)
{
dSP;
- char *tmps;
+ const char *tmps;
STRLEN n_a;
if (MAXARG < 1)
}
STATIC OP *
-S_dofindlabel(pTHX_ OP *o, char *label, OP **opstack, OP **oplimit)
+S_dofindlabel(pTHX_ OP *o, const char *label, OP **opstack, OP **oplimit)
{
OP *kid = Nullop;
OP **ops = opstack;
- static char too_deep[] = "Target of goto is too deeply nested";
+ static const char too_deep[] = "Target of goto is too deeply nested";
if (ops >= oplimit)
Perl_croak(aTHX_ too_deep);
register PERL_CONTEXT *cx;
#define GOTO_DEPTH 64
OP *enterops[GOTO_DEPTH];
- char *label;
- int do_dump = (PL_op->op_type == OP_DUMP);
- static char must_have_label[] = "goto must have label";
+ const char *label = 0;
+ const bool do_dump = (PL_op->op_type == OP_DUMP);
+ static const char must_have_label[] = "goto must have label";
- label = 0;
if (PL_op->op_flags & OPf_STACKED) {
SV *sv = POPs;
STRLEN n_a;
if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs) {
/* put @_ back onto stack */
AV* av = cx->blk_sub.argarray;
-
+
items = AvFILLp(av) + 1;
EXTEND(SP, items+1); /* @_ could have been extended. */
Copy(AvARRAY(av), SP + 1, items, SV*);
*/
SV *sv = GvSV(PL_DBsub);
CV *gotocv;
-
+
if (PERLDB_SUB_NN) {
(void)SvUPGRADE(sv, SVt_PVIV);
(void)SvIOK_on(sv);
}
OP *
-Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, PAD** padp)
+Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp)
/* sv Text to convert to OP tree. */
/* startop op_free() this to undo. */
/* code Short string id of the caller. */
PERL_CONTEXT *cx = &cxstack[cxstack_ix];
I32 optype = 0; /* Might be reset by POPEVAL. */
STRLEN n_a;
-
+
PL_op = saveop;
if (PL_eval_root) {
op_free(PL_eval_root);
PL_encoding = Nullsv;
op = DOCATCH(doeval(gimme, NULL, Nullcv, PL_curcop->cop_seq));
-
+
/* Restore encoding. */
PL_encoding = encoding;
sv_magic(sv, Nullsv, PERL_MAGIC_fm, Nullch, 0);
SvCOMPILED_on(sv);
- if (unchopnum && repeat)
+ if (unchopnum && repeat)
DIE(aTHX_ "Repeated format line will never terminate (~~ and @#)");
return 0;
}
{
dSP;
Time_t when;
- struct tm *tmbuf;
- static char *dayname[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
- static char *monname[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ const struct tm *tmbuf;
+ static const char *dayname[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+ static const char *monname[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
if (MAXARG < 1)
PERL_CALLCONV I32 Perl_debstack(pTHX);
PERL_CALLCONV I32 Perl_debstackptrs(pTHX);
PERL_CALLCONV char* Perl_delimcpy(pTHX_ char* to, char* toend, char* from, char* fromend, int delim, I32* retlen);
-PERL_CALLCONV void Perl_deprecate(pTHX_ char* s);
-PERL_CALLCONV void Perl_deprecate_old(pTHX_ char* s);
+PERL_CALLCONV void Perl_deprecate(pTHX_ const char* s);
+PERL_CALLCONV void Perl_deprecate_old(pTHX_ const char* s);
PERL_CALLCONV OP* Perl_die(pTHX_ const char* pat, ...)
__attribute__format__(__printf__,pTHX_1,pTHX_2);
PERL_CALLCONV OP* Perl_vdie(pTHX_ const char* pat, va_list* args);
PERL_CALLCONV OP* Perl_newSLICEOP(pTHX_ I32 flags, OP* subscript, OP* listop);
PERL_CALLCONV OP* Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o);
PERL_CALLCONV CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
-PERL_CALLCONV CV* Perl_newXS(pTHX_ char* name, XSUBADDR_t f, char* filename);
+PERL_CALLCONV CV* Perl_newXS(pTHX_ const char* name, XSUBADDR_t f, const char* filename);
PERL_CALLCONV AV* Perl_newAV(pTHX);
PERL_CALLCONV OP* Perl_newAVREF(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_newBINOP(pTHX_ I32 type, I32 flags, OP* first, OP* last);
PERL_CALLCONV OP* Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP* loop, I32 whileline, OP* expr, OP* block, OP* cont);
PERL_CALLCONV PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems);
-PERL_CALLCONV char* Perl_scan_vstring(pTHX_ char *vstr, SV *sv);
+PERL_CALLCONV char* Perl_scan_vstring(pTHX_ const char *vstr, SV *sv);
PERL_CALLCONV char* Perl_scan_version(pTHX_ char *vstr, SV *sv, bool qv);
PERL_CALLCONV SV* Perl_new_version(pTHX_ SV *ver);
PERL_CALLCONV SV* Perl_upg_version(pTHX_ SV *ver);
PERL_CALLCONV OP* Perl_scalarvoid(pTHX_ OP* o);
PERL_CALLCONV NV Perl_scan_bin(pTHX_ char* start, STRLEN len, STRLEN* retlen);
PERL_CALLCONV NV Perl_scan_hex(pTHX_ char* start, STRLEN len, STRLEN* retlen);
-PERL_CALLCONV char* Perl_scan_num(pTHX_ char* s, YYSTYPE *lvalp);
+PERL_CALLCONV char* Perl_scan_num(pTHX_ const char* s, YYSTYPE *lvalp);
PERL_CALLCONV NV Perl_scan_oct(pTHX_ char* start, STRLEN len, STRLEN* retlen);
PERL_CALLCONV OP* Perl_scope(pTHX_ OP* o);
PERL_CALLCONV char* Perl_screaminstr(pTHX_ SV* bigsv, SV* littlesv, I32 start_shift, I32 end_shift, I32 *state, I32 last);
#if defined(USE_LOCALE_COLLATE)
PERL_CALLCONV char* Perl_sv_collxfrm(pTHX_ SV* sv, STRLEN* nxp);
#endif
-PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, char* code, PAD** padp);
+PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, const char* code, PAD** padp);
PERL_CALLCONV int Perl_getcwd_sv(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_dec(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_dump(pTHX_ SV* sv);
PERL_CALLCONV char* Perl_sv_pvbyten_force(pTHX_ SV* sv, STRLEN* lp);
PERL_CALLCONV char* Perl_sv_recode_to_utf8(pTHX_ SV* sv, SV *encoding);
PERL_CALLCONV bool Perl_sv_cat_decode(pTHX_ SV* dsv, SV *encoding, SV *ssv, int *offset, char* tstr, int tlen);
-PERL_CALLCONV char* Perl_sv_reftype(pTHX_ SV* sv, int ob);
+PERL_CALLCONV const char* Perl_sv_reftype(pTHX_ const SV* sv, int ob);
PERL_CALLCONV void Perl_sv_replace(pTHX_ SV* sv, SV* nsv);
PERL_CALLCONV void Perl_sv_report_used(pTHX);
PERL_CALLCONV void Perl_sv_reset(pTHX_ char* s, HV* stash);
PERL_CALLCONV void Perl_watch(pTHX_ char** addr);
PERL_CALLCONV I32 Perl_whichsig(pTHX_ const char* sig);
PERL_CALLCONV void Perl_write_to_stderr(pTHX_ const char* message, int msglen);
-PERL_CALLCONV int Perl_yyerror(pTHX_ char* s);
+PERL_CALLCONV int Perl_yyerror(pTHX_ const char* s);
PERL_CALLCONV int Perl_yylex(pTHX);
PERL_CALLCONV int Perl_yyparse(pTHX);
-PERL_CALLCONV int Perl_yywarn(pTHX_ char* s);
+PERL_CALLCONV int Perl_yywarn(pTHX_ const char* s);
#if defined(MYMALLOC)
PERL_CALLCONV void Perl_dump_mstats(pTHX_ char* s);
PERL_CALLCONV int Perl_get_mstats(pTHX_ perl_mstats_t *buf, int buflen, int level);
#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, char *t, char *name, OP *kid);
+STATIC void S_bad_type(pTHX_ I32 n, const char *t, const char *name, 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 OP* S_no_fh_allowed(pTHX_ OP *o);
STATIC OP* S_scalarboolean(pTHX_ OP *o);
-STATIC OP* S_too_few_arguments(pTHX_ OP *o, char* name);
-STATIC OP* S_too_many_arguments(pTHX_ OP *o, char* name);
+STATIC OP* S_too_few_arguments(pTHX_ OP *o, const char* name);
+STATIC OP* S_too_many_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);
#if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
STATIC OP* S_docatch(pTHX_ OP *o);
STATIC void* S_docatch_body(pTHX);
-STATIC OP* S_dofindlabel(pTHX_ OP *o, char *label, OP **opstack, OP **oplimit);
+STATIC OP* S_dofindlabel(pTHX_ OP *o, const char *label, OP **opstack, OP **oplimit);
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 void S_cl_and(pTHX_ struct regnode_charclass_class *cl, struct regnode_charclass_class *and_with);
STATIC void S_cl_or(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl, struct regnode_charclass_class *or_with);
STATIC I32 S_study_chunk(pTHX_ struct RExC_state_t*, regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags, U32 depth);
-STATIC I32 S_add_data(pTHX_ struct RExC_state_t*, I32 n, char *s);
+STATIC I32 S_add_data(pTHX_ struct RExC_state_t*, I32 n, const char *s);
STATIC void S_re_croak2(pTHX_ const char* pat1, const char* pat2, ...) __attribute__((noreturn));
STATIC I32 S_regpposixcc(pTHX_ struct RExC_state_t*, I32 value);
STATIC void S_checkposixcc(pTHX_ struct RExC_state_t*);
STATIC char* S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *slp);
STATIC char* S_skipspace(pTHX_ char *s);
STATIC char* S_swallow_bom(pTHX_ U8 *s);
-STATIC void S_checkcomma(pTHX_ char *s, char *name, char *what);
-STATIC void S_force_ident(pTHX_ char *s, int kind);
+STATIC void S_checkcomma(pTHX_ char *s, char *name, const char *what);
+STATIC void S_force_ident(pTHX_ const char *s, int kind);
STATIC void S_incline(pTHX_ char *s);
STATIC int S_intuit_method(pTHX_ char *s, GV *gv);
STATIC int S_intuit_more(pTHX_ char *s);
STATIC I32 S_lop(pTHX_ I32 f, int x, char *s);
STATIC void S_missingterm(pTHX_ char *s);
-STATIC void S_no_op(pTHX_ char *what, char *s);
+STATIC void S_no_op(pTHX_ const char *what, char *s);
STATIC void S_set_csh(pTHX);
STATIC I32 S_sublex_done(pTHX);
STATIC I32 S_sublex_push(pTHX);
STATIC HV * S_find_in_my_stash(pTHX_ const char *pkgname, I32 len);
STATIC SV* S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, SV *sv, SV *pv, const char *type);
# if defined(DEBUGGING)
-STATIC int S_tokereport(pTHX_ char *s, I32 rv);
+STATIC int S_tokereport(pTHX_ const char *s, I32 rv);
# endif
STATIC int S_ao(pTHX_ int toketype);
STATIC void S_depcom(pTHX);
-STATIC char* S_incl_perldb(pTHX);
+STATIC const char* S_incl_perldb(pTHX);
#if 0
STATIC I32 S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen);
STATIC I32 S_utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen);
* "...".
*/
#define FAIL(msg) STMT_START { \
- char *ellipses = ""; \
+ const char *ellipses = ""; \
IV len = RExC_end - RExC_precomp; \
\
if (!SIZE_ONLY) \
* "...".
*/
#define FAIL2(pat,msg) STMT_START { \
- char *ellipses = ""; \
+ const char *ellipses = ""; \
IV len = RExC_end - RExC_precomp; \
\
if (!SIZE_ONLY) \
*/
char *s0 = STRING(scan), *s, *t;
char *s1 = s0 + STR_LEN(scan) - 1, *s2 = s1 - 4;
- char *t0 = "\xcc\x88\xcc\x81";
- char *t1 = t0 + 3;
+ const char *t0 = "\xcc\x88\xcc\x81";
+ const char *t1 = t0 + 3;
for (s = s0 + 2;
s < s2 && (t = ninstr(s, s1, t0, t1));
}
flags &= ~SCF_DO_STCLASS;
}
- else if (strchr((char*)PL_varies,OP(scan))) {
+ else if (strchr((const char*)PL_varies,OP(scan))) {
I32 mincount, maxcount, minnext, deltanext, fl = 0;
I32 f = flags, pos_before = 0;
regnode *oscan = scan;
/* Skip open. */
nxt = regnext(nxt);
- if (!strchr((char*)PL_simple,OP(nxt))
+ if (!strchr((const char*)PL_simple,OP(nxt))
&& !(PL_regkind[(U8)OP(nxt)] == EXACT
&& STR_LEN(nxt) == 1))
goto nogo;
break;
}
}
- else if (strchr((char*)PL_simple,OP(scan))) {
+ else if (strchr((const char*)PL_simple,OP(scan))) {
int value = 0;
if (flags & SCF_DO_SUBSTR) {
}
STATIC I32
-S_add_data(pTHX_ RExC_state_t *pRExC_state, I32 n, char *s)
+S_add_data(pTHX_ RExC_state_t *pRExC_state, I32 n, const char *s)
{
if (RExC_rx->data) {
Renewc(RExC_rx->data,
else if ((OP(first) == EXACTF || OP(first) == EXACTFL))
r->regstclass = first;
}
- else if (strchr((char*)PL_simple,OP(first)))
+ else if (strchr((const char*)PL_simple,OP(first)))
r->regstclass = first;
else if (PL_regkind[(U8)OP(first)] == BOUND ||
PL_regkind[(U8)OP(first)] == NBOUND)
}
{
- char *p;
- static char parens[] = "=!<,>";
+ const char *p;
+ static const char parens[] = "=!<,>";
if (paren && (p = strchr(parens, paren))) {
U8 node = ((p - parens) % 2) ? UNLESSM : IFMATCH;
/* It would be nice to FAIL() here, but this may be called from
regexec.c, and it would be hard to supply pRExC_state. */
Perl_croak(aTHX_ "Corrupted regexp opcode");
- sv_catpv(sv, (char*)reg_name[OP(o)]); /* Take off const! */
+ sv_catpv(sv, reg_name[OP(o)]); /* Take off const! */
k = PL_regkind[(U8)OP(o)];
#define HOP3c(pos,off,lim) ((char*)HOP3(pos,off,lim))
#define HOPMAYBE3c(pos,off,lim) ((char*)HOPMAYBE3(pos,off,lim))
-#define LOAD_UTF8_CHARCLASS(a,b) STMT_START { if (!CAT2(PL_utf8_,a)) { ENTER; save_re_context(); (void)CAT2(is_utf8_, a)((U8*)b); LEAVE; } } STMT_END
+#define LOAD_UTF8_CHARCLASS(a,b) STMT_START { if (!CAT2(PL_utf8_,a)) { ENTER; save_re_context(); (void)CAT2(is_utf8_, a)((const U8*)b); LEAVE; } } STMT_END
/* for use after a quantifier and before an EXACT-like node -- japhy */
#define JUMPABLE(rn) ( \
#define FUV_SUBSCRIPT_WITHIN 4 /* "within @foo" */
STATIC SV*
-S_varname(pTHX_ GV *gv, char *gvtype, PADOFFSET targ,
+S_varname(pTHX_ GV *gv, const char *gvtype, PADOFFSET targ,
SV* keyname, I32 aindex, int subscript_type)
{
AV *av;
* XXX get rid of all this if gv_fullnameX() ever supports this
* directly */
- char *p;
+ const char *p;
HV *hv = GvSTASH(gv);
sv_setpv(name, gvtype);
if (!hv)
p = "???";
- else if (!HvNAME(hv))
+ else if (!(p=HvNAME(hv)))
p = "__ANON__";
- else
- p = HvNAME(hv);
if (strNE(p, "main")) {
sv_catpv(name,p);
sv_catpvn(name,"::", 2);
#endif
Renew(s,newlen,char);
}
- else {
+ else {
New(703, s, newlen, char);
if (SvPVX(sv) && SvCUR(sv)) {
Move(SvPVX(sv), s, (newlen < SvCUR(sv)) ? newlen : SvCUR(sv), char);
}
}
SvPV_set(sv, s);
- SvLEN_set(sv, newlen);
+ SvLEN_set(sv, newlen);
}
return s;
}
=cut
*/
-char *
-Perl_sv_reftype(pTHX_ SV *sv, int ob)
+const char *
+Perl_sv_reftype(pTHX_ const SV *sv, int ob)
{
if (ob && SvOBJECT(sv)) {
- char *name = HvNAME(SvSTASH(sv));
+ const char *name = HvNAME(SvSTASH(sv));
return name ? name : "__ANON__";
}
else {
#define yychar (*PL_yycharp)
#define yylval (*PL_yylvalp)
-static char ident_too_long[] = "Identifier too long";
-static char c_without_g[] = "Use of /c modifier is meaningless without /g";
-static char c_in_subst[] = "Use of /c modifier is meaningless in s///";
+static char const ident_too_long[] = "Identifier too long";
+static char const c_without_g[] = "Use of /c modifier is meaningless without /g";
+static char const c_in_subst[] = "Use of /c modifier is meaningless in s///";
static void restore_rsfp(pTHX_ void *f);
#ifndef PERL_NO_UTF16_FILTER
#define LEX_KNOWNEXT 0
#ifdef DEBUGGING
-static char* lex_state_names[] = {
+static char const* lex_state_names[] = {
"KNOWNEXT",
"FORMLINE",
"INTERPCONST",
TOKENTYPE_GVVAL
};
-static struct debug_tokens { int token, type; char *name;} debug_tokens[] =
+static struct debug_tokens { const int token, type; const char *name; } debug_tokens[] =
{
{ ADDOP, TOKENTYPE_OPNUM, "ADDOP" },
{ ANDAND, TOKENTYPE_NONE, "ANDAND" },
/* dump the returned token in rv, plus any optional arg in yylval */
STATIC int
-S_tokereport(pTHX_ char* s, I32 rv)
+S_tokereport(pTHX_ const char* s, I32 rv)
{
if (DEBUG_T_TEST) {
- char *name = Nullch;
+ const char *name = Nullch;
enum token_type type = TOKENTYPE_NONE;
struct debug_tokens *p;
- SV* report = newSVpvn("<== ", 4);
+ SV* report = newSVpvn("<== ", 4);
for (p = debug_tokens; p->token; p++) {
if (p->token == (int)rv) {
*/
STATIC void
-S_no_op(pTHX_ char *what, char *s)
+S_no_op(pTHX_ const char *what, char *s)
{
char *oldbp = PL_bufptr;
bool is_first = (PL_oldbufptr == PL_linestart);
*/
void
-Perl_deprecate(pTHX_ char *s)
+Perl_deprecate(pTHX_ const char *s)
{
if (ckWARN(WARN_DEPRECATED))
Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of %s is deprecated", s);
}
void
-Perl_deprecate_old(pTHX_ char *s)
+Perl_deprecate_old(pTHX_ const char *s)
{
/* This function should NOT be called for any new deprecated warnings */
/* Use Perl_deprecate instead */
/* in its own right. */
if (ckWARN2(WARN_DEPRECATED, WARN_SYNTAX))
- Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
+ Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
"Use of %s is deprecated", s);
}
S_newSV_maybe_utf8(pTHX_ const char *start, STRLEN len)
{
SV *sv = newSVpvn(start,len);
- if (UTF && !IN_BYTES && is_utf8_string((U8*)start, len))
+ if (UTF && !IN_BYTES && is_utf8_string((const U8*)start, len))
SvUTF8_on(sv);
return sv;
}
*/
STATIC void
-S_force_ident(pTHX_ register char *s, int kind)
+S_force_ident(pTHX_ register const char *s, int kind)
{
if (s && *s) {
- OP* o = (OP*)newSVOP(OP_CONST, 0, newSVpv(s,0));
+ OP* const o = (OP*)newSVOP(OP_CONST, 0, newSVpv(s,0));
PL_nextval[PL_nexttoke].opval = o;
force_next(WORD);
if (kind) {
default:
{
if (ckWARN(WARN_MISC) &&
- isALNUM(*s) &&
+ isALNUM(*s) &&
*s != '_')
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Unrecognized escape \\%c passed through",
* compile-time require of perl5db.pl.
*/
-STATIC char*
+STATIC const char*
S_incl_perldb(pTHX)
{
if (PL_perldb) {
- char *pdb = PerlEnv_getenv("PERL5DB");
+ const char *pdb = PerlEnv_getenv("PERL5DB");
if (pdb)
return pdb;
}
#ifdef DEBUGGING
- static char* exp_name[] =
+ static char const* exp_name[] =
{ "OPERATOR", "TERM", "REF", "STATE", "BLOCK", "ATTRBLOCK",
"ATTRTERM", "TERMBLOCK", "TERMORDORDOR"
};
d = s + 2;
#ifdef ALTERNATE_SHEBANG
else {
- static char as[] = ALTERNATE_SHEBANG;
+ static char const as[] = ALTERNATE_SHEBANG;
if (*s == as[0] && strnEQ(s, as, sizeof(as) - 1))
d = s + (sizeof(as) - 1);
}
#else
; /* skip to avoid loading attributes.pm */
#endif
- else
+ else
Perl_croak(aTHX_ "The 'unique' attribute may only be applied to 'our' variables");
}
while (*proto == ';')
proto++;
if (*proto == '&' && *s == '{') {
- sv_setpv(PL_subname, PL_curstash ?
+ sv_setpv(PL_subname, PL_curstash ?
"__ANON__" : "__ANON__::__ANON__");
PREBLOCK(LSTOPSUB);
}
/*SUPPRESS 560*/
if (PL_rsfp && (!PL_in_eval || PL_tokenbuf[2] == 'D')) {
- char *pname = "main";
+ const char *pname = "main";
if (PL_tokenbuf[2] == 'D')
pname = HvNAME(PL_curstash ? PL_curstash : PL_defstash);
gv = gv_fetchpv(Perl_form(aTHX_ "%s::DATA", pname), TRUE, SVt_PVIO);
SPAGAIN;
name = POPs;
PUTBACK;
- PerlIO_apply_layers(aTHX_ PL_rsfp, NULL,
+ PerlIO_apply_layers(aTHX_ PL_rsfp, NULL,
Perl_form(aTHX_ ":encoding(%"SVf")",
name));
FREETMPS;
}
STATIC void
-S_checkcomma(pTHX_ register char *s, char *name, char *what)
+S_checkcomma(pTHX_ register char *s, char *name, const char *what)
{
char *w;
pmflag(&pm->op_pmflags,*s++);
}
/* issue a warning if /c is specified,but /g is not */
- if (ckWARN(WARN_REGEXP) &&
+ if (ckWARN(WARN_REGEXP) &&
(pm->op_pmflags & PMf_CONTINUE) && !(pm->op_pmflags & PMf_GLOBAL))
{
Perl_warner(aTHX_ packWARN(WARN_REGEXP), c_without_g);
*/
char *
-Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
+Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
{
- register char *s = start; /* current position in buffer */
+ register const char *s = start; /* current position in buffer */
register char *d; /* destination in temp buffer */
register char *e; /* end of temp buffer */
NV nv; /* number read, as a double */
SV *sv = Nullsv; /* place to put the converted number */
bool floatit; /* boolean: int or float? */
- char *lastub = 0; /* position of last underbar */
- static char number_too_long[] = "Number too long";
+ const char *lastub = 0; /* 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 */
bool overflowed = FALSE;
bool just_zero = TRUE; /* just plain 0 or binary number? */
static NV nvshift[5] = { 1.0, 2.0, 4.0, 8.0, 16.0 };
- static char* bases[5] = { "", "binary", "", "octal",
+ static char const* bases[5] = { "", "binary", "", "octal",
"hexadecimal" };
- static char* Bases[5] = { "", "Binary", "", "Octal",
+ static char const* Bases[5] = { "", "Binary", "", "Octal",
"Hexadecimal" };
- static char *maxima[5] = { "",
+ static char const *maxima[5] = { "",
"0b11111111111111111111111111111111",
"",
"037777777777",
"0xffffffff" };
- char *base, *Base, *max;
+ const char *base, *Base, *max;
/* check for hex */
if (s[1] == 'x') {
sv_setuv(sv, u);
}
if (just_zero && (PL_hints & HINT_NEW_INTEGER))
- sv = new_constant(start, s - start, "integer",
+ sv = new_constant(start, s - start, "integer",
sv, Nullsv, NULL);
else if (PL_hints & HINT_NEW_BINARY)
sv = new_constant(start, s - start, "binary", sv, Nullsv, NULL);
#pragma segment Perl_yylex
#endif
int
-Perl_yywarn(pTHX_ char *s)
+Perl_yywarn(pTHX_ const char *s)
{
PL_in_eval |= EVAL_WARNONLY;
yyerror(s);
}
int
-Perl_yyerror(pTHX_ char *s)
+Perl_yyerror(pTHX_ const char *s)
{
- char *where = NULL;
- char *context = NULL;
+ const char *where = NULL;
+ const char *context = NULL;
int contlen = -1;
SV *msg;
*/
char *
-Perl_scan_vstring(pTHX_ char *s, SV *sv)
+Perl_scan_vstring(pTHX_ const char *s, SV *sv)
{
- char *pos = s;
- char *start = s;
+ const char *pos = s;
+ const char *start = s;
if (*pos == 'v') pos++; /* get past 'v' */
while (pos < PL_bufend && (isDIGIT(*pos) || *pos == '_'))
pos++;
if ( *pos != '.') {
/* this may not be a v-string if followed by => */
- char *next = pos;
+ const char *next = pos;
while (next < PL_bufend && isSPACE(*next))
++next;
if ((PL_bufend - next) >= 2 && *next == '=' && next[1] == '>' ) {
rev = 0;
{
/* this is atoi() that tolerates underscores */
- char *end = pos;
+ const char *end = pos;
UV mult = 1;
while (--end >= s) {
UV orev;