obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
lintflags = \
- -bh \
+ -bhn \
-p \
-s \
-Ncheck=%all \
-Nlevel=4 \
- -errfmt=simple \
+ -errfmt=src \
-errtags \
-erroff=E_BAD_PTR_CAST \
-erroff=E_BLOCK_DECL_UNUSED \
-erroff=E_EXPR_NULL_EFFECT \
-erroff=E_BAD_PTR_INT_COMBINATION \
-erroff=E_LOOP_EMPTY \
- *.c
+ -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_MAIN_PARAM \
+ -Wfoo.flow
.c$(OBJ_EXT):
$(CCCMD) $(PLDLFLAGS) $*.c
.PHONY: lint
lint: $(c)
rm -f *.ln
- lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c) perly.c
+ lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
# Need to unset during recursion to go out of loop.
# The README below ensures that the dependency list is never empty and
perl emacs/e2ctags.pl TAGS > tags
ctags:
- ctags -f Tags --totals --languages=c --langmap=c:+.h *.c *.h
+ ctags -f Tags -N --totals --languages=c --langmap=c:+.h *.c *.h
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
# If this runs make out of memory, delete /usr/include lines.
xlC.aix50.rte 5.0.2.0 or 6.0.0.3
-subversions are not the same `latest' on all OS versions. For example,
+subversions are not the same "latest" on all OS versions. For example,
the latest xlC-5 on aix41 is 5.0.2.9, while on aix43, it is 5.0.2.7.
Perl can be compiled with either IBM's ANSI C compiler or with gcc.
versions from ftp-available updates if the first three digit groups
are the same (in where you can skip intermediate unlike the patches
in the developer snapshots of perl), or to one version up where the
-`base' is available. In other words, the AIX compiler patches are
+"base" is available. In other words, the AIX compiler patches are
cumulative.
vac.C.4.4.0.1 => vac.C.4.4.0.3 is OK (vac.C.4.4.0.2 not needed)
Apa |OP* |newPADOP |I32 type|I32 flags|SV* sv
Apa |OP* |newPMOP |I32 type|I32 flags
Apa |OP* |newPVOP |I32 type|I32 flags|char* pv
-Apa |SV* |newRV |SV* pref
+Apa |SV* |newRV |NN SV* pref
Apda |SV* |newRV_noinc |NN SV *sv
Apda |SV* |newSV |STRLEN len
Apa |OP* |newSVREF |NN OP* o
s |void |unshare_hek_or_pvn|HEK* hek|const char* str|I32 len|U32 hash
sR |HE* |share_hek_flags|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
-asR |struct xpvhv_aux*|hv_auxinit|HV *hv
+s |struct xpvhv_aux*|hv_auxinit|HV *hv
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
#endif
#if defined(USE_PERLIO) && !defined(USE_SFIO)
-Ap |int |PerlIO_close |PerlIO *
-Ap |int |PerlIO_fill |PerlIO *
-Ap |int |PerlIO_fileno |PerlIO *
-Ap |int |PerlIO_eof |PerlIO *
-Ap |int |PerlIO_error |PerlIO *
-Ap |int |PerlIO_flush |PerlIO *
-Ap |void |PerlIO_clearerr |PerlIO *
-Ap |void |PerlIO_set_cnt |PerlIO *|int
-Ap |void |PerlIO_set_ptrcnt |PerlIO *|STDCHAR *|int
-Ap |void |PerlIO_setlinebuf |PerlIO *
-Ap |SSize_t|PerlIO_read |PerlIO *|void *|Size_t
-Ap |SSize_t|PerlIO_write |PerlIO *|const void *|Size_t
-Ap |SSize_t|PerlIO_unread |PerlIO *|const void *|Size_t
-Ap |Off_t |PerlIO_tell |PerlIO *
-Ap |int |PerlIO_seek |PerlIO *|Off_t|int
+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 |STDCHAR *|PerlIO_get_base |PerlIO *
-Ap |STDCHAR *|PerlIO_get_ptr |PerlIO *
-Ap |int |PerlIO_get_bufsiz |PerlIO *
-Ap |int |PerlIO_get_cnt |PerlIO *
+Ap |STDCHAR *|PerlIO_get_base |PerlIO *f
+Ap |STDCHAR *|PerlIO_get_ptr |PerlIO *f
+Ap |int |PerlIO_get_bufsiz |PerlIO *f
+Ap |int |PerlIO_get_cnt |PerlIO *f
Ap |PerlIO *|PerlIO_stdin
Ap |PerlIO *|PerlIO_stdout
|I32 stack_max|I32 mark_min|I32 mark_max
#endif
-pd |PADLIST*|pad_new |int flags
+pda |PADLIST*|pad_new |int flags
pd |void |pad_undef |CV* cv
pd |PADOFFSET|pad_add_name |NN const char *name\
|HV* typestash|HV* ourstash \
|bool clone
pd |PADOFFSET|pad_add_anon |SV* sv|OPCODE op_type
-pd |void |pad_check_dup |const char* name|bool is_our|const HV* ourstash
+pd |void |pad_check_dup |NN const char* name|bool is_our|NN const HV* ourstash
#ifdef DEBUGGING
-pd |void |pad_setsv |PADOFFSET po|SV* sv
+pd |void |pad_setsv |PADOFFSET po|NN SV* sv
#endif
pd |void |pad_block_start|int full
pd |void |pad_tidy |padtidy_type type
-pd |void |do_dump_pad |I32 level|PerlIO *file \
- |PADLIST *padlist|int full
-pd |void |pad_fixup_inner_anons|PADLIST *padlist|CV *old_cv|CV *new_cv
+pd |void |do_dump_pad |I32 level|NN PerlIO *file|PADLIST *padlist|int full
+pd |void |pad_fixup_inner_anons|NN PADLIST *padlist|CV *old_cv|CV *new_cv
-pd |void |pad_push |PADLIST *padlist|int depth
+pd |void |pad_push |NN PADLIST *padlist|int depth
p |HV* |pad_compname_type|const PADOFFSET po
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
|SV** out_capture|SV** out_name_sv \
|int *out_flags
# if defined(DEBUGGING)
-sd |void |cv_dump |const CV *cv|const char *title
+sd |void |cv_dump |NN const CV *cv|NN const char *title
# endif
#endif
pdR |CV* |find_runcv |U32 *db_seqp
p |int |get_debug_opts |const char **s|bool givehelp
#endif
Ap |void |save_set_svflags|SV* sv|U32 mask|U32 val
-Apod |void |hv_assert |HV* tb
+Apod |void |hv_assert |NN HV* tb
#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
sM |SV* |hv_delete_common|HV* tb|SV* key_sv|const char* key|STRLEN klen|int k_flags|I32 d_flags|U32 hash
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|NN HE* eiter
+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
Apd |void |hv_clear_placeholders |NN HV* hb
ApoR |I32* |hv_placeholders_p |NN HV* hv
ApoR |I32 |hv_placeholders_get |NN HV* hv
-ApoR |void |hv_placeholders_set |NN HV* hv|I32 ph
+Apo |void |hv_placeholders_set |NN HV* hv|I32 ph
-p |SV* |magic_scalarpack|HV* hv|MAGIC* mg
+p |SV* |magic_scalarpack|NN HV* hv|NN MAGIC* mg
#ifdef PERL_IN_SV_C
sMd |SV* |find_uninit_var|OP* obase|SV* uninit_sv|bool top
#endif
I32
Perl_hv_iterinit(pTHX_ HV *hv)
{
- register XPVHV* xhv;
HE *entry;
if (!hv)
Perl_croak(aTHX_ "Bad hash");
- xhv = (XPVHV*)SvANY(hv);
if (SvOOK(hv)) {
struct xpvhv_aux *iter = HvAUX(hv);
if (exponent == 0)
return value;
if (value == 0)
- return 0;
+ return (NV)0;
/* On OpenVMS VAX we by default use the D_FLOAT double format,
* and that format does not have *easy* capabilities [1] for
}
OP *
-Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *block,OP *cont)
+Perl_newFOROP(pTHX_ I32 flags, char *label, line_t forline, OP *sv, OP *expr, OP *block, OP *cont)
{
dVAR;
LOOP *loop;
*/
UNOP* flip = (UNOP*)((UNOP*)((BINOP*)expr)->op_first)->op_first;
LOGOP* range = (LOGOP*) flip->op_first;
- OP* left = range->op_first;
- OP* right = left->op_sibling;
+ OP* const left = range->op_first;
+ OP* const right = left->op_sibling;
LISTOP* listop;
range->op_flags &= ~OPf_KIDS;
if (GvCVGEN(gv)) {
/* just a cached method */
SvREFCNT_dec(cv);
- cv = 0;
+ cv = Nullcv;
}
else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
/* already defined (or promised) */
/* XXX It's possible for this HvNAME_get to return null, and get passed into strEQ */
- if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
- && strEQ(HvNAME_get(GvSTASH(CvGV(cv))), "autouse"))) {
- const line_t oldline = CopLINE(PL_curcop);
- if (PL_copline != NOLINE)
- CopLINE_set(PL_curcop, PL_copline);
- Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
- CvCONST(cv) ? "Constant subroutine %s redefined"
- : "Subroutine %s redefined"
- ,name);
- CopLINE_set(PL_curcop, oldline);
+ if (ckWARN(WARN_REDEFINE)) {
+ GV * const gvcv = CvGV(cv);
+ if (gvcv) {
+ HV * const stash = GvSTASH(gvcv);
+ if (stash) {
+ const char *name = HvNAME_get(stash);
+ if ( strEQ(name,"autouse") ) {
+ const line_t oldline = CopLINE(PL_curcop);
+ if (PL_copline != NOLINE)
+ CopLINE_set(PL_curcop, PL_copline);
+ Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
+ CvCONST(cv) ? "Constant subroutine %s redefined"
+ : "Subroutine %s redefined"
+ ,name);
+ CopLINE_set(PL_curcop, oldline);
+ }
+ }
+ }
}
SvREFCNT_dec(cv);
- cv = 0;
+ cv = Nullcv;
}
}
Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
{
I32 ix;
- AV *comppad_name = (AV*)AvARRAY(padlist)[0];
- AV *comppad = (AV*)AvARRAY(padlist)[1];
+ AV * const comppad_name = (AV*)AvARRAY(padlist)[0];
+ AV * const comppad = (AV*)AvARRAY(padlist)[1];
SV **namepad = AvARRAY(comppad_name);
SV **curpad = AvARRAY(comppad);
for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
=back
After the rc file is read, the debugger reads the C<$ENV{PERLDB_OPTS}>
-environment variable and parses this as the remainder of a `O ...'
+environment variable and parses this as the remainder of a "O ..."
line as one might enter at the debugger prompt. You may place the
initialization options C<TTY>, C<noTTY>, C<ReadLine>, and C<NonStop>
there.
When debugging a script that uses #! and is thus normally found in
$PATH, the -S option causes perl to search $PATH for it, so you don't
-have to type the path or `which $scriptname`.
+have to type the path or C<which $scriptname>.
$ perl -Sd foo.pl
if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs
&& CopSTASH_eq(PL_curcop, PL_debstash))
{
- AV *ary = cx->blk_sub.argarray;
- const int off = AvARRAY(ary) - AvALLOC(ary);
+ AV * const ary = cx->blk_sub.argarray;
+ const int off = AvARRAY(ary) - AvALLOC(ary);
if (!PL_dbargs) {
GV* tmpgv;
PERL_CALLCONV SV* Perl_newRV(pTHX_ SV* pref)
__attribute__malloc__
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV SV* Perl_newRV_noinc(pTHX_ SV *sv)
__attribute__malloc__
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_4);
-STATIC struct xpvhv_aux* S_hv_auxinit(pTHX_ HV *hv)
- __attribute__malloc__
- __attribute__warn_unused_result__;
-
+STATIC struct xpvhv_aux* S_hv_auxinit(pTHX_ HV *hv);
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
#endif
#if defined(USE_PERLIO) && !defined(USE_SFIO)
-PERL_CALLCONV int Perl_PerlIO_close(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_fill(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_fileno(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_eof(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_error(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_flush(pTHX_ PerlIO *);
-PERL_CALLCONV void Perl_PerlIO_clearerr(pTHX_ PerlIO *);
-PERL_CALLCONV void Perl_PerlIO_set_cnt(pTHX_ PerlIO *, int);
-PERL_CALLCONV void Perl_PerlIO_set_ptrcnt(pTHX_ PerlIO *, STDCHAR *, int);
-PERL_CALLCONV void Perl_PerlIO_setlinebuf(pTHX_ PerlIO *);
-PERL_CALLCONV SSize_t Perl_PerlIO_read(pTHX_ PerlIO *, void *, Size_t);
-PERL_CALLCONV SSize_t Perl_PerlIO_write(pTHX_ PerlIO *, const void *, Size_t);
-PERL_CALLCONV SSize_t Perl_PerlIO_unread(pTHX_ PerlIO *, const void *, Size_t);
-PERL_CALLCONV Off_t Perl_PerlIO_tell(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_seek(pTHX_ PerlIO *, Off_t, int);
-
-PERL_CALLCONV STDCHAR * Perl_PerlIO_get_base(pTHX_ PerlIO *);
-PERL_CALLCONV STDCHAR * Perl_PerlIO_get_ptr(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_get_bufsiz(pTHX_ PerlIO *);
-PERL_CALLCONV int Perl_PerlIO_get_cnt(pTHX_ PerlIO *);
+PERL_CALLCONV int Perl_PerlIO_close(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_fill(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_fileno(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_eof(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_error(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_flush(pTHX_ PerlIO *f);
+PERL_CALLCONV void Perl_PerlIO_clearerr(pTHX_ PerlIO *f);
+PERL_CALLCONV void Perl_PerlIO_set_cnt(pTHX_ PerlIO *f, int cnt);
+PERL_CALLCONV void Perl_PerlIO_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR *ptr, int cnt)
+ __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV void Perl_PerlIO_setlinebuf(pTHX_ PerlIO *f);
+PERL_CALLCONV SSize_t Perl_PerlIO_read(pTHX_ PerlIO *f, void *buf, Size_t count)
+ __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV SSize_t Perl_PerlIO_write(pTHX_ PerlIO *f, const void *buf, Size_t count)
+ __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV SSize_t Perl_PerlIO_unread(pTHX_ PerlIO *f, const void *buf, Size_t count)
+ __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV Off_t Perl_PerlIO_tell(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_seek(pTHX_ PerlIO *f, Off_t offset, int whence);
+
+PERL_CALLCONV STDCHAR * Perl_PerlIO_get_base(pTHX_ PerlIO *f);
+PERL_CALLCONV STDCHAR * Perl_PerlIO_get_ptr(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_get_bufsiz(pTHX_ PerlIO *f);
+PERL_CALLCONV int Perl_PerlIO_get_cnt(pTHX_ PerlIO *f);
PERL_CALLCONV PerlIO * Perl_PerlIO_stdin(pTHX);
PERL_CALLCONV PerlIO * Perl_PerlIO_stdout(pTHX);
STATIC void S_deb_stack_n(pTHX_ SV** stack_base, I32 stack_min, I32 stack_max, I32 mark_min, I32 mark_max);
#endif
-PERL_CALLCONV PADLIST* Perl_pad_new(pTHX_ int flags);
+PERL_CALLCONV PADLIST* Perl_pad_new(pTHX_ int flags)
+ __attribute__malloc__
+ __attribute__warn_unused_result__;
+
PERL_CALLCONV void Perl_pad_undef(pTHX_ CV* cv);
PERL_CALLCONV PADOFFSET Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool clone)
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV PADOFFSET Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type);
-PERL_CALLCONV void Perl_pad_check_dup(pTHX_ const char* name, bool is_our, const HV* ourstash);
+PERL_CALLCONV void Perl_pad_check_dup(pTHX_ const char* name, bool is_our, const HV* ourstash)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_3);
+
#ifdef DEBUGGING
-PERL_CALLCONV void Perl_pad_setsv(pTHX_ PADOFFSET po, SV* sv);
+PERL_CALLCONV void Perl_pad_setsv(pTHX_ PADOFFSET po, SV* sv)
+ __attribute__nonnull__(pTHX_2);
+
#endif
PERL_CALLCONV void Perl_pad_block_start(pTHX_ int full);
PERL_CALLCONV void Perl_pad_tidy(pTHX_ padtidy_type type);
-PERL_CALLCONV void Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padlist, int full);
-PERL_CALLCONV void Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv);
+PERL_CALLCONV void Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padlist, int full)
+ __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);
+
+
+PERL_CALLCONV void Perl_pad_push(pTHX_ PADLIST *padlist, int depth)
+ __attribute__nonnull__(pTHX_1);
-PERL_CALLCONV void Perl_pad_push(pTHX_ PADLIST *padlist, int depth);
PERL_CALLCONV HV* Perl_pad_compname_type(pTHX_ const PADOFFSET po);
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
STATIC PADOFFSET S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags);
# if defined(DEBUGGING)
-STATIC void S_cv_dump(pTHX_ const CV *cv, const char *title);
+STATIC void S_cv_dump(pTHX_ const CV *cv, const char *title)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
# endif
#endif
PERL_CALLCONV CV* Perl_find_runcv(pTHX_ U32 *db_seqp)
PERL_CALLCONV int Perl_get_debug_opts(pTHX_ const char **s, bool givehelp);
#endif
PERL_CALLCONV void Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val);
-PERL_CALLCONV void Perl_hv_assert(pTHX_ HV* tb);
+PERL_CALLCONV void Perl_hv_assert(pTHX_ HV* tb)
+ __attribute__nonnull__(pTHX_1);
+
#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
STATIC SV* S_hv_delete_common(pTHX_ HV* tb, SV* key_sv, const char* key, STRLEN klen, int k_flags, I32 d_flags, U32 hash);
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_hv_eiter_set(pTHX_ HV* hv, HE* eiter)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
+ __attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_hv_name_set(pTHX_ HV* hv, const char *name, I32 len, int flags)
__attribute__nonnull__(pTHX_1);
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV void Perl_hv_placeholders_set(pTHX_ HV* hv, I32 ph)
- __attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-PERL_CALLCONV SV* Perl_magic_scalarpack(pTHX_ HV* hv, MAGIC* mg);
+PERL_CALLCONV SV* Perl_magic_scalarpack(pTHX_ HV* hv, MAGIC* mg)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
#ifdef PERL_IN_SV_C
STATIC SV* S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool top);
#endif
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
report_uninit(sv);
}
- return 0;
+ return (NV)0;
}
}
if (SvTHINKFIRST(sv)) {
flags. NWC, 2000/11/25 */
/* Both already have p flags, so do nothing */
} else {
- NV nv = SvNVX(sv);
+ const NV nv = SvNVX(sv);
if (SvNVX(sv) < (NV)IV_MAX + 0.5) {
if (SvIVX(sv) == I_V(nv)) {
SvNOK_on(sv);
if (numtype & IS_NUMBER_NOT_INT) {
/* UV and NV both imprecise. */
} else {
- UV nv_as_uv = U_V(nv);
+ const UV nv_as_uv = U_V(nv);
if (value == nv_as_uv && SvUVX(sv) != UV_MAX) {
SvNOK_on(sv);
S_asIV(pTHX_ SV *sv)
{
UV value;
- int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), &value);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), &value);
if ((numtype & (IS_NUMBER_IN_UV | IS_NUMBER_NOT_INT))
== IS_NUMBER_IN_UV) {
/* At this point I believe I should acquire a global SV mutex. */
if (SvFAKE(sv)) {
const char *pvx = SvPVX_const(sv);
- STRLEN len = SvLEN(sv);
- STRLEN cur = SvCUR(sv);
- U32 hash = SvSHARED_HASH(sv);
- SV *next = SV_COW_NEXT_SV(sv); /* next COW sv in the loop. */
+ const STRLEN len = SvLEN(sv);
+ const STRLEN cur = SvCUR(sv);
+ const U32 hash = SvSHARED_HASH(sv);
+ SV *const next = SV_COW_NEXT_SV(sv); /* next COW sv in the loop. */
if (DEBUG_C_TEST) {
PerlIO_printf(Perl_debug_log,
"Copy on write: Force normal %ld\n",
if (SvFAKE(sv)) {
const char *pvx = SvPVX_const(sv);
const int is_utf8 = SvUTF8(sv);
- STRLEN len = SvCUR(sv);
- U32 hash = SvSHARED_HASH(sv);
+ const STRLEN len = SvCUR(sv);
+ const U32 hash = SvSHARED_HASH(sv);
SvFAKE_off(sv);
SvREADONLY_off(sv);
- SvPV_set(sv, (char*)0);
- SvLEN_set(sv, 0);
+ SvPV_set(sv, Nullch);
+ SvLEN_set(sv, 0);
SvGROW(sv, len + 1);
Move(pvx,SvPVX_const(sv),len,char);
*SvEND(sv) = '\0';
while (cont) {
int offset = s - SvPVX_const(PL_linestr);
- bool found = sv_cat_decode(sv, PL_encoding, PL_linestr,
+ const bool found = sv_cat_decode(sv, PL_encoding, PL_linestr,
&offset, (char*)termstr, termlen);
const char *ns = SvPVX_const(PL_linestr) + offset;
char *svlast = SvEND(sv) - 1;
char *
Perl_instr(pTHX_ register const char *big, register const char *little)
{
- register const char *s, *x;
register I32 first;
if (!little)
if (!first)
return (char*)big;
while (*big) {
+ register const char *s, *x;
if (*big++ != first)
continue;
for (x=big,s=little; *s; /**/ ) {
char *
Perl_ninstr(pTHX_ register const char *big, register const char *bigend, const char *little, const char *lend)
{
- register const char *s, *x;
register const I32 first = *little;
register const char *littleend = lend;
return Nullch;
bigend -= littleend - little++;
while (big <= bigend) {
+ register const char *s, *x;
if (*big++ != first)
continue;
for (x=big,s=little; s < littleend; /**/ ) {
Perl_rninstr(pTHX_ register const char *big, const char *bigend, const char *little, const char *lend)
{
register const char *bigbeg;
- register const char *s, *x;
register const I32 first = *little;
register const char *littleend = lend;
bigbeg = big;
big = bigend - (littleend - little++);
while (big >= bigbeg) {
+ register const char *s, *x;
if (*big-- != first)
continue;
for (x=big+2,s=little; s < littleend; /**/ ) {
if (len == 0) /* TAIL might be on a zero-length string. */
return;
if (len > 2) {
- U8 mlen;
const unsigned char *sb;
+ const U8 mlen = (len>255) ? 255 : (U8)len;
- if (len > 255)
- mlen = 255;
- else
- mlen = (U8)len;
Sv_Grow(sv, len + 256 + FBM_TABLE_OFFSET);
table = (unsigned char*)(SvPVX_mutable(sv) + len + FBM_TABLE_OFFSET);
s = table - 1 - FBM_TABLE_OFFSET; /* last char */
/* This should be better than FBM if c1 == c2, and almost
as good otherwise: maybe better since we do less indirection.
And we save a lot of memory by caching no table. */
- register unsigned char c1 = little[0];
- register unsigned char c2 = little[1];
+ const unsigned char c1 = little[0];
+ const unsigned char c2 = little[1];
s = big + 1;
bigend--;
goto check_end;
}
else { /* less expensive than calling strncmp() */
- register unsigned char *olds = s;
+ register unsigned char * const olds = s;
tmp = littlelen;
char *
Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift, I32 *old_posp, I32 last)
{
- register unsigned char *s, *x;
register unsigned char *big;
register I32 pos;
register I32 previous;
}
big -= previous;
do {
+ register unsigned char *s, *x;
if (pos >= stop_pos) break;
if (big[pos] != first)
continue;
char *
Perl_savepv(pTHX_ const char *pv)
{
- register char *newaddr;
-#ifdef PERL_MALLOC_WRAP
- STRLEN pvlen;
-#endif
if (!pv)
return Nullch;
+ else {
+ char *newaddr;
+ const STRLEN pvlen = strlen(pv)+1;
+ New(902,newaddr,pvlen,char);
+ return strcpy(newaddr,pv);
+ }
-#ifdef PERL_MALLOC_WRAP
- pvlen = strlen(pv)+1;
- New(902,newaddr,pvlen,char);
-#else
- New(902,newaddr,strlen(pv)+1,char);
-#endif
- return strcpy(newaddr,pv);
}
/* same thing but with a known length */
len = av_len((AV *)vs);
if ( len == -1 )
{
- Perl_sv_catpv(aTHX_ sv,"0");
+ sv_catpvn(sv,"0",1);
return sv;
}
digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
if ( (int)PERL_ABS(digit) != 0 || len == 1 )
{
if ( digit < 0 ) /* alpha version */
- Perl_sv_catpv(aTHX_ sv,"_");
+ sv_catpvn(sv,"_",1);
/* Don't display additional trailing zeros */
Perl_sv_catpvf(aTHX_ sv,"%03d", (int)PERL_ABS(digit));
}
}
else /* len == 0 */
{
- Perl_sv_catpv(aTHX_ sv,"000");
+ sv_catpvn(sv,"000",3);
}
return sv;
}
len = av_len((AV *)vs);
if ( len == -1 )
{
- Perl_sv_catpv(aTHX_ sv,"");
+ sv_catpvn(sv,"",0);
return sv;
}
digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
if ( len <= 2 ) { /* short version, must be at least three */
for ( len = 2 - len; len != 0; len-- )
- Perl_sv_catpv(aTHX_ sv,".0");
+ sv_catpvn(sv,".0",2);
}
return sv;