Ap |void |free_tmps
p |OP* |gen_constant_list|OP* o
#if !defined(HAS_GETENV_LEN)
-p |char* |getenv_len |const char* key|unsigned long *len
+p |char* |getenv_len |NN const char* key|NN unsigned long *len
#endif
Ap |void |gp_free |GV* gv
Ap |GP* |gp_ref |GP* gp
p |int |magic_freeregexp|SV* sv|MAGIC* mg
p |int |magic_freeovrld|SV* sv|MAGIC* mg
p |int |magic_get |SV* sv|MAGIC* mg
-p |int |magic_getarylen|SV* sv|MAGIC* mg
+p |int |magic_getarylen|NN SV* sv|NN const MAGIC* mg
p |int |magic_getdefelem|SV* sv|MAGIC* mg
p |int |magic_getglob |SV* sv|MAGIC* mg
p |int |magic_getnkeys |SV* sv|MAGIC* mg
Apd |CV* |get_cv |const char* name|I32 create
Ap |int |init_i18nl10n |int printwarn
Ap |int |init_i18nl14n |int printwarn
-Ap |void |new_collate |NN char* newcoll
-Ap |void |new_ctype |NN char* newctype
-Ap |void |new_numeric |NN char* newcoll
+Ap |void |new_collate |NULLOK const char* newcoll
+Ap |void |new_ctype |NN const char* newctype
+Ap |void |new_numeric |NULLOK const char* newcoll
Ap |void |set_numeric_local
Ap |void |set_numeric_radix
Ap |void |set_numeric_standard
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
+Ap |void |taint_proper |NULLOK const char* f|NN const char* s
Apd |UV |to_utf8_case |NN const U8 *p|NN U8* ustrp|STRLEN *lenp|SV **swash|const char *normal|const char *special
Apd |UV |to_utf8_lower |NN const U8 *p|NN U8* ustrp|STRLEN *lenp
Apd |UV |to_utf8_upper |NN const U8 *p|NN U8* ustrp|STRLEN *lenp
s |int |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char *meth
s |int |magic_methcall |NN SV *sv|NN const MAGIC *mg|NN const char *meth|I32 f \
|int n|SV *val
+s |void |restore_magic |NN const void *p
+s |void |unwind_handler_stack|NN const void *p
+
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
#if defined(USE_LOCALE_NUMERIC) || defined(USE_LOCALE_COLLATE)
-s |char* |stdize_locale |char* locs
+s |char* |stdize_locale |NN char* locs
#endif
#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
-s |COP* |closest_cop |COP *cop|OP *o
+s |COP* |closest_cop |NN COP *cop|NULLOK const OP *o
s |SV* |mess_alloc
#endif
#define save_magic S_save_magic
#define magic_methpack S_magic_methpack
#define magic_methcall S_magic_methcall
+#define restore_magic S_restore_magic
+#define unwind_handler_stack S_unwind_handler_stack
#endif
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
#define save_magic(a,b) S_save_magic(aTHX_ a,b)
#define magic_methpack(a,b,c) S_magic_methpack(aTHX_ a,b,c)
#define magic_methcall(a,b,c,d,e,f) S_magic_methcall(aTHX_ a,b,c,d,e,f)
+#define restore_magic(a) S_restore_magic(aTHX_ a)
+#define unwind_handler_stack(a) S_unwind_handler_stack(aTHX_ a)
#endif
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
{
local *FH;
open FH, "> $source_file" or die "Can't create $source_file: $!";
- print FH "int boot_compilet() { return 1; }\n";
+ print FH "int boot_compilet(void) { return 1; }\n";
close FH;
}
ok -e $source_file;
STATIC char *
S_stdize_locale(pTHX_ char *locs)
{
- char *s;
+ const char *s = strchr(locs, '=');
bool okay = TRUE;
- if ((s = strchr(locs, '='))) {
- char *t;
-
+ if (s) {
+ const char * const t = strchr(s, '.');
okay = FALSE;
- if ((t = strchr(s, '.'))) {
- char *u;
-
- if ((u = strchr(t, '\n'))) {
-
- if (u[1] == 0) {
- STRLEN len = u - s;
- Move(s + 1, locs, len, char);
- locs[len] = 0;
- okay = TRUE;
- }
+ if (t) {
+ const char * const u = strchr(t, '\n');
+ if (u && (u[1] == 0)) {
+ const STRLEN len = u - s;
+ Move(s + 1, locs, len, char);
+ locs[len] = 0;
+ okay = TRUE;
}
}
}
* Set up for a new numeric locale.
*/
void
-Perl_new_numeric(pTHX_ char *newnum)
+Perl_new_numeric(pTHX_ const char *newnum)
{
#ifdef USE_LOCALE_NUMERIC
* Set up for a new ctype locale.
*/
void
-Perl_new_ctype(pTHX_ char *newctype)
+Perl_new_ctype(pTHX_ const char *newctype)
{
#ifdef USE_LOCALE_CTYPE
dVAR;
}
#endif /* USE_LOCALE_CTYPE */
- (void)newctype;
+ PERL_UNUSED_ARG(newctype);
}
/*
* Set up for a new collation locale.
*/
void
-Perl_new_collate(pTHX_ char *newcoll)
+Perl_new_collate(pTHX_ const char *newcoll)
{
#ifdef USE_LOCALE_COLLATE
/* 50: surely no system expands a char more. */
#define XFRMBUFSIZE (2 * 50)
char xbuf[XFRMBUFSIZE];
- Size_t fa = strxfrm(xbuf, "a", XFRMBUFSIZE);
- Size_t fb = strxfrm(xbuf, "ab", XFRMBUFSIZE);
- SSize_t mult = fb - fa;
+ const Size_t fa = strxfrm(xbuf, "a", XFRMBUFSIZE);
+ const Size_t fb = strxfrm(xbuf, "ab", XFRMBUFSIZE);
+ const SSize_t mult = fb - fa;
if (mult < 1)
Perl_croak(aTHX_ "strxfrm() gets absurd");
PL_collxfrm_base = (fa > (Size_t)mult) ? (fa - mult) : 0;
Signal_t Perl_csighandler(int sig);
-static void restore_magic(pTHX_ const void *p);
-static void unwind_handler_stack(pTHX_ const void *p);
-
#ifdef __Lynx__
/* Missing protos on LynxOS */
void setruid(uid_t id);
sv_force_normal(sv);
#endif
- SAVEDESTRUCTOR_X(restore_magic, INT2PTR(void*, (IV)mgs_ix));
+ SAVEDESTRUCTOR_X(S_restore_magic, INT2PTR(void*, (IV)mgs_ix));
mgs = SSPTR(mgs_ix, MGS*);
mgs->mgs_sv = sv;
}
}
- restore_magic(aTHX_ INT2PTR(void *, (IV)mgs_ix));
+ restore_magic(INT2PTR(void *, (IV)mgs_ix));
if (SvREFCNT(sv) == 1) {
/* We hold the last reference to this SV, which implies that the
CALL_FPTR(vtbl->svt_set)(aTHX_ sv, mg);
}
- restore_magic(aTHX_ INT2PTR(void*, (IV)mgs_ix));
+ restore_magic(INT2PTR(void*, (IV)mgs_ix));
return 0;
}
save_magic(mgs_ix, sv);
/* omit MGf_GSKIP -- not changed here */
len = CALL_FPTR(vtbl->svt_len)(aTHX_ sv, mg);
- restore_magic(aTHX_ INT2PTR(void*, (IV)mgs_ix));
+ restore_magic(INT2PTR(void*, (IV)mgs_ix));
return len;
}
}
save_magic(mgs_ix, sv);
/* omit MGf_GSKIP -- not changed here */
len = CALL_FPTR(vtbl->svt_len)(aTHX_ sv, mg);
- restore_magic(aTHX_ INT2PTR(void*, (IV)mgs_ix));
+ restore_magic(INT2PTR(void*, (IV)mgs_ix));
return len;
}
}
CALL_FPTR(vtbl->svt_clear)(aTHX_ sv, mg);
}
- restore_magic(aTHX_ INT2PTR(void*, (IV)mgs_ix));
+ restore_magic(INT2PTR(void*, (IV)mgs_ix));
return 0;
}
Perl_magic_regdata_cnt(pTHX_ SV *sv, MAGIC *mg)
{
register const REGEXP *rx;
- (void)sv;
+ PERL_UNUSED_ARG(sv);
if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
if (mg->mg_obj) /* @+ */
i = s;
if (i > 0 && RX_MATCH_UTF8(rx)) {
- char *b = rx->subbeg;
+ const char * const b = rx->subbeg;
if (b)
i = Perl_utf8_length(aTHX_ (U8*)b, (U8*)(b+i));
}
int
Perl_magic_regdatum_set(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv; (void)mg;
+ PERL_UNUSED_ARG(sv); PERL_UNUSED_ARG(mg);
Perl_croak(aTHX_ PL_no_modify);
NORETURN_FUNCTION_END;
}
}
#else
{
- int saveerrno = errno;
+ const int saveerrno = errno;
sv_setnv(sv, (NV)errno);
sv_setpv(sv, errno ? Strerror(errno) : "");
errno = saveerrno;
sv_setpv(sv, errno ? Strerror(errno) : "");
#else
{
- int saveerrno = errno;
+ const int saveerrno = errno;
sv_setnv(sv, (NV)errno);
#ifdef OS2
if (errno == errno_isOS2 || errno == errno_isOS2_set)
int
Perl_magic_getuvar(pTHX_ SV *sv, MAGIC *mg)
{
- struct ufuncs *uf = (struct ufuncs *)mg->mg_ptr;
+ struct ufuncs * const uf = (struct ufuncs *)mg->mg_ptr;
if (uf && uf->uf_val)
(*uf->uf_val)(aTHX_ uf->uf_index, sv);
}
#endif /* VMS */
if (s && klen == 4 && strEQ(ptr,"PATH")) {
- const char *strend = s + len;
+ const char * const strend = s + len;
while (s < strend) {
char tmpbuf[256];
int
Perl_magic_clearenv(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv;
+ PERL_UNUSED_ARG(sv);
my_setenv(MgPV_nolen_const(mg),Nullch);
return 0;
}
# endif /* PERL_IMPLICIT_SYS || WIN32 */
#endif /* VMS || EPOC */
#endif /* !PERL_MICRO */
- (void)sv;
- (void)mg;
+ PERL_UNUSED_ARG(sv);
+ PERL_UNUSED_ARG(mg);
return 0;
}
int
Perl_magic_getsig(pTHX_ SV *sv, MAGIC *mg)
{
- I32 i;
/* Are we fetching a signal entry? */
- i = whichsig(MgPV_nolen_const(mg));
+ const I32 i = whichsig(MgPV_nolen_const(mg));
if (i > 0) {
if(PL_psig_ptr[i])
sv_setsv(sv,PL_psig_ptr[i]);
* refactoring might be in order.
*/
dVAR;
- register const char *s = MgPV_nolen_const(mg);
- (void)sv;
+ register const char * const s = MgPV_nolen_const(mg);
+ PERL_UNUSED_ARG(sv);
if (*s == '_') {
SV** svp = 0;
if (strEQ(s,"__DIE__"))
else
Perl_croak(aTHX_ "No such hook: %s", s);
if (svp && *svp) {
- SV *to_dec = *svp;
+ SV * const to_dec = *svp;
*svp = 0;
SvREFCNT_dec(to_dec);
}
}
else {
- I32 i;
/* Are we clearing a signal entry? */
- i = whichsig(s);
+ const I32 i = whichsig(s);
if (i > 0) {
#ifdef HAS_SIGPROCMASK
sigset_t set, save;
int
Perl_magic_setisa(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv;
- (void)mg;
+ PERL_UNUSED_ARG(sv);
+ PERL_UNUSED_ARG(mg);
PL_sub_generation++;
return 0;
}
int
Perl_magic_setamagic(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv;
- (void)mg;
+ PERL_UNUSED_ARG(sv);
+ PERL_UNUSED_ARG(mg);
/* HV_badAMAGIC_on(Sv_STASH(sv)); */
PL_amagic_generation++;
{
HV * const hv = (HV*)LvTARG(sv);
I32 i = 0;
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (hv) {
(void) hv_iterinit(hv);
int
Perl_magic_setnkeys(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (LvTARG(sv)) {
hv_ksplit((HV*)LvTARG(sv), SvIV(sv));
}
{
dVAR; dSP;
SV *retval = &PL_sv_undef;
- SV *tied = SvTIED_obj((SV*)hv, mg);
- HV *pkg = SvSTASH((SV*)SvRV(tied));
+ SV * const tied = SvTIED_obj((SV*)hv, mg);
+ HV * const pkg = SvSTASH((SV*)SvRV(tied));
if (!gv_fetchmethod_autoload(pkg, "SCALAR", FALSE)) {
SV *key;
int
Perl_magic_setdbline(pTHX_ SV *sv, MAGIC *mg)
{
- OP *o;
- I32 i;
- GV* gv;
- SV** svp;
-
- gv = PL_DBline;
- i = SvTRUE(sv);
- svp = av_fetch(GvAV(gv),
+ GV * const gv = PL_DBline;
+ const I32 i = SvTRUE(sv);
+ SV ** const svp = av_fetch(GvAV(gv),
atoi(MgPV_nolen_const(mg)), FALSE);
- if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp)))) {
- /* set or clear breakpoint in the relevant control op */
- if (i)
- o->op_flags |= OPf_SPECIAL;
- else
- o->op_flags &= ~OPf_SPECIAL;
+ if (svp && SvIOKp(*svp)) {
+ OP * const o = INT2PTR(OP*,SvIVX(*svp));
+ if (o) {
+ /* set or clear breakpoint in the relevant control op */
+ if (i)
+ o->op_flags |= OPf_SPECIAL;
+ else
+ o->op_flags &= ~OPf_SPECIAL;
+ }
}
return 0;
}
int
-Perl_magic_getarylen(pTHX_ SV *sv, MAGIC *mg)
+Perl_magic_getarylen(pTHX_ SV *sv, const MAGIC *mg)
{
- AV *obj = (AV*)mg->mg_obj;
+ const AV * const obj = (AV*)mg->mg_obj;
if (obj) {
sv_setiv(sv, AvFILL(obj) + PL_curcop->cop_arybase);
} else {
int
Perl_magic_setarylen(pTHX_ SV *sv, MAGIC *mg)
{
- AV *obj = (AV*)mg->mg_obj;
+ AV * const obj = (AV*)mg->mg_obj;
if (obj) {
av_fill(obj, SvIV(sv) - PL_curcop->cop_arybase);
} else {
int
Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg)
{
- SV* lsv = LvTARG(sv);
+ SV* const lsv = LvTARG(sv);
if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) {
mg = mg_find(lsv, PERL_MAGIC_regex_global);
int
Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg)
{
- SV* lsv = LvTARG(sv);
+ SV* const lsv = LvTARG(sv);
SSize_t pos;
STRLEN len;
STRLEN ulen = 0;
int
Perl_magic_getglob(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (SvFAKE(sv)) { /* FAKE globs can get coerced */
SvFAKE_off(sv);
gv_efullname3(sv,((GV*)sv), "*");
Perl_magic_setglob(pTHX_ SV *sv, MAGIC *mg)
{
GV* gv;
- (void)mg;
-
+ PERL_UNUSED_ARG(mg);
+
if (!SvOK(sv))
return 0;
gv = gv_fetchsv(sv,TRUE, SVt_PVGV);
const char * const tmps = SvPV_const(lsv,len);
I32 offs = LvTARGOFF(sv);
I32 rem = LvTARGLEN(sv);
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (SvUTF8(lsv))
sv_pos_u2b(lsv, &offs, &rem);
SV * const lsv = LvTARG(sv);
I32 lvoff = LvTARGOFF(sv);
I32 lvlen = LvTARGLEN(sv);
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (DO_UTF8(sv)) {
sv_utf8_upgrade(lsv);
int
Perl_magic_gettaint(pTHX_ SV *sv, MAGIC *mg)
{
+ PERL_UNUSED_ARG(sv);
TAINT_IF(mg->mg_len & 1);
return 0;
}
int
Perl_magic_settaint(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv;
+ PERL_UNUSED_ARG(sv);
if (PL_tainted)
mg->mg_len |= 1;
else
Perl_magic_getvec(pTHX_ SV *sv, MAGIC *mg)
{
SV * const lsv = LvTARG(sv);
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (!lsv) {
SvOK_off(sv);
int
Perl_magic_setvec(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
do_vecset(sv); /* XXX slurp this routine */
return 0;
}
SV *targ = Nullsv;
if (LvTARGLEN(sv)) {
if (mg->mg_obj) {
- SV *ahv = LvTARG(sv);
- HE *he = hv_fetch_ent((HV*)ahv, mg->mg_obj, FALSE, 0);
+ SV * const ahv = LvTARG(sv);
+ HE * const he = hv_fetch_ent((HV*)ahv, mg->mg_obj, FALSE, 0);
if (he)
targ = HeVAL(he);
}
else {
- AV* av = (AV*)LvTARG(sv);
+ AV* const av = (AV*)LvTARG(sv);
if ((I32)LvTARGOFF(sv) <= AvFILL(av))
targ = AvARRAY(av)[LvTARGOFF(sv)];
}
int
Perl_magic_setdefelem(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
if (LvTARGLEN(sv))
vivify_defelem(sv);
if (LvTARG(sv)) {
if (!LvTARGLEN(sv) || !(mg = mg_find(sv, PERL_MAGIC_defelem)))
return;
if (mg->mg_obj) {
- SV *ahv = LvTARG(sv);
- HE *he = hv_fetch_ent((HV*)ahv, mg->mg_obj, TRUE, 0);
+ SV * const ahv = LvTARG(sv);
+ HE * const he = hv_fetch_ent((HV*)ahv, mg->mg_obj, TRUE, 0);
if (he)
value = HeVAL(he);
if (!value || value == &PL_sv_undef)
Perl_croak(aTHX_ PL_no_helem_sv, mg->mg_obj);
}
else {
- AV* av = (AV*)LvTARG(sv);
+ AV* const av = (AV*)LvTARG(sv);
if ((I32)LvTARGLEN(sv) < 0 && (I32)LvTARGOFF(sv) > AvFILL(av))
LvTARG(sv) = Nullsv; /* array can't be extended */
else {
int
Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg)
{
- AV *av = (AV*)mg->mg_obj;
- SV **svp = AvARRAY(av);
+ AV * const av = (AV*)mg->mg_obj;
+ SV ** const svp = AvARRAY(av);
I32 i = AvFILLp(av);
- (void)sv;
+ PERL_UNUSED_ARG(sv);
while (i >= 0) {
if (svp[i]) {
int
Perl_magic_setbm(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
sv_unmagic(sv, PERL_MAGIC_bm);
SvVALID_off(sv);
return 0;
int
Perl_magic_setfm(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
sv_unmagic(sv, PERL_MAGIC_fm);
SvCOMPILED_off(sv);
return 0;
int
Perl_magic_setregexp(pTHX_ SV *sv, MAGIC *mg)
{
- (void)mg;
+ PERL_UNUSED_ARG(mg);
sv_unmagic(sv, PERL_MAGIC_qr);
return 0;
}
int
Perl_magic_freeregexp(pTHX_ SV *sv, MAGIC *mg)
{
- regexp *re = (regexp *)mg->mg_obj;
+ regexp * const re = (regexp *)mg->mg_obj;
+ PERL_UNUSED_ARG(sv);
+
ReREFCNT_dec(re);
- (void)sv;
return 0;
}
* RenE<eacute> Descartes said "I think not."
* and vanished with a faint plop.
*/
- (void)sv;
+ PERL_UNUSED_ARG(sv);
if (mg->mg_ptr) {
Safefree(mg->mg_ptr);
mg->mg_ptr = NULL;
int
Perl_magic_setutf8(pTHX_ SV *sv, MAGIC *mg)
{
- (void)sv;
+ PERL_UNUSED_ARG(sv);
Safefree(mg->mg_ptr); /* The mg_ptr holds the pos cache. */
mg->mg_ptr = 0;
mg->mg_len = -1; /* The mg_len holds the len cache. */
break;
case '|':
{
- IO *io = GvIOp(PL_defoutgv);
+ IO * const io = GvIOp(PL_defoutgv);
if(!io)
break;
if ((SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)) == 0)
#endif
dSP;
GV *gv = Nullgv;
- HV *st;
- SV *sv = Nullsv, *tSv = PL_Sv;
+ SV *sv = Nullsv;
+ SV * const tSv = PL_Sv;
CV *cv = Nullcv;
OP *myop = PL_op;
U32 flags = 0;
- XPV *tXpv = PL_Xpv;
+ XPV * const tXpv = PL_Xpv;
if (PL_savestack_ix + 15 <= PL_savestack_max)
flags |= 1;
infinity, so we fix 4 (in fact 5): */
if (flags & 1) {
PL_savestack_ix += 5; /* Protect save in progress. */
- SAVEDESTRUCTOR_X(unwind_handler_stack, (void*)&flags);
+ SAVEDESTRUCTOR_X(S_unwind_handler_stack, (void*)&flags);
}
if (flags & 4)
PL_markstack_ptr++; /* Protect mark. */
PL_scopestack_ix += 1;
/* sv_2cv is too complicated, try a simpler variant first: */
if (!SvROK(PL_psig_ptr[sig]) || !(cv = (CV*)SvRV(PL_psig_ptr[sig]))
- || SvTYPE(cv) != SVt_PVCV)
+ || SvTYPE(cv) != SVt_PVCV) {
+ HV *st;
cv = sv_2cv(PL_psig_ptr[sig],&st,&gv,TRUE);
+ }
if (!cv || !CvROOT(cv)) {
if (ckWARN(WARN_SIGNAL))
static void
-restore_magic(pTHX_ const void *p)
+S_restore_magic(pTHX_ const void *p)
{
- MGS* mgs = SSPTR(PTR2IV(p), MGS*);
- SV* sv = mgs->mgs_sv;
+ MGS* const mgs = SSPTR(PTR2IV(p), MGS*);
+ SV* const sv = mgs->mgs_sv;
if (!sv)
return;
}
static void
-unwind_handler_stack(pTHX_ const void *p)
+S_unwind_handler_stack(pTHX_ const void *p)
{
dVAR;
const U32 flags = *(const U32*)p;
else
return 0;
# else
- (void)fp;
- (void)iotype;
- (void)mode;
+ PERL_UNUSED_ARG(fp);
+ PERL_UNUSED_ARG(iotype);
+ PERL_UNUSED_ARG(mode);
return 1;
# endif
#endif
PerlIO_binmode(pTHX_ PerlIO *fp, int iotype, int mode, const char *names)
{
#ifdef USE_SFIO
- (void)iotype;
- (void)mode;
- (void)names;
+ PERL_UNUSED_ARG(iotype);
+ PERL_UNUSED_ARG(mode);
+ PERL_UNUSED_ARG(names);
return 1;
#else
return perlsio_binmode(fp, iotype, mode);
IV
PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
- (void)mode;
- (void)arg;
- (void)tab;
+ PERL_UNUSED_ARG(mode);
+ PERL_UNUSED_ARG(arg);
+ PERL_UNUSED_ARG(tab);
if (PerlIOValid(f)) {
PerlIO_flush(f);
PerlIO_pop(aTHX_ f);
IV
PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
- (void)mode;
- (void)arg;
- (void)tab;
+ PERL_UNUSED_ARG(mode);
+ PERL_UNUSED_ARG(arg);
+ PERL_UNUSED_ARG(tab);
if (PerlIOValid(f)) {
PerlIO *t;
{
int code = 0;
while (n < max) {
- PerlIO_funcs *tab = PerlIO_layer_fetch(aTHX_ layers, n, NULL);
+ PerlIO_funcs * const tab = PerlIO_layer_fetch(aTHX_ layers, n, NULL);
if (tab) {
if (!PerlIO_push(aTHX_ f, tab, mode, PerlIOArg)) {
code = -1;
{
int code = 0;
if (f && names) {
- PerlIO_list_t *layers = PerlIO_list_alloc(aTHX);
+ PerlIO_list_t * const layers = PerlIO_list_alloc(aTHX);
code = PerlIO_parse_layers(aTHX_ layers, names);
if (code == 0) {
code = PerlIO_apply_layera(aTHX_ f, mode, layers, 0, layers->cur);
IV
PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
- (void)mode;
- (void)arg;
+ PERL_UNUSED_ARG(mode);
+ PERL_UNUSED_ARG(arg);
if (PerlIOValid(f)) {
if (tab->kind & PERLIO_K_UTF8)
PerlIOBase(f)->flags |= PERLIO_F_UTF8;
IV n, const char *mode, int fd, int imode, int perm,
PerlIO *old, int narg, SV **args)
{
- PerlIO_funcs *tab = PerlIO_default_btm();
- (void)self;
+ PerlIO_funcs * const tab = PerlIO_default_btm();
+ PERL_UNUSED_ARG(self);
if (tab && tab->Open)
return (*tab->Open) (aTHX_ tab, layers, n - 1, mode, fd, imode, perm,
old, narg, args);
PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
PerlIOl * const l = PerlIOBase(f);
- (void)arg;
+ PERL_UNUSED_ARG(arg);
l->flags &= ~(PERLIO_F_CANREAD | PERLIO_F_CANWRITE |
PERLIO_F_TRUNCATE | PERLIO_F_APPEND);
IV
PerlIOBase_popped(pTHX_ PerlIO *f)
{
- (void)f;
+ PERL_UNUSED_ARG(f);
return 0;
}
IV
PerlIOBase_noop_ok(pTHX_ PerlIO *f)
{
- (void)f;
+ PERL_UNUSED_ARG(f);
return 0;
}
IV
PerlIOBase_noop_fail(pTHX_ PerlIO *f)
{
- (void)f;
+ PERL_UNUSED_ARG(f);
return -1;
}
*/
# error "Don't know how to set FILE.fileno on your platform"
#endif
- (void)f;
+ PERL_UNUSED_ARG(f);
return 0;
# endif
}
}
return name;
#else
- (void)f;
- (void)buf;
+ PERL_UNUSED_ARG(f);
+ PERL_UNUSED_ARG(buf);
Perl_croak(aTHX_ "Don't know how to get file name");
return Nullch;
#endif
register PERL_CONTEXT *cx;
I32 pop2 = 0;
I32 gimme;
- I32 optype = 0;
+ I32 optype;
OP *nextop;
SV **newsp;
PMOP *newpm;
SV **mark;
SV *sv = Nullsv;
+ PERL_UNUSED_VAR(optype);
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags)
{
tempsym_t sym;
- (void)strbeg;
- (void)new_s;
- (void)ocnt;
+ PERL_UNUSED_ARG(strbeg);
+ PERL_UNUSED_ARG(new_s);
+ PERL_UNUSED_ARG(ocnt);
if (flags & FLAG_DO_UTF8) flags |= FLAG_WAS_UTF8;
else if (need_utf8(pat, patend)) {
Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, register SV **beglist, SV **endlist, SV ***next_in_list, U32 flags)
{
tempsym_t sym;
- (void)next_in_list;
- (void)flags;
+ PERL_UNUSED_ARG(next_in_list);
+ PERL_UNUSED_ARG(flags);
TEMPSYM_INIT(&sym, pat, patend, FLAG_PACK);
register IO * const io = GvIOp(gv);
PerlIO * const ofp = IoOFP(io);
PerlIO *fp;
- SV **newsp = Null(SV**);
- I32 gimme = 0;
+ SV **newsp;
+ I32 gimme;
register PERL_CONTEXT *cx;
PERL_UNUSED_VAR(newsp);
PERL_UNUSED_VAR(gimme);
PERL_CALLCONV void Perl_free_tmps(pTHX);
PERL_CALLCONV OP* Perl_gen_constant_list(pTHX_ OP* o);
#if !defined(HAS_GETENV_LEN)
-PERL_CALLCONV char* Perl_getenv_len(pTHX_ const char* key, unsigned long *len);
+PERL_CALLCONV char* Perl_getenv_len(pTHX_ const char* key, unsigned long *len)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
#endif
PERL_CALLCONV void Perl_gp_free(pTHX_ GV* gv);
PERL_CALLCONV GP* Perl_gp_ref(pTHX_ GP* gp);
PERL_CALLCONV int Perl_magic_freeregexp(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_freeovrld(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_get(pTHX_ SV* sv, MAGIC* mg);
-PERL_CALLCONV int Perl_magic_getarylen(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getarylen(pTHX_ SV* sv, const MAGIC* mg)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
PERL_CALLCONV int Perl_magic_getdefelem(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_getglob(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_getnkeys(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV CV* Perl_get_cv(pTHX_ const char* name, I32 create);
PERL_CALLCONV int Perl_init_i18nl10n(pTHX_ int printwarn);
PERL_CALLCONV int Perl_init_i18nl14n(pTHX_ int printwarn);
-PERL_CALLCONV void Perl_new_collate(pTHX_ char* newcoll)
- __attribute__nonnull__(pTHX_1);
-
-PERL_CALLCONV void Perl_new_ctype(pTHX_ char* newctype)
- __attribute__nonnull__(pTHX_1);
-
-PERL_CALLCONV void Perl_new_numeric(pTHX_ char* newcoll)
+PERL_CALLCONV void Perl_new_collate(pTHX_ const char* newcoll);
+PERL_CALLCONV void Perl_new_ctype(pTHX_ const char* newctype)
__attribute__nonnull__(pTHX_1);
+PERL_CALLCONV void Perl_new_numeric(pTHX_ const char* newcoll);
PERL_CALLCONV void Perl_set_numeric_local(pTHX);
PERL_CALLCONV void Perl_set_numeric_radix(pTHX);
PERL_CALLCONV void Perl_set_numeric_standard(pTHX);
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 void Perl_taint_proper(pTHX_ const char* f, const char* s)
+ __attribute__nonnull__(pTHX_2);
+
PERL_CALLCONV UV Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, const char *normal, const char *special)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
+STATIC void S_restore_magic(pTHX_ const void *p)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC void S_unwind_handler_stack(pTHX_ const void *p)
+ __attribute__nonnull__(pTHX_1);
+
+
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
#if defined(USE_LOCALE_NUMERIC) || defined(USE_LOCALE_COLLATE)
-STATIC char* S_stdize_locale(pTHX_ char* locs);
+STATIC char* S_stdize_locale(pTHX_ char* locs)
+ __attribute__nonnull__(pTHX_1);
+
#endif
#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
-STATIC COP* S_closest_cop(pTHX_ COP *cop, OP *o);
+STATIC COP* S_closest_cop(pTHX_ COP *cop, const OP *o)
+ __attribute__nonnull__(pTHX_1);
+
STATIC SV* S_mess_alloc(pTHX);
#endif
Perl_save_threadsv(pTHX_ PADOFFSET i)
{
Perl_croak(aTHX_ "panic: save_threadsv called in non-threaded perl");
- (void)i;
+ PERL_UNUSED_ARG(i);
NORETURN_FUNCTION_END;
}
void
Perl_taint_proper(pTHX_ const char *f, const char *s)
{
- const char *ug;
-
#if defined(HAS_SETEUID) && defined(DEBUGGING)
# if Uid_t_size == 1
{
- UV uid = PL_uid;
- UV euid = PL_euid;
+ const UV uid = PL_uid;
+ const UV euid = PL_euid;
- DEBUG_u(PerlIO_printf(Perl_debug_log,
+ DEBUG_u(PerlIO_printf(Perl_debug_log,
"%s %d %"UVuf" %"UVuf"\n",
s, PL_tainted, uid, euid));
}
# else
{
- IV uid = PL_uid;
- IV euid = PL_euid;
+ const IV uid = PL_uid;
+ const IV euid = PL_euid;
- DEBUG_u(PerlIO_printf(Perl_debug_log,
+ DEBUG_u(PerlIO_printf(Perl_debug_log,
"%s %d %"IVdf" %"IVdf"\n",
s, PL_tainted, uid, euid));
}
#endif
if (PL_tainted) {
+ const char *ug;
+
if (!f)
f = PL_no_security;
if (PL_euid != PL_uid)
if (!GvHV(PL_envgv) || !(SvRMAGICAL(GvHV(PL_envgv))
&& mg_find((SV*)GvHV(PL_envgv), PERL_MAGIC_env))) {
const bool was_tainted = PL_tainted;
- const char *name = GvENAME(PL_envgv);
+ const char * const name = GvENAME(PL_envgv);
PL_tainted = TRUE;
if (strEQ(name,"ENV"))
/* hash alias */
STRLEN len;
const bool was_tainted = PL_tainted;
const char *t = SvPV_const(*svp, len);
- const char *e = t + len;
+ const char * const e = t + len;
PL_tainted = was_tainted;
if (t < e && isALNUM(*t))
t++;
#endif /* !VMS */
for (e = misc_env; *e; e++) {
- svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
+ SV ** const svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
if (svp && *svp != &PL_sv_undef && SvTAINTED(*svp)) {
TAINT;
taint_proper("Insecure $ENV{%s}%s", *e);
}
STATIC COP*
-S_closest_cop(pTHX_ COP *cop, OP *o)
+S_closest_cop(pTHX_ COP *cop, const OP *o)
{
/* Look for PL_op starting from o. cop is the last COP we've seen. */
/* Nothing found. */
- return 0;
+ return Null(COP *);
}
SV *
void
Perl_set_context(void *t)
{
- dVAR;
+ dVAR;
#if defined(USE_ITHREADS)
# ifdef I_MACH_CTHREADS
cthread_set_data(cthread_self(), t);
Perl_croak_nocontext("panic: pthread_setspecific");
# endif
#else
- (void)t;
+ PERL_UNUSED_ARG(t);
#endif
}
char *
Perl_getenv_len(pTHX_ const char *env_elem, unsigned long *len)
{
- char *env_trans = PerlEnv_getenv(env_elem);
+ char * const env_trans = PerlEnv_getenv(env_elem);
if (env_trans)
*len = strlen(env_trans);
return env_trans;