summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-07-13 05:49:19 -0500
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-07-13 16:37:48 +0000
commit46c461b51dd657dd9227e8d230ce0a737a33cb3e (patch)
treeca0f3694daf76da19fba2b8c90d3aa186b9011f9
parent858a90f980dd074da7b777d2a853a60c6e058f77 (diff)
downloadperl-46c461b51dd657dd9227e8d230ce0a737a33cb3e.tar.gz
More embed.fnc plowing
Message-ID: <20050713154919.GA24586@petdance.com> p4raw-id: //depot/perl@25138
-rw-r--r--embed.fnc171
-rw-r--r--gv.c6
-rw-r--r--hv.c5
-rw-r--r--op.c25
-rw-r--r--pad.c2
-rw-r--r--perlio.c48
-rw-r--r--pp_ctl.c2
-rw-r--r--pp_hot.c12
-rw-r--r--proto.h192
-rw-r--r--toke.c4
10 files changed, 285 insertions, 182 deletions
diff --git a/embed.fnc b/embed.fnc
index 527d8e4422..4669f7df29 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -87,7 +87,7 @@ END_EXTERN_C
/* functions with flag 'n' should come before here */
START_EXTERN_C
# include "pp_proto.h"
-Ap |SV* |amagic_call |SV* left|SV* right|int method|int dir
+Ap |SV* |amagic_call |NN SV* left|NN SV* right|int method|int dir
Ap |bool |Gv_AMupdate |NN HV* stash
ApR |CV* |gv_handler |NULLOK HV* stash|I32 id
p |OP* |append_elem |I32 optype|NULLOK OP* first|NULLOK OP* last
@@ -248,16 +248,16 @@ p |OP* |gen_constant_list|OP* o
#if !defined(HAS_GETENV_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
+Ap |void |gp_free |NULLOK GV* gv
+Ap |GP* |gp_ref |NULLOK GP* gp
Ap |GV* |gv_AVadd |NN GV* gv
Ap |GV* |gv_HVadd |NN GV* gv
Ap |GV* |gv_IOadd |NN GV* gv
-ApR |GV* |gv_autoload4 |HV* stash|NN const char* name|STRLEN len|I32 method
-Ap |void |gv_check |HV* stash
-Ap |void |gv_efullname |SV* sv|const GV* gv
-Apmb |void |gv_efullname3 |SV* sv|const GV* gv|const char* prefix
-Ap |void |gv_efullname4 |SV* sv|const GV* gv|const char* prefix|bool keepmain
+ApR |GV* |gv_autoload4 |NULLOK HV* stash|NN const char* name|STRLEN len|I32 method
+Ap |void |gv_check |NN HV* stash
+Ap |void |gv_efullname |NN SV* sv|NN const GV* gv
+Apmb |void |gv_efullname3 |NN SV* sv|NN const GV* gv|NULLOK const char* prefix
+Ap |void |gv_efullname4 |NN SV* sv|NN const GV* gv|NULLOK const char* prefix|bool keepmain
Ap |GV* |gv_fetchfile |NN const char* name
Apd |GV* |gv_fetchmeth |HV* stash|const char* name|STRLEN len \
|I32 level
@@ -740,7 +740,7 @@ Apd |void |sv_vcatpvf |NN SV* sv|const char* pat|va_list* args
Apd |void |sv_catpv |NN SV* sv|const char* ptr
Amdb |void |sv_catpvn |NN SV* sv|const char* ptr|STRLEN len
Amdb |void |sv_catsv |NN SV* dsv|SV* ssv
-Apd |void |sv_chop |NN SV* sv|const char* ptr
+Apd |void |sv_chop |NN SV* sv|NULLOK const char* ptr
pd |I32 |sv_clean_all
pd |void |sv_clean_objs
Apd |void |sv_clear |NN SV* sv
@@ -933,10 +933,10 @@ Apd |void |sv_force_normal_flags|NN SV *sv|U32 flags
Ap |void |tmps_grow |I32 n
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 |OP * |my_attrs |NN OP *o|OP *attrs
+Ap |OP* |newANONATTRSUB |I32 floor|NULLOK OP *proto|NULLOK OP *attrs|NULLOK OP *block
+Ap |CV* |newATTRSUB |I32 floor|NULLOK OP *o|NULLOK OP *proto|NULLOK OP *attrs|OP *block
+Apr |void |newMYSUB |I32 floor|NULLOK OP *o|NULLOK OP *proto|NULLOK OP *attrs|NULLOK OP *block
+p |OP * |my_attrs |NN OP *o|NULLOK OP *attrs
p |void |boot_core_xsutils
#if defined(USE_ITHREADS)
Apa |PERL_CONTEXT*|cx_dup |PERL_CONTEXT* cx|I32 ix|I32 max|CLONE_PARAMS* param
@@ -1064,7 +1064,7 @@ pR |OP* |ck_unpack |NN OP *o
sR |bool |is_handle_constructor|NN const OP *o|I32 numargs
sR |I32 |is_list_assignment|const OP *o
s |void |cop_free |NN COP *cop
-s |OP* |modkids |OP *o|I32 type
+s |OP* |modkids |NULLOK OP *o|I32 type
s |OP* |scalarboolean |NN OP *o
sR |OP* |newDEFSVOP
sR |OP* |new_logop |I32 type|I32 flags|NN OP **firstp|NN OP **otherp
@@ -1128,7 +1128,7 @@ sR |const char *|get_num |NN const char *ppat|NN I32 *lenptr
#endif
#if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
-sR |OP* |docatch |OP *o
+sR |OP* |docatch |NULLOK OP *o
s |void |docatch_body
sR |OP* |dofindlabel |OP *o|const char *label|OP **opstack|OP **oplimit
sR |OP* |doparseform |SV *sv
@@ -1138,8 +1138,8 @@ sR |I32 |dopoptolabel |NN const char *label
sR |I32 |dopoptoloop |I32 startingblock
sR |I32 |dopoptosub |I32 startingblock
sR |I32 |dopoptosub_at |const PERL_CONTEXT* cxstk|I32 startingblock
-s |void |save_lines |AV *array|SV *sv
-sR |OP* |doeval |int gimme|OP** startop|CV* outside|U32 seq
+s |void |save_lines |NULLOK AV *array|NN SV *sv
+sR |OP* |doeval |int gimme|NULLOK OP** startop|NULLOK CV* outside|U32 seq
sR |PerlIO *|doopen_pm |const char *name|const char *mode
sR |bool |path_is_absolute|NN const char *name
#endif
@@ -1147,7 +1147,7 @@ sR |bool |path_is_absolute|NN const char *name
#if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
s |void |do_oddball |NN HV *hash|NN SV **relem|NN SV **firstrelem
sR |CV* |get_db_sub |NN SV **svp|NN CV *cv
-sR |SV* |method_common |NN SV* meth|U32* hashp
+sR |SV* |method_common |NN SV* meth|NULLOK U32* hashp
#endif
#if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
@@ -1184,14 +1184,14 @@ Es |int |cl_is_anything |NN const struct regnode_charclass_class *cl
Es |void |cl_init |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl
Es |void |cl_init_zero |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl
Es |void |cl_and |NN struct regnode_charclass_class *cl \
- |const struct regnode_charclass_class *and_with
+ |NN const struct regnode_charclass_class *and_with
Es |void |cl_or |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl \
|NN const struct regnode_charclass_class *or_with
Es |I32 |study_chunk |struct RExC_state_t*|regnode **scanp|I32 *deltap \
|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 |NN const char* pat1|NN const char* pat2|...
Es |I32 |regpposixcc |struct RExC_state_t*|I32 value
Es |void |checkposixcc |struct RExC_state_t*
@@ -1204,12 +1204,13 @@ Es |I32 |make_trie |struct RExC_state_t*|regnode *startbranch \
ERs |I32 |regmatch |NN regnode *prog
ERs |I32 |regrepeat |NN const regnode *p|I32 max
ERs |I32 |regrepeat_hard |NN regnode *p|I32 max|NN I32 *lp
-ERs |I32 |regtry |regexp *prog|char *startpos
-ERs |bool |reginclass |NN const regnode *n|NN const U8 *p|STRLEN *lenp|bool do_utf8sv_is_utf8
+ERs |I32 |regtry |NN regexp *prog|NN char *startpos
+ERs |bool |reginclass |NN const regnode *n|NN const U8 *p|NULLOK STRLEN *lenp\
+ |bool do_utf8sv_is_utf8
Es |CHECKPOINT|regcppush |I32 parenfloor
Es |char*|regcppop
Es |char*|regcp_set_to |I32 ss
-Es |void |cache_re |regexp *prog
+Es |void |cache_re |NN regexp *prog
ERs |U8* |reghop |U8 *pos|I32 off
ERs |U8* |reghop3 |U8 *pos|I32 off|U8 *lim
ERs |U8* |reghopmaybe |U8 *pos|I32 off
@@ -1221,11 +1222,11 @@ Es |void |to_byte_substr |NN regexp * prog
#if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
s |CV* |deb_curcv |I32 ix
-s |void |debprof |const OP *o
+s |void |debprof |NN const OP *o
#endif
#if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
-s |SV* |save_scalar_at |SV **sptr
+s |SV* |save_scalar_at |NN SV **sptr
#endif
#if defined(PERL_IN_GV_C) || defined(PERL_IN_SV_C) || defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
@@ -1242,10 +1243,10 @@ s |void |sv_del_backref |NN SV *target|NN SV *ref
sR |SV * |varname |NULLOK GV *gv|const char gvtype|PADOFFSET targ \
|NULLOK SV *keyname|I32 aindex|int subscript_type
# ifdef DEBUGGING
-s |void |del_sv |SV *p
+s |void |del_sv |NN SV *p
# endif
# if !defined(NV_PRESERVES_UV)
-s |int |sv_2iuv_non_preserve |SV *sv|I32 numtype
+s |int |sv_2iuv_non_preserve |NN SV *sv|I32 numtype
# endif
sR |I32 |expect_number |NN char** pattern
#
@@ -1264,43 +1265,43 @@ sM |void |sv_release_COW |SV *sv|const char *pvx|STRLEN len|SV *after
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
s |void |check_uni
s |void |force_next |I32 type
-s |char* |force_version |char *start|int guessing
-s |char* |force_word |char *start|int token|int check_keyword \
+s |char* |force_version |NN char *start|int guessing
+s |char* |force_word |NN char *start|int token|int check_keyword \
|int allow_pack|int allow_tick
-s |SV* |tokeq |SV *sv
+s |SV* |tokeq |NN SV *sv
s |int |pending_ident
-s |char* |scan_const |NN char *start
-s |char* |scan_formline |NN char *s
-s |char* |scan_heredoc |NN char *s
+sR |char* |scan_const |NN char *start
+sR |char* |scan_formline |NN char *s
+sR |char* |scan_heredoc |NN char *s
s |char* |scan_ident |NN char *s|NN const char *send|NN char *dest \
|STRLEN destlen|I32 ck_uni
-s |char* |scan_inputsymbol|char *start
-s |char* |scan_pat |char *start|I32 type
-s |char* |scan_str |char *start|int keep_quoted|int keep_delims
-s |char* |scan_subst |char *start
-s |char* |scan_trans |char *start
-s |char* |scan_word |char *s|char *dest|STRLEN destlen \
- |int allow_package|STRLEN *slp
-s |char* |skipspace |char *s
-s |char* |swallow_bom |U8 *s
+sR |char* |scan_inputsymbol|NN char *start
+sR |char* |scan_pat |NN char *start|I32 type
+sR |char* |scan_str |NN char *start|int keep_quoted|int keep_delims
+sR |char* |scan_subst |NN char *start
+sR |char* |scan_trans |NN char *start
+s |char* |scan_word |NN char *s|NN char *dest|STRLEN destlen \
+ |int allow_package|NN STRLEN *slp
+sR |char* |skipspace |NN char *s
+sR |char* |swallow_bom |NN U8 *s
s |void |checkcomma |NN char *s|NN const char *name|NN const char *what
-s |void |force_ident |const char *s|int kind
-s |void |incline |char *s
-s |int |intuit_method |char *s|GV *gv
-s |int |intuit_more |char *s
-s |I32 |lop |I32 f|int x|char *s
-rs |void |missingterm |char *s
-s |void |no_op |const char *what|char *s
+s |void |force_ident |NN const char *s|int kind
+s |void |incline |NN char *s
+s |int |intuit_method |NN char *s|NN GV *gv
+s |int |intuit_more |NN char *s
+s |I32 |lop |I32 f|int x|NN char *s
+rs |void |missingterm |NULLOK char *s
+s |void |no_op |NN const char *what|NULLOK char *s
s |void |set_csh
-s |I32 |sublex_done
-s |I32 |sublex_push
-s |I32 |sublex_start
+sR |I32 |sublex_done
+sR |I32 |sublex_push
+sR |I32 |sublex_start
sR |char * |filter_gets |NN SV *sv|NN PerlIO *fp|STRLEN append
sR |HV * |find_in_my_stash|NN 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 |const char *s|I32 rv
+s |int |tokereport |NN const char *s|I32 rv
# endif
s |int |ao |int toketype
s |void |depcom
@@ -1315,7 +1316,7 @@ s |I32 |cr_textfilter |int idx|NULLOK SV *sv|int maxlen
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-s |SV*|isa_lookup |HV *stash|const char *name|HV *name_stash|int len|int level
+s |SV*|isa_lookup |NULLOK HV *stash|NN const char *name|NULLOK HV *name_stash|int len|int level
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
@@ -1344,41 +1345,41 @@ START_EXTERN_C
Apd |void |sv_setsv_flags |NN SV* dsv|NULLOK SV* ssv|I32 flags
Apd |void |sv_catpvn_flags|NN SV* sv|NN const char* ptr|STRLEN len|I32 flags
-Apd |void |sv_catsv_flags |NN SV* dsv|SV* ssv|I32 flags
+Apd |void |sv_catsv_flags |NN SV* dsv|NULLOK SV* ssv|I32 flags
Apd |STRLEN |sv_utf8_upgrade_flags|NN SV *sv|I32 flags
-Apd |char* |sv_pvn_force_flags|SV* sv|STRLEN* lp|I32 flags
+Apd |char* |sv_pvn_force_flags|NN SV* sv|NULLOK STRLEN* lp|I32 flags
Apd |void |sv_copypv |NN SV* dsv|NN SV* ssv
Ap |char* |my_atof2 |NN const char *s|NN NV* value
Apn |int |my_socketpair |int family|int type|int protocol|int fd[2]
#ifdef PERL_OLD_COPY_ON_WRITE
-pMXE |SV* |sv_setsv_cow |SV* dsv|SV* ssv
+pMXE |SV* |sv_setsv_cow |NN SV* dsv|NN SV* ssv
#endif
#if defined(USE_PERLIO) && !defined(USE_SFIO)
-Ap |int |PerlIO_close |PerlIO *f
-Ap |int |PerlIO_fill |PerlIO *f
-Ap |int |PerlIO_fileno |PerlIO *f
-Ap |int |PerlIO_eof |PerlIO *f
-Ap |int |PerlIO_error |PerlIO *f
-Ap |int |PerlIO_flush |PerlIO *f
-Ap |void |PerlIO_clearerr |PerlIO *f
-Ap |void |PerlIO_set_cnt |PerlIO *f|int cnt
-Ap |void |PerlIO_set_ptrcnt |PerlIO *f|NN STDCHAR *ptr|int cnt
-Ap |void |PerlIO_setlinebuf |PerlIO *f
-Ap |SSize_t|PerlIO_read |PerlIO *f|NN void *buf|Size_t count
-Ap |SSize_t|PerlIO_write |PerlIO *f|NN const void *buf|Size_t count
-Ap |SSize_t|PerlIO_unread |PerlIO *f|NN const void *buf|Size_t count
-Ap |Off_t |PerlIO_tell |PerlIO *f
-Ap |int |PerlIO_seek |PerlIO *f|Off_t offset|int whence
+Ap |int |PerlIO_close |NULLOK PerlIO *f
+Ap |int |PerlIO_fill |NULLOK PerlIO *f
+Ap |int |PerlIO_fileno |NULLOK PerlIO *f
+Ap |int |PerlIO_eof |NULLOK PerlIO *f
+Ap |int |PerlIO_error |NULLOK PerlIO *f
+Ap |int |PerlIO_flush |NULLOK PerlIO *f
+Ap |void |PerlIO_clearerr |NULLOK PerlIO *f
+Ap |void |PerlIO_set_cnt |NULLOK PerlIO *f|int cnt
+Ap |void |PerlIO_set_ptrcnt |NULLOK PerlIO *f|NN STDCHAR *ptr|int cnt
+Ap |void |PerlIO_setlinebuf |NULLOK PerlIO *f
+Ap |SSize_t|PerlIO_read |NULLOK PerlIO *f|NN void *buf|Size_t count
+Ap |SSize_t|PerlIO_write |NULLOK PerlIO *f|NN const void *buf|Size_t count
+Ap |SSize_t|PerlIO_unread |NULLOK PerlIO *f|NN const void *buf|Size_t count
+Ap |Off_t |PerlIO_tell |NULLOK PerlIO *f
+Ap |int |PerlIO_seek |NULLOK PerlIO *f|Off_t offset|int whence
-Ap |STDCHAR *|PerlIO_get_base |PerlIO *f
-Ap |STDCHAR *|PerlIO_get_ptr |PerlIO *f
-ApR |int |PerlIO_get_bufsiz |PerlIO *f
-ApR |int |PerlIO_get_cnt |PerlIO *f
+Ap |STDCHAR *|PerlIO_get_base |NULLOK PerlIO *f
+Ap |STDCHAR *|PerlIO_get_ptr |NULLOK PerlIO *f
+ApR |int |PerlIO_get_bufsiz |NULLOK PerlIO *f
+ApR |int |PerlIO_get_cnt |NULLOK PerlIO *f
-Ap |PerlIO *|PerlIO_stdin
-Ap |PerlIO *|PerlIO_stdout
-Ap |PerlIO *|PerlIO_stderr
+ApR |PerlIO *|PerlIO_stdin
+ApR |PerlIO *|PerlIO_stdout
+ApR |PerlIO *|PerlIO_stderr
#endif /* PERLIO_LAYERS */
p |void |deb_stack_all
@@ -1399,7 +1400,7 @@ pd |void |pad_setsv |PADOFFSET po|NN SV* sv
pd |void |pad_block_start|int full
pd |void |pad_tidy |padtidy_type type
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_fixup_inner_anons|NN PADLIST *padlist|NN CV *old_cv|NN CV *new_cv
pd |void |pad_push |NN PADLIST *padlist|int depth
pR |HV* |pad_compname_type|const PADOFFSET po
@@ -1415,17 +1416,17 @@ sd |void |cv_dump |NN const CV *cv|NN const char *title
pdR |CV* |find_runcv |NULLOK U32 *db_seqp
p |void |free_tied_hv_pool
#if defined(DEBUGGING)
-pR |int |get_debug_opts |const char **s|bool givehelp
+pR |int |get_debug_opts |NN const char **s|bool givehelp
#endif
-Ap |void |save_set_svflags|SV* sv|U32 mask|U32 val
+Ap |void |save_set_svflags|NULLOK SV* sv|U32 mask|U32 val
Apod |void |hv_assert |NN HV* tb
ApdR |SV* |hv_scalar |NN HV* hv
ApoR |I32* |hv_riter_p |NN HV* hv
ApoR |HE** |hv_eiter_p |NN HV* hv
Apo |void |hv_riter_set |NN HV* hv|I32 riter
-Apo |void |hv_eiter_set |NN HV* hv|HE* eiter
-Apo |void |hv_name_set |NN HV* hv|const char *name|I32 len|int flags
+Apo |void |hv_eiter_set |NN HV* hv|NULLOK HE* eiter
+Apo |void |hv_name_set |NN HV* hv|NULLOK const char *name|I32 len|int flags
Apd |void |hv_clear_placeholders |NN HV* hb
ApoR |I32* |hv_placeholders_p |NN HV* hv
ApoR |I32 |hv_placeholders_get |NN HV* hv
@@ -1519,7 +1520,7 @@ dpR |bool |is_gv_magical_sv|NN SV *name|U32 flags
ApR |bool |stashpv_hvname_match|NN const COP *cop|NN const HV *hv
#ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
-p |void |dump_sv_child |SV *sv
+p |void |dump_sv_child |NN SV *sv
#endif
#ifdef PERL_DONT_CREATE_GVSV
diff --git a/gv.c b/gv.c
index d307124907..27268407e6 100644
--- a/gv.c
+++ b/gv.c
@@ -1191,10 +1191,8 @@ Perl_gv_fullname3(pTHX_ SV *sv, const GV *gv, const char *prefix)
void
Perl_gv_efullname4(pTHX_ SV *sv, const GV *gv, const char *prefix, bool keepmain)
{
- const GV *egv = GvEGV(gv);
- if (!egv)
- egv = gv;
- gv_fullname4(sv, egv, prefix, keepmain);
+ const GV * const egv = GvEGV(gv);
+ gv_fullname4(sv, egv ? egv : gv, prefix, keepmain);
}
void
diff --git a/hv.c b/hv.c
index 63149ac792..0745b67311 100644
--- a/hv.c
+++ b/hv.c
@@ -1729,7 +1729,7 @@ Perl_hv_undef(pTHX_ HV *hv)
if ((name = HvNAME_get(hv))) {
if(PL_stashcache)
hv_delete(PL_stashcache, name, HvNAMELEN_get(hv), G_DISCARD);
- Perl_hv_name_set(aTHX_ hv, 0, 0, 0);
+ Perl_hv_name_set(aTHX_ hv, Nullch, 0, 0);
}
SvFLAGS(hv) &= ~SVf_OOK;
Safefree(HvARRAY(hv));
@@ -1871,7 +1871,8 @@ Perl_hv_name_set(pTHX_ HV *hv, const char *name, I32 len, int flags)
{
struct xpvhv_aux *iter;
U32 hash;
- (void)flags;
+
+ PERL_UNUSED_ARG(flags);
if (SvOOK(hv)) {
iter = HvAUX(hv);
diff --git a/op.c b/op.c
index b7f560b435..55a976bfc9 100644
--- a/op.c
+++ b/op.c
@@ -161,7 +161,7 @@ Perl_Slab_Free(pTHX_ void *op)
STATIC const char*
S_gv_ename(pTHX_ GV *gv)
{
- SV* tmpsv = sv_newmortal();
+ SV* const tmpsv = sv_newmortal();
gv_efullname3(tmpsv, gv, Nullch);
return SvPV_nolen_const(tmpsv);
}
@@ -3743,7 +3743,8 @@ Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr, OP *block)
OP* o;
const bool once = block && block->op_flags & OPf_SPECIAL &&
(block->op_type == OP_ENTERSUB || block->op_type == OP_NULL);
- (void)debuggable;
+
+ PERL_UNUSED_ARG(debuggable);
if (expr) {
if (once && expr->op_type == OP_CONST && !SvTRUE(((SVOP*)expr)->op_sv))
@@ -3753,8 +3754,8 @@ Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr, OP *block)
expr = newUNOP(OP_DEFINED, 0,
newASSIGNOP(0, newDEFSVOP(), 0, expr) );
} else if (expr->op_flags & OPf_KIDS) {
- const OP *k1 = ((UNOP*)expr)->op_first;
- const OP *k2 = (k1) ? k1->op_sibling : NULL;
+ const OP * const k1 = ((UNOP*)expr)->op_first;
+ const OP * const k2 = k1 ? k1->op_sibling : NULL;
switch (expr->op_type) {
case OP_NULL:
if (k2 && k2->op_type == OP_READLINE
@@ -3806,15 +3807,16 @@ whileline, OP *expr, OP *block, OP *cont, I32 has_my)
OP *listop;
OP *o;
U8 loopflags = 0;
- (void)debuggable;
+
+ PERL_UNUSED_ARG(debuggable);
if (expr && (expr->op_type == OP_READLINE || expr->op_type == OP_GLOB
|| (expr->op_type == OP_NULL && expr->op_targ == OP_GLOB))) {
expr = newUNOP(OP_DEFINED, 0,
newASSIGNOP(0, newDEFSVOP(), 0, expr) );
} else if (expr && (expr->op_flags & OPf_KIDS)) {
- const OP *k1 = ((UNOP*)expr)->op_first;
- const OP *k2 = (k1) ? k1->op_sibling : NULL;
+ const OP * const k1 = ((UNOP*)expr)->op_first;
+ const OP * const k2 = (k1) ? k1->op_sibling : NULL;
switch (expr->op_type) {
case OP_NULL:
if (k2 && k2->op_type == OP_READLINE
@@ -4205,7 +4207,8 @@ Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
void
Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
{
- (void)floor;
+ PERL_UNUSED_ARG(floor);
+
if (o)
SAVEFREEOP(o);
if (proto)
@@ -4905,7 +4908,7 @@ Perl_oopsCV(pTHX_ OP *o)
{
Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__);
/* STUB */
- (void)o;
+ PERL_UNUSED_ARG(o);
NORETURN_FUNCTION_END;
}
@@ -5069,7 +5072,7 @@ Perl_ck_eval(pTHX_ OP *o)
dVAR;
PL_hints |= HINT_BLOCK_SCOPE;
if (o->op_flags & OPf_KIDS) {
- SVOP *kid = (SVOP*)cUNOPo->op_first;
+ SVOP * const kid = (SVOP*)cUNOPo->op_first;
if (!kid) {
o->op_flags &= ~OPf_KIDS;
@@ -5143,7 +5146,7 @@ Perl_ck_exists(pTHX_ OP *o)
{
o = ck_fun(o);
if (o->op_flags & OPf_KIDS) {
- OP *kid = cUNOPo->op_first;
+ OP * const kid = cUNOPo->op_first;
if (kid->op_type == OP_ENTERSUB) {
(void) ref(kid, o->op_type);
if (kid->op_type != OP_RV2CV && !PL_error_count)
diff --git a/pad.c b/pad.c
index f60aeaf6dd..db1ee0f7aa 100644
--- a/pad.c
+++ b/pad.c
@@ -1539,7 +1539,7 @@ Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
if (namesv && namesv != &PL_sv_undef
&& *SvPVX_const(namesv) == '&')
{
- CV *innercv = (CV*)curpad[ix];
+ CV * const innercv = (CV*)curpad[ix];
assert(CvWEAKOUTSIDE(innercv));
assert(CvOUTSIDE(innercv) == old_cv);
CvOUTSIDE(innercv) = new_cv;
diff --git a/perlio.c b/perlio.c
index 9cd24d2bf9..e36a7308c0 100644
--- a/perlio.c
+++ b/perlio.c
@@ -66,7 +66,7 @@ int mkstemp(char*);
/* Call the callback or PerlIOBase, and return failure. */
#define Perl_PerlIO_or_Base(f, callback, base, failure, args) \
if (PerlIOValid(f)) { \
- const PerlIO_funcs *tab = PerlIOBase(f)->tab; \
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;\
if (tab && tab->callback) \
return (*tab->callback) args; \
else \
@@ -79,7 +79,7 @@ int mkstemp(char*);
/* Call the callback or fail, and return failure. */
#define Perl_PerlIO_or_fail(f, callback, failure, args) \
if (PerlIOValid(f)) { \
- const PerlIO_funcs *tab = PerlIOBase(f)->tab; \
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;\
if (tab && tab->callback) \
return (*tab->callback) args; \
SETERRNO(EINVAL, LIB_INVARG); \
@@ -91,7 +91,7 @@ int mkstemp(char*);
/* Call the callback or PerlIOBase, and be void. */
#define Perl_PerlIO_or_Base_void(f, callback, base, args) \
if (PerlIOValid(f)) { \
- const PerlIO_funcs *tab = PerlIOBase(f)->tab; \
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;\
if (tab && tab->callback) \
(*tab->callback) args; \
else \
@@ -103,7 +103,7 @@ int mkstemp(char*);
/* Call the callback or fail, and be void. */
#define Perl_PerlIO_or_fail_void(f, callback, args) \
if (PerlIOValid(f)) { \
- const PerlIO_funcs *tab = PerlIOBase(f)->tab; \
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;\
if (tab && tab->callback) \
(*tab->callback) args; \
else \
@@ -747,7 +747,7 @@ PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load)
if ((SSize_t) len <= 0)
len = strlen(name);
for (i = 0; i < PL_known_layers->cur; i++) {
- PerlIO_funcs *f = PL_known_layers->array[i].funcs;
+ PerlIO_funcs * const f = PL_known_layers->array[i].funcs;
if (memEQ(f->name, name, len) && f->name[len] == 0) {
PerlIO_debug("%.*s => %p\n", (int) len, name, (void*)f);
return f;
@@ -759,10 +759,10 @@ PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load)
Perl_croak(aTHX_ "Recursive call to Perl_load_module in PerlIO_find_layer");
return NULL;
} else {
- SV *pkgsv = newSVpvn("PerlIO", 6);
- SV *layer = newSVpvn(name, len);
- CV *cv = get_cv("PerlIO::Layer::NoWarnings", FALSE);
- ENTER;
+ SV * const pkgsv = newSVpvn("PerlIO", 6);
+ SV * const layer = newSVpvn(name, len);
+ CV * const cv = get_cv("PerlIO::Layer::NoWarnings", FALSE);
+ ENTER;
SAVEINT(PL_in_load_module);
if (cv) {
SAVEGENERICSV(PL_warnhook);
@@ -866,8 +866,8 @@ XS(XS_io_MODIFY_SCALAR_ATTRIBUTES)
SV *
PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab)
{
- HV *stash = gv_stashpv("PerlIO::Layer", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(tab))), stash);
+ HV * const stash = gv_stashpv("PerlIO::Layer", TRUE);
+ SV * const sv = sv_bless(newRV_noinc(newSViv(PTR2IV(tab))), stash);
return sv;
}
@@ -889,9 +889,9 @@ XS(XS_PerlIO__Layer__find)
Perl_croak(aTHX_ "Usage class->find(name[,load])");
else {
STRLEN len;
- const char *name = SvPV_const(ST(1), len);
+ const char * const name = SvPV_const(ST(1), len);
const bool load = (items > 2) ? SvTRUE(ST(2)) : 0;
- PerlIO_funcs *layer = PerlIO_find_layer(aTHX_ name, len, load);
+ PerlIO_funcs * const layer = PerlIO_find_layer(aTHX_ name, len, load);
ST(0) =
(layer) ? sv_2mortal(PerlIO_tab_sv(aTHX_ layer)) :
&PL_sv_undef;
@@ -979,7 +979,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names)
}
}
if (e > s) {
- PerlIO_funcs *layer =
+ PerlIO_funcs * const layer =
PerlIO_find_layer(aTHX_ s, llen, 1);
if (layer) {
PerlIO_list_push(aTHX_ av, layer,
@@ -1134,7 +1134,7 @@ Perl_boot_core_PerlIO(pTHX)
PerlIO_funcs *
PerlIO_default_layer(pTHX_ I32 n)
{
- PerlIO_list_t *av = PerlIO_default_layers(aTHX);
+ PerlIO_list_t * const av = PerlIO_default_layers(aTHX);
if (n < 0)
n += av->cur;
return PerlIO_layer_fetch(aTHX_ av, n, PERLIO_FUNCS_CAST(&PerlIO_stdio));
@@ -1351,7 +1351,7 @@ int
PerlIO__close(pTHX_ PerlIO *f)
{
if (PerlIOValid(f)) {
- PerlIO_funcs *tab = PerlIOBase(f)->tab;
+ PerlIO_funcs * const tab = PerlIOBase(f)->tab;
if (tab && tab->Close)
return (*tab->Close)(aTHX_ f);
else
@@ -1445,7 +1445,7 @@ PerlIO_resolve_layers(pTHX_ const char *layers,
* for it
*/
if (SvROK(arg) && !sv_isobject(arg)) {
- PerlIO_funcs *handler = PerlIO_layer_from_ref(aTHX_ SvRV(arg));
+ PerlIO_funcs * const handler = PerlIO_layer_from_ref(aTHX_ SvRV(arg));
if (handler) {
def = PerlIO_list_alloc(aTHX);
PerlIO_list_push(aTHX_ def, handler, &PL_sv_undef);
@@ -1512,7 +1512,7 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
PerlIOl *l = *f;
layera = PerlIO_list_alloc(aTHX);
while (l) {
- SV *arg = (l->tab->Getarg)
+ SV * const arg = (l->tab->Getarg)
? (*l->tab->Getarg) (aTHX_ &l, NULL, 0)
: &PL_sv_undef;
PerlIO_list_push(aTHX_ layera, l->tab, arg);
@@ -1530,7 +1530,7 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
*/
n = layera->cur - 1;
while (n >= 0) {
- PerlIO_funcs *t = PerlIO_layer_fetch(aTHX_ layera, n, NULL);
+ PerlIO_funcs * const t = PerlIO_layer_fetch(aTHX_ layera, n, NULL);
if (t && t->Open) {
tab = t;
break;
@@ -1709,7 +1709,7 @@ int
PerlIO_has_base(PerlIO *f)
{
if (PerlIOValid(f)) {
- const PerlIO_funcs *tab = PerlIOBase(f)->tab;
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;
if (tab)
return (tab->Get_base != NULL);
@@ -1725,7 +1725,7 @@ int
PerlIO_fast_gets(PerlIO *f)
{
if (PerlIOValid(f) && (PerlIOBase(f)->flags & PERLIO_F_FASTGETS)) {
- const PerlIO_funcs *tab = PerlIOBase(f)->tab;
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;
if (tab)
return (tab->Set_ptrcnt != NULL);
@@ -1741,7 +1741,7 @@ int
PerlIO_has_cntptr(PerlIO *f)
{
if (PerlIOValid(f)) {
- const PerlIO_funcs *tab = PerlIOBase(f)->tab;
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;
if (tab)
return (tab->Get_ptr != NULL && tab->Get_cnt != NULL);
@@ -1757,7 +1757,7 @@ int
PerlIO_canset_cnt(PerlIO *f)
{
if (PerlIOValid(f)) {
- const PerlIO_funcs *tab = PerlIOBase(f)->tab;
+ const PerlIO_funcs * const tab = PerlIOBase(f)->tab;
if (tab)
return (tab->Set_ptrcnt != NULL);
@@ -2667,7 +2667,7 @@ PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab
{
PerlIO *n;
if (PerlIOValid(f) && PerlIOValid(n = PerlIONext(f))) {
- PerlIO_funcs *toptab = PerlIOBase(n)->tab;
+ PerlIO_funcs * const toptab = PerlIOBase(n)->tab;
if (toptab == tab) {
/* Top is already stdio - pop self (duplicate) and use original */
PerlIO_pop(aTHX_ f);
diff --git a/pp_ctl.c b/pp_ctl.c
index c53c6d5d6a..7adfd697b7 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2902,7 +2902,7 @@ STATIC OP *
S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
{
dVAR; dSP;
- OP *saveop = PL_op;
+ OP * const saveop = PL_op;
PL_in_eval = ((saveop && saveop->op_type == OP_REQUIRE)
? (EVAL_INREQUIRE | (PL_in_eval & EVAL_INEVAL))
diff --git a/pp_hot.c b/pp_hot.c
index 07eb58553c..b150ac9538 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2969,17 +2969,15 @@ PP(pp_method_named)
STATIC SV *
S_method_common(pTHX_ SV* meth, U32* hashp)
{
- SV* sv;
SV* ob;
GV* gv;
HV* stash;
STRLEN namelen;
- const char* packname = 0;
+ const char* packname = Nullch;
SV *packsv = Nullsv;
STRLEN packlen;
- const char *name = SvPV_const(meth, namelen);
-
- sv = *(PL_stack_base + TOPMARK + 1);
+ const char * const name = SvPV_const(meth, namelen);
+ SV * const sv = *(PL_stack_base + TOPMARK + 1);
if (!sv)
Perl_croak(aTHX_ "Can't call method \"%s\" on an undefined value", name);
@@ -2992,8 +2990,6 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
GV* iogv;
/* this isn't a reference */
- packname = Nullch;
-
if(SvOK(sv) && (packname = SvPV_const(sv, packlen))) {
const HE* const he = hv_fetch_ent(PL_stashcache, sv, 0, 0);
if (he) {
@@ -3085,7 +3081,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
packname = CopSTASHPV(PL_curcop);
}
else if (stash) {
- HEK *packhek = HvNAME_HEK(stash);
+ HEK * const packhek = HvNAME_HEK(stash);
if (packhek) {
packname = HEK_KEY(packhek);
packlen = HEK_LEN(packhek);
diff --git a/proto.h b/proto.h
index 0dc9b03adb..640ab78283 100644
--- a/proto.h
+++ b/proto.h
@@ -76,7 +76,10 @@ END_EXTERN_C
/* functions with flag 'n' should come before here */
START_EXTERN_C
# include "pp_proto.h"
-PERL_CALLCONV SV* Perl_amagic_call(pTHX_ SV* left, SV* right, int method, int dir);
+PERL_CALLCONV SV* Perl_amagic_call(pTHX_ SV* left, SV* right, int method, int dir)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
PERL_CALLCONV bool Perl_Gv_AMupdate(pTHX_ HV* stash)
__attribute__nonnull__(pTHX_1);
@@ -512,10 +515,21 @@ PERL_CALLCONV GV* Perl_gv_autoload4(pTHX_ HV* stash, const char* name, STRLEN le
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV void Perl_gv_check(pTHX_ HV* stash);
-PERL_CALLCONV void Perl_gv_efullname(pTHX_ SV* sv, const GV* gv);
-/* PERL_CALLCONV void Perl_gv_efullname3(pTHX_ SV* sv, const GV* gv, const char* prefix); */
-PERL_CALLCONV void Perl_gv_efullname4(pTHX_ SV* sv, const GV* gv, const char* prefix, bool keepmain);
+PERL_CALLCONV void Perl_gv_check(pTHX_ HV* stash)
+ __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void Perl_gv_efullname(pTHX_ SV* sv, const GV* gv)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
+/* PERL_CALLCONV void Perl_gv_efullname3(pTHX_ SV* sv, const GV* gv, const char* prefix)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2); */
+
+PERL_CALLCONV void Perl_gv_efullname4(pTHX_ SV* sv, const GV* gv, const char* prefix, bool keepmain)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
PERL_CALLCONV GV* Perl_gv_fetchfile(pTHX_ const char* name)
__attribute__nonnull__(pTHX_1);
@@ -2527,7 +2541,9 @@ STATIC I32 S_dopoptosub(pTHX_ I32 startingblock)
STATIC I32 S_dopoptosub_at(pTHX_ const PERL_CONTEXT* cxstk, I32 startingblock)
__attribute__warn_unused_result__;
-STATIC void S_save_lines(pTHX_ AV *array, SV *sv);
+STATIC void S_save_lines(pTHX_ AV *array, SV *sv)
+ __attribute__nonnull__(pTHX_2);
+
STATIC OP* S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
__attribute__warn_unused_result__;
@@ -2654,7 +2670,8 @@ STATIC void S_cl_init_zero(pTHX_ struct RExC_state_t*, struct regnode_charclass_
__attribute__nonnull__(pTHX_2);
STATIC void S_cl_and(pTHX_ struct regnode_charclass_class *cl, const struct regnode_charclass_class *and_with)
- __attribute__nonnull__(pTHX_1);
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
STATIC void S_cl_or(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with)
__attribute__nonnull__(pTHX_1)
@@ -2664,7 +2681,9 @@ STATIC void S_cl_or(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *
STATIC I32 S_study_chunk(pTHX_ struct RExC_state_t*, regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags, U32 depth);
STATIC I32 S_add_data(pTHX_ struct RExC_state_t*, I32 n, const char *s);
STATIC void S_re_croak2(pTHX_ const char* pat1, const char* pat2, ...)
- __attribute__noreturn__;
+ __attribute__noreturn__
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
STATIC I32 S_regpposixcc(pTHX_ struct RExC_state_t*, I32 value);
STATIC void S_checkposixcc(pTHX_ struct RExC_state_t*);
@@ -2687,7 +2706,9 @@ STATIC I32 S_regrepeat_hard(pTHX_ regnode *p, I32 max, I32 *lp)
__attribute__nonnull__(pTHX_3);
STATIC I32 S_regtry(pTHX_ regexp *prog, char *startpos)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
STATIC bool S_reginclass(pTHX_ const regnode *n, const U8 *p, STRLEN *lenp, bool do_utf8sv_is_utf8)
__attribute__warn_unused_result__
@@ -2697,7 +2718,9 @@ STATIC bool S_reginclass(pTHX_ const regnode *n, const U8 *p, STRLEN *lenp, bool
STATIC CHECKPOINT S_regcppush(pTHX_ I32 parenfloor);
STATIC char* S_regcppop(pTHX);
STATIC char* S_regcp_set_to(pTHX_ I32 ss);
-STATIC void S_cache_re(pTHX_ regexp *prog);
+STATIC void S_cache_re(pTHX_ regexp *prog)
+ __attribute__nonnull__(pTHX_1);
+
STATIC U8* S_reghop(pTHX_ U8 *pos, I32 off)
__attribute__warn_unused_result__;
@@ -2729,11 +2752,15 @@ STATIC void S_to_byte_substr(pTHX_ regexp * prog)
#if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
STATIC CV* S_deb_curcv(pTHX_ I32 ix);
-STATIC void S_debprof(pTHX_ const OP *o);
+STATIC void S_debprof(pTHX_ const OP *o)
+ __attribute__nonnull__(pTHX_1);
+
#endif
#if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
-STATIC SV* S_save_scalar_at(pTHX_ SV **sptr);
+STATIC SV* S_save_scalar_at(pTHX_ SV **sptr)
+ __attribute__nonnull__(pTHX_1);
+
#endif
#if defined(PERL_IN_GV_C) || defined(PERL_IN_SV_C) || defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
@@ -2769,10 +2796,14 @@ STATIC SV * S_varname(pTHX_ GV *gv, const char gvtype, PADOFFSET targ, SV *keyna
__attribute__warn_unused_result__;
# ifdef DEBUGGING
-STATIC void S_del_sv(pTHX_ SV *p);
+STATIC void S_del_sv(pTHX_ SV *p)
+ __attribute__nonnull__(pTHX_1);
+
# endif
# if !defined(NV_PRESERVES_UV)
-STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv, I32 numtype);
+STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv, I32 numtype)
+ __attribute__nonnull__(pTHX_1);
+
# endif
STATIC I32 S_expect_number(pTHX_ char** pattern)
__attribute__warn_unused_result__
@@ -2803,17 +2834,26 @@ STATIC void S_sv_release_COW(pTHX_ SV *sv, const char *pvx, STRLEN len, SV *afte
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
STATIC void S_check_uni(pTHX);
STATIC void S_force_next(pTHX_ I32 type);
-STATIC char* S_force_version(pTHX_ char *start, int guessing);
-STATIC char* S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack, int allow_tick);
-STATIC SV* S_tokeq(pTHX_ SV *sv);
+STATIC char* S_force_version(pTHX_ char *start, int guessing)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack, int allow_tick)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC SV* S_tokeq(pTHX_ SV *sv)
+ __attribute__nonnull__(pTHX_1);
+
STATIC int S_pending_ident(pTHX);
STATIC char* S_scan_const(pTHX_ char *start)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
STATIC char* S_scan_formline(pTHX_ char *s)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
STATIC char* S_scan_heredoc(pTHX_ char *s)
+ __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
STATIC char* S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck_uni)
@@ -2821,32 +2861,76 @@ STATIC char* S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN de
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
-STATIC char* S_scan_inputsymbol(pTHX_ char *start);
-STATIC char* S_scan_pat(pTHX_ char *start, I32 type);
-STATIC char* S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims);
-STATIC char* S_scan_subst(pTHX_ char *start);
-STATIC char* S_scan_trans(pTHX_ char *start);
-STATIC char* S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *slp);
-STATIC char* S_skipspace(pTHX_ char *s);
-STATIC char* S_swallow_bom(pTHX_ U8 *s);
+STATIC char* S_scan_inputsymbol(pTHX_ char *start)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_scan_pat(pTHX_ char *start, I32 type)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_scan_subst(pTHX_ char *start)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_scan_trans(pTHX_ char *start)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *slp)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2)
+ __attribute__nonnull__(pTHX_5);
+
+STATIC char* S_skipspace(pTHX_ char *s)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
+STATIC char* S_swallow_bom(pTHX_ U8 *s)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+
STATIC void S_checkcomma(pTHX_ char *s, const char *name, const char *what)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
-STATIC void S_force_ident(pTHX_ const char *s, int kind);
-STATIC void S_incline(pTHX_ char *s);
-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_force_ident(pTHX_ const char *s, int kind)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC void S_incline(pTHX_ char *s)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC int S_intuit_method(pTHX_ char *s, GV *gv)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
+STATIC int S_intuit_more(pTHX_ char *s)
+ __attribute__nonnull__(pTHX_1);
+
+STATIC I32 S_lop(pTHX_ I32 f, int x, char *s)
+ __attribute__nonnull__(pTHX_3);
+
STATIC void S_missingterm(pTHX_ char *s)
__attribute__noreturn__;
-STATIC void S_no_op(pTHX_ const char *what, char *s);
+STATIC void S_no_op(pTHX_ const char *what, char *s)
+ __attribute__nonnull__(pTHX_1);
+
STATIC void S_set_csh(pTHX);
-STATIC I32 S_sublex_done(pTHX);
-STATIC I32 S_sublex_push(pTHX);
-STATIC I32 S_sublex_start(pTHX);
+STATIC I32 S_sublex_done(pTHX)
+ __attribute__warn_unused_result__;
+
+STATIC I32 S_sublex_push(pTHX)
+ __attribute__warn_unused_result__;
+
+STATIC I32 S_sublex_start(pTHX)
+ __attribute__warn_unused_result__;
+
STATIC char * S_filter_gets(pTHX_ SV *sv, PerlIO *fp, STRLEN append)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1)
@@ -2858,7 +2942,9 @@ 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_ const char *s, I32 rv);
+STATIC int S_tokereport(pTHX_ const char *s, I32 rv)
+ __attribute__nonnull__(pTHX_1);
+
# endif
STATIC int S_ao(pTHX_ int toketype);
STATIC void S_depcom(pTHX);
@@ -2873,7 +2959,9 @@ STATIC I32 S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-STATIC SV* S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, int len, int level);
+STATIC SV* S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, int len, int level)
+ __attribute__nonnull__(pTHX_2);
+
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
@@ -2918,7 +3006,9 @@ PERL_CALLCONV void Perl_sv_catsv_flags(pTHX_ SV* dsv, SV* ssv, I32 flags)
PERL_CALLCONV STRLEN Perl_sv_utf8_upgrade_flags(pTHX_ SV *sv, I32 flags)
__attribute__nonnull__(pTHX_1);
-PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags);
+PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags)
+ __attribute__nonnull__(pTHX_1);
+
PERL_CALLCONV void Perl_sv_copypv(pTHX_ SV* dsv, SV* ssv)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
@@ -2929,7 +3019,10 @@ PERL_CALLCONV char* Perl_my_atof2(pTHX_ const char *s, NV* value)
PERL_CALLCONV int Perl_my_socketpair(int family, int type, int protocol, int fd[2]);
#ifdef PERL_OLD_COPY_ON_WRITE
-PERL_CALLCONV SV* Perl_sv_setsv_cow(pTHX_ SV* dsv, SV* ssv);
+PERL_CALLCONV SV* Perl_sv_setsv_cow(pTHX_ SV* dsv, SV* ssv)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
#endif
#if defined(USE_PERLIO) && !defined(USE_SFIO)
@@ -2966,9 +3059,15 @@ PERL_CALLCONV int Perl_PerlIO_get_cnt(pTHX_ PerlIO *f)
__attribute__warn_unused_result__;
-PERL_CALLCONV PerlIO * Perl_PerlIO_stdin(pTHX);
-PERL_CALLCONV PerlIO * Perl_PerlIO_stdout(pTHX);
-PERL_CALLCONV PerlIO * Perl_PerlIO_stderr(pTHX);
+PERL_CALLCONV PerlIO * Perl_PerlIO_stdin(pTHX)
+ __attribute__warn_unused_result__;
+
+PERL_CALLCONV PerlIO * Perl_PerlIO_stdout(pTHX)
+ __attribute__warn_unused_result__;
+
+PERL_CALLCONV PerlIO * Perl_PerlIO_stderr(pTHX)
+ __attribute__warn_unused_result__;
+
#endif /* PERLIO_LAYERS */
PERL_CALLCONV void Perl_deb_stack_all(pTHX);
@@ -3006,7 +3105,9 @@ PERL_CALLCONV void Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padl
__attribute__nonnull__(pTHX_2);
PERL_CALLCONV void Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
- __attribute__nonnull__(pTHX_1);
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2)
+ __attribute__nonnull__(pTHX_3);
PERL_CALLCONV void Perl_pad_push(pTHX_ PADLIST *padlist, int depth)
@@ -3036,7 +3137,8 @@ PERL_CALLCONV CV* Perl_find_runcv(pTHX_ U32 *db_seqp)
PERL_CALLCONV void Perl_free_tied_hv_pool(pTHX);
#if defined(DEBUGGING)
PERL_CALLCONV int Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
#endif
PERL_CALLCONV void Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val);
@@ -3184,7 +3286,9 @@ PERL_CALLCONV bool Perl_stashpv_hvname_match(pTHX_ const COP *cop, const HV *hv)
#ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
-PERL_CALLCONV void Perl_dump_sv_child(pTHX_ SV *sv);
+PERL_CALLCONV void Perl_dump_sv_child(pTHX_ SV *sv)
+ __attribute__nonnull__(pTHX_1);
+
#endif
#ifdef PERL_DONT_CREATE_GVSV
diff --git a/toke.c b/toke.c
index 33ec2c460e..ae56a6fec6 100644
--- a/toke.c
+++ b/toke.c
@@ -9085,7 +9085,7 @@ S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRL
{
register char *d;
register char *e;
- char *bracket = 0;
+ char *bracket = Nullch;
char funny = *s++;
if (isSPACE(*s))
@@ -9263,7 +9263,7 @@ S_scan_pat(pTHX_ char *start, I32 type)
char *s = scan_str(start,FALSE,FALSE);
if (!s) {
- char *delimiter = skipspace(start);
+ char * const delimiter = skipspace(start);
Perl_croak(aTHX_ *delimiter == '?'
? "Search pattern not terminated or ternary operator parsed as search pattern"
: "Search pattern not terminated" );