p |int |magic_nextpack |SV* sv|MAGIC* mg|SV* key
p |U32 |magic_regdata_cnt|SV* sv|MAGIC* mg
p |int |magic_regdatum_get|SV* sv|MAGIC* mg
-p |int |magic_regdatum_set|SV* sv|MAGIC* mg
+pr |int |magic_regdatum_set|SV* sv|MAGIC* mg
p |int |magic_set |SV* sv|MAGIC* mg
p |int |magic_setamagic|SV* sv|MAGIC* mg
p |int |magic_setarylen|SV* sv|MAGIC* mg
p |PerlIO*|nextargv |GV* gv
Ap |char* |ninstr |const char* big|const char* bigend \
|const char* little|const char* lend
-p |OP* |oopsCV |OP* o
+pr |OP* |oopsCV |OP* o
Ap |void |op_free |OP* arg
p |void |package |OP* o
pd |PADOFFSET|pad_alloc |I32 optype|U32 tmptype
Ap |void |save_gp |GV* gv|I32 empty
Ap |HV* |save_hash |GV* gv
Ap |void |save_helem |HV* hv|SV *key|SV **sptr
-Ap |void |save_hints
+Apr |void |save_hints
Ap |void |save_hptr |HV** hptr
Ap |void |save_I16 |I16* intp
Ap |void |save_I32 |I32* intp
Ap |void |save_padsv |PADOFFSET off
Ap |void |save_sptr |SV** sptr
Ap |SV* |save_svref |SV** sptr
-Ap |SV** |save_threadsv |PADOFFSET i
+Apr |SV** |save_threadsv |PADOFFSET i
p |OP* |sawparens |OP* o
p |OP* |scalar |OP* o
p |OP* |scalarkids |OP* o
p |OP* |scalarseq |OP* o
p |OP* |scalarvoid |OP* o
-Apd |NV |scan_bin |char* start|STRLEN len|STRLEN* retlen
-Apd |NV |scan_hex |char* start|STRLEN len|STRLEN* retlen
+Apd |NV |scan_bin |const char* start|STRLEN len|STRLEN* retlen
+Apd |NV |scan_hex |const char* start|STRLEN len|STRLEN* retlen
Ap |char* |scan_num |const char* s|YYSTYPE *lvalp
-Apd |NV |scan_oct |char* start|STRLEN len|STRLEN* retlen
+Apd |NV |scan_oct |const char* start|STRLEN len|STRLEN* retlen
p |OP* |scope |OP* o
Ap |char* |screaminstr |SV* bigsv|SV* littlesv|I32 start_shift \
|I32 end_shift|I32 *state|I32 last
p |int |magic_killbackrefs|SV *sv|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
-Ap |void |newMYSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block
+Apr |void |newMYSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block
p |OP * |my_attrs |OP *o|OP *attrs
p |void |boot_core_xsutils
#if defined(USE_ITHREADS)
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 |HEK* |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
-s |void |hv_notallowed |int flags|const char *key|I32 klen|const char *msg
+rs |void |hv_notallowed |int flags|const char *key|I32 klen|const char *msg
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
|regnode *last|struct scan_data_t *data \
|U32 flags|U32 depth
Es |I32 |add_data |struct RExC_state_t*|I32 n|const char *s
-rs |void|re_croak2 |const char* pat1|const char* pat2|...
+rs |void |re_croak2 |const char* pat1|const char* pat2|...
Es |I32 |regpposixcc |struct RExC_state_t*|I32 value
Es |void |checkposixcc |struct RExC_state_t*
s |int |intuit_method |char *s|GV *gv
s |int |intuit_more |char *s
s |I32 |lop |I32 f|int x|char *s
-s |void |missingterm |char *s
+rs |void |missingterm |char *s
s |void |no_op |const char *what|char *s
s |void |set_csh
s |I32 |sublex_done
{
Perl_croak(aTHX_ PL_no_modify);
/* NOT REACHED */
+ (void)sv; (void)mg;
return 0;
}
*/
NV
-Perl_scan_bin(pTHX_ char *start, STRLEN len, STRLEN *retlen)
+Perl_scan_bin(pTHX_ const char *start, STRLEN len, STRLEN *retlen)
{
NV rnv;
I32 flags = *retlen ? PERL_SCAN_ALLOW_UNDERSCORES : 0;
- UV ruv = grok_bin (start, &len, &flags, &rnv);
+ const UV ruv = grok_bin (start, &len, &flags, &rnv);
*retlen = len;
return (flags & PERL_SCAN_GREATER_THAN_UV_MAX) ? rnv : (NV)ruv;
}
NV
-Perl_scan_oct(pTHX_ char *start, STRLEN len, STRLEN *retlen)
+Perl_scan_oct(pTHX_ const char *start, STRLEN len, STRLEN *retlen)
{
NV rnv;
I32 flags = *retlen ? PERL_SCAN_ALLOW_UNDERSCORES : 0;
- UV ruv = grok_oct (start, &len, &flags, &rnv);
+ const UV ruv = grok_oct (start, &len, &flags, &rnv);
*retlen = len;
return (flags & PERL_SCAN_GREATER_THAN_UV_MAX) ? rnv : (NV)ruv;
}
NV
-Perl_scan_hex(pTHX_ char *start, STRLEN len, STRLEN *retlen)
+Perl_scan_hex(pTHX_ const char *start, STRLEN len, STRLEN *retlen)
{
NV rnv;
I32 flags = *retlen ? PERL_SCAN_ALLOW_UNDERSCORES : 0;
- UV ruv = grok_hex (start, &len, &flags, &rnv);
+ const UV ruv = grok_hex (start, &len, &flags, &rnv);
*retlen = len;
return (flags & PERL_SCAN_GREATER_THAN_UV_MAX) ? rnv : (NV)ruv;
#ifdef USE_LOCALE_NUMERIC
if (PL_numeric_radix_sv && IN_LOCALE) {
STRLEN len;
- char* radix = SvPV(PL_numeric_radix_sv, len);
+ const char* radix = SvPV(PL_numeric_radix_sv, len);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
*sp += len;
return TRUE;
result[2] = -result[2];
#endif /* USE_PERL_ATOF */
*value = result[2];
- return s;
+ return (char *)s;
}
#if ! defined(HAS_MODFL) && defined(HAS_AINTL) && defined(HAS_COPYSIGNL)
int
Perl_block_start(pTHX_ int full)
{
- int retval = PL_savestack_ix;
+ const int retval = PL_savestack_ix;
pad_block_start(full);
SAVEHINTS();
PL_hints &= ~HINT_BLOCK_SCOPE;
{
OP* listop;
OP* o;
- int once = block && block->op_flags & OPf_SPECIAL &&
+ const bool once = block && block->op_flags & OPf_SPECIAL &&
(block->op_type == OP_ENTERSUB || block->op_type == OP_NULL);
+ (void)debuggable;
if (expr) {
if (once && expr->op_type == OP_CONST && !SvTRUE(((SVOP*)expr)->op_sv))
expr = newUNOP(OP_DEFINED, 0,
newASSIGNOP(0, newDEFSVOP(), 0, expr) );
} else if (expr->op_flags & OPf_KIDS) {
- OP *k1 = ((UNOP*)expr)->op_first;
- OP *k2 = (k1) ? k1->op_sibling : NULL;
+ const OP *k1 = ((UNOP*)expr)->op_first;
+ const OP *k2 = (k1) ? k1->op_sibling : NULL;
switch (expr->op_type) {
case OP_NULL:
if (k2 && k2->op_type == OP_READLINE
OP *listop;
OP *o;
U8 loopflags = 0;
+ (void)debuggable;
if (expr && (expr->op_type == OP_READLINE || expr->op_type == OP_GLOB
|| (expr->op_type == OP_NULL && expr->op_targ == OP_GLOB))) {
Perl_croak(aTHX_ "Can't use %s for loop variable", PL_op_desc[sv->op_type]);
}
else {
- I32 offset = pad_findmy("$_");
+ const I32 offset = pad_findmy("$_");
if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS(offset) & SVpad_OUR) {
sv = newGVOP(OP_GV, 0, PL_defgv);
}
void
Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
{
+ (void)floor;
if (o)
SAVEFREEOP(o);
if (proto)
{
Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__);
/* STUB */
- return o;
+ (void)o;
}
OP *
PerlIO_getname(PerlIO *f, char *buf)
{
dTHX;
- char *name = NULL;
#ifdef VMS
+ char *name = NULL;
bool exported = FALSE;
FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
if (!stdio) {
name = fgetname(stdio, buf);
if (exported) PerlIO_releaseFILE(f,stdio);
}
+ return name;
#else
+ (void)f;
+ (void)buf;
Perl_croak(aTHX_ "Don't know how to get file name");
#endif
- return name;
}
For backwards compatibility. Use C<grok_bin> instead.
- NV scan_bin(char* start, STRLEN len, STRLEN* retlen)
+ NV scan_bin(const char* start, STRLEN len, STRLEN* retlen)
=for hackers
Found in file numeric.c
For backwards compatibility. Use C<grok_hex> instead.
- NV scan_hex(char* start, STRLEN len, STRLEN* retlen)
+ NV scan_hex(const char* start, STRLEN len, STRLEN* retlen)
=for hackers
Found in file numeric.c
For backwards compatibility. Use C<grok_oct> instead.
- NV scan_oct(char* start, STRLEN len, STRLEN* retlen)
+ NV scan_oct(const char* start, STRLEN len, STRLEN* retlen)
=for hackers
Found in file numeric.c
C<maybe_tainted> if results are untrustworthy (often due to the use of
locales).
+XXX Except that it maybe_tainted is never assigned to.
+
Usually used via one of its frontends C<sv_vcatpvf> and C<sv_vcatpvf_mg>.
void sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
PERL_CALLCONV int Perl_magic_nextpack(pTHX_ SV* sv, MAGIC* mg, SV* key);
PERL_CALLCONV U32 Perl_magic_regdata_cnt(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_regdatum_get(pTHX_ SV* sv, MAGIC* mg);
-PERL_CALLCONV int Perl_magic_regdatum_set(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_regdatum_set(pTHX_ SV* sv, MAGIC* mg) __attribute__((noreturn));
PERL_CALLCONV int Perl_magic_set(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_setamagic(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_setarylen(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_vcmp(pTHX_ SV *lvs, SV *rvs);
PERL_CALLCONV PerlIO* Perl_nextargv(pTHX_ GV* gv);
PERL_CALLCONV char* Perl_ninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend);
-PERL_CALLCONV OP* Perl_oopsCV(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_oopsCV(pTHX_ OP* o) __attribute__((noreturn));
PERL_CALLCONV void Perl_op_free(pTHX_ OP* arg);
PERL_CALLCONV void Perl_package(pTHX_ OP* o);
PERL_CALLCONV PADOFFSET Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype);
PERL_CALLCONV void Perl_save_gp(pTHX_ GV* gv, I32 empty);
PERL_CALLCONV HV* Perl_save_hash(pTHX_ GV* gv);
PERL_CALLCONV void Perl_save_helem(pTHX_ HV* hv, SV *key, SV **sptr);
-PERL_CALLCONV void Perl_save_hints(pTHX);
+PERL_CALLCONV void Perl_save_hints(pTHX) __attribute__((noreturn));
PERL_CALLCONV void Perl_save_hptr(pTHX_ HV** hptr);
PERL_CALLCONV void Perl_save_I16(pTHX_ I16* intp);
PERL_CALLCONV void Perl_save_I32(pTHX_ I32* intp);
PERL_CALLCONV void Perl_save_padsv(pTHX_ PADOFFSET off);
PERL_CALLCONV void Perl_save_sptr(pTHX_ SV** sptr);
PERL_CALLCONV SV* Perl_save_svref(pTHX_ SV** sptr);
-PERL_CALLCONV SV** Perl_save_threadsv(pTHX_ PADOFFSET i);
+PERL_CALLCONV SV** Perl_save_threadsv(pTHX_ PADOFFSET i) __attribute__((noreturn));
PERL_CALLCONV OP* Perl_sawparens(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_scalar(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_scalarkids(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_scalarseq(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_scalarvoid(pTHX_ OP* o);
-PERL_CALLCONV NV Perl_scan_bin(pTHX_ char* start, STRLEN len, STRLEN* retlen);
-PERL_CALLCONV NV Perl_scan_hex(pTHX_ char* start, STRLEN len, STRLEN* retlen);
+PERL_CALLCONV NV Perl_scan_bin(pTHX_ const char* start, STRLEN len, STRLEN* retlen);
+PERL_CALLCONV NV Perl_scan_hex(pTHX_ const char* start, STRLEN len, STRLEN* retlen);
PERL_CALLCONV char* Perl_scan_num(pTHX_ const char* s, YYSTYPE *lvalp);
-PERL_CALLCONV NV Perl_scan_oct(pTHX_ char* start, STRLEN len, STRLEN* retlen);
+PERL_CALLCONV NV Perl_scan_oct(pTHX_ const char* start, STRLEN len, STRLEN* retlen);
PERL_CALLCONV OP* Perl_scope(pTHX_ OP* o);
PERL_CALLCONV char* Perl_screaminstr(pTHX_ SV* bigsv, SV* littlesv, I32 start_shift, I32 end_shift, I32 *state, I32 last);
#if !defined(VMS)
PERL_CALLCONV int Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg);
PERL_CALLCONV OP* Perl_newANONATTRSUB(pTHX_ I32 floor, OP *proto, OP *attrs, OP *block);
PERL_CALLCONV CV* Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
-PERL_CALLCONV void Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
+PERL_CALLCONV void Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) __attribute__((noreturn));
PERL_CALLCONV OP * Perl_my_attrs(pTHX_ OP *o, OP *attrs);
PERL_CALLCONV void Perl_boot_core_xsutils(pTHX);
#if defined(USE_ITHREADS)
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 HEK* S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags);
-STATIC void S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const char *msg);
+STATIC void S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const char *msg) __attribute__((noreturn));
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
STATIC int S_intuit_method(pTHX_ char *s, GV *gv);
STATIC int S_intuit_more(pTHX_ char *s);
STATIC I32 S_lop(pTHX_ I32 f, int x, char *s);
-STATIC void S_missingterm(pTHX_ char *s);
+STATIC void S_missingterm(pTHX_ char *s) __attribute__((noreturn));
STATIC void S_no_op(pTHX_ const char *what, char *s);
STATIC void S_set_csh(pTHX);
STATIC I32 S_sublex_done(pTHX);
STRLEN l2 = strlen(pat2);
char buf[512];
SV *msv;
- char *message;
+ const char *message;
if (l1 > 510)
l1 = 510;
Perl_save_threadsv(pTHX_ PADOFFSET i)
{
Perl_croak(aTHX_ "panic: save_threadsv called in non-threaded perl");
+ (void)i;
return 0;
}
if (!sv) {
*lp = 0;
- return "";
+ return (char *)"";
}
if (SvGMAGICAL(sv)) {
if (flags & SV_GMAGIC)
report_uninit(sv);
}
*lp = 0;
- return "";
+ return (char *)"";
}
}
if (SvTHINKFIRST(sv)) {
goto tokensaveref;
}
*lp = strlen(typestr);
- return typestr;
+ return (char *)typestr;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
if (ckWARN(WARN_UNINITIALIZED))
report_uninit(sv);
*lp = 0;
- return "";
+ return (char *)"";
}
}
if (SvIOK(sv) || ((SvIOKp(sv) && !SvNOKp(sv)))) {
if (SvTYPE(sv) < SVt_PV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_PV);
- return "";
+ return (char *)"";
}
*lp = s - SvPVX(sv);
SvCUR_set(sv, *lp);
}
else {
STRLEN len;
- char *t;
+ const char *t;
if (tsv) {
sv_2mortal(tsv);
C<maybe_tainted> if results are untrustworthy (often due to the use of
locales).
+XXX Except that it maybe_tainted is never assigned to.
+
Usually used via one of its frontends C<sv_vcatpvf> and C<sv_vcatpvf_mg>.
=cut
switch (pat[1]) {
case 's':
if (args) {
- char *s = va_arg(*args, char*);
+ const char *s = va_arg(*args, char*);
sv_catpv(sv, s ? s : nullstr);
}
else if (svix < svmax) {
Perl_fp_dup(pTHX_ PerlIO *fp, char type, CLONE_PARAMS *param)
{
PerlIO *ret;
+ (void)type;
+
if (!fp)
return (PerlIO*)NULL;
if (!GvHV(PL_envgv) || !(SvRMAGICAL(GvHV(PL_envgv))
&& mg_find((SV*)GvHV(PL_envgv), PERL_MAGIC_env))) {
const bool was_tainted = PL_tainted;
- char *name = GvENAME(PL_envgv);
+ const char *name = GvENAME(PL_envgv);
PL_tainted = TRUE;
if (strEQ(name,"ENV"))
/* hash alias */
svp = hv_fetch(GvHVn(PL_envgv),"TERM",4,FALSE);
if (svp && *svp && SvTAINTED(*svp)) {
STRLEN n_a;
- bool was_tainted = PL_tainted;
+ const bool was_tainted = PL_tainted;
char *t = SvPV(*svp, n_a);
char *e = t + n_a;
PL_tainted = was_tainted;
I32 len;
SV *tmpstr;
char term;
+ const char newline[] = "\n";
+ const char *found_newline;
register char *d;
register char *e;
char *peek;
s = olds;
}
#endif
- d = "\n";
- if (outer || !(d=ninstr(s,PL_bufend,d,d+1)))
- herewas = newSVpvn(s,PL_bufend-s);
- else
- s--, herewas = newSVpvn(s,d-s);
+ if ( outer || !(found_newline = ninstr(s,PL_bufend,newline,newline+1)) ) {
+ herewas = newSVpvn(s,PL_bufend-s);
+ }
+ else {
+ s--;
+ herewas = newSVpvn(s,found_newline-s);
+ }
s += SvCUR(herewas);
tmpstr = NEWSV(87,79);
else
lvalp->opval = Nullop;
- return s;
+ return (char *)s;
}
STATIC char *
if ((PL_bufend - next) >= 2 && *next == '=' && next[1] == '>' ) {
/* return string not v-string */
sv_setpvn(sv,(char *)s,pos-s);
- return pos;
+ return (char *)pos;
}
}
sv_magic(sv,NULL,PERL_MAGIC_vstring,(const char*)start, pos-start);
SvRMAGICAL_on(sv);
}
- return s;
+ return (char *)s;
}
I32 count = 0;
if (!*is_utf8)
- return start;
+ return (U8 *)start;
/* ensure valid UTF-8 and chars < 256 before converting string */
for (send = s + *len; s < send;) {
(c = *s++) && UTF8_IS_CONTINUATION(c))
count++;
else
- return start;
+ return (U8 *)start;
}
}
}
*d = '\0';
*len = d - start;
- return start;
+ return (U8 *)start;
}
/*
POPSTACK;
if (IN_PERL_COMPILETIME) {
STRLEN len;
- char* pv = SvPV(tokenbufsv, len);
+ const char* pv = SvPV(tokenbufsv, len);
Copy(pv, PL_tokenbuf, len+1, char);
PL_curcop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
if (to < toend)
*to = '\0';
*retlen = tolen;
- return from;
+ return (char *)from;
}
/* return ptr to little string in big string, NULL if not found */
OP *
Perl_vdie(pTHX_ const char* pat, va_list *args)
{
- char *message;
+ const char *message;
const int was_in_eval = PL_in_eval;
STRLEN msglen;
I32 utf8 = 0;
void
Perl_vcroak(pTHX_ const char* pat, va_list *args)
{
- char *message;
+ const char *message;
STRLEN msglen;
I32 utf8 = 0;
int extidx = 0, i = 0;
const char *curext = Nullch;
#else
+ (void)search_ext;
# define MAX_EXT_LEN 0
#endif
while (len-- > 0)
av_push((AV *)sv, newSViv(0));
}
- return s;
+ return (char *)s;
}
/*
void
Perl_sv_nosharing(pTHX_ SV *sv)
{
+ (void)sv;
}
/*
void
Perl_sv_nolocking(pTHX_ SV *sv)
{
+ (void)sv;
}
void
Perl_sv_nounlocking(pTHX_ SV *sv)
{
+ (void)sv;
}
U32