Apd |STRLEN |is_utf8_char |NN const U8 *p
Apd |bool |is_utf8_string |NN const U8 *s|STRLEN len
Apd |bool |is_utf8_string_loc|NN const U8 *s|STRLEN len|NN const U8 **p
-Ap |bool |is_utf8_alnum |NN const U8 *p
-Ap |bool |is_utf8_alnumc |NN const U8 *p
-Ap |bool |is_utf8_idfirst|NN const U8 *p
-Ap |bool |is_utf8_idcont |NN const U8 *p
-Ap |bool |is_utf8_alpha |NN const U8 *p
-Ap |bool |is_utf8_ascii |NN const U8 *p
-Ap |bool |is_utf8_space |NN const U8 *p
-Ap |bool |is_utf8_cntrl |NN const U8 *p
-Ap |bool |is_utf8_digit |NN const U8 *p
-Ap |bool |is_utf8_graph |NN const U8 *p
-Ap |bool |is_utf8_upper |NN const U8 *p
-Ap |bool |is_utf8_lower |NN const U8 *p
-Ap |bool |is_utf8_print |NN const U8 *p
-Ap |bool |is_utf8_punct |NN const U8 *p
-Ap |bool |is_utf8_xdigit |NN const U8 *p
-Ap |bool |is_utf8_mark |NN const U8 *p
+ApR |bool |is_utf8_alnum |NN const U8 *p
+ApR |bool |is_utf8_alnumc |NN const U8 *p
+ApR |bool |is_utf8_idfirst|NN const U8 *p
+ApR |bool |is_utf8_idcont |NN const U8 *p
+ApR |bool |is_utf8_alpha |NN const U8 *p
+ApR |bool |is_utf8_ascii |NN const U8 *p
+ApR |bool |is_utf8_space |NN const U8 *p
+ApR |bool |is_utf8_cntrl |NN const U8 *p
+ApR |bool |is_utf8_digit |NN const U8 *p
+ApR |bool |is_utf8_graph |NN const U8 *p
+ApR |bool |is_utf8_upper |NN const U8 *p
+ApR |bool |is_utf8_lower |NN const U8 *p
+ApR |bool |is_utf8_print |NN const U8 *p
+ApR |bool |is_utf8_punct |NN const U8 *p
+ApR |bool |is_utf8_xdigit |NN const U8 *p
+ApR |bool |is_utf8_mark |NN const U8 *p
p |OP* |jmaybe |NN OP* arg
pP |I32 |keyword |NN const char* d|I32 len
Ap |void |leave_scope |I32 base
p |PADOFFSET|allocmy |NN char* name
pd |PADOFFSET|pad_findmy |NN const char* name
Ap |PADOFFSET|find_rundefsvoffset |
-p |OP* |oopsAV |NN OP* o
-p |OP* |oopsHV |NN OP* o
+pR |OP* |oopsAV |NN OP* o
+pR |OP* |oopsHV |NN OP* o
pd |void |pad_leavemy
Apd |SV* |pad_sv |PADOFFSET po
pd |void |pad_free |PADOFFSET po
Ap |I32 |regexec_flags |NN regexp* prog|NN char* stringarg \
|NN char* strend|NN char* strbeg|I32 minend \
|SV* screamer|void* data|U32 flags
-Ap |regnode*|regnext |regnode* p
+ApR |regnode*|regnext |NN regnode* p
Ep |void |regprop |SV* sv|const regnode* o
Ap |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count
ApP |char* |rninstr |NN const char* big|NN const char* bigend \
Apd |I32 |sv_cmp |NN SV* sv1|NN SV* sv2
Apd |I32 |sv_cmp_locale |NN SV* sv1|NN SV* sv2
#if defined(USE_LOCALE_COLLATE)
-Apd |char* |sv_collxfrm |NN SV* sv|STRLEN* nxp
+Apd |char* |sv_collxfrm |NN SV* sv|NN STRLEN* nxp
#endif
Ap |OP* |sv_compile_2op |NN SV* sv|NN OP** startp|NN const char* code|NN PAD** padp
Apd |int |getcwd_sv |NN SV* sv
#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
s |void |hsplit |HV *hv
s |void |hfreeentries |HV *hv
-s |HE* |new_he
-s |void |del_he |HE *p
-s |HEK* |save_hek_flags |const char *str|I32 len|U32 hash|int flags
-s |void |hv_magic_check |HV *hv|bool *needs_copy|bool *needs_store
-s |void |unshare_hek_or_pvn|HEK* hek|const char* sv|I32 len|U32 hash
-s |HE* |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
-rs |void |hv_notallowed |int flags|const char *key|I32 klen|const char *msg
+sR |HE* |new_he
+s |void |del_he |NN HE *p
+sR |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
+s |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
+s |void |unshare_hek_or_pvn|HEK* hek|NN const char* sv|I32 len|U32 hash
+sR |HE* |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
+rs |void |hv_notallowed |int flags|NN const char *key|I32 klen|NN const char *msg
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
s |SV* |mul128 |NN SV *sv|U8 m
s |I32 |measure_struct |NN struct tempsym* symptr
s |bool |next_symbol |NN struct tempsym* symptr
-s |SV* |is_an_int |NN const char *s|STRLEN l
+sR |SV* |is_an_int |NN const char *s|STRLEN l
s |int |div128 |NN SV *pnum|NN bool *done
s |const char *|group_end |NN const char *pat|NN const char *patend|char ender
s |const char *|get_num |NN const char *ppat|NN I32 *lenptr
#if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
s |OP* |doform |CV *cv|GV *gv|OP *retop
-sr |int |emulate_eaccess|const char* path|Mode_t mode
+s |int |emulate_eaccess|const char* path|Mode_t mode
# if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
s |int |dooneliner |char *cmd|char *filename
# 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
-dp |bool |is_gv_magical_sv|SV *name|U32 flags
+dpR |bool |is_gv_magical_sv|SV *name|U32 flags
Apd |char* |savesvpv |SV* sv
END_EXTERN_C
+/*
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */
}
else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
/* already defined (or promised) */
+ /* XXX It's possible for this HvNAME_get to return null, and get passed into strEQ */
if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
&& strEQ(HvNAME_get(GvSTASH(CvGV(cv))), "autouse"))) {
const line_t oldline = CopLINE(PL_curcop);
|| o->op_type == OP_BIT_AND
|| o->op_type == OP_BIT_XOR))
{
- const OP * left = cBINOPo->op_first;
- const OP * right = left->op_sibling;
+ const OP * const left = cBINOPo->op_first;
+ const OP * const right = left->op_sibling;
if ((OP_IS_NUMCOMPARE(left->op_type) &&
(left->op_flags & OPf_PARENS) == 0) ||
(OP_IS_NUMCOMPARE(right->op_type) &&
HV* stash;
GV *gv;
SV *sv;
- I32 markoff = MARK - PL_stack_base;
+ const I32 markoff = MARK - PL_stack_base;
const char *methname;
int how = PERL_MAGIC_tied;
U32 items;
dVAR; dSP;
MAGIC *mg;
SV *sv = POPs;
- char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
+ const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar;
if (SvTYPE(sv) == SVt_PVGV && !(sv = (SV *)GvIOp(sv)))
dSP;
MAGIC *mg;
SV *sv = POPs;
- char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
+ const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar;
if (SvTYPE(sv) == SVt_PVGV && !(sv = (SV *)GvIOp(sv)))
PP(pp_select)
{
dSP; dTARGET;
- GV *newdefout, *egv;
+ GV *egv;
HV *hv;
- newdefout = (PL_op->op_private > 0) ? ((GV *) POPs) : (GV *) NULL;
+ GV * const newdefout = (PL_op->op_private > 0) ? ((GV *) POPs) : (GV *) NULL;
egv = GvEGV(PL_defoutgv);
if (!egv)
cv = GvFORM(fgv);
if (!cv) {
- char *name = NULL;
if (fgv) {
- SV *tmpsv = sv_newmortal();
+ SV * const tmpsv = sv_newmortal();
+ char *name;
gv_efullname4(tmpsv, fgv, Nullch, FALSE);
name = SvPV_nolen(tmpsv);
+ if (name && *name)
+ DIE(aTHX_ "Undefined format \"%s\" called", name);
}
- if (name && *name)
- DIE(aTHX_ "Undefined format \"%s\" called", name);
DIE(aTHX_ "Not a format reference");
}
if (CvCLONE(cv))
if (!fgv)
DIE(aTHX_ "bad top format reference");
cv = GvFORM(fgv);
- {
- char *name = NULL;
- if (!cv) {
- SV *sv = sv_newmortal();
- gv_efullname4(sv, fgv, Nullch, FALSE);
- name = SvPV_nolen(sv);
- }
+ if (!cv) {
+ SV * const sv = sv_newmortal();
+ char *name;
+ gv_efullname4(sv, fgv, Nullch, FALSE);
+ name = SvPV_nolen(sv);
if (name && *name)
- DIE(aTHX_ "Undefined top format \"%s\" called",name);
- /* why no:
- else
- DIE(aTHX_ "Undefined top format called");
- ?*/
+ DIE(aTHX_ "Undefined top format \"%s\" called",name);
}
+ /* why no:
+ else
+ DIE(aTHX_ "Undefined top format called");
+ ?*/
if (CvCLONE(cv))
cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
return doform(cv,gv,PL_op);
SV *sv;
char *tmps;
STRLEN len;
- int mode, perm;
+ const int perm = (MAXARG > 3) ? POPi : 0666;
+ const int mode = POPi;
- if (MAXARG > 3)
- perm = POPi;
- else
- perm = 0666;
- mode = POPi;
sv = POPs;
gv = (GV *)POPs;
(void)SvPOK_only(read_target);
if (fp_utf8 && !IN_BYTES) {
/* Look at utf8 we got back and count the characters */
- char *bend = buffer + count;
+ const char *bend = buffer + count;
while (buffer < bend) {
if (charstart) {
skip = UTF8SKIP(buffer);
PP(pp_syswrite)
{
dVAR; dSP;
- int items = (SP - PL_stack_base) - TOPMARK;
+ const int items = (SP - PL_stack_base) - TOPMARK;
if (items == 2) {
SV *sv;
EXTEND(SP, 1);
}
#ifdef HAS_SOCKET
else if (SP > MARK) {
- char *sockbuf;
STRLEN mlen;
- sockbuf = SvPVx(*++MARK, mlen);
+ char * const sockbuf = SvPVx(*++MARK, mlen);
/* length is really flags */
retval = PerlSock_sendto(PerlIO_fileno(IoIFP(io)), buffer, blen,
length, (struct sockaddr *)sockbuf, mlen);
dVAR; dSP;
GV *gv;
IO *io;
- int whence = POPi;
+ const int whence = POPi;
#if LSEEKSIZE > IVSIZE
Off_t offset = (Off_t)SvNVx(POPs);
#else
{
dSP; dTARGET;
SV *argsv = POPs;
- unsigned int func = POPu;
+ const unsigned int func = POPu;
const int optype = PL_op->op_type;
char *s;
IV retval;
__attribute__nonnull__(pTHX_3);
PERL_CALLCONV bool Perl_is_utf8_alnum(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_alnumc(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_idfirst(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_idcont(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_alpha(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_ascii(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_space(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_cntrl(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_digit(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_graph(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_lower(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_print(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_punct(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_xdigit(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ const U8 *p)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV OP* Perl_jmaybe(pTHX_ OP* arg)
PERL_CALLCONV PADOFFSET Perl_find_rundefsvoffset(pTHX);
PERL_CALLCONV OP* Perl_oopsAV(pTHX_ OP* o)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV OP* Perl_oopsHV(pTHX_ OP* o)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_pad_leavemy(pTHX);
__attribute__nonnull__(pTHX_3)
__attribute__nonnull__(pTHX_4);
-PERL_CALLCONV regnode* Perl_regnext(pTHX_ regnode* p);
+PERL_CALLCONV regnode* Perl_regnext(pTHX_ regnode* p)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
PERL_CALLCONV void Perl_regprop(pTHX_ SV* sv, const regnode* o);
PERL_CALLCONV void Perl_repeatcpy(pTHX_ char* to, const char* from, I32 len, I32 count)
__attribute__nonnull__(pTHX_1)
#if defined(USE_LOCALE_COLLATE)
PERL_CALLCONV char* Perl_sv_collxfrm(pTHX_ SV* sv, STRLEN* nxp)
- __attribute__nonnull__(pTHX_1);
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
#endif
PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, const char* code, PAD** padp)
#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
STATIC void S_hsplit(pTHX_ HV *hv);
STATIC void S_hfreeentries(pTHX_ HV *hv);
-STATIC HE* S_new_he(pTHX);
-STATIC void S_del_he(pTHX_ HE *p);
-STATIC HEK* S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags);
-STATIC void S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store);
-STATIC void S_unshare_hek_or_pvn(pTHX_ HEK* hek, const char* sv, I32 len, U32 hash);
-STATIC HE* S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags);
+STATIC HE* S_new_he(pTHX)
+ __attribute__warn_unused_result__;
+
+STATIC void S_del_he(pTHX_ HE *p)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC HEK* S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC void S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2)
+ __attribute__nonnull__(pTHX_3);
+
+STATIC void S_unshare_hek_or_pvn(pTHX_ HEK* hek, const char* sv, I32 len, U32 hash)
+ __attribute__nonnull__(pTHX_2);
+
+STATIC HE* S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags)
+ __attribute__warn_unused_result__;
+
STATIC void S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const char *msg)
- __attribute__noreturn__;
+ __attribute__noreturn__
+ __attribute__nonnull__(pTHX_2)
+ __attribute__nonnull__(pTHX_4);
#endif
__attribute__nonnull__(pTHX_1);
STATIC SV* S_is_an_int(pTHX_ const char *s, STRLEN l)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
STATIC int S_div128(pTHX_ SV *pnum, bool *done)
#if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
STATIC OP* S_doform(pTHX_ CV *cv, GV *gv, OP *retop);
-STATIC int S_emulate_eaccess(pTHX_ const char* path, Mode_t mode)
- __attribute__noreturn__;
-
+STATIC int S_emulate_eaccess(pTHX_ const char* path, Mode_t mode);
# if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
STATIC int S_dooneliner(pTHX_ char *cmd, char *filename);
# endif
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);
+PERL_CALLCONV bool Perl_is_gv_magical_sv(pTHX_ SV *name, U32 flags)
+ __attribute__warn_unused_result__;
+
PERL_CALLCONV char* Perl_savesvpv(pTHX_ SV* sv);
END_EXTERN_C
+/*
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */
/* ex: set ro: */
void
Perl_reginitcolors(pTHX)
{
- int i = 0;
- char *s = PerlEnv_getenv("PERL_RE_COLORS");
-
+ const char * const s = PerlEnv_getenv("PERL_RE_COLORS");
if (s) {
- PL_colors[0] = s = savepv(s);
+ char *t = savepv(s);
+ int i = 0;
+ PL_colors[0] = t;
while (++i < 6) {
- s = strchr(s, '\t');
- if (s) {
- *s = '\0';
- PL_colors[i] = ++s;
+ t = strchr(t, '\t');
+ if (t) {
+ *t = '\0';
+ PL_colors[i] = ++t;
}
else
- PL_colors[i] = s = (char *)"";
+ PL_colors[i] = t = (char *)"";
}
} else {
+ int i = 0;
while (i < 6)
PL_colors[i++] = (char *)"";
}
!(r->reganch & ROPT_ANCH) )
{
/* turn .* into ^.* with an implied $*=1 */
- int type = OP(NEXTOPER(first));
-
- if (type == REG_ANY)
- type = ROPT_ANCH_MBOL;
- else
- type = ROPT_ANCH_SBOL;
-
+ const int type =
+ (OP(NEXTOPER(first)) == REG_ANY)
+ ? ROPT_ANCH_MBOL
+ : ROPT_ANCH_SBOL;
r->reganch |= type | ROPT_IMPLICIT;
first = NEXTOPER(first);
goto again;
&& !(data.start_class->flags & ANYOF_EOS)
&& !cl_is_anything(data.start_class))
{
- I32 n = add_data(pRExC_state, 1, "f");
+ const I32 n = add_data(pRExC_state, 1, "f");
New(1006, RExC_rx->data->data[n], 1,
struct regnode_charclass_class);
if (!(data.start_class->flags & ANYOF_EOS)
&& !cl_is_anything(data.start_class))
{
- I32 n = add_data(pRExC_state, 1, "f");
+ const I32 n = add_data(pRExC_state, 1, "f");
New(1006, RExC_rx->data->data[n], 1,
struct regnode_charclass_class);
register char op;
register char *next;
I32 flags;
- char *origparse = RExC_parse;
+ const char * const origparse = RExC_parse;
char *maxpos;
I32 min;
I32 max = REG_INFTY;
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
{
- I32 num = atoi(RExC_parse);
+ const I32 num = atoi(RExC_parse);
if (num > 9 && num >= RExC_npar)
goto defchar;
register UV ender;
register char *p;
char *oldp, *s;
- STRLEN numlen;
STRLEN foldlen;
U8 tmpbuf[UTF8_MAXBYTES_CASE+1], *foldbuf;
break;
case 'x':
if (*++p == '{') {
- char* e = strchr(p, '}');
+ char* const e = strchr(p, '}');
if (!e) {
RExC_parse = p + 1;
else {
I32 flags = PERL_SCAN_ALLOW_UNDERSCORES
| PERL_SCAN_DISALLOW_PREFIX;
- numlen = e - p - 1;
+ STRLEN numlen = e - p - 1;
ender = grok_hex(p + 1, &numlen, &flags, NULL);
if (ender > 0xff)
RExC_utf8 = 1;
}
else {
I32 flags = PERL_SCAN_DISALLOW_PREFIX;
- numlen = 2;
+ STRLEN numlen = 2;
ender = grok_hex(p, &numlen, &flags, NULL);
p += numlen;
}
if (*p == '0' ||
(isDIGIT(p[1]) && atoi(p) >= RExC_npar) ) {
I32 flags = 0;
- numlen = 3;
+ STRLEN numlen = 3;
ender = grok_oct(p, &numlen, &flags, NULL);
p += numlen;
}
default:
normal_default:
if (UTF8_IS_START(*p) && UTF) {
+ STRLEN numlen;
ender = utf8n_to_uvchr((U8*)p, RExC_end - p,
&numlen, 0);
p += numlen;
if (FOLD) {
/* Emit all the Unicode characters. */
+ STRLEN numlen;
for (foldbuf = tmpbuf;
foldlen;
foldlen -= numlen) {
if (FOLD) {
/* Emit all the Unicode characters. */
+ STRLEN numlen;
for (foldbuf = tmpbuf;
foldlen;
foldlen -= numlen) {
if (RExC_utf8)
SvUTF8_on(sv);
if (sv_utf8_downgrade(sv, TRUE)) {
- char *s = sv_recode_to_utf8(sv, PL_encoding);
- STRLEN newlen = SvCUR(sv);
+ const char * const s = sv_recode_to_utf8(sv, PL_encoding);
+ const STRLEN newlen = SvCUR(sv);
if (SvUTF8(sv))
RExC_utf8 = 1;
if (value == '[' && RExC_parse + 1 < RExC_end &&
/* I smell either [: or [= or [. -- POSIX has been here, right? */
POSIXCC(UCHARAT(RExC_parse))) {
- char c = UCHARAT(RExC_parse);
+ const char c = UCHARAT(RExC_parse);
char* s = RExC_parse++;
while (RExC_parse < RExC_end && UCHARAT(RExC_parse) != c)
/* Grandfather lone [:, [=, [. */
RExC_parse = s;
else {
- char* t = RExC_parse++; /* skip over the c */
+ const char* t = RExC_parse++; /* skip over the c */
assert(*t == c);
RExC_parse++; /* skip over the ending ] */
posixcc = s + 1;
if (*s == ':') {
- I32 complement = *posixcc == '^' ? *posixcc++ : 0;
- I32 skip = t - posixcc;
+ const I32 complement = *posixcc == '^' ? *posixcc++ : 0;
+ const I32 skip = t - posixcc;
/* Initially switch on the length of the name. */
switch (skip) {
S_checkposixcc(pTHX_ RExC_state_t *pRExC_state)
{
if (!SIZE_ONLY && POSIXCC(UCHARAT(RExC_parse))) {
- char *s = RExC_parse;
- char c = *s++;
+ const char *s = RExC_parse;
+ const char c = *s++;
while(*s && isALNUM(*s))
s++;
if (RExC_parse >= RExC_end)
vFAIL2("Empty \\%c{}", (U8)value);
if (*RExC_parse == '{') {
- U8 c = (U8)value;
+ const U8 c = (U8)value;
e = strchr(RExC_parse++, '}');
if (!e)
vFAIL2("Missing right brace on \\%c{}", c);
IV i;
if (prevvalue < 256) {
- IV ceilvalue = value < 256 ? value : 255;
+ const IV ceilvalue = value < 256 ? value : 255;
#ifdef EBCDIC
/* In EBCDIC [\x89-\x91] should include
ANYOF_BITMAP_SET(ret, i);
}
if (value > 255 || UTF) {
- UV prevnatvalue = NATIVE_TO_UNI(prevvalue);
- UV natvalue = NATIVE_TO_UNI(value);
+ const UV prevnatvalue = NATIVE_TO_UNI(prevvalue);
+ const UV natvalue = NATIVE_TO_UNI(value);
ANYOF_FLAGS(ret) |= ANYOF_UNICODE;
if (prevnatvalue < natvalue) { /* what about > ? */
if (FOLD) {
U8 foldbuf[UTF8_MAXBYTES_CASE+1];
STRLEN foldlen;
- UV f = to_uni_fold(natvalue, foldbuf, &foldlen);
+ const UV f = to_uni_fold(natvalue, foldbuf, &foldlen);
/* If folding and foldable and a single
* character, insert also the folded version
PerlIO_printf(Perl_debug_log, "with eval ");
PerlIO_printf(Perl_debug_log, "\n");
if (r->offsets) {
- U32 i;
const U32 len = r->offsets[0];
GET_RE_DEBUG_FLAGS_DECL;
DEBUG_OFFSETS_r({
+ U32 i;
PerlIO_printf(Perl_debug_log, "Offsets: [%"UVuf"]\n\t", (UV)r->offsets[0]);
for (i = 1; i <= len; i++)
PerlIO_printf(Perl_debug_log, "%"UVuf"[%"UVuf"] ",
/* Using is_utf8_string() is a crude hack but it may
* be the best for now since we have no flag "this EXACTish
* node was UTF-8" --jhi */
- bool do_utf8 = is_utf8_string((U8*)STRING(o), STR_LEN(o));
- char *s = do_utf8 ?
+ const bool do_utf8 = is_utf8_string((U8*)STRING(o), STR_LEN(o));
+ const char *s = do_utf8 ?
pv_uni_display(dsv, (U8*)STRING(o), STR_LEN(o), 60,
UNI_DISPLAY_REGEX) :
STRING(o);
U8 s[UTF8_MAXBYTES_CASE+1];
for (i = 0; i <= 256; i++) { /* just the first 256 */
- U8 *e = uvchr_to_utf8(s, i);
+ uvchr_to_utf8(s, i);
if (i < 256 && swash_fetch(sw, s, TRUE)) {
if (rangestart == -1)
if (i <= rangestart + 3)
for (; rangestart < i; rangestart++) {
+ U8 *e;
for(e = uvchr_to_utf8(s, rangestart), p = s; p < e; p++)
put_byte(sv, *p);
}
else {
+ U8 *e;
for (e = uvchr_to_utf8(s, rangestart), p = s; p < e; p++)
put_byte(sv, *p);
sv_catpv(sv, "-");
- for (e = uvchr_to_utf8(s, i - 1), p = s; p < e; p++)
- put_byte(sv, *p);
+ for (e = uvchr_to_utf8(s, i - 1), p = s; p < e; p++)
+ put_byte(sv, *p);
}
rangestart = -1;
}
while(*s && *s != '\n') s++;
if (*s == '\n') {
- char *t = ++s;
+ const char *t = ++s;
while (*s) {
if (*s == '\n')
{
/* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
- U32 i;
- GV *mgv;
REGEXP *rx;
- char digits[TYPE_CHARS(long)];
if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
+ U32 i;
for (i = 1; i <= rx->nparens; i++) {
+ GV *mgv;
+ char digits[TYPE_CHARS(long)];
sprintf(digits, "%lu", (long)i);
if ((mgv = gv_fetchpv(digits, FALSE, SVt_PV)))
save_scalar(mgv);
I32 i;
U32 paren = 0;
char *input;
- I32 tmps;
GET_RE_DEBUG_FLAGS_DECL;
/* Now restore the parentheses context. */
for (i -= (REGCP_OTHER_ELEMS - REGCP_FRAME_ELEMS);
i > 0; i -= REGCP_PAREN_ELEMS) {
+ I32 tmps;
paren = (U32)SSPOPINT;
PL_reg_start_tmp[paren] = (char *) SSPOPPTR;
PL_regstartp[paren] = SSPOPINT;
I32 ml_anch;
register char *other_last = Nullch; /* other substr checked before this */
char *check_at = Nullch; /* check substr found at this pos */
- I32 multiline = prog->reganch & PMf_MULTILINE;
+ const I32 multiline = prog->reganch & PMf_MULTILINE;
#ifdef DEBUGGING
char *i_strpos = strpos;
SV *dsv = PERL_DEBUG_PAD_ZERO(0);
}
DEBUG_EXECUTE_r({
- char *s = PL_reg_match_utf8 ?
+ const char *s = PL_reg_match_utf8 ?
sv_uni_display(dsv, sv, 60, UNI_DISPLAY_REGEX) :
strpos;
- int len = PL_reg_match_utf8 ?
+ const int len = PL_reg_match_utf8 ?
strlen(s) : strend - strpos;
if (!PL_colorset)
reginitcolors();
S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, const char *strend, I32 norun)
{
dVAR;
- I32 doevery = (prog->reganch & ROPT_SKIP) == 0;
+ const I32 doevery = (prog->reganch & ROPT_SKIP) == 0;
char *m;
STRLEN ln;
STRLEN lnc;
if (do_utf8) {
UV c, f;
U8 tmpbuf [UTF8_MAXBYTES+1];
- U8 foldbuf[UTF8_MAXBYTES_CASE+1];
STRLEN len, foldlen;
if (c1 == c2) {
&& (norun || regtry(prog, s)) )
goto got_it;
else {
+ U8 foldbuf[UTF8_MAXBYTES_CASE+1];
uvchr_to_utf8(tmpbuf, c);
f = to_utf8_fold(tmpbuf, foldbuf, &foldlen);
if ( f != c
&& (norun || regtry(prog, s)) )
goto got_it;
else {
+ U8 foldbuf[UTF8_MAXBYTES_CASE+1];
uvchr_to_utf8(tmpbuf, c);
f = to_utf8_fold(tmpbuf, foldbuf, &foldlen);
if ( f != c
register char *startpos = stringarg;
I32 minlen; /* must match at least this many chars */
I32 dontbother = 0; /* how many characters not to try at end */
- /* I32 start_shift = 0; */ /* Offset of the start to find
- constant substr. */ /* CC */
I32 end_shift = 0; /* Same for the end. */ /* CC */
I32 scream_pos = -1; /* Internal iterator of scream. */
char *scream_olds;
SV* oreplsv = GvSV(PL_replgv);
- bool do_utf8 = DO_UTF8(sv);
+ const bool do_utf8 = DO_UTF8(sv);
const I32 multiline = prog->reganch & PMf_MULTILINE;
#ifdef DEBUGGING
SV *dsv0 = PERL_DEBUG_PAD_ZERO(0);
GET_RE_DEBUG_FLAGS_DECL;
+ (void)data; /* Currently unused */
RX_MATCH_UTF8_set(prog,do_utf8);
PL_regcc = 0;
}
DEBUG_EXECUTE_r({
- char *s0 = UTF ?
- pv_uni_display(dsv0, (U8*)prog->precomp, prog->prelen, 60,
- UNI_DISPLAY_REGEX) :
- prog->precomp;
- int len0 = UTF ? SvCUR(dsv0) : prog->prelen;
- char *s1 = do_utf8 ? sv_uni_display(dsv1, sv, 60,
+ const char * const s0 = UTF
+ ? pv_uni_display(dsv0, (U8*)prog->precomp, prog->prelen, 60,
+ UNI_DISPLAY_REGEX)
+ : prog->precomp;
+ const int len0 = UTF ? SvCUR(dsv0) : prog->prelen;
+ const char * const s1 = do_utf8 ? sv_uni_display(dsv1, sv, 60,
UNI_DISPLAY_REGEX) : startpos;
- int len1 = do_utf8 ? SvCUR(dsv1) : strend - startpos;
+ const int len1 = do_utf8 ? SvCUR(dsv1) : strend - startpos;
if (!PL_colorset)
reginitcolors();
PerlIO_printf(Perl_debug_log,
DEBUG_EXECUTE_r( {
SV *prop = sv_newmortal();
- int docolor = *PL_colors[0];
- int taill = (docolor ? 10 : 7); /* 3 chars for "> <" */
+ const int docolor = *PL_colors[0];
+ const int taill = (docolor ? 10 : 7); /* 3 chars for "> <" */
int l = (PL_regeol - locinput) > taill ? taill : (PL_regeol - locinput);
/* The part of the string before starttry has one color
(pref0_len chars), between starttry and current
pref0_len = pref_len;
regprop(prop, scan);
{
- char *s0 =
+ const char * const s0 =
do_utf8 && OP(scan) != CANY ?
pv_uni_display(dsv0, (U8*)(locinput - pref_len),
pref0_len, 60, UNI_DISPLAY_REGEX) :
locinput - pref_len;
- int len0 = do_utf8 ? strlen(s0) : pref0_len;
- char *s1 = do_utf8 && OP(scan) != CANY ?
+ const int len0 = do_utf8 ? strlen(s0) : pref0_len;
+ const char * const s1 = do_utf8 && OP(scan) != CANY ?
pv_uni_display(dsv1, (U8*)(locinput - pref_len + pref0_len),
pref_len - pref0_len, 60, UNI_DISPLAY_REGEX) :
locinput - pref_len + pref0_len;
- int len1 = do_utf8 ? strlen(s1) : pref_len - pref0_len;
- char *s2 = do_utf8 && OP(scan) != CANY ?
+ const int len1 = do_utf8 ? strlen(s1) : pref_len - pref0_len;
+ const char * const s2 = do_utf8 && OP(scan) != CANY ?
pv_uni_display(dsv2, (U8*)locinput,
PL_regeol - locinput, 60, UNI_DISPLAY_REGEX) :
locinput;
- int len2 = do_utf8 ? strlen(s2) : l;
+ const int len2 = do_utf8 ? strlen(s2) : l;
PerlIO_printf(Perl_debug_log,
"%4"IVdf" <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3"IVdf":%*s%s\n",
(IV)(locinput - PL_bostr),
UV uvc = 0;
STRLEN len = 0;
STRLEN foldlen = 0;
- U8 foldbuf[ UTF8_MAXBYTES_CASE + 1 ];
U8 *uscan = (U8*)NULL;
STRLEN bufflen=0;
accepted = 0;
uscan += len;
len=0;
} else {
+ U8 foldbuf[ UTF8_MAXBYTES_CASE + 1 ];
uvc = utf8n_to_uvuni( (U8*)uc, UTF8_MAXLEN, &len, uniflags );
uvc = to_uni_fold( uvc, foldbuf, &foldlen );
foldlen -= UNISKIP( uvc );
break;
case SAVEt_FREEPV:
ptr = SSPOPPTR;
- Safefree((char*)ptr);
+ Safefree(ptr);
break;
case SAVEt_CLEARSV:
ptr = (void*)&PL_curpad[SSPOPLONG];
svanext = (SV*) SvANY(svanext);
if (!SvFAKE(sva))
- Safefree((void *)sva);
+ Safefree(sva);
}
for (arena = PL_xnv_arenaroot; arena; arena = arenanext) {
if (SvREADONLY(sv)) {
if (SvFAKE(sv)) {
char *pvx = SvPVX(sv);
- int is_utf8 = SvUTF8(sv);
+ const int is_utf8 = SvUTF8(sv);
STRLEN len = SvCUR(sv);
U32 hash = SvUVX(sv);
SvFAKE_off(sv);