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
+Ap |SV* |filter_add |NULLOK filter_t funcp|NULLOK SV* datasv
Ap |void |filter_del |filter_t funcp
Ap |I32 |filter_read |int idx|SV* buffer|int maxlen
ApPR |char** |get_op_descs
ApPR |char* |instr |NN const char* big|NN const char* little
pR |bool |io_close |NN IO* io|bool not_implicit
pR |OP* |invert |OP* cmd
-dpR |bool |is_gv_magical |const char *name|STRLEN len|U32 flags
+dpR |bool |is_gv_magical |NN const char *name|STRLEN len|U32 flags
ApR |I32 |is_lvalue_sub
ApPR |U32 |to_uni_upper_lc|U32 c
ApPR |U32 |to_uni_title_lc|U32 c
|NN const char* little|STRLEN littlelen
Apd |int |sv_isa |NN SV* sv|const char* name
Apd |int |sv_isobject |NN SV* sv
-Apd |STRLEN |sv_len |NN SV* sv
-Apd |STRLEN |sv_len_utf8 |NN SV* sv
+Apd |STRLEN |sv_len |NULLOK SV* sv
+Apd |STRLEN |sv_len_utf8 |NULLOK SV* sv
Apd |void |sv_magic |NN SV* sv|SV* obj|int how|const char* name \
|I32 namlen
Apd |MAGIC *|sv_magicext |NN SV* sv|SV* obj|int how|const MGVTBL *vtbl \
ApdR |SV* |sv_newmortal
Apd |SV* |sv_newref |NULLOK SV* sv
Ap |char* |sv_peek |SV* sv
-Apd |void |sv_pos_u2b |SV* sv|NN I32* offsetp|I32* lenp
-Apd |void |sv_pos_b2u |SV* sv|NN I32* offsetp
+Apd |void |sv_pos_u2b |NULLOK SV* sv|NN I32* offsetp|NULLOK I32* lenp
+Apd |void |sv_pos_b2u |NULLOK SV* sv|NN I32* offsetp
Amdb |char* |sv_pvn_force |SV* sv|STRLEN* lp
Apd |char* |sv_pvutf8n_force|SV* sv|STRLEN* lp
Apd |char* |sv_pvbyten_force|SV* sv|STRLEN* lp
s |I32 |utf16rev_textfilter|int idx|SV *sv|int maxlen
#endif
# if defined(PERL_CR_FILTER)
-s |I32 |cr_textfilter |int idx|SV *sv|int maxlen
+s |I32 |cr_textfilter |int idx|NULLOK SV *sv|int maxlen
# endif
#endif
Ap |GV* |gv_fetchpvn_flags|const char* name|STRLEN len|I32 flags|I32 sv_type
Ap |GV* |gv_fetchsv|SV *name|I32 flags|I32 sv_type
-dpR |bool |is_gv_magical_sv|SV *name|U32 flags
+dpR |bool |is_gv_magical_sv|NN SV *name|U32 flags
ApR |bool |stashpv_hvname_match|NN const COP *cop|NN const HV *hv
nsplit = ++nend;
}
if (nsplit) {
- const char *origname = name;
+ const char * const origname = name;
name = nsplit + 1;
if (*nsplit == ':')
--nsplit;
gv = gv_autoload4(ostash, name, nend - name, TRUE);
}
else if (autoload) {
- CV* cv = GvCV(gv);
+ CV* const cv = GvCV(gv);
if (!CvROOT(cv) && !CvXSUB(cv)) {
GV* stubgv;
GV* autogv;
Perl_gv_stashsv(pTHX_ SV *sv, I32 create)
{
STRLEN len;
- const char *ptr = SvPV_const(sv,len);
+ const char * const ptr = SvPV_const(sv,len);
return gv_stashpvn(ptr, len, create);
}
GV *
Perl_gv_fetchsv(pTHX_ SV *name, I32 flags, I32 sv_type) {
STRLEN len;
- const char *nambeg = SvPV_const(name, len);
+ const char * const nambeg = SvPV_const(name, len);
return gv_fetchpvn_flags(nambeg, len, flags | SvUTF8(name), sv_type);
}
if (!stash) {
if (add) {
- register SV *err = Perl_mess(aTHX_
+ SV * const err = Perl_mess(aTHX_
"Global symbol \"%s%s\" requires explicit package name",
(sv_type == SVt_PV ? "$"
: sv_type == SVt_PVAV ? "@"
break;
case 'I':
if (strEQ(name2, "SA")) {
- AV* av = GvAVn(gv);
+ AV* const av = GvAVn(gv);
GvMULTI_on(gv);
sv_magic((SV*)av, (SV*)gv, PERL_MAGIC_isa, Nullch, 0);
/* NOTE: No support for tied ISA */
break;
case 'O':
if (strEQ(name2, "VERLOAD")) {
- HV* hv = GvHVn(gv);
+ HV* const hv = GvHVn(gv);
GvMULTI_on(gv);
hv_magic(hv, Nullgv, PERL_MAGIC_overload);
}
hv = GvHVn(gv);
hv_magic(hv, Nullgv, PERL_MAGIC_sig);
for (i = 1; i < SIG_SIZE; i++) {
- SV ** init;
- init = hv_fetch(hv, PL_sig_name[i], strlen(PL_sig_name[i]), 1);
+ SV ** const init = hv_fetch(hv, PL_sig_name[i], strlen(PL_sig_name[i]), 1);
if (init)
sv_setsv(*init, &PL_sv_undef);
PL_psig_ptr[i] = 0;
break;
case '-':
{
- AV* av = GvAVn(gv);
+ AV* const av = GvAVn(gv);
sv_magic((SV*)av, Nullsv, PERL_MAGIC_regdata, Nullch, 0);
SvREADONLY_on(av);
goto magicalize;
case '+':
{
- AV* av = GvAVn(gv);
+ AV* const av = GvAVn(gv);
sv_magic((SV*)av, (SV*)av, PERL_MAGIC_regdata, Nullch, 0);
SvREADONLY_on(av);
/* FALL THROUGH */
break;
case ']':
{
- SV *sv = GvSV(gv);
+ SV * const sv = GvSV(gv);
if (!sv_derived_from(PL_patchlevel, "version"))
(void *)upg_version(PL_patchlevel);
GvSV(gv) = vnumify(PL_patchlevel);
bool
Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags)
{
- (void)flags;
+ PERL_UNUSED_ARG(flags);
+
if (len > 1) {
const char * const name1 = name + 1;
switch (*name) {
#ifdef PERL_POISON
#define Safefree(d) \
- (d ? (void)(safefree((Malloc_t)(d)), Poison(&(d), 1, Malloc_t)) : (void) 0)
+ ((d) ? (void)(safefree((Malloc_t)(d)), Poison(&(d), 1, Malloc_t)) : (void) 0)
#else
#define Safefree(d) safefree((Malloc_t)(d))
#endif
void
Perl_free_tied_hv_pool(pTHX)
{
- HE *ohe;
HE *he = PL_hv_fetch_ent_mh;
while (he) {
+ HE * const ohe = he;
Safefree(HeKEY_hek(he));
- ohe = he;
he = HeNEXT(he);
del_HE(ohe);
}
Perl_hek_dup(pTHX_ HEK *source, CLONE_PARAMS* param)
{
HEK *shared = (HEK*)ptr_table_fetch(PL_ptr_table, source);
- (void)param;
+
+ PERL_UNUSED_ARG(param);
if (shared) {
/* We already shared this hash key. */
Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val,
register U32 hash, int flags)
{
- HE *hek = hv_fetch_common (hv, NULL, key, klen, flags,
+ HE * const hek = hv_fetch_common (hv, NULL, key, klen, flags,
(HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
return hek ? &HeVAL(hek) : NULL;
}
} /* ISFETCH */
else if (SvRMAGICAL(hv) && (action & HV_FETCH_ISEXISTS)) {
if (mg_find((SV*)hv, PERL_MAGIC_tied) || SvGMAGICAL((SV*)hv)) {
- SV* svret;
/* I don't understand why hv_exists_ent has svret and sv,
whereas hv_exists only had one. */
- svret = sv_newmortal();
+ SV * const svret = sv_newmortal();
sv = sv_newmortal();
if (keysv || is_utf8) {
#ifdef ENV_IS_CASELESS
else if (mg_find((SV*)hv, PERL_MAGIC_env)) {
/* XXX This code isn't UTF8 clean. */
- const char *keysave = key;
+ char * const keysave = key;
/* Will need to free this, so set FREEKEY flag. */
key = savepvn(key,klen);
key = (const char*)strupr((char*)key);
}
if (is_utf8) {
- const char *keysave = key;
+ char * const keysave = key;
key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8);
if (is_utf8)
flags |= HVhek_UTF8;
if (!(action & HV_FETCH_ISSTORE)
&& SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
unsigned long len;
- char *env = PerlEnv_ENVgetenv_len(key,&len);
+ const char * const env = PerlEnv_ENVgetenv_len(key,&len);
if (env) {
sv = newSVpvn(env,len);
SvTAINTED_on(sv);
while (entry) {
/* We're going to trash this HE's next pointer when we chain it
into the new hash below, so store where we go next. */
- HE *next = HeNEXT(entry);
+ HE * const next = HeNEXT(entry);
UV hash;
HE **bep;
HV *
Perl_newHV(pTHX)
{
- register HV *hv;
register XPVHV* xhv;
+ HV * const hv = (HV*)NEWSV(502,0);
- hv = (HV*)NEWSV(502,0);
sv_upgrade((SV *)hv, SVt_PVHV);
xhv = (XPVHV*)SvANY(hv);
SvPOK_off(hv);
HV *
Perl_newHVhv(pTHX_ HV *ohv)
{
- HV *hv = newHV();
+ HV * const hv = newHV();
STRLEN hv_max, hv_fill;
if (!ohv || (hv_fill = HvFILL(ohv)) == 0)
perl_construct(pTHXx)
{
dVAR;
+ PERL_UNUSED_ARG(my_perl);
#ifdef MULTIPLICITY
init_interp();
PL_perl_destruct_level = 1;
pid_t child;
#endif
+ PERL_UNUSED_ARG(my_perl);
+
/* wait for all pseudo-forked children to finish */
PERL_WAIT_FOR_CHILDREN;
destruct_level = PL_perl_destruct_level;
#ifdef DEBUGGING
{
- const char *s;
- if ((s = PerlEnv_getenv("PERL_DESTRUCT_LEVEL"))) {
+ const char * const s = PerlEnv_getenv("PERL_DESTRUCT_LEVEL");
+ if (s) {
const int i = atoi(s);
if (destruct_level < i)
destruct_level = i;
int ret;
dJMPENV;
+ PERL_UNUSED_VAR(my_perl);
+
#ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
#ifdef IAMSUID
#undef IAMSUID
if (!PL_rehash_seed_set)
PL_rehash_seed = get_hash_seed();
{
- const char *s = PerlEnv_getenv("PERL_HASH_SEED_DEBUG");
+ const char * const s = PerlEnv_getenv("PERL_HASH_SEED_DEBUG");
if (s && (atoi(s) == 1))
PerlIO_printf(Perl_debug_log, "HASH_SEED = %"UVuf"\n", PL_rehash_seed);
int ret = 0;
dJMPENV;
+ PERL_UNUSED_ARG(my_perl);
+
oldscope = PL_scopestack_ix;
#ifdef VMS
VMSISH_HUSHED = 0;
POPEVAL(cx);
PL_curpm = newpm;
LEAVE;
+ PERL_UNUSED_VAR(newsp);
+ PERL_UNUSED_VAR(gimme);
+ PERL_UNUSED_VAR(optype);
}
JMPENV_POP;
}
}
JMPENV_JUMP(2);
+ PERL_UNUSED_VAR(gimme);
+ PERL_UNUSED_VAR(newsp);
}
static I32
read_e_script(pTHX_ int idx, SV *buf_sv, int maxlen)
{
- const char *p, *nl;
- (void)idx;
- (void)maxlen;
+ const char * const p = SvPVX_const(PL_e_script);
+ const char *nl = strchr(p, '\n');
+
+ PERL_UNUSED_ARG(idx);
+ PERL_UNUSED_ARG(maxlen);
- p = SvPVX_const(PL_e_script);
- nl = strchr(p, '\n');
nl = (nl) ? nl+1 : SvEND(PL_e_script);
if (nl-p == 0) {
filter_del(read_e_script);
PMOP *newpm;
SV **mark;
SV *sv = Nullsv;
- PERL_UNUSED_VAR(optype);
+
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
dounwind(cxix);
POPBLOCK(cx,newpm);
- PERL_UNUSED_VAR(optype);
cxstack_ix++; /* temporarily protect top context */
mark = newsp;
switch (CxTYPE(cx)) {
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVESUB(sv);
+ PERL_UNUSED_VAR(optype);
+ PERL_UNUSED_VAR(gimme);
return nextop;
}
static const char must_have_label[] = "goto must have label";
if (PL_op->op_flags & OPf_STACKED) {
- SV *sv = POPs;
+ SV * const sv = POPs;
/* This egregious kludge implements goto &subroutine */
if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) {
dVAR; dSP; /* Make POPBLOCK work. */
PERL_CONTEXT *cx;
SV **newsp;
- I32 gimme = 0; /* SUSPECT - INITIALZE TO WHAT? NI-S */
+ I32 gimme;
I32 optype;
OP dummy;
OP *rop;
CopSTASH_set(&PL_compiling, PL_curstash);
}
if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) {
- SV *sv = sv_newmortal();
+ SV * const sv = sv_newmortal();
Perl_sv_setpvf(aTHX_ sv, "_<(%.10seval %lu)[%s:%"IVdf"]",
code, (unsigned long)++PL_evalseq,
CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
#ifdef OP_IN_REGISTER
op = PL_opsave;
#endif
+ PERL_UNUSED_VAR(newsp);
+ PERL_UNUSED_VAR(optype);
+
return rop;
}
sv_setpvn(ERRSV,"",0);
if (yyparse() || PL_error_count || !PL_eval_root) {
SV **newsp; /* Used by POPBLOCK. */
- PERL_CONTEXT *cx = &cxstack[cxstack_ix];
+ PERL_CONTEXT *cx = &cxstack[cxstack_ix];
I32 optype = 0; /* Might be reset by POPEVAL. */
+ const char *msg;
PL_op = saveop;
if (PL_eval_root) {
}
lex_end();
LEAVE;
+
+ msg = SvPVx_nolen_const(ERRSV);
if (optype == OP_REQUIRE) {
- const char* const msg = SvPVx_nolen_const(ERRSV);
const SV * const nsv = cx->blk_eval.old_namesv;
(void)hv_store(GvHVn(PL_incgv), SvPVX_const(nsv), SvCUR(nsv),
&PL_sv_undef, 0);
*msg ? msg : "Unknown error\n");
}
else if (startop) {
- const char* msg = SvPVx_nolen_const(ERRSV);
-
POPBLOCK(cx,PL_curpm);
POPEVAL(cx);
Perl_croak(aTHX_ "%sCompilation failed in regexp",
(*msg ? msg : "Unknown error\n"));
}
else {
- const char* msg = SvPVx_nolen_const(ERRSV);
if (!*msg) {
sv_setpv(ERRSV, "Compilation error");
}
}
+ PERL_UNUSED_VAR(newsp);
RETPUSHUNDEF;
}
CopLINE_set(&PL_compiling, 0);
PerlIO *fp;
if (namelen > 3 && strEQ(name + namelen - 3, ".pm")) {
- SV *pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c');
+ SV * const pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c');
const char * const pmc = SvPV_nolen_const(pmcsv);
- Stat_t pmstat;
Stat_t pmcstat;
if (PerlLIO_stat(pmc, &pmcstat) < 0) {
fp = PerlIO_open(name, mode);
}
else {
+ Stat_t pmstat;
if (PerlLIO_stat(name, &pmstat) < 0 ||
pmstat.st_mtime < pmcstat.st_mtime)
{
POPBLOCK(cx,newpm);
POPEVAL(cx);
+ PERL_UNUSED_VAR(optype);
TAINT_NOT;
if (gimme == G_VOID)
return NORMAL;
}
+ /*NOTREACHED*/
assert (0); /* Cannot get here. */
/* This is deliberately moved here as spaghetti code to keep it out of the
hot path. */
__attribute__warn_unused_result__;
PERL_CALLCONV bool Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX)
__attribute__warn_unused_result__;
PERL_CALLCONV int Perl_sv_isobject(pTHX_ SV* sv)
__attribute__nonnull__(pTHX_1);
-PERL_CALLCONV STRLEN Perl_sv_len(pTHX_ SV* sv)
- __attribute__nonnull__(pTHX_1);
-
-PERL_CALLCONV STRLEN Perl_sv_len_utf8(pTHX_ SV* sv)
- __attribute__nonnull__(pTHX_1);
-
+PERL_CALLCONV STRLEN Perl_sv_len(pTHX_ SV* sv);
+PERL_CALLCONV STRLEN Perl_sv_len_utf8(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_magic(pTHX_ SV* sv, SV* obj, int how, const char* name, I32 namlen)
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV GV* Perl_gv_fetchpvn_flags(pTHX_ const char* name, STRLEN len, I32 flags, I32 sv_type);
PERL_CALLCONV GV* Perl_gv_fetchsv(pTHX_ SV *name, I32 flags, I32 sv_type);
PERL_CALLCONV bool Perl_is_gv_magical_sv(pTHX_ SV *name, U32 flags)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_stashpv_hvname_match(pTHX_ const COP *cop, const HV *hv)
GET_RE_DEBUG_FLAGS_DECL;
- (void)data; /* Currently unused */
+ PERL_UNUSED_ARG(data);
RX_MATCH_UTF8_set(prog,do_utf8);
PL_regcc = 0;
static void
restore_pos(pTHX_ void *arg)
{
- (void)arg; /* unused */
+ PERL_UNUSED_ARG(arg);
if (PL_reg_eval_set) {
if (PL_reg_oldsaved) {
PL_reg_re->subbeg = PL_reg_oldsaved;
STATIC void
S_to_utf8_substr(pTHX_ register regexp *prog)
{
- SV* sv;
if (prog->float_substr && !prog->float_utf8) {
+ SV* sv;
prog->float_utf8 = sv = newSVsv(prog->float_substr);
sv_utf8_upgrade(sv);
if (SvTAIL(prog->float_substr))
prog->check_utf8 = sv;
}
if (prog->anchored_substr && !prog->anchored_utf8) {
+ SV* sv;
prog->anchored_utf8 = sv = newSVsv(prog->anchored_substr);
sv_utf8_upgrade(sv);
if (SvTAIL(prog->anchored_substr))
STATIC void
S_to_byte_substr(pTHX_ register regexp *prog)
{
- SV* sv;
if (prog->float_utf8 && !prog->float_substr) {
+ SV* sv;
prog->float_substr = sv = newSVsv(prog->float_utf8);
if (sv_utf8_downgrade(sv, TRUE)) {
if (SvTAIL(prog->float_utf8))
prog->check_substr = sv;
}
if (prog->anchored_utf8 && !prog->anchored_substr) {
+ SV* sv;
prog->anchored_substr = sv = newSVsv(prog->anchored_utf8);
if (sv_utf8_downgrade(sv, TRUE)) {
if (SvTAIL(prog->anchored_utf8))
STRLEN *cache = 0;
const U8 *s = start;
I32 uoffset = *offsetp;
- const U8 *send = s + len;
+ const U8 * const send = s + len;
MAGIC *mg = 0;
bool found = FALSE;
* is made as in S_utf8_mg_pos(), namely that
* walking backward is twice slower than
* walking forward. */
- STRLEN forw = *offsetp;
+ const STRLEN forw = *offsetp;
STRLEN backw = cache[1] - *offsetp;
if (!(forw < 2 * backw)) {
if (SvUTF8(sv1)) {
/* sv1 is the UTF-8 one,
* if is equal it must be downgrade-able */
- char *pv = (char*)bytes_from_utf8((const U8*)pv1,
+ char * const pv = (char*)bytes_from_utf8((const U8*)pv1,
&cur1, &is_utf8);
if (pv != pv1)
pv1 = tpv = pv;
else {
/* sv2 is the UTF-8 one,
* if is equal it must be downgrade-able */
- char *pv = (char *)bytes_from_utf8((const U8*)pv2,
+ char * const pv = (char *)bytes_from_utf8((const U8*)pv2,
&cur2, &is_utf8);
if (pv != pv2)
pv2 = tpv = pv;
const char *name = Nullch;
enum token_type type = TOKENTYPE_NONE;
const struct debug_tokens *p;
- SV* report = newSVpvn("<== ", 4);
+ SV* const report = newSVpvn("<== ", 4);
for (p = debug_tokens; p->token; p++) {
if (p->token == (int)rv) {
STATIC void
S_no_op(pTHX_ const char *what, char *s)
{
- char *oldbp = PL_bufptr;
- bool is_first = (PL_oldbufptr == PL_linestart);
+ char * const oldbp = PL_bufptr;
+ const bool is_first = (PL_oldbufptr == PL_linestart);
if (!s)
s = oldbp;
char tmpbuf[3];
char q;
if (s) {
- char *nl = strrchr(s,'\n');
+ char * const nl = strrchr(s,'\n');
if (nl)
*nl = '\0';
}
strip_return(SV *sv)
{
register const char *s = SvPVX_const(sv);
- register const char *e = s + SvCUR(sv);
+ register const char * const e = s + SvCUR(sv);
/* outer loop optimized to do nothing if there are no CR-LFs */
while (s < e) {
if (*s++ == '\r' && *s == '\n') {
* so store the line into the debugger's array of lines
*/
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV *sv = NEWSV(85,0);
+ SV * const sv = NEWSV(85,0);
sv_upgrade(sv, SVt_PVMG);
sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
if ((t = strchr(s, '(')) && t < PL_bufptr)
return;
if (ckWARN_d(WARN_AMBIGUOUS)){
- char ch = *s;
+ const char ch = *s;
*s = '\0';
Perl_warner(aTHX_ packWARN(WARN_AMBIGUOUS),
"Warning: Use of \"%s\" without parentheses is ambiguous",
STATIC SV *
S_newSV_maybe_utf8(pTHX_ const char *start, STRLEN len)
{
- SV *sv = newSVpvn(start,len);
+ SV * const sv = newSVpvn(start,len);
if (UTF && !IN_BYTES && is_utf8_string((const U8*)start, len))
SvUTF8_on(sv);
return sv;
NV nshift = 1.0;
STRLEN len;
const char *start = SvPV_const(sv,len);
- const char *end = start + len;
+ const char * const end = start + len;
const bool utf = SvUTF8(sv) ? TRUE : FALSE;
while (start < end) {
STRLEN skip;
{
dVAR;
if (!PL_lex_starts++) {
- SV *sv = newSVpvn("",0);
+ SV * const sv = newSVpvn("",0);
if (SvUTF8(PL_linestr))
SvUTF8_on(sv);
PL_expect = XOPERATOR;
I32 max; /* last character in range */
if (has_utf8) {
- char *c = (char*)utf8_hop((U8*)d, -1);
+ char * const c = (char*)utf8_hop((U8*)d, -1);
char *e = d++;
while (e-- > c)
*(e + 1) = *e;
case 'x':
++s;
if (*s == '{') {
- char* e = strchr(s, '}');
+ char* const e = strchr(s, '}');
I32 flags = PERL_SCAN_ALLOW_UNDERSCORES |
PERL_SCAN_DISALLOW_PREFIX;
STRLEN len;
}
}
if (hicount) {
- STRLEN offset = d - SvPVX_const(sv);
+ const STRLEN offset = d - SvPVX_const(sv);
U8 *src, *dst;
d = SvGROW(sv, SvLEN(sv) + hicount + 1) + offset;
src = (U8 *)d - 1;
d += hicount;
while (src >= (const U8 *)SvPVX_const(sv)) {
if (!NATIVE_IS_INVARIANT(*src)) {
- U8 ch = NATIVE_TO_ASCII(*src);
+ const U8 ch = NATIVE_TO_ASCII(*src);
*dst-- = (U8)UTF8_EIGHT_BIT_LO(ch);
*dst-- = (U8)UTF8_EIGHT_BIT_HI(ch);
}
}
#endif
if (!has_utf8 && SvUTF8(res)) {
- const char *ostart = SvPVX_const(sv);
+ const char * const ostart = SvPVX_const(sv);
SvCUR_set(sv, d - ostart);
SvPOK_on(sv);
*d = '\0';
has_utf8 = TRUE;
}
if (len > (STRLEN)(e - s + 4)) { /* I _guess_ 4 is \N{} --jhi */
- const char *odest = SvPVX_const(sv);
+ const char * const odest = SvPVX_const(sv);
SvGROW(sv, (SvLEN(sv) + len - (e - s + 4)));
d = SvPVX(sv) + (d - odest);
and then encode the next character */
if ((has_utf8 || this_utf8) && !NATIVE_IS_INVARIANT((U8)(*s))) {
STRLEN len = 1;
- UV uv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s);
- STRLEN need = UNISKIP(NATIVE_TO_UNI(uv));
+ const UV uv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s);
+ const STRLEN need = UNISKIP(NATIVE_TO_UNI(uv));
s += len;
if (need > len) {
/* encoded value larger than old, need extra space (NOTE: SvCUR() not set here) */
- STRLEN off = d - SvPVX_const(sv);
+ const STRLEN off = d - SvPVX_const(sv);
d = SvGROW(sv, SvLEN(sv) + (need-len)) + off;
}
d = (char*)uvchr_to_utf8((U8*)d, uv);
int weight = 2; /* let's weigh the evidence */
char seen[256];
unsigned char un_char = 255, last_un_char;
- const char *send = strchr(s,']');
+ const char * const send = strchr(s,']');
char tmpbuf[sizeof PL_tokenbuf * 4];
if (!send) /* has to be an expression */
S_incl_perldb(pTHX)
{
if (PL_perldb) {
- const char *pdb = PerlEnv_getenv("PERL5DB");
+ const char * const pdb = PerlEnv_getenv("PERL5DB");
if (pdb)
return pdb;
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = Nullch;
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV *sv = NEWSV(85,0);
+ SV * const sv = NEWSV(85,0);
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
} while (PL_doextract);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s;
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV *sv = NEWSV(85,0);
+ SV * const sv = NEWSV(85,0);
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
STRLEN blen;
STRLEN llen;
const char *bstart = SvPV_const(CopFILESV(PL_curcop),blen);
- const char *lstart = SvPV_const(x,llen);
+ const char * const lstart = SvPV_const(x,llen);
if (llen < blen) {
bstart += blen - llen;
if (strnEQ(bstart, lstart, llen) && bstart[-1] == '/') {
const bool switches_done = PL_doswitches;
do {
if (*d == 'M' || *d == 'm' || *d == 'C') {
- const char *m = d;
+ const char * const m = d;
while (*d && !isSPACE(*d)) d++;
Perl_croak(aTHX_ "Too late for \"-%.*s\" option",
(int)(d - m), m);