{
#ifdef DEBUGGING
register I32 i = stack_max - 30;
- I32 *markscan = PL_markstack + mark_min;
+ const I32 *markscan = PL_markstack + mark_min;
if (i < stack_min)
i = stack_min;
Apd |char* |sv_2pv_nolen |SV* sv
Apd |char* |sv_2pvutf8_nolen|SV* sv
Apd |char* |sv_2pvbyte_nolen|SV* sv
-Amdb |char* |sv_pv |SV *sv
-Amdb |char* |sv_pvutf8 |SV *sv
-Amdb |char* |sv_pvbyte |SV *sv
-Amdb |STRLEN |sv_utf8_upgrade|SV *sv
-ApdM |bool |sv_utf8_downgrade|SV *sv|bool fail_ok
-Apd |void |sv_utf8_encode |SV *sv
-ApdM |bool |sv_utf8_decode |SV *sv
-Apd |void |sv_force_normal|SV *sv
-Apd |void |sv_force_normal_flags|SV *sv|U32 flags
+AmdbR |char* |sv_pv |NN SV *sv
+AmdbR |char* |sv_pvutf8 |NN SV *sv
+AmdbR |char* |sv_pvbyte |NN SV *sv
+Amdb |STRLEN |sv_utf8_upgrade|NN SV *sv
+ApdM |bool |sv_utf8_downgrade|NN SV *sv|bool fail_ok
+Apd |void |sv_utf8_encode |NN SV *sv
+ApdM |bool |sv_utf8_decode |NN SV *sv
+Apd |void |sv_force_normal|NN SV *sv
+Apd |void |sv_force_normal_flags|NN SV *sv|U32 flags
Ap |void |tmps_grow |I32 n
-Apd |SV* |sv_rvweaken |SV *sv
-p |int |magic_killbackrefs|SV *sv|MAGIC *mg
+Apd |SV* |sv_rvweaken |NN SV *sv
+p |int |magic_killbackrefs|NN SV *sv|NN MAGIC *mg
Ap |OP* |newANONATTRSUB |I32 floor|OP *proto|OP *attrs|OP *block
Ap |CV* |newATTRSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block
Apr |void |newMYSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block
p |void |deb_stack_all
#ifdef PERL_IN_DEB_C
-s |void |deb_stack_n |SV** stack_base|I32 stack_min \
+s |void |deb_stack_n |NN SV** stack_base|I32 stack_min \
|I32 stack_max|I32 mark_min|I32 mark_max
#endif
pda |PADLIST*|pad_new |int flags
-pd |void |pad_undef |CV* cv
+pd |void |pad_undef |NN CV* cv
pd |PADOFFSET|pad_add_name |NN const char *name\
- |HV* typestash|HV* ourstash \
- |bool clone
-pd |PADOFFSET|pad_add_anon |SV* sv|OPCODE op_type
+ |NULLOK HV* typestash|NULLOK HV* ourstash|bool clone
+pd |PADOFFSET|pad_add_anon |NN SV* sv|OPCODE op_type
pd |void |pad_check_dup |NN const char* name|bool is_our|NN const HV* ourstash
#ifdef DEBUGGING
pd |void |pad_setsv |PADOFFSET po|NN SV* sv
#endif
pd |void |pad_block_start|int full
pd |void |pad_tidy |padtidy_type type
-pd |void |do_dump_pad |I32 level|NN PerlIO *file|PADLIST *padlist|int full
+pd |void |do_dump_pad |I32 level|NN PerlIO *file|NULLOK PADLIST *padlist|int full
pd |void |pad_fixup_inner_anons|NN PADLIST *padlist|CV *old_cv|CV *new_cv
pd |void |pad_push |NN PADLIST *padlist|int depth
pR |HV* |pad_compname_type|const PADOFFSET po
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
-sd |PADOFFSET|pad_findlex |const char *name|const CV* cv|U32 seq|int warn \
- |SV** out_capture|SV** out_name_sv \
- |int *out_flags
+sd |PADOFFSET|pad_findlex |NN const char *name|NN const CV* cv|U32 seq|int warn \
+ |NULLOK SV** out_capture|NN SV** out_name_sv \
+ |NN int *out_flags
# if defined(DEBUGGING)
sd |void |cv_dump |NN const CV *cv|NN const char *title
# endif
#endif
-pdR |CV* |find_runcv |U32 *db_seqp
+pdR |CV* |find_runcv |NULLOK U32 *db_seqp
p |void |free_tied_hv_pool
#if defined(DEBUGGING)
p |int |get_debug_opts |const char **s|bool givehelp
p |SV* |magic_scalarpack|NN HV* hv|NN MAGIC* mg
#ifdef PERL_IN_SV_C
-sMd |SV* |find_uninit_var|OP* obase|SV* uninit_sv|bool top
+sMd |SV* |find_uninit_var|NULLOK OP* obase|NULLOK SV* uninit_sv|bool top
#endif
#ifdef PERL_NEED_MY_HTOLE16
np |long |my_betohl |long n
#endif
-np |void |my_swabn |void* ptr|int n
+np |void |my_swabn |NN void* ptr|int n
-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
+ApR |GV* |gv_fetchpvn_flags|NN const char* name|STRLEN len|I32 flags|I32 sv_type
+ApR |GV* |gv_fetchsv|NN SV *name|I32 flags|I32 sv_type
dpR |bool |is_gv_magical_sv|NN SV *name|U32 flags
ApR |bool |stashpv_hvname_match|NN const COP *cop|NN const HV *hv
Perl_is_gv_magical_sv(pTHX_ SV *name, U32 flags)
{
STRLEN len;
- const char *temp = SvPV_const(name, len);
+ const char * const temp = SvPV_const(name, len);
return is_gv_magical(temp, len, flags);
}
Perl_pad_undef(pTHX_ CV* cv)
{
I32 ix;
- const PADLIST *padlist = CvPADLIST(cv);
+ const PADLIST * const padlist = CvPADLIST(cv);
if (!padlist)
return;
Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
{
PADOFFSET ix;
- SV* name;
-
- name = NEWSV(1106, 0);
+ SV* const name = NEWSV(1106, 0);
sv_upgrade(name, SVt_PVNV);
sv_setpvn(name, "&", 1);
SvIV_set(name, -1);
I32 offset, new_offset;
SV *new_capture;
SV **new_capturep;
- const AV *padlist = CvPADLIST(cv);
+ const AV * const padlist = CvPADLIST(cv);
*out_flags = 0;
return FALSE;
e = (const U8 *) SvEND(sv);
while (c < e) {
- U8 ch = *c++;
+ const U8 ch = *c++;
if (!UTF8_IS_INVARIANT(ch)) {
SvUTF8_on(sv);
break;
if (SvREADONLY(sv)) {
/* At this point I believe I should acquire a global SV mutex. */
if (SvFAKE(sv)) {
- const char *pvx = SvPVX_const(sv);
+ const char * const pvx = SvPVX_const(sv);
const STRLEN len = SvLEN(sv);
const STRLEN cur = SvCUR(sv);
SV * const next = SV_COW_NEXT_SV(sv); /* next COW sv in the loop. */
#else
if (SvREADONLY(sv)) {
if (SvFAKE(sv)) {
- const char *pvx = SvPVX_const(sv);
+ const char * const pvx = SvPVX_const(sv);
const STRLEN len = SvCUR(sv);
SvFAKE_off(sv);
SvREADONLY_off(sv);
Andreas would like keys he put in as utf8 to come back as utf8
*/
STRLEN utf8_len = HEK_LEN(hek);
- U8 *as_utf8 = bytes_to_utf8 ((U8*)HEK_KEY(hek), &utf8_len);
- SV *sv = newSVpvn ((char*)as_utf8, utf8_len);
+ const U8 *as_utf8 = bytes_to_utf8 ((U8*)HEK_KEY(hek), &utf8_len);
+ SV * const sv = newSVpvn ((const char*)as_utf8, utf8_len);
SvUTF8_on (sv);
Safefree (as_utf8); /* bytes_to_utf8() allocates a new string */
that would contain the (wrong) hash value, and might get passed
into an hv routine with a regular hash */
- SV *sv = newSVpvn (HEK_KEY(hek), HEK_LEN(hek));
+ SV * const sv = newSVpvn (HEK_KEY(hek), HEK_LEN(hek));
if (HEK_UTF8(hek))
SvUTF8_on (sv);
return sv;
STRLEN len;
if (SvREADONLY(sv) && !(flags & SV_MUTABLE_RETURN)) {
+ const char * const ref = sv_reftype(sv,0);
if (PL_op)
Perl_croak(aTHX_ "Can't coerce readonly %s to string in %s",
- sv_reftype(sv,0), OP_NAME(PL_op));
+ ref, OP_NAME(PL_op));
else
- Perl_croak(aTHX_ "Can't coerce readonly %s to string",
- sv_reftype(sv,0));
+ Perl_croak(aTHX_ "Can't coerce readonly %s to string", ref);
}
- if (SvTYPE(sv) > SVt_PVLV && SvTYPE(sv) != SVt_PVFM) {
+ if (SvTYPE(sv) > SVt_PVLV && SvTYPE(sv) != SVt_PVFM)
Perl_croak(aTHX_ "Can't coerce %s to string in %s", sv_reftype(sv,0),
OP_NAME(PL_op));
- }
- else
- s = sv_2pv_flags(sv, &len, flags);
+ s = sv_2pv_flags(sv, &len, flags);
if (lp)
*lp = len;
void
Perl_sv_unref_flags(pTHX_ SV *ref, U32 flags)
{
- SV* target = SvRV(ref);
+ SV* const target = SvRV(ref);
if (SvWEAKREF(ref)) {
sv_del_backref(target, ref);
Perl_sv_untaint(pTHX_ SV *sv)
{
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) {
- MAGIC *mg = mg_find(sv, PERL_MAGIC_taint);
+ MAGIC * const mg = mg_find(sv, PERL_MAGIC_taint);
if (mg)
mg->mg_len &= ~1;
}
{
char buf[TYPE_CHARS(UV)];
char *ebuf;
- char *ptr = uiv_2buf(buf, iv, 0, 0, &ebuf);
+ char * const ptr = uiv_2buf(buf, iv, 0, 0, &ebuf);
sv_setpvn(sv, ptr, ebuf - ptr);
}
{
char buf[TYPE_CHARS(UV)];
char *ebuf;
- char *ptr = uiv_2buf(buf, iv, 0, 0, &ebuf);
+ char * const ptr = uiv_2buf(buf, iv, 0, 0, &ebuf);
sv_setpvn(sv, ptr, ebuf - ptr);
SvSETMAGIC(sv);
s = skipspace(s);
if ((PL_expect != XREF || PL_oldoldbufptr == PL_last_lop) && intuit_more(s)) {
- char *t;
if (*s == '[') {
PL_tokenbuf[0] = '@';
if (ckWARN(WARN_SYNTAX)) {
+ char *t;
for(t = s + 1;
isSPACE(*t) || isALNUM_lazy_if(t,UTF) || *t == '$';
t++) ;
}
}
else if (*s == '{') {
+ char *t;
PL_tokenbuf[0] = '%';
if (ckWARN(WARN_SYNTAX) && strEQ(PL_tokenbuf+1, "SIG") &&
(t = strchr(s, '}')) && (t = strchr(t, '=')))
/* might be an "our" variable" */
if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
/* build ops for a bareword */
- HV *stash = PAD_COMPNAME_OURSTASH(tmp);
- HEK *stashname = HvNAME_HEK(stash);
- SV *sym = newSVhek(stashname);
+ HV * const stash = PAD_COMPNAME_OURSTASH(tmp);
+ HEK * const stashname = HvNAME_HEK(stash);
+ SV * const sym = newSVhek(stashname);
sv_catpvn(sym, "::", 2);
sv_catpv(sym, PL_tokenbuf+1);
yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
void
Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
{
- const char *func =
+ const char * const func =
op == OP_READLINE ? "readline" : /* "<HANDLE>" not nice */
op == OP_LEAVEWRITE ? "write" : /* "write exit" not nice */
PL_op_desc[op];
- const char *pars = OP_IS_FILETEST(op) ? "" : "()";
- const char *type = OP_IS_SOCKET(op)
+ const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
+ const char * const type = OP_IS_SOCKET(op)
|| (gv && io && IoTYPE(io) == IoTYPE_SOCKET)
? "socket" : "filehandle";
- const char *name = NULL;
-
- if (gv && isGV(gv)) {
- name = GvENAME(gv);
- }
+ const char * const name = gv && isGV(gv) ? GvENAME(gv) : NULL;
if (op == OP_phoney_OUTPUT_ONLY || op == OP_phoney_INPUT_ONLY) {
if (ckWARN(WARN_IO)) {
- const char *direction = (op == OP_phoney_INPUT_ONLY) ? "in" : "out";
+ const char * const direction = (op == OP_phoney_INPUT_ONLY) ? "in" : "out";
if (name && *name)
Perl_warner(aTHX_ packWARN(WARN_IO),
"Filehandle %s opened only for %sput",