summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.SH27
-rw-r--r--cc_runtime.h3
-rw-r--r--cop.h8
-rw-r--r--deb.c4
-rw-r--r--embed.fnc51
-rw-r--r--hv.c6
-rw-r--r--mg.c2
-rw-r--r--op.c98
-rw-r--r--op.h2
-rw-r--r--perl.c15
-rw-r--r--pp.c2
-rw-r--r--pp_ctl.c10
-rw-r--r--pp_sort.c2
-rw-r--r--regcomp.c19
-rw-r--r--regexec.c17
-rw-r--r--sv.c60
-rw-r--r--toke.c50
-rw-r--r--utf8.c2
-rw-r--r--util.c26
19 files changed, 210 insertions, 194 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 940708bf0f..00034908ce 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -359,30 +359,33 @@ obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ
obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
lintflags = \
- -bhn \
+ -b \
+ -n \
-p \
- -s \
-Ncheck=%all \
-Nlevel=4 \
-errfmt=src \
-errtags \
+ -erroff=E_ASSIGN_NARROW_CONV \
-erroff=E_BAD_PTR_CAST \
+ -erroff=E_BAD_PTR_CAST_ALIGN \
+ -erroff=E_BAD_PTR_INT_COMBINATION \
+ -erroff=E_BAD_SIGN_EXTEND \
-erroff=E_BLOCK_DECL_UNUSED \
+ -erroff=E_CASE_FALLTHRU \
-erroff=E_CONSTANT_CONDITION \
- -erroff=E_BAD_PTR_CAST_ALIGN \
- -erroff=E_PTRDIFF_OVERFLOW \
+ -erroff=E_EQUALITY_NOT_ASSIGNMENT \
-erroff=E_EXPR_NULL_EFFECT \
- -erroff=E_BAD_PTR_INT_COMBINATION \
- -erroff=E_LOOP_EMPTY \
- -erroff=E_TRUE_LOGICAL_EXPR \
-erroff=E_FALSE_LOGICAL_EXPR \
- -erroff=E_INDISTING_FROM_TRUNC \
- -erroff=E_POINTER_TO_OBJECT \
- -erroff=E_ASSIGN_NARROW_CONV \
- -erroff=E_BAD_SIGN_EXTEND \
-erroff=E_INCL_NUSD \
+ -erroff=E_INDISTING_FROM_TRUNC \
+ -erroff=E_LOOP_EMPTY \
-erroff=E_MAIN_PARAM \
- -Wfoo.flow
+ -erroff=E_POINTER_TO_OBJECT \
+ -erroff=E_PTRDIFF_OVERFLOW \
+ -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L \
+ -erroff=E_STATIC_UNUSED \
+ -erroff=E_TRUE_LOGICAL_EXPR \
.c$(OBJ_EXT):
$(CCCMD) $(PLDLFLAGS) $*.c
diff --git a/cc_runtime.h b/cc_runtime.h
index 3815d3a5e3..cb8c4caeee 100644
--- a/cc_runtime.h
+++ b/cc_runtime.h
@@ -54,8 +54,7 @@
switch (ret) { \
case 0: \
PL_op = ppaddr(aTHX); \
- /* XXX PL_retstack[PL_retstack_ix - 1] = Nullop; */ \
- if (PL_op != nxt) CALLRUNOPS(); \
+ if (PL_op != nxt) CALLRUNOPS(); \
JMPENV_POP; \
break; \
case 1: JMPENV_POP; JMPENV_JUMP(1); \
diff --git a/cop.h b/cop.h
index 6c26e0ee5a..f0429b17a9 100644
--- a/cop.h
+++ b/cop.h
@@ -150,8 +150,6 @@ struct cop {
SV * cop_io; /* lexical IO defaults */
};
-#define Nullcop Null(COP*)
-
#ifdef USE_ITHREADS
# define CopFILE(c) ((c)->cop_file)
# define CopFILEGV(c) (CopFILE(c) \
@@ -254,7 +252,7 @@ struct block_sub {
cx->blk_sub.cv = cv; \
cx->blk_sub.olddepth = CvDEPTH(cv); \
cx->blk_sub.hasargs = hasargs; \
- cx->blk_sub.retop = Nullop; \
+ cx->blk_sub.retop = NULL; \
if (!CvDEPTH(cv)) { \
(void)SvREFCNT_inc(cv); \
(void)SvREFCNT_inc(cv); \
@@ -276,7 +274,7 @@ struct block_sub {
#define PUSHFORMAT(cx) \
cx->blk_sub.cv = cv; \
cx->blk_sub.gv = gv; \
- cx->blk_sub.retop = Nullop; \
+ cx->blk_sub.retop = NULL; \
cx->blk_sub.hasargs = 0; \
cx->blk_sub.dfoutgv = PL_defoutgv; \
(void)SvREFCNT_inc(cx->blk_sub.dfoutgv)
@@ -348,7 +346,7 @@ struct block_eval {
cx->blk_eval.old_eval_root = PL_eval_root; \
cx->blk_eval.cur_text = PL_linestr; \
cx->blk_eval.cv = NULL; /* set by doeval(), as applicable */ \
- cx->blk_eval.retop = Nullop; \
+ cx->blk_eval.retop = NULL; \
cx->blk_eval.cur_top_env = PL_top_env; \
} STMT_END
diff --git a/deb.c b/deb.c
index a21066e697..df2ccffaa4 100644
--- a/deb.c
+++ b/deb.c
@@ -32,6 +32,8 @@ Perl_deb_nocontext(const char *pat, ...)
va_start(args, pat);
vdeb(pat, &args);
va_end(args);
+#else
+ PERL_UNUSED_ARG(pat);
#endif /* DEBUGGING */
}
#endif
@@ -54,7 +56,7 @@ Perl_vdeb(pTHX_ const char *pat, va_list *args)
{
#ifdef DEBUGGING
dVAR;
- char* file = OutCopFILE(PL_curcop);
+ const char* const file = OutCopFILE(PL_curcop);
PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : "<free>"),
(long)CopLINE(PL_curcop));
diff --git a/embed.fnc b/embed.fnc
index a1c3d2217b..90294ba388 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1042,12 +1042,12 @@ paRxo |void* |get_arena |int svtype
s |void |hsplit |NN HV *hv
s |void |hfreeentries |NN HV *hv
sa |HE* |new_he
-sa |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
-s |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
+sanR |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
+sn |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
s |void |unshare_hek_or_pvn|NULLOK const HEK* hek|NULLOK const char* str|I32 len|U32 hash
sR |HEK* |share_hek_flags|NN const char* sv|I32 len|U32 hash|int flags
rs |void |hv_notallowed |int flags|NN const char *key|I32 klen|NN const char *msg
-s |struct xpvhv_aux*|hv_auxinit|NN HV *hv
+sRn |struct xpvhv_aux*|hv_auxinit|NN HV *hv
sM |SV* |hv_delete_common|NULLOK HV* tb|NULLOK SV* keysv|NULLOK const char* key \
|STRLEN klen|int k_flags|I32 d_flags|U32 hash
sM |HE* |hv_fetch_common|NULLOK HV* tb|NULLOK SV* keysv|NULLOK const char* key \
@@ -1107,7 +1107,7 @@ pR |OP* |ck_substr |NN OP *o
pR |OP* |ck_svconst |NN OP *o
pR |OP* |ck_trunc |NN OP *o
pR |OP* |ck_unpack |NN OP *o
-sR |bool |is_handle_constructor|NN const OP *o|I32 numargs
+sRn |bool |is_handle_constructor|NN const OP *o|I32 numargs
sR |I32 |is_list_assignment|NULLOK const OP *o
s |void |cop_free |NN COP *cop
s |OP* |modkids |NULLOK OP *o|I32 type
@@ -1116,7 +1116,7 @@ sR |OP* |newDEFSVOP
sR |OP* |new_logop |I32 type|I32 flags|NN OP **firstp|NN OP **otherp
s |void |simplify_sort |NN OP *o
s |const char* |gv_ename |NN GV *gv
-s |bool |scalar_mod_type|NN const OP *o|I32 type
+sRn |bool |scalar_mod_type|NN const OP *o|I32 type
s |OP * |my_kid |NULLOK OP *o|NULLOK OP *attrs|NN OP **imopsp
s |OP * |dup_attrlist |NN OP *o
s |void |apply_attrs |NN HV *stash|NN SV *target|NULLOK OP *attrs|bool for_my
@@ -1203,7 +1203,7 @@ 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 *|check_type_and_open|NN const char *name|NN const char *mode
sR |PerlIO *|doopen_pm |NN const char *name|NN const char *mode
-sR |bool |path_is_absolute|NN const char *name
+sRn |bool |path_is_absolute|NN const char *name
sR |I32 |run_user_filter|int idx|NN SV *buf_sv|int maxlen
sR |PMOP* |make_matcher |NN regexp* re
sR |bool |matcher_matches_sv|NN PMOP* matcher|NN SV* sv
@@ -1244,13 +1244,13 @@ Es |regnode*|regatom |NN struct RExC_state_t *state|NN I32 *flagp
Es |regnode*|regbranch |NN struct RExC_state_t *state|NN I32 *flagp|I32 first
Es |void |reguni |NN const struct RExC_state_t *state|UV uv|NN char *s|NN STRLEN *lenp
Es |regnode*|regclass |NN struct RExC_state_t *state
-ERs |I32 |regcurly |NN const char *
+ERsn |I32 |regcurly |NN const char *
Es |regnode*|reg_node |NN struct RExC_state_t *state|U8 op
Es |regnode*|regpiece |NN struct RExC_state_t *state|NN I32 *flagp
Es |void |reginsert |NN struct RExC_state_t *state|U8 op|NN regnode *opnd
Es |void |regoptail |NN struct RExC_state_t *state|NN regnode *p|NN regnode *val
Es |void |regtail |NN struct RExC_state_t *state|NN regnode *p|NN regnode *val
-Es |char* |regwhite |NN char *p|NN const char *e
+EsRn |char* |regwhite |NN char *p|NN const char *e
Es |char* |nextchar |NN struct RExC_state_t *state
# ifdef DEBUGGING
Es |regnode*|dumpuntil |NN regnode *start|NN regnode *node \
@@ -1258,18 +1258,18 @@ Es |regnode*|dumpuntil |NN regnode *start|NN regnode *node \
Es |void |put_byte |NN SV* sv|int c
# endif
Es |void |scan_commit |NN struct RExC_state_t* state|NN struct scan_data_t *data
-Es |void |cl_anything |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
-Es |int |cl_is_anything |NN const struct regnode_charclass_class *cl
-Es |void |cl_init |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
-Es |void |cl_init_zero |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
-Es |void |cl_and |NN struct regnode_charclass_class *cl \
+Esn |void |cl_anything |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
+EsRn |int |cl_is_anything |NN const struct regnode_charclass_class *cl
+Esn |void |cl_init |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
+Esn |void |cl_init_zero |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl
+Esn |void |cl_and |NN struct regnode_charclass_class *cl \
|NN const struct regnode_charclass_class *and_with
-Es |void |cl_or |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl \
+Esn |void |cl_or |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl \
|NN const struct regnode_charclass_class *or_with
Es |I32 |study_chunk |NN struct RExC_state_t* state|NN regnode **scanp \
|NN I32 *deltap|NN regnode *last|NULLOK struct scan_data_t *data \
|U32 flags|U32 depth
-Es |I32 |add_data |NN struct RExC_state_t* state|I32 n|NN const char *s
+EsRn |I32 |add_data |NN struct RExC_state_t* state|I32 n|NN const char *s
rs |void |re_croak2 |NN const char* pat1|NN const char* pat2|...
Es |I32 |regpposixcc |NN struct RExC_state_t* state|I32 value
Es |void |checkposixcc |NN struct RExC_state_t* state
@@ -1290,9 +1290,9 @@ Es |CHECKPOINT|regcppush |I32 parenfloor
Es |char*|regcppop
Es |void |cache_re |NN regexp *prog
ERs |U8* |reghop |NN U8 *pos|I32 off
-ERs |U8* |reghop3 |NN U8 *pos|I32 off|NN U8 *lim
+ERsn |U8* |reghop3 |NN U8 *pos|I32 off|NN U8 *lim
ERs |U8* |reghopmaybe |NN U8 *pos|I32 off
-ERs |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN U8 *lim
+ERsn |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN U8 *lim
ERs |char* |find_byclass |NN regexp * prog|NN regnode *c|NN char *s|NN const char *strend|I32 norun
Es |void |to_utf8_substr |NN regexp * prog
Es |void |to_byte_substr |NN regexp * prog
@@ -1342,9 +1342,18 @@ s |bool |utf8_mg_pos_init |NN SV *sv|NN MAGIC **mgp \
|NN const U8 *s|NN const U8 *start
s |char * |stringify_regexp|NN SV *sv|NN MAGIC *mg|NULLOK STRLEN *lp
sn |char * |F0convert |NV nv|NN char *endbuf|NN STRLEN *len
-#if defined(PERL_OLD_COPY_ON_WRITE)
+# if defined(PERL_OLD_COPY_ON_WRITE)
sM |void |sv_release_COW |NN SV *sv|NN const char *pvx|STRLEN len|NN SV *after
-#endif
+# endif
+s |SV * |more_sv
+s |void * |more_bodies |size_t size|svtype sv_type
+s |bool |sv_2iuv_common |NN SV *sv
+s |void |glob_assign_glob|NN SV *dstr|NN SV *sstr|const int dtype
+s |void |glob_assign_ref|NN SV *dstr|NN SV *sstr
+sRn |PTR_TBL_ENT_t *|ptr_table_find|NN PTR_TBL_t *tbl|NN const void *sv
+s |SV * |find_hash_subscript|NULLOK HV *hv|NN SV *val
+s |I32 |find_array_subscript|NULLOK AV *av|NN SV *val
+s |SV * |find_uninit_var|NULLOK OP *obase|NULLOK SV *uninit_sv|bool match
#endif
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
@@ -1409,7 +1418,7 @@ s |char* |stdize_locale |NN char* locs
#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
-s |COP* |closest_cop |NN COP *cop|NULLOK const OP *o
+s |const COP*|closest_cop |NN const COP *cop|NULLOK const OP *o
s |SV* |mess_alloc
s |const char *|vdie_croak_common|NULLOK const char *pat|NULLOK va_list *args \
|NULLOK STRLEN *msglen|NULLOK I32* utf8
@@ -1423,7 +1432,7 @@ sn |NV|mulexp10 |NV value|I32 exponent
#endif
#if defined(PERL_IN_UTF8_C) || defined(PERL_DECL_PROT)
-s |STRLEN |is_utf8_char_slow|NN const U8 *s|const STRLEN len
+sRn |STRLEN |is_utf8_char_slow|NN const U8 *s|const STRLEN len
sR |bool |is_utf8_common |NN const U8 *const p|NN SV **swash|NN const char * const swashname
sR |SV* |swash_get |NN SV* swash|UV start|UV span
#endif
diff --git a/hv.c b/hv.c
index ca509aa62a..061d0ce62f 100644
--- a/hv.c
+++ b/hv.c
@@ -91,7 +91,7 @@ S_new_he(pTHX)
#endif
STATIC HEK *
-S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags)
+S_save_hek_flags(const char *str, I32 len, U32 hash, int flags)
{
const int flags_masked = flags & HVhek_MASK;
char *k;
@@ -857,7 +857,7 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
}
STATIC void
-S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store)
+S_hv_magic_check(HV *hv, bool *needs_copy, bool *needs_store)
{
const MAGIC *mg = SvMAGIC(hv);
*needs_copy = FALSE;
@@ -1820,7 +1820,7 @@ Perl_hv_undef(pTHX_ HV *hv)
}
static struct xpvhv_aux*
-S_hv_auxinit(pTHX_ HV *hv) {
+S_hv_auxinit(HV *hv) {
struct xpvhv_aux *iter;
char *array;
diff --git a/mg.c b/mg.c
index 2de5a86504..6446b2cc52 100644
--- a/mg.c
+++ b/mg.c
@@ -354,7 +354,7 @@ Perl_mg_find(pTHX_ const SV *sv, int type)
return mg;
}
}
- return 0;
+ return NULL;
}
/*
diff --git a/op.c b/op.c
index 32927d33c6..9580c64865 100644
--- a/op.c
+++ b/op.c
@@ -146,14 +146,14 @@ Perl_Slab_Free(pTHX_ void *op)
}
#endif
/*
- * In the following definition, the ", Nullop" is just to make the compiler
+ * In the following definition, the ", NULL" is just to make the compiler
* think the expression is of the right type: croak actually does a Siglongjmp.
*/
#define CHECKOP(type,o) \
((PL_op_mask && PL_op_mask[type]) \
? ( op_free((OP*)o), \
Perl_croak(aTHX_ "'%s' trapped by operation mask", PL_op_desc[type]), \
- Nullop ) \
+ NULL ) \
: CALL_FPTR(PL_check[type])(aTHX_ (OP*)o))
#define RETURN_UNLIMITED_NUMBER (PERL_INT_MAX / 2)
@@ -316,7 +316,7 @@ Perl_op_free(pTHX_ OP *o)
FreeOp(o);
#ifdef DEBUG_LEAKING_SCALARS
if (PL_op == o)
- PL_op = Nullop;
+ PL_op = NULL;
#endif
}
@@ -426,7 +426,7 @@ clear_pmop:
}
PmopSTASH_free(cPMOPo);
}
- cPMOPo->op_pmreplroot = Nullop;
+ cPMOPo->op_pmreplroot = NULL;
/* we use the "SAFE" version of the PM_ macros here
* since sv_clean_all might release some PMOPs
* after PL_regex_padav has been cleared
@@ -434,7 +434,7 @@ clear_pmop:
* happen before sv_clean_all
*/
ReREFCNT_dec(PM_GETRE_SAFE(cPMOPo));
- PM_SETRE_SAFE(cPMOPo, (REGEXP*)NULL);
+ PM_SETRE_SAFE(cPMOPo, NULL);
#ifdef USE_ITHREADS
if(PL_regex_pad) { /* We could be in destruction */
av_push((AV*) PL_regex_pad[0],(SV*) PL_regex_pad[(cPMOPo)->op_pmoffset]);
@@ -1104,7 +1104,7 @@ Perl_mod(pTHX_ OP *o, I32 type)
NewOp(1101, newop, 1, UNOP);
newop->op_type = OP_RV2CV;
newop->op_ppaddr = PL_ppaddr[OP_RV2CV];
- newop->op_first = Nullop;
+ newop->op_first = NULL;
newop->op_next = (OP*)newop;
kid->op_sibling = (OP*)newop;
newop->op_private |= OPpLVAL_INTRO;
@@ -1138,7 +1138,7 @@ Perl_mod(pTHX_ OP *o, I32 type)
kid->op_next = okid;
}
else
- okid->op_next = Nullop;
+ okid->op_next = NULL;
okid->op_type = OP_RV2CV;
okid->op_targ = 0;
okid->op_ppaddr = PL_ppaddr[OP_RV2CV];
@@ -1362,7 +1362,7 @@ Perl_mod(pTHX_ OP *o, I32 type)
}
STATIC bool
-S_scalar_mod_type(pTHX_ const OP *o, I32 type)
+S_scalar_mod_type(const OP *o, I32 type)
{
switch (type) {
case OP_SASSIGN:
@@ -1409,7 +1409,7 @@ S_scalar_mod_type(pTHX_ const OP *o, I32 type)
}
STATIC bool
-S_is_handle_constructor(pTHX_ const OP *o, I32 numargs)
+S_is_handle_constructor(const OP *o, I32 numargs)
{
switch (o->op_type) {
case OP_PIPE_OP:
@@ -1425,7 +1425,7 @@ S_is_handle_constructor(pTHX_ const OP *o, I32 numargs)
case OP_ACCEPT:
if (numargs == 1)
return TRUE;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
default:
return FALSE;
}
@@ -1551,7 +1551,7 @@ S_dup_attrlist(pTHX_ OP *o)
rop = newSVOP(OP_CONST, o->op_flags, SvREFCNT_inc(cSVOPo->op_sv));
else {
assert((o->op_type == OP_LIST) && (o->op_flags & OPf_KIDS));
- rop = Nullop;
+ rop = NULL;
for (o = cLISTOPo->op_first; o; o=o->op_sibling) {
if (o->op_type == OP_CONST)
rop = append_elem(OP_LIST, rop,
@@ -1664,7 +1664,7 @@ void
Perl_apply_attrs_string(pTHX_ const char *stashpv, CV *cv,
const char *attrstr, STRLEN len)
{
- OP *attrs = Nullop;
+ OP *attrs = NULL;
if (!len) {
len = strlen(attrstr);
@@ -1772,7 +1772,7 @@ Perl_my_attrs(pTHX_ OP *o, OP *attrs)
#endif
if (attrs)
SAVEFREEOP(attrs);
- rops = Nullop;
+ rops = NULL;
o = my_kid(o, attrs, &rops);
if (rops) {
if (maybe_scalar && o->op_type == OP_PADSV) {
@@ -1790,7 +1790,7 @@ Perl_my_attrs(pTHX_ OP *o, OP *attrs)
OP *
Perl_my(pTHX_ OP *o)
{
- return my_attrs(o, Nullop);
+ return my_attrs(o, NULL);
}
OP *
@@ -1892,7 +1892,7 @@ Perl_scope(pTHX_ OP *o)
}
}
else
- o = newLISTOP(OP_SCOPE, 0, o, Nullop);
+ o = newLISTOP(OP_SCOPE, 0, o, NULL);
}
return o;
}
@@ -2174,7 +2174,7 @@ Perl_convert(pTHX_ I32 type, I32 flags, OP *o)
{
dVAR;
if (!o || o->op_type != OP_LIST)
- o = newLISTOP(OP_LIST, 0, o, Nullop);
+ o = newLISTOP(OP_LIST, 0, o, NULL);
else
o->op_flags &= ~OPf_WANT;
@@ -2286,7 +2286,7 @@ OP *
Perl_force_list(pTHX_ OP *o)
{
if (!o || o->op_type != OP_LIST)
- o = newLISTOP(OP_LIST, 0, o, Nullop);
+ o = newLISTOP(OP_LIST, 0, o, NULL);
op_null(o);
return o;
}
@@ -2400,7 +2400,10 @@ Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
return fold_constants((OP *)binop);
}
-static int uvcompare(const void *a, const void *b) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__pure__;
+static int uvcompare(const void *a, const void *b)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__pure__;
static int uvcompare(const void *a, const void *b)
{
if (*((const UV *)a) < (*(const UV *)b))
@@ -2785,7 +2788,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
PMOP *pm;
LOGOP *rcop;
I32 repl_has_vars = 0;
- OP* repl = Nullop;
+ OP* repl = NULL;
bool reglist;
if (o->op_type == OP_SUBST || o->op_type == OP_TRANS) {
@@ -2795,7 +2798,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
kid = cLISTOPx(expr)->op_first;
while (kid->op_sibling != repl)
kid = kid->op_sibling;
- kid->op_sibling = Nullop;
+ kid->op_sibling = NULL;
cLISTOPx(expr)->op_last = kid;
}
@@ -2805,8 +2808,8 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
/* convert single element list to element */
OP* const oe = expr;
expr = cLISTOPx(oe)->op_first->op_sibling;
- cLISTOPx(oe)->op_first->op_sibling = Nullop;
- cLISTOPx(oe)->op_last = Nullop;
+ cLISTOPx(oe)->op_first->op_sibling = NULL;
+ cLISTOPx(oe)->op_last = NULL;
op_free(oe);
}
@@ -3066,7 +3069,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
if (idop->op_type != OP_CONST)
Perl_croak(aTHX_ "Module name must be constant");
- veop = Nullop;
+ veop = NULL;
if (version) {
SV * const vesv = ((SVOP*)version)->op_sv;
@@ -3097,7 +3100,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
if (arg && arg->op_type == OP_STUB)
imop = arg; /* no import on explicit () */
else if (SvNIOKp(((SVOP*)idop)->op_sv)) {
- imop = Nullop; /* use 5.0; */
+ imop = NULL; /* use 5.0; */
if (!aver)
idop->op_private |= OPpCONST_NOVER;
}
@@ -3119,8 +3122,8 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
/* Fake up the BEGIN {}, which does its thing immediately. */
newATTRSUB(floor,
newSVOP(OP_CONST, 0, newSVpvs_share("BEGIN")),
- Nullop,
- Nullop,
+ NULL,
+ NULL,
append_elem(OP_LINESEQ,
append_elem(OP_LINESEQ,
newSTATEOP(0, NULL, newUNOP(OP_REQUIRE, 0, idop)),
@@ -3199,7 +3202,7 @@ Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args)
veop = newSVOP(OP_CONST, 0, ver);
}
else
- veop = Nullop;
+ veop = NULL;
if (flags & PERL_LOADMOD_NOIMPORT) {
imop = sawparens(newNULLLIST());
}
@@ -3208,7 +3211,7 @@ Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args)
}
else {
SV *sv;
- imop = Nullop;
+ imop = NULL;
sv = va_arg(*args, SV*);
while (sv) {
imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
@@ -3427,7 +3430,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
pm->op_pmflags |= PMf_ONCE;
tmpop = cUNOPo->op_first; /* to list (nulled) */
tmpop = ((UNOP*)tmpop)->op_first; /* to pushmark */
- tmpop->op_sibling = Nullop; /* don't free split */
+ tmpop->op_sibling = NULL; /* don't free split */
right->op_next = tmpop->op_next; /* fix starting loc */
op_free(o); /* blow off assign */
right->op_flags &= ~OPf_WANT;
@@ -3563,7 +3566,7 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
first = *firstp = cUNOPo->op_first;
if (o->op_next)
first->op_next = o->op_next;
- cUNOPo->op_first = Nullop;
+ cUNOPo->op_first = NULL;
op_free(o);
}
}
@@ -3576,7 +3579,7 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
(type == OP_OR && !SvTRUE(((SVOP*)first)->op_sv)) ||
(type == OP_DOR && !SvOK(((SVOP*)first)->op_sv))) {
op_free(first);
- *firstp = Nullop;
+ *firstp = NULL;
if (other->op_type == OP_CONST)
other->op_private |= OPpCONST_SHORTCIRCUIT;
return other;
@@ -3600,7 +3603,7 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
}
op_free(other);
- *otherp = Nullop;
+ *otherp = NULL;
if (first->op_type == OP_CONST)
first->op_private |= OPpCONST_SHORTCIRCUIT;
return first;
@@ -3905,7 +3908,7 @@ whileline, OP *expr, OP *block, OP *cont, I32 has_my)
if (o == expr && o->op_type == OP_CONST && !SvTRUE(cSVOPo->op_sv)) {
op_free(expr); /* oops, it's a while (0) */
op_free((OP*)loop);
- return Nullop; /* listop already freed by new_logop */
+ return NULL; /* listop already freed by new_logop */
}
if (listop)
((LISTOP*)listop)->op_last->op_next =
@@ -3961,14 +3964,14 @@ Perl_newFOROP(pTHX_ I32 flags, char *label, line_t forline, OP *sv, OP *expr, OP
padoff = sv->op_targ;
sv->op_targ = 0;
op_free(sv);
- sv = Nullop;
+ sv = NULL;
}
else if (sv->op_type == OP_THREADSV) { /* per-thread variable */
padoff = sv->op_targ;
sv->op_targ = 0;
iterflags |= OPf_SPECIAL;
op_free(sv);
- sv = Nullop;
+ sv = NULL;
}
else
Perl_croak(aTHX_ "Can't use %s for loop variable", PL_op_desc[sv->op_type]);
@@ -4004,7 +4007,7 @@ Perl_newFOROP(pTHX_ I32 flags, char *label, line_t forline, OP *sv, OP *expr, OP
LISTOP* listop;
range->op_flags &= ~OPf_KIDS;
- range->op_first = Nullop;
+ range->op_first = NULL;
listop = (LISTOP*)newLISTOP(OP_LIST, 0, left, right);
listop->op_first->op_next = range->op_next;
@@ -4277,8 +4280,8 @@ Perl_cv_undef(pTHX_ CV *cv)
PAD_SAVE_SETNULLPAD();
op_free(CvROOT(cv));
- CvROOT(cv) = Nullop;
- CvSTART(cv) = Nullop;
+ CvROOT(cv) = NULL;
+ CvSTART(cv) = NULL;
LEAVE;
}
SvPOK_off((SV*)cv); /* forget prototype */
@@ -4450,7 +4453,7 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
CV *
Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)
{
- return Perl_newATTRSUB(aTHX_ floor, o, proto, Nullop, block);
+ return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block);
}
CV *
@@ -4667,7 +4670,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if (PL_error_count) {
op_free(block);
- block = Nullop;
+ block = NULL;
if (name) {
const char *s = strrchr(name, ':');
s = s ? s+1 : name;
@@ -5030,7 +5033,7 @@ Perl_newANONHASH(pTHX_ OP *o)
OP *
Perl_newANONSUB(pTHX_ I32 floor, OP *proto, OP *block)
{
- return newANONATTRSUB(floor, proto, Nullop, block);
+ return newANONATTRSUB(floor, proto, NULL, block);
}
OP *
@@ -5449,7 +5452,7 @@ Perl_ck_rvconst(pTHX_ register OP *o)
o->op_private &= ~HINT_STRICT_REFS;
}
if ((o->op_private & HINT_STRICT_REFS) && (kid->op_private & OPpCONST_BARE)) {
- const char *badthing = NULL;
+ const char *badthing;
switch (o->op_type) {
case OP_RV2SV:
badthing = "a SCALAR";
@@ -5460,6 +5463,9 @@ Perl_ck_rvconst(pTHX_ register OP *o)
case OP_RV2HV:
badthing = "a HASH";
break;
+ default:
+ badthing = NULL;
+ break;
}
if (badthing)
Perl_croak(aTHX_
@@ -6030,7 +6036,7 @@ Perl_ck_smartmatch(pTHX_ OP *o)
OP *second = first->op_sibling;
/* Implicitly take a reference to an array or hash */
- first->op_sibling = Nullop;
+ first->op_sibling = NULL;
first = cBINOPo->op_first = ref_array_or_hash(first);
second = first->op_sibling = ref_array_or_hash(second);
@@ -6570,9 +6576,9 @@ Perl_ck_subr(pTHX_ OP *o)
if (o2->op_type == OP_CONST)
o2->op_private &= ~OPpCONST_STRICT;
else if (o2->op_type == OP_LIST) {
- OP * const o = ((UNOP*)o2)->op_first->op_sibling;
- if (o && o->op_type == OP_CONST)
- o->op_private &= ~OPpCONST_STRICT;
+ OP * const sib = ((UNOP*)o2)->op_first->op_sibling;
+ if (sib && sib->op_type == OP_CONST)
+ sib->op_private &= ~OPpCONST_STRICT;
}
}
o->op_private |= (PL_hints & HINT_STRICT_REFS);
diff --git a/op.h b/op.h
index 4e4aa47d7f..cbf86a085e 100644
--- a/op.h
+++ b/op.h
@@ -522,7 +522,7 @@ struct loop {
#endif
#define OpREFCNT_set(o,n) ((o)->op_targ = (n))
-#define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : Nullop)
+#define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : NULL)
#define OpREFCNT_dec(o) (--(o)->op_targ)
/* flags used by Perl_load_module() */
diff --git a/perl.c b/perl.c
index 3a17b4882a..48757b9da5 100644
--- a/perl.c
+++ b/perl.c
@@ -729,9 +729,9 @@ perl_destruct(pTHXx)
PAD_SET_CUR_NOSAVE(CvPADLIST(PL_main_cv), 1);
}
op_free(PL_main_root);
- PL_main_root = Nullop;
+ PL_main_root = NULL;
}
- PL_main_start = Nullop;
+ PL_main_start = NULL;
SvREFCNT_dec(PL_main_cv);
PL_main_cv = NULL;
PL_dirty = TRUE;
@@ -1554,9 +1554,9 @@ setuid perl scripts securely.\n");
if (PL_main_root) {
op_free(PL_main_root);
- PL_main_root = Nullop;
+ PL_main_root = NULL;
}
- PL_main_start = Nullop;
+ PL_main_start = NULL;
SvREFCNT_dec(PL_main_cv);
PL_main_cv = NULL;
@@ -2420,8 +2420,7 @@ Perl_get_cv(pTHX_ const char *name, I32 create)
if (create && !GvCVu(gv))
return newSUB(start_subparse(FALSE, 0),
newSVOP(OP_CONST, 0, newSVpv(name,0)),
- Nullop,
- Nullop);
+ NULL, NULL);
if (gv)
return GvCVu(gv);
return NULL;
@@ -2524,7 +2523,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
}
Zero(&myop, 1, LOGOP);
- myop.op_next = Nullop;
+ myop.op_next = NULL;
if (!(flags & G_NOARGS))
myop.op_flags |= OPf_STACKED;
myop.op_flags |= ((flags & G_VOID) ? OPf_WANT_VOID :
@@ -2700,7 +2699,7 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
if (!(flags & G_NOARGS))
myop.op_flags = OPf_STACKED;
- myop.op_next = Nullop;
+ myop.op_next = NULL;
myop.op_type = OP_ENTEREVAL;
myop.op_flags |= ((flags & G_VOID) ? OPf_WANT_VOID :
(flags & G_ARRAY) ? OPf_WANT_LIST :
diff --git a/pp.c b/pp.c
index 3a66f73022..d5c2679f44 100644
--- a/pp.c
+++ b/pp.c
@@ -771,7 +771,7 @@ PP(pp_undef)
if (cv_const_sv((CV*)sv) && ckWARN(WARN_MISC))
Perl_warner(aTHX_ packWARN(WARN_MISC), "Constant subroutine %s undefined",
CvANON((CV*)sv) ? "(anonymous)" : GvENAME(CvGV((CV*)sv)));
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case SVt_PVFM:
{
/* let user-undef'd sub keep its identity */
diff --git a/pp_ctl.c b/pp_ctl.c
index 3f0168e836..1ebea195cf 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2730,7 +2730,7 @@ S_docatch(pTHX_ OP *o)
}
JMPENV_POP;
PL_op = oldop;
- return Nullop;
+ return NULL;
}
OP *
@@ -2918,11 +2918,11 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
/* try to compile it */
- PL_eval_root = Nullop;
+ PL_eval_root = NULL;
PL_error_count = 0;
PL_curcop = &PL_compiling;
PL_curcop->cop_arybase = 0;
- if (saveop && saveop->op_type != OP_REQUIRE && saveop->op_flags & OPf_SPECIAL)
+ if (saveop && (saveop->op_type != OP_REQUIRE) && (saveop->op_flags & OPf_SPECIAL))
PL_in_eval |= EVAL_KEEPERR;
else
sv_setpvn(ERRSV,"",0);
@@ -2935,7 +2935,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
PL_op = saveop;
if (PL_eval_root) {
op_free(PL_eval_root);
- PL_eval_root = Nullop;
+ PL_eval_root = NULL;
}
SP = PL_stack_base + POPMARK; /* pop original mark */
if (!startop) {
@@ -4570,7 +4570,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
/* perhaps someone can come up with a better name for
this? it is not really "absolute", per se ... */
static bool
-S_path_is_absolute(pTHX_ const char *name)
+S_path_is_absolute(const char *name)
{
if (PERL_FILE_IS_ABSOLUTE(name)
#ifdef MACOS_TRADITIONAL
diff --git a/pp_sort.c b/pp_sort.c
index 3ea07d57a0..48595886cb 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1536,7 +1536,7 @@ PP(pp_sort)
}
}
else {
- PL_sortcop = Nullop;
+ PL_sortcop = NULL;
stash = CopSTASH(PL_curcop);
}
diff --git a/regcomp.c b/regcomp.c
index 5d9fb63e53..625479cc99 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -487,7 +487,7 @@ S_scan_commit(pTHX_ RExC_state_t *pRExC_state, scan_data_t *data)
/* Can match anything (initialization) */
STATIC void
-S_cl_anything(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
+S_cl_anything(RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
{
ANYOF_CLASS_ZERO(cl);
ANYOF_BITMAP_SETALL(cl);
@@ -498,7 +498,7 @@ S_cl_anything(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *c
/* Can match anything (initialization) */
STATIC int
-S_cl_is_anything(pTHX_ const struct regnode_charclass_class *cl)
+S_cl_is_anything(const struct regnode_charclass_class *cl)
{
int value;
@@ -514,7 +514,7 @@ S_cl_is_anything(pTHX_ const struct regnode_charclass_class *cl)
/* Can match anything (initialization) */
STATIC void
-S_cl_init(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
+S_cl_init(RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
{
Zero(cl, 1, struct regnode_charclass_class);
cl->type = ANYOF;
@@ -522,7 +522,7 @@ S_cl_init(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
}
STATIC void
-S_cl_init_zero(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
+S_cl_init_zero(RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
{
Zero(cl, 1, struct regnode_charclass_class);
cl->type = ANYOF;
@@ -534,7 +534,7 @@ S_cl_init_zero(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *
/* 'And' a given class with another one. Can create false positives */
/* We assume that cl is not inverted */
STATIC void
-S_cl_and(pTHX_ struct regnode_charclass_class *cl,
+S_cl_and(struct regnode_charclass_class *cl,
const struct regnode_charclass_class *and_with)
{
if (!(and_with->flags & ANYOF_CLASS)
@@ -571,7 +571,7 @@ S_cl_and(pTHX_ struct regnode_charclass_class *cl,
/* 'OR' a given class with another one. Can create false positives */
/* We assume that cl is not inverted */
STATIC void
-S_cl_or(pTHX_ RExC_state_t *pRExC_state, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with)
+S_cl_or(RExC_state_t *pRExC_state, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with)
{
if (or_with->flags & ANYOF_INVERT) {
/* We do not use
@@ -2725,7 +2725,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap,
}
STATIC I32
-S_add_data(pTHX_ RExC_state_t *pRExC_state, I32 n, const char *s)
+S_add_data(RExC_state_t *pRExC_state, I32 n, const char *s)
{
if (RExC_rx->data) {
Renewc(RExC_rx->data,
@@ -4413,7 +4413,7 @@ tryagain:
}
STATIC char *
-S_regwhite(pTHX_ char *p, const char *e)
+S_regwhite(char *p, const char *e)
{
while (p < e) {
if (isSPACE(*p))
@@ -5415,7 +5415,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
STATIC char*
S_nextchar(pTHX_ RExC_state_t *pRExC_state)
{
- dVAR;
char* retval = RExC_parse++;
for (;;) {
@@ -5641,7 +5640,7 @@ S_regoptail(pTHX_ RExC_state_t *pRExC_state, regnode *p, regnode *val)
- regcurly - a little FSA that accepts {\d+,?\d*}
*/
STATIC I32
-S_regcurly(pTHX_ register const char *s)
+S_regcurly(register const char *s)
{
if (*s++ != '{')
return FALSE;
diff --git a/regexec.c b/regexec.c
index e374871ab6..919a12b9da 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3466,7 +3466,7 @@ S_regmatch(pTHX_ regnode *prog)
PL_regcc = cc.oldcc;
saySAME(n);
}
- /* NOT REACHED */
+ /* NOTREACHED */
case WHILEM: {
/*
* This is really hard to understand, because after we match
@@ -3667,7 +3667,7 @@ S_regmatch(pTHX_ regnode *prog)
cc->lastloc = lastloc;
CACHEsayNO;
}
- /* NOT REACHED */
+ /* NOTREACHED */
case BRANCHJ:
next = scan + ARG(scan);
if (next == scan)
@@ -3855,6 +3855,7 @@ S_regmatch(pTHX_ regnode *prog)
}
}
sayNO;
+ /* NOTREACHED */
break;
}
case CURLYN:
@@ -4330,11 +4331,11 @@ do_no:
goto reenter;
}
- /* NOT REACHED */
+ /* NOTREACHED */
default:
Perl_croak(aTHX_ "regexp unwind memory corruption");
}
- /* NOT REACHED */
+ /* NOTREACHED */
}
#ifdef DEBUGGING
PL_regindent--;
@@ -4827,11 +4828,11 @@ STATIC U8 *
S_reghop(pTHX_ U8 *s, I32 off)
{
dVAR;
- return S_reghop3(aTHX_ s, off, (U8*)(off >= 0 ? PL_regeol : PL_bostr));
+ return S_reghop3(s, off, (U8*)(off >= 0 ? PL_regeol : PL_bostr));
}
STATIC U8 *
-S_reghop3(pTHX_ U8 *s, I32 off, U8* lim)
+S_reghop3(U8 *s, I32 off, U8* lim)
{
dVAR;
if (off >= 0) {
@@ -4859,11 +4860,11 @@ STATIC U8 *
S_reghopmaybe(pTHX_ U8 *s, I32 off)
{
dVAR;
- return S_reghopmaybe3(aTHX_ s, off, (U8*)(off >= 0 ? PL_regeol : PL_bostr));
+ return S_reghopmaybe3(s, off, (U8*)(off >= 0 ? PL_regeol : PL_bostr));
}
STATIC U8 *
-S_reghopmaybe3(pTHX_ U8* s, I32 off, U8* lim)
+S_reghopmaybe3(U8* s, I32 off, U8* lim)
{
dVAR;
if (off >= 0) {
diff --git a/sv.c b/sv.c
index 9c379b8638..a26c14a952 100644
--- a/sv.c
+++ b/sv.c
@@ -3305,7 +3305,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
S_glob_assign_glob(aTHX_ dstr, sstr, dtype);
return;
}
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
default:
if (SvGMAGICAL(sstr) && (flags & SV_GMAGIC)) {
@@ -5721,7 +5721,7 @@ Perl_sv_cmp_locale(pTHX_ register SV *sv1, register SV *sv2)
*/
raw_compare:
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
#endif /* USE_LOCALE_COLLATE */
@@ -7032,8 +7032,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
* declaration! */
newSUB(start_subparse(FALSE, 0),
newSVOP(OP_CONST, 0, tmpsv),
- Nullop,
- Nullop);
+ NULL, NULL);
LEAVE;
if (!GvCVu(gv))
Perl_croak(aTHX_ "Unable to create sub named \"%"SVf"\"",
@@ -7863,7 +7862,7 @@ S_expect_number(pTHX_ char** pattern)
case '7': case '8': case '9':
var = *(*pattern)++ - '0';
while (isDIGIT(**pattern)) {
- I32 tmp = var * 10 + (*(*pattern)++ - '0');
+ const I32 tmp = var * 10 + (*(*pattern)++ - '0');
if (tmp < var)
Perl_croak(aTHX_ "Integer overflow in format string for %s", (PL_op ? OP_NAME(PL_op) : "sv_vcatpvfn"));
var = tmp;
@@ -8325,7 +8324,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
#endif
#if defined(HAS_QUAD) || defined(HAS_LONG_DOUBLE)
case 'L': /* Ld */
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
#ifdef HAS_QUAD
case 'q': /* qd */
#endif
@@ -8341,9 +8340,9 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
break;
}
#endif
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'h':
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'V':
intsize = *q++;
break;
@@ -8446,7 +8445,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
#else
intsize = 'l';
#endif
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'd':
case 'i':
#if vdNUMBER
@@ -8512,7 +8511,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
#else
intsize = 'l';
#endif
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'u':
base = 10;
goto uns_integer;
@@ -8527,7 +8526,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
#else
intsize = 'l';
#endif
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'o':
base = 8;
goto uns_integer;
@@ -8637,7 +8636,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
case 'F':
c = 'f'; /* maybe %F isn't supported here */
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
case 'e': case 'E':
case 'f':
case 'g': case 'G':
@@ -8658,7 +8657,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
break;
/* [perl #20339] - we should accept and ignore %lf rather than die */
case 'l':
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
default:
#if defined(USE_LONG_DOUBLE)
intsize = args ? 0 : 'q';
@@ -8668,7 +8667,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
#if defined(HAS_LONG_DOUBLE)
break;
#else
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
#endif
case 'h':
goto unknown;
@@ -9295,7 +9294,7 @@ Perl_ptr_table_new(pTHX)
/* map an existing pointer using a table */
STATIC PTR_TBL_ENT_t *
-S_ptr_table_find(pTHX_ PTR_TBL_t *tbl, const void *sv) {
+S_ptr_table_find(PTR_TBL_t *tbl, const void *sv) {
PTR_TBL_ENT_t *tblent;
const UV hash = PTR_TABLE_HASH(sv);
assert(tbl);
@@ -9310,7 +9309,7 @@ S_ptr_table_find(pTHX_ PTR_TBL_t *tbl, const void *sv) {
void *
Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, const void *sv)
{
- PTR_TBL_ENT_t const *const tblent = S_ptr_table_find(aTHX_ tbl, sv);
+ PTR_TBL_ENT_t const *const tblent = ptr_table_find(tbl, sv);
return tblent ? tblent->newval : (void *) 0;
}
@@ -9319,7 +9318,7 @@ Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, const void *sv)
void
Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, const void *oldsv, void *newsv)
{
- PTR_TBL_ENT_t *tblent = S_ptr_table_find(aTHX_ tbl, oldsv);
+ PTR_TBL_ENT_t *tblent = S_ptr_table_find(tbl, oldsv);
if (tblent) {
tblent->newval = newsv;
@@ -10093,12 +10092,12 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
OpREFCNT_inc(o);
break;
default:
- TOPPTR(nss,ix) = Nullop;
+ TOPPTR(nss,ix) = NULL;
break;
}
}
else
- TOPPTR(nss,ix) = Nullop;
+ TOPPTR(nss,ix) = NULL;
break;
case SAVEt_FREEPV:
c = (char*)POPPTR(ss,ix);
@@ -10314,17 +10313,17 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
IV i;
CLONE_PARAMS clone_params;
- CLONE_PARAMS* param = &clone_params;
+ CLONE_PARAMS* const param = &clone_params;
- PerlInterpreter *my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+ PerlInterpreter * const my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
/* for each stash, determine whether its objects should be cloned */
S_visit(proto_perl, do_mark_cloneable_stash, SVt_PVHV, SVTYPEMASK);
PERL_SET_THX(my_perl);
# ifdef DEBUGGING
Poison(my_perl, 1, PerlInterpreter);
- PL_op = Nullop;
- PL_curcop = (COP *)Nullop;
+ PL_op = NULL;
+ PL_curcop = NULL;
PL_markstack = 0;
PL_scopestack = 0;
PL_savestack = 0;
@@ -10350,15 +10349,15 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
IV i;
CLONE_PARAMS clone_params;
CLONE_PARAMS* param = &clone_params;
- PerlInterpreter *my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
+ PerlInterpreter * const my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
/* for each stash, determine whether its objects should be cloned */
S_visit(proto_perl, do_mark_cloneable_stash, SVt_PVHV, SVTYPEMASK);
PERL_SET_THX(my_perl);
# ifdef DEBUGGING
Poison(my_perl, 1, PerlInterpreter);
- PL_op = Nullop;
- PL_curcop = (COP *)Nullop;
+ PL_op = NULL;
+ PL_curcop = NULL;
PL_markstack = 0;
PL_scopestack = 0;
PL_savestack = 0;
@@ -10973,7 +10972,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_errors = sv_dup_inc(proto_perl->Terrors, param);
PL_hv_fetch_ent_mh = Nullhe;
PL_modcount = proto_perl->Tmodcount;
- PL_lastgotoprobe = Nullop;
+ PL_lastgotoprobe = NULL;
PL_dumpindent = proto_perl->Tdumpindent;
PL_sortcop = (OP*)any_dup(proto_perl->Tsortcop, proto_perl);
@@ -11536,7 +11535,6 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
? '@' : '%',
o->op_targ, NULL, 0, FUV_SUBSCRIPT_WITHIN);
}
-
break;
case OP_AASSIGN:
@@ -11601,7 +11599,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
case OP_CHOMP:
if (SvROK(PL_rs) && uninit_sv == SvRV(PL_rs))
return sv_2mortal(newSVpvs("${$/}"));
- /* FALL THROUGH */
+ /*FALLTHROUGH*/
default:
do_op:
@@ -11615,7 +11613,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
/* if all except one arg are constant, or have no side-effects,
* or are optimized away, then it's unambiguous */
- o2 = Nullop;
+ o2 = NULL;
for (kid=o; kid; kid = kid->op_sibling) {
if (kid &&
( (kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid)))
@@ -11625,7 +11623,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
)
continue;
if (o2) { /* more than one found */
- o2 = Nullop;
+ o2 = NULL;
break;
}
o2 = kid;
diff --git a/toke.c b/toke.c
index 8f01720491..c5f9c8fe9f 100644
--- a/toke.c
+++ b/toke.c
@@ -1083,7 +1083,7 @@ STATIC char *
S_force_version(pTHX_ char *s, int guessing)
{
dVAR;
- OP *version = Nullop;
+ OP *version = NULL;
char *d;
s = skipspace(s);
@@ -1206,7 +1206,7 @@ S_sublex_start(pTHX)
if (op_type == OP_NULL) {
yylval.opval = PL_lex_op;
- PL_lex_op = Nullop;
+ PL_lex_op = NULL;
return THING;
}
if (op_type == OP_CONST || op_type == OP_READLINE) {
@@ -1238,7 +1238,7 @@ S_sublex_start(pTHX)
PL_expect = XTERM;
if (PL_lex_op) {
yylval.opval = PL_lex_op;
- PL_lex_op = Nullop;
+ PL_lex_op = NULL;
return PMFUNC;
}
else
@@ -1302,7 +1302,7 @@ S_sublex_push(pTHX)
if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST)
PL_lex_inpat = PL_sublex_info.sub_op;
else
- PL_lex_inpat = Nullop;
+ PL_lex_inpat = NULL;
return '(';
}
@@ -1893,15 +1893,15 @@ S_scan_const(pTHX_ char *start)
and then encode the next character */
if ((has_utf8 || this_utf8) && !NATIVE_IS_INVARIANT((U8)(*s))) {
STRLEN len = 1;
- const UV uv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s);
- const STRLEN need = UNISKIP(NATIVE_TO_UNI(uv));
+ const UV nextuv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s);
+ const STRLEN need = UNISKIP(NATIVE_TO_UNI(nextuv));
s += len;
if (need > len) {
/* encoded value larger than old, need extra space (NOTE: SvCUR() not set here) */
const STRLEN off = d - SvPVX_const(sv);
d = SvGROW(sv, SvLEN(sv) + (need-len)) + off;
}
- d = (char*)uvchr_to_utf8((U8*)d, uv);
+ d = (char*)uvchr_to_utf8((U8*)d, nextuv);
has_utf8 = TRUE;
}
else {
@@ -2399,7 +2399,7 @@ S_tokenize_use(pTHX_ int is_use, char *s) {
if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
s = force_version(s, TRUE);
if (*s == ';' || (s = skipspace(s), *s == ';')) {
- PL_nextval[PL_nexttoke].opval = Nullop;
+ PL_nextval[PL_nexttoke].opval = NULL;
force_next(WORD);
}
else if (*s == 'v') {
@@ -3272,7 +3272,7 @@ Perl_yylex(pTHX)
PL_expect = XTERMBLOCK;
grabattrs:
s = skipspace(s);
- attrs = Nullop;
+ attrs = NULL;
while (isIDFIRST_lazy_if(s,UTF)) {
I32 tmp;
d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len);
@@ -3846,9 +3846,9 @@ Perl_yylex(pTHX)
char tmpbuf[sizeof PL_tokenbuf];
for (t++; isSPACE(*t); t++) ;
if (isIDFIRST_lazy_if(t,UTF)) {
- STRLEN len;
+ STRLEN dummylen;
t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE,
- &len);
+ &dummylen);
for (; isSPACE(*t); t++) ;
if (*t == ';' && get_cv(tmpbuf, FALSE))
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
@@ -4464,9 +4464,9 @@ Perl_yylex(pTHX)
PL_last_lop_op = OP_ENTERSUB;
/* Is there a prototype? */
if (SvPOK(cv)) {
- STRLEN len;
- const char *proto = SvPV_const((SV*)cv, len);
- if (!len)
+ STRLEN protolen;
+ const char *proto = SvPV_const((SV*)cv, protolen);
+ if (!protolen)
TERM(FUNC0SUB);
if (*proto == '$' && proto[1] == '\0')
OPERATOR(UNIOPSUB);
@@ -5104,10 +5104,10 @@ Perl_yylex(pTHX)
/* [perl #16184] */
&& !(t[0] == '=' && t[1] == '>')
) {
- int len = (int)(d-s);
+ int parms_len = (int)(d-s);
Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE),
"Precedence problem: open %.*s should be open(%.*s)",
- len, s, len, s);
+ parms_len, s, parms_len, s);
}
}
LOP(OP_OPEN,XTERM);
@@ -5172,7 +5172,7 @@ Perl_yylex(pTHX)
PL_expect = XOPERATOR;
force_next(')');
if (SvCUR(PL_lex_stuff)) {
- OP *words = Nullop;
+ OP *words = NULL;
int warned = 0;
d = SvPV_force(PL_lex_stuff, len);
while (len) {
@@ -10373,13 +10373,13 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
/* update debugger info */
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV * const sv = newSV(0);
+ SV * const line_sv = newSV(0);
- sv_upgrade(sv, SVt_PVMG);
- sv_setsv(sv,PL_linestr);
- (void)SvIOK_on(sv);
- SvIV_set(sv, 0);
- av_store(CopFILEAVx(PL_curcop), (I32)CopLINE(PL_curcop), sv);
+ sv_upgrade(line_sv, SVt_PVMG);
+ sv_setsv(line_sv,PL_linestr);
+ (void)SvIOK_on(line_sv);
+ SvIV_set(line_sv, 0);
+ av_store(CopFILEAVx(PL_curcop), (I32)CopLINE(PL_curcop), line_sv);
}
/* having changed the buffer, we must update PL_bufend */
@@ -10815,7 +10815,7 @@ vstring:
if (sv)
lvalp->opval = newSVOP(OP_CONST, 0, sv);
else
- lvalp->opval = Nullop;
+ lvalp->opval = NULL;
return (char *)s;
}
@@ -10922,6 +10922,8 @@ S_set_csh(pTHX)
dVAR;
if (!PL_cshlen)
PL_cshlen = strlen(PL_cshname);
+#else
+ PERL_UNUSED_ARG(my_perl);
#endif
}
diff --git a/utf8.c b/utf8.c
index e3d8d09662..a926735c9e 100644
--- a/utf8.c
+++ b/utf8.c
@@ -186,7 +186,7 @@ five bytes or more.
=cut */
STATIC STRLEN
-S_is_utf8_char_slow(pTHX_ const U8 *s, const STRLEN len)
+S_is_utf8_char_slow(const U8 *s, const STRLEN len)
{
U8 u = *s;
STRLEN slen;
diff --git a/util.c b/util.c
index 420232c4db..c10dd29e11 100644
--- a/util.c
+++ b/util.c
@@ -1046,8 +1046,8 @@ Perl_mess(pTHX_ const char *pat, ...)
return retval;
}
-STATIC COP*
-S_closest_cop(pTHX_ COP *cop, const OP *o)
+STATIC const COP*
+S_closest_cop(pTHX_ const COP *cop, const OP *o)
{
dVAR;
/* Look for PL_op starting from o. cop is the last COP we've seen. */
@@ -1056,15 +1056,15 @@ S_closest_cop(pTHX_ COP *cop, const OP *o)
return cop;
if (o->op_flags & OPf_KIDS) {
- OP *kid;
+ const OP *kid;
for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling) {
- COP *new_cop;
+ const COP *new_cop;
/* If the OP_NEXTSTATE has been optimised away we can still use it
* the get the file and line number. */
if (kid->op_type == OP_NULL && kid->op_targ == OP_NEXTSTATE)
- cop = (COP *)kid;
+ cop = (const COP *)kid;
/* Keep searching, and return when we've found something. */
@@ -1076,7 +1076,7 @@ S_closest_cop(pTHX_ COP *cop, const OP *o)
/* Nothing found. */
- return Null(COP *);
+ return NULL;
}
SV *
@@ -1084,11 +1084,9 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
{
dVAR;
SV * const sv = mess_alloc();
- static const char dgd[] = " during global destruction.\n";
- sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
-
/*
* Try and find the file and line for PL_op. This will usually be
* PL_curcop, but it might be a cop that has been optimised away. We
@@ -1097,7 +1095,8 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
*/
const COP *cop = closest_cop(PL_curcop, PL_curcop->op_sibling);
- if (!cop) cop = PL_curcop;
+ if (!cop)
+ cop = PL_curcop;
if (CopLINE(cop))
Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
@@ -1106,12 +1105,13 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
const bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX_const(PL_rs) == '\n');
Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,
- PL_last_in_gv == PL_argvgv ?
- "" : GvNAME(PL_last_in_gv),
+ PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
line_mode ? "line" : "chunk",
(IV)IoLINES(GvIOp(PL_last_in_gv)));
}
- sv_catpv(sv, PL_dirty ? dgd : ".\n");
+ if (PL_dirty)
+ sv_catpvs(sv, " during global destruction");
+ sv_catpvs(sv, ".\n");
}
return sv;
}