Ap |char* |instr |const char* big|const char* little
p |bool |io_close |IO* io|bool not_implicit
p |OP* |invert |OP* cmd
-dp |bool |is_gv_magical |char *name|STRLEN len|U32 flags
+dp |bool |is_gv_magical |const char *name|STRLEN len|U32 flags
Ap |I32 |is_lvalue_sub
Ap |U32 |to_uni_upper_lc|U32 c
Ap |U32 |to_uni_title_lc|U32 c
Ap |bool |is_uni_print_lc|UV c
Ap |bool |is_uni_punct_lc|UV c
Ap |bool |is_uni_xdigit_lc|UV c
-Apd |STRLEN |is_utf8_char |U8 *p
-Apd |bool |is_utf8_string |U8 *s|STRLEN len
-Apd |bool |is_utf8_string_loc|U8 *s|STRLEN len|U8 **p
-Ap |bool |is_utf8_alnum |U8 *p
-Ap |bool |is_utf8_alnumc |U8 *p
-Ap |bool |is_utf8_idfirst|U8 *p
-Ap |bool |is_utf8_idcont |U8 *p
-Ap |bool |is_utf8_alpha |U8 *p
-Ap |bool |is_utf8_ascii |U8 *p
-Ap |bool |is_utf8_space |U8 *p
-Ap |bool |is_utf8_cntrl |U8 *p
-Ap |bool |is_utf8_digit |U8 *p
-Ap |bool |is_utf8_graph |U8 *p
-Ap |bool |is_utf8_upper |U8 *p
-Ap |bool |is_utf8_lower |U8 *p
-Ap |bool |is_utf8_print |U8 *p
-Ap |bool |is_utf8_punct |U8 *p
-Ap |bool |is_utf8_xdigit |U8 *p
-Ap |bool |is_utf8_mark |U8 *p
+Apd |STRLEN |is_utf8_char |const U8 *p
+Apd |bool |is_utf8_string |const U8 *s|STRLEN len
+Apd |bool |is_utf8_string_loc|const U8 *s|STRLEN len|const U8 **p
+Ap |bool |is_utf8_alnum |const U8 *p
+Ap |bool |is_utf8_alnumc |const U8 *p
+Ap |bool |is_utf8_idfirst|const U8 *p
+Ap |bool |is_utf8_idcont |const U8 *p
+Ap |bool |is_utf8_alpha |const U8 *p
+Ap |bool |is_utf8_ascii |const U8 *p
+Ap |bool |is_utf8_space |const U8 *p
+Ap |bool |is_utf8_cntrl |const U8 *p
+Ap |bool |is_utf8_digit |const U8 *p
+Ap |bool |is_utf8_graph |const U8 *p
+Ap |bool |is_utf8_upper |const U8 *p
+Ap |bool |is_utf8_lower |const U8 *p
+Ap |bool |is_utf8_print |const U8 *p
+Ap |bool |is_utf8_punct |const U8 *p
+Ap |bool |is_utf8_xdigit |const U8 *p
+Ap |bool |is_utf8_mark |const U8 *p
p |OP* |jmaybe |OP* arg
p |I32 |keyword |char* d|I32 len
Ap |void |leave_scope |I32 base
Ap |void |vload_module|U32 flags|SV* name|SV* ver|va_list* args
p |OP* |localize |OP* arg|I32 lexical
Apd |I32 |looks_like_number|SV* sv
-Apd |UV |grok_bin |char* start|STRLEN* len|I32* flags|NV *result
-Apd |UV |grok_hex |char* start|STRLEN* len|I32* flags|NV *result
+Apd |UV |grok_bin |const char* start|STRLEN* len|I32* flags|NV *result
+Apd |UV |grok_hex |const char* start|STRLEN* len|I32* flags|NV *result
Apd |int |grok_number |const char *pv|STRLEN len|UV *valuep
Apd |bool |grok_numeric_radix|const char **sp|const char *send
-Apd |UV |grok_oct |char* start|STRLEN* len|I32* flags|NV *result
+Apd |UV |grok_oct |const char* start|STRLEN* len|I32* flags|NV *result
p |int |magic_clearenv |SV* sv|MAGIC* mg
p |int |magic_clear_all_env|SV* sv|MAGIC* mg
p |int |magic_clearpack|SV* sv|MAGIC* mg
|va_list* args|SV** svargs|I32 svmax \
|bool *maybe_tainted
Ap |NV |str_to_version |SV *sv
-Ap |SV* |swash_init |char* pkg|char* name|SV* listsv \
- |I32 minbits|I32 none
-Ap |UV |swash_fetch |SV *sv|U8 *ptr|bool do_utf8
+Ap |SV* |swash_init |const char* pkg|const char* name|SV* listsv|I32 minbits|I32 none
+Ap |UV |swash_fetch |SV *sv|const U8 *ptr|bool do_utf8
Ap |void |taint_env
Ap |void |taint_proper |const char* f|const char* s
-Apd |UV |to_utf8_case |U8 *p|U8* ustrp|STRLEN *lenp \
- |SV **swash|char *normal|char *special
-Apd |UV |to_utf8_lower |U8 *p|U8* ustrp|STRLEN *lenp
-Apd |UV |to_utf8_upper |U8 *p|U8* ustrp|STRLEN *lenp
-Apd |UV |to_utf8_title |U8 *p|U8* ustrp|STRLEN *lenp
-Apd |UV |to_utf8_fold |U8 *p|U8* ustrp|STRLEN *lenp
+Apd |UV |to_utf8_case |const U8 *p|U8* ustrp|STRLEN *lenp|SV **swash|char *normal|char *special
+Apd |UV |to_utf8_lower |const U8 *p|U8* ustrp|STRLEN *lenp
+Apd |UV |to_utf8_upper |const U8 *p|U8* ustrp|STRLEN *lenp
+Apd |UV |to_utf8_title |const U8 *p|U8* ustrp|STRLEN *lenp
+Apd |UV |to_utf8_fold |const U8 *p|U8* ustrp|STRLEN *lenp
#if defined(UNLINK_ALL_VERSIONS)
Ap |I32 |unlnk |char* f
#endif
ApMd |U8* |utf8_to_bytes |U8 *s|STRLEN *len
ApMd |U8* |bytes_from_utf8|U8 *s|STRLEN *len|bool *is_utf8
ApMd |U8* |bytes_to_utf8 |const U8 *s|STRLEN *len
-Apd |UV |utf8_to_uvchr |U8 *s|STRLEN* retlen
-Apd |UV |utf8_to_uvuni |U8 *s|STRLEN* retlen
-Adp |UV |utf8n_to_uvchr |U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
-Adp |UV |utf8n_to_uvuni |U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
+Apd |UV |utf8_to_uvchr |const U8 *s|STRLEN* retlen
+Apd |UV |utf8_to_uvuni |const U8 *s|STRLEN* retlen
+Adp |UV |utf8n_to_uvchr |const U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
+Adp |UV |utf8n_to_uvuni |const U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
Apd |U8* |uvchr_to_utf8 |U8 *d|UV uv
Ap |U8* |uvuni_to_utf8 |U8 *d|UV uv
Ap |U8* |uvchr_to_utf8_flags |U8 *d|UV uv|UV flags
s |I32 |sublex_push
s |I32 |sublex_start
s |char * |filter_gets |SV *sv|PerlIO *fp|STRLEN append
-s |HV * |find_in_my_stash|char *pkgname|I32 len
-s |SV* |new_constant |char *s|STRLEN len|const char *key|SV *sv \
+s |HV * |find_in_my_stash|const char *pkgname|I32 len
+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
}
/*
-=for apidoc is_gv_magical
+=for apidoc is_gv_magical_sv
Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
=cut
*/
bool
-Perl_is_gv_magical(pTHX_ char *name, STRLEN len, U32 flags)
+Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags)
{
if (len > 1) {
const char *name1 = name + 1;
case '8':
case '9':
{
- char *end = name + len;
+ const char *end = name + len;
while (--end > name) {
if (!isDIGIT(*end))
return FALSE;
On return I<*len> is set to the length of the scanned string,
and I<*flags> gives output flags.
-If the value is <= UV_MAX it is returned as a UV, the output flags are clear,
+If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,
and nothing is written to I<*result>. If the value is > UV_MAX C<grok_bin>
returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
and writes the value to I<*result> (or the value is discarded if I<result>
*/
UV
-Perl_grok_bin(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) {
+Perl_grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) {
const char *s = start;
STRLEN len = *len_p;
UV value = 0;
NV value_nv = 0;
const UV max_div_2 = UV_MAX / 2;
- bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ const bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
bool overflowed = FALSE;
+ char bit;
if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
/* strip off leading b or 0b.
}
}
- for (; len-- && *s; s++) {
- char bit = *s;
+ for (; len-- && (bit = *s); s++) {
if (bit == '0' || bit == '1') {
/* Write it in this wonky order with a goto to attempt to get the
compiler to make the common case integer-only loop pretty tight.
*/
UV
-Perl_grok_hex(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) {
+Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) {
const char *s = start;
STRLEN len = *len_p;
UV value = 0;
NV value_nv = 0;
const UV max_div_16 = UV_MAX / 16;
- bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ const bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
bool overflowed = FALSE;
const char *hexdigit;
*/
UV
-Perl_grok_oct(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) {
+Perl_grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) {
const char *s = start;
STRLEN len = *len_p;
UV value = 0;
NV value_nv = 0;
const UV max_div_8 = UV_MAX / 8;
- bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ const bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
bool overflowed = FALSE;
for (; len-- && *s; s++) {
}
}
if (const_sv) {
- SvREFCNT_inc(const_sv);
+ (void)SvREFCNT_inc(const_sv);
if (cv) {
assert(!CvROOT(cv) && !CvCONST(cv));
sv_setpv((SV*)cv, ""); /* prototype is "" */
gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
glob_gv = gv_fetchpv("File::Glob::csh_glob", FALSE, SVt_PVCV);
GvCV(gv) = GvCV(glob_gv);
- SvREFCNT_inc((SV*)GvCV(gv));
+ (void)SvREFCNT_inc((SV*)GvCV(gv));
GvIMPORTED_CV_on(gv);
LEAVE;
}
if (namesv && namesv != &PL_sv_undef
&& *SvPVX(namesv) == '&')
{
- CV *innercv = (CV*)curpad[ix];
+ CV * const innercv = (CV*)curpad[ix];
namepad[ix] = Nullsv;
SvREFCNT_dec(namesv);
CvWEAKOUTSIDE_off(innercv);
CvOUTSIDE(innercv) = outercv;
CvOUTSIDE_SEQ(innercv) = seq;
- SvREFCNT_inc(outercv);
+ (void)SvREFCNT_inc(outercv);
}
else {
CvOUTSIDE(innercv) = Nullcv;
p = &(list->array[list->cur++]);
p->funcs = funcs;
if ((p->arg = arg)) {
- SvREFCNT_inc(arg);
+ (void)SvREFCNT_inc(arg);
}
}
On return I<*len> is set to the length of the scanned string,
and I<*flags> gives output flags.
-If the value is <= UV_MAX it is returned as a UV, the output flags are clear,
+If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,
and nothing is written to I<*result>. If the value is > UV_MAX C<grok_bin>
returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
and writes the value to I<*result> (or the value is discarded if I<result>
C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the binary
number may use '_' characters to separate digits.
- UV grok_bin(char* start, STRLEN* len, I32* flags, NV *result)
+ UV grok_bin(const char* start, STRLEN* len, I32* flags, NV *result)
=for hackers
Found in file numeric.c
C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the hex
number may use '_' characters to separate digits.
- UV grok_hex(char* start, STRLEN* len, I32* flags, NV *result)
+ UV grok_hex(const char* start, STRLEN* len, I32* flags, NV *result)
=for hackers
Found in file numeric.c
If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the octal
number may use '_' characters to separate digits.
- UV grok_oct(char* start, STRLEN* len, I32* flags, NV *result)
+ UV grok_oct(const char* start, STRLEN* len, I32* flags, NV *result)
=for hackers
Found in file numeric.c
UTF-8 character. The actual number of bytes in the UTF-8 character
will be returned if it is valid, otherwise 0.
- STRLEN is_utf8_char(U8 *p)
+ STRLEN is_utf8_char(const U8 *p)
=for hackers
Found in file utf8.c
not mean 'a string that contains code points above 0x7F encoded in UTF-8'
because a valid ASCII string is a valid UTF-8 string.
- bool is_utf8_string(U8 *s, STRLEN len)
+ bool is_utf8_string(const U8 *s, STRLEN len)
=for hackers
Found in file utf8.c
Like is_ut8_string but store the location of the failure in
the last argument.
- bool is_utf8_string_loc(U8 *s, STRLEN len, U8 **p)
+ bool is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **p)
=for hackers
Found in file utf8.c
The "normal" is a string like "ToLower" which means the swash
%utf8::ToLower.
- UV to_utf8_case(U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, char *normal, char *special)
+ UV to_utf8_case(const U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, char *normal, char *special)
=for hackers
Found in file utf8.c
The first character of the foldcased version is returned
(but note, as explained above, that there may be more.)
- UV to_utf8_fold(U8 *p, U8* ustrp, STRLEN *lenp)
+ UV to_utf8_fold(const U8 *p, U8* ustrp, STRLEN *lenp)
=for hackers
Found in file utf8.c
The first character of the lowercased version is returned
(but note, as explained above, that there may be more.)
- UV to_utf8_lower(U8 *p, U8* ustrp, STRLEN *lenp)
+ UV to_utf8_lower(const U8 *p, U8* ustrp, STRLEN *lenp)
=for hackers
Found in file utf8.c
The first character of the titlecased version is returned
(but note, as explained above, that there may be more.)
- UV to_utf8_title(U8 *p, U8* ustrp, STRLEN *lenp)
+ UV to_utf8_title(const U8 *p, U8* ustrp, STRLEN *lenp)
=for hackers
Found in file utf8.c
The first character of the uppercased version is returned
(but note, as explained above, that there may be more.)
- UV to_utf8_upper(U8 *p, U8* ustrp, STRLEN *lenp)
+ UV to_utf8_upper(const U8 *p, U8* ustrp, STRLEN *lenp)
=for hackers
Found in file utf8.c
Allows length and flags to be passed to low level routine.
- UV utf8n_to_uvchr(U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
+ UV utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
=for hackers
Found in file utf8.c
Most code should use utf8_to_uvchr() rather than call this directly.
- UV utf8n_to_uvuni(U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
+ UV utf8n_to_uvuni(const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
=for hackers
Found in file utf8.c
If C<s> does not point to a well-formed UTF-8 character, zero is
returned and retlen is set, if possible, to -1.
- UV utf8_to_uvchr(U8 *s, STRLEN* retlen)
+ UV utf8_to_uvchr(const U8 *s, STRLEN* retlen)
=for hackers
Found in file utf8.c
If C<s> does not point to a well-formed UTF-8 character, zero is
returned and retlen is set, if possible, to -1.
- UV utf8_to_uvuni(U8 *s, STRLEN* retlen)
+ UV utf8_to_uvuni(const U8 *s, STRLEN* retlen)
=for hackers
Found in file utf8.c
This assumption is met by all callers within the perl core, which all pass
pointers returned by SvPV.
- bool is_gv_magical(char *name, STRLEN len, U32 flags)
+ bool is_gv_magical(const char *name, STRLEN len, U32 flags)
+
+=for hackers
+Found in file gv.c
+
+=item is_gv_magical_sv
+
+Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
+
+ bool is_gv_magical_sv(SV *name, U32 flags)
=for hackers
Found in file gv.c
retry:
if (!CvROOT(cv) && !CvXSUB(cv)) {
- GV *gv = CvGV(cv);
- GV *autogv;
+ const GV * const gv = CvGV(cv);
if (gv) {
+ GV *autogv;
SV *tmpstr;
/* autoloaded stub? */
if (cv != GvCV(gv) && (cv = GvCV(gv)))
}
/* First do some returnish stuff. */
- SvREFCNT_inc(cv); /* avoid premature free during unwind */
+ (void)SvREFCNT_inc(cv); /* avoid premature free during unwind */
FREETMPS;
cxix = dopoptosub(cxstack_ix);
if (cxix < 0)
continue;
}
} else if (SvUTF8(sv)) { /* OP_READLINE, OP_RCATLINE */
- U8 *s = (U8*)SvPVX(sv) + offset;
- STRLEN len = SvCUR(sv) - offset;
- U8 *f;
+ const U8 *s = (U8*)SvPVX(sv) + offset;
+ const STRLEN len = SvCUR(sv) - offset;
+ const U8 *f;
if (ckWARN(WARN_UTF8) &&
!Perl_is_utf8_string_loc(aTHX_ s, len, &f))
PERL_CALLCONV char* Perl_instr(pTHX_ const char* big, const char* little);
PERL_CALLCONV bool Perl_io_close(pTHX_ IO* io, bool not_implicit);
PERL_CALLCONV OP* Perl_invert(pTHX_ OP* cmd);
-PERL_CALLCONV bool Perl_is_gv_magical(pTHX_ char *name, STRLEN len, U32 flags);
+PERL_CALLCONV bool Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags);
PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX);
PERL_CALLCONV U32 Perl_to_uni_upper_lc(pTHX_ U32 c);
PERL_CALLCONV U32 Perl_to_uni_title_lc(pTHX_ U32 c);
PERL_CALLCONV bool Perl_is_uni_print_lc(pTHX_ UV c);
PERL_CALLCONV bool Perl_is_uni_punct_lc(pTHX_ UV c);
PERL_CALLCONV bool Perl_is_uni_xdigit_lc(pTHX_ UV c);
-PERL_CALLCONV STRLEN Perl_is_utf8_char(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len);
-PERL_CALLCONV bool Perl_is_utf8_string_loc(pTHX_ U8 *s, STRLEN len, U8 **p);
-PERL_CALLCONV bool Perl_is_utf8_alnum(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_alnumc(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_idfirst(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_idcont(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_alpha(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_ascii(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_space(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_cntrl(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_digit(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_graph(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_lower(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_print(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_punct(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_xdigit(pTHX_ U8 *p);
-PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ U8 *p);
+PERL_CALLCONV STRLEN Perl_is_utf8_char(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_string(pTHX_ const U8 *s, STRLEN len);
+PERL_CALLCONV bool Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **p);
+PERL_CALLCONV bool Perl_is_utf8_alnum(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_alnumc(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_idfirst(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_idcont(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_alpha(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_ascii(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_space(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_cntrl(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_digit(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_graph(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_lower(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_print(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_punct(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_xdigit(pTHX_ const U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ const U8 *p);
PERL_CALLCONV OP* Perl_jmaybe(pTHX_ OP* arg);
PERL_CALLCONV I32 Perl_keyword(pTHX_ char* d, I32 len);
PERL_CALLCONV void Perl_leave_scope(pTHX_ I32 base);
PERL_CALLCONV void Perl_vload_module(pTHX_ U32 flags, SV* name, SV* ver, va_list* args);
PERL_CALLCONV OP* Perl_localize(pTHX_ OP* arg, I32 lexical);
PERL_CALLCONV I32 Perl_looks_like_number(pTHX_ SV* sv);
-PERL_CALLCONV UV Perl_grok_bin(pTHX_ char* start, STRLEN* len, I32* flags, NV *result);
-PERL_CALLCONV UV Perl_grok_hex(pTHX_ char* start, STRLEN* len, I32* flags, NV *result);
+PERL_CALLCONV UV Perl_grok_bin(pTHX_ const char* start, STRLEN* len, I32* flags, NV *result);
+PERL_CALLCONV UV Perl_grok_hex(pTHX_ const char* start, STRLEN* len, I32* flags, NV *result);
PERL_CALLCONV int Perl_grok_number(pTHX_ const char *pv, STRLEN len, UV *valuep);
PERL_CALLCONV bool Perl_grok_numeric_radix(pTHX_ const char **sp, const char *send);
-PERL_CALLCONV UV Perl_grok_oct(pTHX_ char* start, STRLEN* len, I32* flags, NV *result);
+PERL_CALLCONV UV Perl_grok_oct(pTHX_ const char* start, STRLEN* len, I32* flags, NV *result);
PERL_CALLCONV int Perl_magic_clearenv(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_clear_all_env(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_clearpack(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV void Perl_sv_vcatpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
PERL_CALLCONV void Perl_sv_vsetpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
PERL_CALLCONV NV Perl_str_to_version(pTHX_ SV *sv);
-PERL_CALLCONV SV* Perl_swash_init(pTHX_ char* pkg, char* name, SV* listsv, I32 minbits, I32 none);
-PERL_CALLCONV UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr, bool do_utf8);
+PERL_CALLCONV SV* Perl_swash_init(pTHX_ const char* pkg, const char* name, SV* listsv, I32 minbits, I32 none);
+PERL_CALLCONV UV Perl_swash_fetch(pTHX_ SV *sv, const U8 *ptr, bool do_utf8);
PERL_CALLCONV void Perl_taint_env(pTHX);
PERL_CALLCONV void Perl_taint_proper(pTHX_ const char* f, const char* s);
-PERL_CALLCONV UV Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, char *normal, char *special);
-PERL_CALLCONV UV Perl_to_utf8_lower(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp);
-PERL_CALLCONV UV Perl_to_utf8_upper(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp);
-PERL_CALLCONV UV Perl_to_utf8_title(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp);
-PERL_CALLCONV UV Perl_to_utf8_fold(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp);
+PERL_CALLCONV UV Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, char *normal, char *special);
+PERL_CALLCONV UV Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp);
+PERL_CALLCONV UV Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp);
+PERL_CALLCONV UV Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp);
+PERL_CALLCONV UV Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp);
#if defined(UNLINK_ALL_VERSIONS)
PERL_CALLCONV I32 Perl_unlnk(pTHX_ char* f);
#endif
PERL_CALLCONV U8* Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *len);
PERL_CALLCONV U8* Perl_bytes_from_utf8(pTHX_ U8 *s, STRLEN *len, bool *is_utf8);
PERL_CALLCONV U8* Perl_bytes_to_utf8(pTHX_ const U8 *s, STRLEN *len);
-PERL_CALLCONV UV Perl_utf8_to_uvchr(pTHX_ U8 *s, STRLEN* retlen);
-PERL_CALLCONV UV Perl_utf8_to_uvuni(pTHX_ U8 *s, STRLEN* retlen);
-PERL_CALLCONV UV Perl_utf8n_to_uvchr(pTHX_ U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags);
-PERL_CALLCONV UV Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags);
+PERL_CALLCONV UV Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN* retlen);
+PERL_CALLCONV UV Perl_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN* retlen);
+PERL_CALLCONV UV Perl_utf8n_to_uvchr(pTHX_ const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags);
+PERL_CALLCONV UV Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags);
PERL_CALLCONV U8* Perl_uvchr_to_utf8(pTHX_ U8 *d, UV uv);
PERL_CALLCONV U8* Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv);
PERL_CALLCONV U8* Perl_uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags);
STATIC I32 S_sublex_push(pTHX);
STATIC I32 S_sublex_start(pTHX);
STATIC char * S_filter_gets(pTHX_ SV *sv, PerlIO *fp, STRLEN append);
-STATIC HV * S_find_in_my_stash(pTHX_ char *pkgname, I32 len);
-STATIC SV* S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv, const char *type);
+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);
# endif
SSPUSHINT(SAVEt_AELEM);
/* if it gets reified later, the restore will have the wrong refcnt */
if (!AvREAL(av) && AvREIFY(av))
- SvREFCNT_inc(*sptr);
+ (void)SvREFCNT_inc(*sptr);
save_scalar_at(sptr);
sv = *sptr;
/* If we're localizing a tied array element, this new sv
nmg->mg_obj = (SV*)re_dup((REGEXP*)mg->mg_obj, param);
}
else if(mg->mg_type == PERL_MAGIC_backref) {
- AV *av = (AV*) mg->mg_obj;
+ const AV * const av = (AV*) mg->mg_obj;
SV **svp;
I32 i;
- SvREFCNT_inc(nmg->mg_obj = (SV*)newAV());
+ (void)SvREFCNT_inc(nmg->mg_obj = (SV*)newAV());
svp = AvARRAY(av);
for (i = AvFILLp(av); i >= 0; i--) {
if (!svp[i]) continue;
}
STATIC HV *
-S_find_in_my_stash(pTHX_ char *pkgname, I32 len)
+S_find_in_my_stash(pTHX_ const char *pkgname, I32 len)
{
GV *gv;
and type is used with error messages only. */
STATIC SV *
-S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
+S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, SV *sv, SV *pv,
const char *type)
{
dSP;
/*
-=for apidoc A|STRLEN|is_utf8_char|U8 *s
+=for apidoc A|STRLEN|is_utf8_char|const U8 *s
Tests if some arbitrary number of bytes begins in a valid UTF-8
character. Note that an INVARIANT (i.e. ASCII) character is a valid
=cut */
STRLEN
-Perl_is_utf8_char(pTHX_ U8 *s)
+Perl_is_utf8_char(pTHX_ const U8 *s)
{
U8 u = *s;
STRLEN slen, len;
}
/*
-=for apidoc A|bool|is_utf8_string|U8 *s|STRLEN len
+=for apidoc A|bool|is_utf8_string|const U8 *s|STRLEN len
Returns true if first C<len> bytes of the given string form a valid
UTF-8 string, false otherwise. Note that 'a valid UTF-8 string' does
*/
bool
-Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
+Perl_is_utf8_string(pTHX_ const U8 *s, STRLEN len)
{
- U8* x = s;
- U8* send;
+ const U8* x = s;
+ const U8* send;
STRLEN c;
if (!len && s)
}
/*
-=for apidoc A|bool|is_utf8_string_loc|U8 *s|STRLEN len|U8 **p
+=for apidoc A|bool|is_utf8_string_loc|const U8 *s|STRLEN len|const U8 **p
Like is_ut8_string but store the location of the failure in
the last argument.
*/
bool
-Perl_is_utf8_string_loc(pTHX_ U8 *s, STRLEN len, U8 **p)
+Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **p)
{
- U8* x = s;
- U8* send;
+ const U8* x = s;
+ const U8* send;
STRLEN c;
if (!len && s)
}
/*
-=for apidoc A|UV|utf8n_to_uvuni|U8 *s|STRLEN curlen|STRLEN *retlen|U32 flags
+=for apidoc A|UV|utf8n_to_uvuni|const U8 *s|STRLEN curlen|STRLEN *retlen|U32 flags
Bottom level UTF-8 decode routine.
Returns the unicode code point value of the first character in the string C<s>
*/
UV
-Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
+Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
{
- U8 *s0 = s;
+ const U8 *s0 = s;
UV uv = *s, ouv = 0;
STRLEN len = 1;
- bool dowarn = ckWARN_d(WARN_UTF8);
- UV startbyte = *s;
+ const bool dowarn = ckWARN_d(WARN_UTF8);
+ const UV startbyte = *s;
STRLEN expectlen = 0;
U32 warning = 0;
}
/*
-=for apidoc A|UV|utf8_to_uvchr|U8 *s|STRLEN *retlen
+=for apidoc A|UV|utf8_to_uvchr|const U8 *s|STRLEN *retlen
Returns the native character value of the first character in the string C<s>
which is assumed to be in UTF-8 encoding; C<retlen> will be set to the
*/
UV
-Perl_utf8_to_uvchr(pTHX_ U8 *s, STRLEN *retlen)
+Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
{
return Perl_utf8n_to_uvchr(aTHX_ s, UTF8_MAXBYTES, retlen,
ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY);
}
/*
-=for apidoc A|UV|utf8_to_uvuni|U8 *s|STRLEN *retlen
+=for apidoc A|UV|utf8_to_uvuni|const U8 *s|STRLEN *retlen
Returns the Unicode code point of the first character in the string C<s>
which is assumed to be in UTF-8 encoding; C<retlen> will be set to the
*/
UV
-Perl_utf8_to_uvuni(pTHX_ U8 *s, STRLEN *retlen)
+Perl_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
{
/* Call the low level routine asking for checks */
return Perl_utf8n_to_uvuni(aTHX_ s, UTF8_MAXBYTES, retlen,
}
bool
-Perl_is_utf8_alnum(pTHX_ U8 *p)
+Perl_is_utf8_alnum(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_alnumc(pTHX_ U8 *p)
+Perl_is_utf8_alnumc(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_idfirst(pTHX_ U8 *p) /* The naming is historical. */
+Perl_is_utf8_idfirst(pTHX_ const U8 *p) /* The naming is historical. */
{
if (*p == '_')
return TRUE;
}
bool
-Perl_is_utf8_idcont(pTHX_ U8 *p)
+Perl_is_utf8_idcont(pTHX_ const U8 *p)
{
if (*p == '_')
return TRUE;
}
bool
-Perl_is_utf8_alpha(pTHX_ U8 *p)
+Perl_is_utf8_alpha(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_ascii(pTHX_ U8 *p)
+Perl_is_utf8_ascii(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_space(pTHX_ U8 *p)
+Perl_is_utf8_space(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_digit(pTHX_ U8 *p)
+Perl_is_utf8_digit(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_upper(pTHX_ U8 *p)
+Perl_is_utf8_upper(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_lower(pTHX_ U8 *p)
+Perl_is_utf8_lower(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_cntrl(pTHX_ U8 *p)
+Perl_is_utf8_cntrl(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_graph(pTHX_ U8 *p)
+Perl_is_utf8_graph(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_print(pTHX_ U8 *p)
+Perl_is_utf8_print(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_punct(pTHX_ U8 *p)
+Perl_is_utf8_punct(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_xdigit(pTHX_ U8 *p)
+Perl_is_utf8_xdigit(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
}
bool
-Perl_is_utf8_mark(pTHX_ U8 *p)
+Perl_is_utf8_mark(pTHX_ const U8 *p)
{
if (!is_utf8_char(p))
return FALSE;
=cut */
UV
-Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *normal, char *special)
+Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *normal, char *special)
{
- UV uv0, uv1;
+ UV uv1;
U8 tmpbuf[UTF8_MAXBYTES_CASE+1];
STRLEN len = 0;
- uv0 = utf8_to_uvchr(p, 0);
+ const UV uv0 = utf8_to_uvchr(p, 0);
/* The NATIVE_TO_UNI() and UNI_TO_NATIVE() mappings
* are necessary in EBCDIC, they are redundant no-ops
* in ASCII-ish platforms, and hopefully optimized away. */
}
/*
-=for apidoc A|UV|to_utf8_upper|U8 *p|U8 *ustrp|STRLEN *lenp
+=for apidoc A|UV|to_utf8_upper|const U8 *p|U8 *ustrp|STRLEN *lenp
Convert the UTF-8 encoded character at p to its uppercase version and
store that in UTF-8 in ustrp and its length in bytes in lenp. Note
=cut */
UV
-Perl_to_utf8_upper(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp)
+Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
{
return Perl_to_utf8_case(aTHX_ p, ustrp, lenp,
&PL_utf8_toupper, "ToUpper", "utf8::ToSpecUpper");
}
/*
-=for apidoc A|UV|to_utf8_title|U8 *p|U8 *ustrp|STRLEN *lenp
+=for apidoc A|UV|to_utf8_title|const U8 *p|U8 *ustrp|STRLEN *lenp
Convert the UTF-8 encoded character at p to its titlecase version and
store that in UTF-8 in ustrp and its length in bytes in lenp. Note
=cut */
UV
-Perl_to_utf8_title(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp)
+Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
{
return Perl_to_utf8_case(aTHX_ p, ustrp, lenp,
&PL_utf8_totitle, "ToTitle", "utf8::ToSpecTitle");
}
/*
-=for apidoc A|UV|to_utf8_lower|U8 *p|U8 *ustrp|STRLEN *lenp
+=for apidoc A|UV|to_utf8_lower|const U8 *p|U8 *ustrp|STRLEN *lenp
Convert the UTF-8 encoded character at p to its lowercase version and
store that in UTF-8 in ustrp and its length in bytes in lenp. Note
=cut */
UV
-Perl_to_utf8_lower(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp)
+Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
{
return Perl_to_utf8_case(aTHX_ p, ustrp, lenp,
&PL_utf8_tolower, "ToLower", "utf8::ToSpecLower");
}
/*
-=for apidoc A|UV|to_utf8_fold|U8 *p|U8 *ustrp|STRLEN *lenp
+=for apidoc A|UV|to_utf8_fold|const U8 *p|U8 *ustrp|STRLEN *lenp
Convert the UTF-8 encoded character at p to its foldcase version and
store that in UTF-8 in ustrp and its length in bytes in lenp. Note
=cut */
UV
-Perl_to_utf8_fold(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp)
+Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
{
return Perl_to_utf8_case(aTHX_ p, ustrp, lenp,
&PL_utf8_tofold, "ToFold", "utf8::ToSpecFold");
/* a "swash" is a swatch hash */
SV*
-Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none)
+Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits, I32 none)
{
SV* retval;
SV* tokenbufsv = sv_newmortal();
dSP;
- size_t pkg_len = strlen(pkg);
- size_t name_len = strlen(name);
+ const size_t pkg_len = strlen(pkg);
+ const size_t name_len = strlen(name);
HV *stash = gv_stashpvn(pkg, pkg_len, FALSE);
SV* errsv_save;
* the lower-level routine, and it is similarly broken for returning
* multiple values. --jhi */
UV
-Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr, bool do_utf8)
+Perl_swash_fetch(pTHX_ SV *sv, const U8 *ptr, bool do_utf8)
{
HV* hv = (HV*)SvRV(sv);
U32 klen;
*/
#undef Perl_utf8n_to_uvchr
UV
-Perl_utf8n_to_uvchr(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
+Perl_utf8n_to_uvchr(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
{
UV uv = Perl_utf8n_to_uvuni(aTHX_ s, curlen, retlen, flags);
return UNI_TO_NATIVE(uv);