From: Andy Lester Date: Sun, 10 Jul 2005 14:36:35 +0000 (-0500) Subject: Making my way thru embed.fnc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=890ce7af62ab97fd07b5b49562f13e94286469fb;p=p5sagit%2Fp5-mst-13.2.git Making my way thru embed.fnc Message-ID: <20050710193635.GC8081@petdance.com> p4raw-id: //depot/perl@25107 --- diff --git a/doio.c b/doio.c index e9b37ca..0ecfe7d 100644 --- a/doio.c +++ b/doio.c @@ -71,7 +71,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs, I32 num_svs) { - (void)num_svs; + PERL_UNUSED_ARG(num_svs); return do_openn(gv, name, len, as_raw, rawmode, rawperm, supplied_fp, &svs, 1); } @@ -82,7 +82,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, I32 num_svs) { dVAR; - register IO *io = GvIOn(gv); + register IO * const io = GvIOn(gv); PerlIO *saveifp = Nullfp; PerlIO *saveofp = Nullfp; int savefd = -1; @@ -1455,12 +1455,11 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp, #if defined(MACOS_TRADITIONAL) || defined(SYMBIAN) Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system"); #else - register char **a; - const char *tmps = Nullch; - if (sp > mark) { Newx(PL_Argv, sp - mark + 1, char*); - a = PL_Argv; + char **a = PL_Argv; + const char *tmps = Nullch; + while (++mark <= sp) { if (*mark) *a++ = (char*)SvPV_nolen_const(*mark); @@ -1649,7 +1648,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) register I32 tot = 0; const char *what; const char *s; - SV **oldmark = mark; + SV ** const oldmark = mark; #define APPLY_TAINT_PROPER() \ STMT_START { \ @@ -1980,7 +1979,7 @@ Perl_do_ipcctl(pTHX_ I32 optype, SV **mark, SV **sp) const I32 id = SvIVx(*++mark); const I32 n = (optype == OP_SEMCTL) ? SvIVx(*++mark) : 0; const I32 cmd = SvIVx(*++mark); - (void)sp; + PERL_UNUSED_ARG(sp); astr = *++mark; infosize = 0; @@ -2103,7 +2102,7 @@ Perl_do_msgsnd(pTHX_ SV **mark, SV **sp) I32 msize, flags; STRLEN len; const I32 id = SvIVx(*++mark); - (void)sp; + PERL_UNUSED_ARG(sp); mstr = *++mark; flags = SvIVx(*++mark); @@ -2126,7 +2125,7 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp) long mtype; I32 msize, flags, ret; const I32 id = SvIVx(*++mark); - (void)sp; + PERL_UNUSED_ARG(sp); mstr = *++mark; /* suppress warning when reading into undef var --jhi */ @@ -2162,7 +2161,7 @@ Perl_do_semop(pTHX_ SV **mark, SV **sp) const char *opbuf; STRLEN opsize; const I32 id = SvIVx(*++mark); - (void)sp; + PERL_UNUSED_ARG(sp); opstr = *++mark; opbuf = SvPV_const(opstr, opsize); @@ -2216,7 +2215,7 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp) I32 mpos, msize; struct shmid_ds shmds; const I32 id = SvIVx(*++mark); - (void)sp; + PERL_UNUSED_ARG(sp); mstr = *++mark; mpos = SvIVx(*++mark); @@ -2297,7 +2296,8 @@ Perl_start_glob (pTHX_ SV *tmpglob, IO *io) #include char rslt[NAM$C_MAXRSS+1+sizeof(unsigned short int)] = {'\0','\0'}; char vmsspec[NAM$C_MAXRSS+1]; - char *rstr = rslt + sizeof(unsigned short int), *begin, *end, *cp; + char * const rstr = rslt + sizeof(unsigned short int); + char *begin, *end, *cp; $DESCRIPTOR(dfltdsc,"SYS$DISK:[]*.*;"); PerlIO *tmpfp; STRLEN i; diff --git a/doop.c b/doop.c index 3604b94..27c3248 100644 --- a/doop.c +++ b/doop.c @@ -1017,7 +1017,7 @@ Perl_do_chomp(pTHX_ register SV *sv) count = 0; if (SvTYPE(sv) == SVt_PVAV) { register I32 i; - AV* av = (AV*)sv; + AV* const av = (AV*)sv; const I32 max = AvFILL(av); for (i = 0; i <= max; i++) { @@ -1028,7 +1028,7 @@ Perl_do_chomp(pTHX_ register SV *sv) return count; } else if (SvTYPE(sv) == SVt_PVHV) { - HV* hv = (HV*)sv; + HV* const hv = (HV*)sv; HE* entry; (void)hv_iterinit(hv); while ((entry = hv_iternext(hv))) @@ -1390,7 +1390,7 @@ Perl_do_kv(pTHX) while ((entry = hv_iternext(keys))) { SPAGAIN; if (dokeys) { - SV* sv = hv_iterkeysv(entry); + SV* const sv = hv_iterkeysv(entry); XPUSHs(sv); /* won't clobber stack_sp */ } if (dovalues) { diff --git a/embed.fnc b/embed.fnc index 66bcaf1..6346937 100644 --- a/embed.fnc +++ b/embed.fnc @@ -79,8 +79,8 @@ Anop |Free_t |mfree |Malloc_t where npR |MEM_SIZE|malloced_size |void *p #endif -Anp |void* |get_context -Anp |void |set_context |void *thx +AnpR |void* |get_context +Anp |void |set_context |NN void *thx END_EXTERN_C @@ -88,31 +88,31 @@ END_EXTERN_C START_EXTERN_C # include "pp_proto.h" Ap |SV* |amagic_call |SV* left|SV* right|int method|int dir -Ap |bool |Gv_AMupdate |HV* stash -Ap |CV* |gv_handler |HV* stash|I32 id -p |OP* |append_elem |I32 optype|OP* head|OP* tail -p |OP* |append_list |I32 optype|LISTOP* first|LISTOP* last -p |I32 |apply |I32 type|SV** mark|SV** sp -ApM |void |apply_attrs_string|const char *stashpv|CV *cv|const char *attrstr|STRLEN len -Apd |void |av_clear |AV* ar -Apd |SV* |av_delete |AV* ar|I32 key|I32 flags -ApdR |bool |av_exists |AV* ar|I32 key +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 +p |OP* |append_list |I32 optype|NULLOK LISTOP* first|NULLOK LISTOP* last +p |I32 |apply |I32 type|NN SV** mark|NN SV** sp +ApM |void |apply_attrs_string|NN const char *stashpv|NN CV *cv|NN const char *attrstr|STRLEN len +Apd |void |av_clear |NULLOK AV* ar +Apd |SV* |av_delete |NULLOK AV* ar|I32 key|I32 flags +ApdR |bool |av_exists |NULLOK AV* ar|I32 key Apd |void |av_extend |NN AV* ar|I32 key pR |AV* |av_fake |I32 size|NN SV** svp -ApdR |SV** |av_fetch |AV* ar|I32 key|I32 lval -Apd |void |av_fill |AV* ar|I32 fill -ApdR |I32 |av_len |const AV* ar +ApdR |SV** |av_fetch |NULLOK AV* ar|I32 key|I32 lval +Apd |void |av_fill |NN AV* ar|I32 fill +ApdR |I32 |av_len |NN const AV* ar ApdR |AV* |av_make |I32 size|NN SV** svp -Apd |SV* |av_pop |AV* ar -Apd |void |av_push |AV* ar|SV* val -p |void |av_reify |AV* ar -ApdR |SV* |av_shift |AV* ar -Apd |SV** |av_store |AV* ar|I32 key|SV* val -Apd |void |av_undef |AV* ar -Apd |void |av_unshift |AV* ar|I32 num -Apo |SV** |av_arylen_p |AV* av +Apd |SV* |av_pop |NULLOK AV* ar +Apd |void |av_push |NULLOK AV* ar|NN SV* val +p |void |av_reify |NN AV* ar +ApdR |SV* |av_shift |NULLOK AV* ar +Apd |SV** |av_store |NULLOK AV* ar|I32 key|SV* val +Apd |void |av_undef |NULLOK AV* ar +Apd |void |av_unshift |NULLOK AV* ar|I32 num +Apo |SV** |av_arylen_p |NN AV* av pR |OP* |bind_match |I32 type|NN OP* left|NN OP* pat -pR |OP* |block_end |I32 floor|OP* seq +pR |OP* |block_end |I32 floor|NN OP* seq ApR |I32 |block_gimme pR |int |block_start |int full p |void |boot_core_UNIVERSAL @@ -126,43 +126,43 @@ ApR |UV |cast_uv |NV f #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP) ApR |I32 |my_chsize |int fd|Off_t length #endif -pR |OP* |convert |I32 optype|I32 flags|OP* o -Afprd |void |croak |const char* pat|... -Apr |void |vcroak |const char* pat|va_list* args +pR |OP* |convert |I32 optype|I32 flags|NULLOK OP* o +Afprd |void |croak |NN const char* pat|... +Apr |void |vcroak |NN const char* pat|va_list* args #if defined(PERL_IMPLICIT_CONTEXT) -Afnrp |void |croak_nocontext|const char* pat|... -Afnp |OP* |die_nocontext |const char* pat|... -Afnp |void |deb_nocontext |const char* pat|... -Afnp |char* |form_nocontext |const char* pat|... -Anp |void |load_module_nocontext|U32 flags|SV* name|SV* ver|... -Afnp |SV* |mess_nocontext |const char* pat|... -Afnp |void |warn_nocontext |const char* pat|... -Afnp |void |warner_nocontext|U32 err|const char* pat|... -Afnp |SV* |newSVpvf_nocontext|const char* pat|... -Afnp |void |sv_catpvf_nocontext|SV* sv|const char* pat|... -Afnp |void |sv_setpvf_nocontext|SV* sv|const char* pat|... -Afnp |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|... -Afnp |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|... -Afnp |int |fprintf_nocontext|PerlIO* stream|const char* fmt|... -Afnp |int |printf_nocontext|const char* fmt|... -#endif -p |void |cv_ckproto |NN const CV* cv|const GV* gv|const char* p +Afnrp |void |croak_nocontext|NN const char* pat|... +Afnp |OP* |die_nocontext |NN const char* pat|... +Afnp |void |deb_nocontext |NN const char* pat|... +Afnp |char* |form_nocontext |NN const char* pat|... +Anp |void |load_module_nocontext|U32 flags|NN SV* name|NN SV* ver|... +Afnp |SV* |mess_nocontext |NN const char* pat|... +Afnp |void |warn_nocontext |NN const char* pat|... +Afnp |void |warner_nocontext|U32 err|NN const char* pat|... +Afnp |SV* |newSVpvf_nocontext|NN const char* pat|... +Afnp |void |sv_catpvf_nocontext|NN SV* sv|const char* pat|... +Afnp |void |sv_setpvf_nocontext|NN SV* sv|const char* pat|... +Afnp |void |sv_catpvf_mg_nocontext|NN SV* sv|const char* pat|... +Afnp |void |sv_setpvf_mg_nocontext|NN SV* sv|const char* pat|... +Afnp |int |fprintf_nocontext|NN PerlIO* stream|NN const char* fmt|... +Afnp |int |printf_nocontext|NN const char* fmt|... +#endif +p |void |cv_ckproto |NN const CV* cv|NULLOK const GV* gv|NULLOK const char* p pd |CV* |cv_clone |NN CV* proto -Apd |SV* |cv_const_sv |CV* cv -p |SV* |op_const_sv |const OP* o|CV* cv -Apd |void |cv_undef |CV* cv -Ap |void |cx_dump |PERL_CONTEXT* cs +ApdR |SV* |cv_const_sv |NULLOK CV* cv +pR |SV* |op_const_sv |NULLOK const OP* o|NULLOK CV* cv +Apd |void |cv_undef |NN CV* cv +Ap |void |cx_dump |NN PERL_CONTEXT* cx Ap |SV* |filter_add |NULLOK filter_t funcp|NULLOK SV* datasv -Ap |void |filter_del |filter_t funcp -Ap |I32 |filter_read |int idx|SV* buffer|int maxlen +Ap |void |filter_del |NN filter_t funcp +ApR |I32 |filter_read |int idx|NN SV* buffer|int maxlen ApPR |char** |get_op_descs ApPR |char** |get_op_names pPR |const char* |get_no_modify pPR |U32* |get_opargs ApPR |PPADDR_t*|get_ppaddr EpR |I32 |cxinc -Afp |void |deb |const char* pat|... -Ap |void |vdeb |const char* pat|va_list* args +Afp |void |deb |NN const char* pat|... +Ap |void |vdeb |NN const char* pat|va_list* args Ap |void |debprofdump Ap |I32 |debop |NN const OP* o Ap |I32 |debstack @@ -171,24 +171,24 @@ Ap |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ |NN const char* fromend|int delim|NN I32* retlen p |void |deprecate |NN const char* s p |void |deprecate_old |NN const char* s -Afp |OP* |die |const char* pat|... -p |OP* |vdie |const char* pat|va_list* args -p |OP* |die_where |const char* message|STRLEN msglen +Afp |OP* |die |NN const char* pat|... +p |OP* |vdie |NULLOK const char* pat|NULLOK va_list* args +p |OP* |die_where |NN const char* message|STRLEN msglen Ap |void |dounwind |I32 cxix -p |bool |do_aexec |SV* really|SV** mark|SV** sp -p |bool |do_aexec5 |SV* really|SV** mark|SV** sp|int fd|int flag +p |bool |do_aexec |NULLOK SV* really|NN SV** mark|NN SV** sp +p |bool |do_aexec5 |NULLOK SV* really|NN SV** mark|NN SV** sp|int fd|int flag Ap |int |do_binmode |NN PerlIO *fp|int iotype|int mode p |void |do_chop |NN SV* asv|NN SV* sv Ap |bool |do_close |NN GV* gv|bool not_implicit p |bool |do_eof |NN GV* gv p |bool |do_exec |NN char* cmd #if defined(WIN32) || defined(SYMBIAN) -Ap |int |do_aspawn |SV* really|SV** mark|SV** sp -Ap |int |do_spawn |char* cmd -Ap |int |do_spawn_nowait|char* cmd +Ap |int |do_aspawn |NN SV* really|NN SV** mark|NN SV** sp +Ap |int |do_spawn |NN char* cmd +Ap |int |do_spawn_nowait|NN char* cmd #endif #if !defined(WIN32) -p |bool |do_exec3 |char* cmd|int fd|int flag +p |bool |do_exec3 |NN char* cmd|int fd|int flag #endif p |void |do_execfree #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) @@ -201,42 +201,42 @@ p |I32 |do_shmio |I32 optype|SV** mark|SV** sp #endif Ap |void |do_join |NN SV* sv|NN SV* del|NN SV** mark|NN SV** sp p |OP* |do_kv -Ap |bool |do_open |GV* gv|char* name|I32 len|int as_raw \ - |int rawmode|int rawperm|PerlIO* supplied_fp -Ap |bool |do_open9 |GV *gv|char *name|I32 len|int as_raw \ - |int rawmode|int rawperm|PerlIO *supplied_fp \ - |SV *svs|I32 num -Ap |bool |do_openn |GV *gv|char *name|I32 len|int as_raw \ - |int rawmode|int rawperm|PerlIO *supplied_fp \ - |SV **svp|I32 num -p |void |do_pipe |SV* sv|GV* rgv|GV* wgv -p |bool |do_print |SV* sv|PerlIO* fp -p |OP* |do_readline -p |I32 |do_chomp |SV* sv -p |bool |do_seek |GV* gv|Off_t pos|int whence -Ap |void |do_sprintf |SV* sv|I32 len|SV** sarg -p |Off_t |do_sysseek |GV* gv|Off_t pos|int whence -p |Off_t |do_tell |GV* gv -p |I32 |do_trans |SV* sv +Ap |bool |do_open |NN GV* gv|NN char* name|I32 len|int as_raw \ + |int rawmode|int rawperm|NULLOK PerlIO* supplied_fp +Ap |bool |do_open9 |NN GV *gv|NN char *name|I32 len|int as_raw \ + |int rawmode|int rawperm|NULLOK PerlIO *supplied_fp \ + |NN SV *svs|I32 num +Ap |bool |do_openn |NN GV *gv|NN char *name|I32 len|int as_raw \ + |int rawmode|int rawperm|NULLOK PerlIO *supplied_fp \ + |NULLOK SV **svp|I32 num +p |void |do_pipe |NN SV* sv|NULLOK GV* rgv|NULLOK GV* wgv +p |bool |do_print |NULLOK SV* sv|NN PerlIO* fp +pR |OP* |do_readline +p |I32 |do_chomp |NN SV* sv +p |bool |do_seek |NULLOK GV* gv|Off_t pos|int whence +Ap |void |do_sprintf |NN SV* sv|I32 len|NN SV** sarg +p |Off_t |do_sysseek |NN GV* gv|Off_t pos|int whence +pR |Off_t |do_tell |NN GV* gv +p |I32 |do_trans |NN SV* sv p |UV |do_vecget |NN SV* sv|I32 offset|I32 size p |void |do_vecset |NN SV* sv -p |void |do_vop |I32 optype|SV* sv|SV* left|SV* right -p |OP* |dofile |OP* term -Ap |I32 |dowantarray +p |void |do_vop |I32 optype|NN SV* sv|NN SV* left|NN SV* right +p |OP* |dofile |NN OP* term +ApR |I32 |dowantarray Ap |void |dump_all Ap |void |dump_eval #if defined(DUMP_FDS) Ap |void |dump_fds |char* s #endif Ap |void |dump_form |const GV* gv -Ap |void |gv_dump |GV* gv -Ap |void |op_dump |const OP* arg +Ap |void |gv_dump |NN GV* gv +Ap |void |op_dump |NN const OP* arg Ap |void |pmop_dump |PMOP* pm Ap |void |dump_packsubs |const HV* stash Ap |void |dump_sub |NN const GV* gv -Apd |void |fbm_compile |SV* sv|U32 flags -Apd |char* |fbm_instr |unsigned char* big|unsigned char* bigend \ - |SV* littlesv|U32 flags +Apd |void |fbm_compile |NN SV* sv|U32 flags +ApdR |char* |fbm_instr |NN unsigned char* big|NN unsigned char* bigend \ + |NN SV* littlesv|U32 flags p |char* |find_script |const char *scriptname|bool dosearch \ |const char **search_ext|I32 flags p |OP* |force_list |NN OP* arg @@ -450,7 +450,7 @@ Apd |void |sortsv |SV ** array|size_t num_elts|SVCOMPARE_t cmp Apd |int |mg_clear |SV* sv Apd |int |mg_copy |SV* sv|SV* nsv|const char* key|I32 klen pd |void |mg_localize |SV* sv|SV* nsv -Apd |MAGIC* |mg_find |const SV* sv|int type +ApdR |MAGIC* |mg_find |NULLOK const SV* sv|int type Apd |int |mg_free |SV* sv Apd |int |mg_get |SV* sv Apd |U32 |mg_length |SV* sv @@ -566,7 +566,7 @@ Ap |void |op_free |OP* arg p |void |package |OP* o pd |PADOFFSET|pad_alloc |I32 optype|U32 tmptype p |PADOFFSET|allocmy |NN char* name -pd |PADOFFSET|pad_findmy |NN const char* name +pdR |PADOFFSET|pad_findmy |NN const char* name Ap |PADOFFSET|find_rundefsvoffset | pR |OP* |oopsAV |NN OP* o pR |OP* |oopsHV |NN OP* o @@ -591,10 +591,10 @@ Apd |I32 |call_sv |SV* sv|I32 flags Ap |void |despatch_signals Apd |SV* |eval_pv |NN const char* p|I32 croak_on_error Apd |I32 |eval_sv |NN SV* sv|I32 flags -Apd |SV* |get_sv |NN const char* name|I32 create -Apd |AV* |get_av |NN const char* name|I32 create -Apd |HV* |get_hv |const char* name|I32 create -Apd |CV* |get_cv |const char* name|I32 create +ApdR |SV* |get_sv |NN const char* name|I32 create +ApdR |AV* |get_av |NN const char* name|I32 create +ApdR |HV* |get_hv |NN const char* name|I32 create +ApdR |CV* |get_cv |NN const char* name|I32 create Ap |int |init_i18nl10n |int printwarn Ap |int |init_i18nl14n |int printwarn Ap |void |new_collate |NULLOK const char* newcoll @@ -857,7 +857,7 @@ p |void |vivify_ref |SV* sv|U32 to_what p |I32 |wait4pid |Pid_t pid|int* statusp|int flags p |U32 |parse_unicode_opts|const char **popt p |U32 |seed -p |UV |get_hash_seed +pR |UV |get_hash_seed p |void |report_evil_fh |const GV *gv|const IO *io|I32 op pd |void |report_uninit |SV* uninit_sv Afpd |void |warn |const char* pat|... @@ -873,7 +873,7 @@ p |int |yyparse p |int |yywarn |const char* s #if defined(MYMALLOC) Ap |void |dump_mstats |char* s -Ap |int |get_mstats |perl_mstats_t *buf|int buflen|int level +ApR |int |get_mstats |NN perl_mstats_t *buf|int buflen|int level #endif Anpa |Malloc_t|safesysmalloc |MEM_SIZE nbytes Anpa |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size @@ -1124,7 +1124,7 @@ s |bool |next_symbol |NN struct tempsym* symptr sR |SV* |is_an_int |NN const char *s|STRLEN l s |int |div128 |NN SV *pnum|NN bool *done s |const char *|group_end |NN const char *pat|NN const char *patend|char ender -s |const char *|get_num |NN const char *ppat|NN I32 *lenptr +sR |const char *|get_num |NN const char *ppat|NN I32 *lenptr #endif #if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT) @@ -1295,8 +1295,8 @@ s |void |set_csh s |I32 |sublex_done s |I32 |sublex_push s |I32 |sublex_start -s |char * |filter_gets |SV *sv|PerlIO *fp|STRLEN append -s |HV * |find_in_my_stash|const char *pkgname|I32 len +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) @@ -1327,6 +1327,9 @@ s |char* |stdize_locale |NN char* locs #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) s |COP* |closest_cop |NN 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 +s |void |vdie_common |NULLOK const char *message|STRLEN msglen|I32 utf8 #endif #if defined(PERL_IN_NUMERIC_C) || defined(PERL_DECL_PROT) @@ -1370,8 +1373,8 @@ Ap |int |PerlIO_seek |PerlIO *f|Off_t offset|int whence 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 +ApR |int |PerlIO_get_bufsiz |PerlIO *f +ApR |int |PerlIO_get_cnt |PerlIO *f Ap |PerlIO *|PerlIO_stdin Ap |PerlIO *|PerlIO_stdout @@ -1402,7 +1405,7 @@ pd |void |pad_push |NN PADLIST *padlist|int depth pR |HV* |pad_compname_type|const PADOFFSET po #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT) -sd |PADOFFSET|pad_findlex |NN const char *name|NN const CV* cv|U32 seq|int warn \ +sdR |PADOFFSET|pad_findlex |NN const char *name|NN const CV* cv|U32 seq|int warn \ |NULLOK SV** out_capture|NN SV** out_name_sv \ |NN int *out_flags # if defined(DEBUGGING) @@ -1412,7 +1415,7 @@ 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) -p |int |get_debug_opts |const char **s|bool givehelp +pR |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 |NN HV* tb diff --git a/gv.c b/gv.c index fd8367c..823102c 100644 --- a/gv.c +++ b/gv.c @@ -713,7 +713,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, register const char *namend; HV *stash = 0; const I32 add = flags & ~SVf_UTF8; - (void)full_len; + + PERL_UNUSED_ARG(full_len); if (*name == '*' && isALPHA(name[1])) /* accidental stringify on a GV? */ name++; @@ -1526,7 +1527,7 @@ Perl_gv_handler(pTHX_ HV *stash, I32 id) "Inherited AUTOLOAD for a non-method deprecated", since our caller is going through a function call, not a method call. So return the CV for AUTOLOAD, setting $AUTOLOAD. */ - GV *gv = gv_fetchmethod(stash, PL_AMG_names[id]); + GV * const gv = gv_fetchmethod(stash, PL_AMG_names[id]); if (gv && GvCV(gv)) return GvCV(gv); @@ -1611,13 +1612,13 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) * SV* ref causes confusion with the interpreter variable of * the same name */ - SV* tmpRef=SvRV(left); + SV* const tmpRef=SvRV(left); if (!SvROK(tmpRef) && SvTYPE(tmpRef) <= SVt_PVMG) { /* * Just to be extra cautious. Maybe in some * additional cases sv_setsv is safe, too. */ - SV* newref = newSVsv(tmpRef); + SV* const newref = newSVsv(tmpRef); SvOBJECT_on(newref); SvSTASH_set(newref, (HV*)SvREFCNT_inc(SvSTASH(tmpRef))); return newref; @@ -1627,13 +1628,13 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) case abs_amg: if ((cvp[off1=lt_amg] || cvp[off1=ncmp_amg]) && ((cv = cvp[off=neg_amg]) || (cv = cvp[off=subtr_amg]))) { - SV* nullsv=sv_2mortal(newSViv(0)); + SV* const nullsv=sv_2mortal(newSViv(0)); if (off1==lt_amg) { - SV* lessp = amagic_call(left,nullsv, + SV* const lessp = amagic_call(left,nullsv, lt_amg,AMGf_noright); logic = SvTRUE(lessp); } else { - SV* lessp = amagic_call(left,nullsv, + SV* const lessp = amagic_call(left,nullsv, ncmp_amg,AMGf_noright); logic = (SvNV(lessp) < 0); } diff --git a/hv.c b/hv.c index f1598cb..63149ac 100644 --- a/hv.c +++ b/hv.c @@ -1667,7 +1667,7 @@ S_hfreeentries(pTHX_ HV *hv) entry = array[0]; for (;;) { if (entry) { - register HE *oentry = entry; + register HE * const oentry = entry; entry = HeNEXT(entry); hv_free_ent(hv, oentry); } diff --git a/op.c b/op.c index 4faa42e..1caca14 100644 --- a/op.c +++ b/op.c @@ -1636,7 +1636,7 @@ Perl_apply_attrs_string(pTHX_ const char *stashpv, CV *cv, while (len) { for (; isSPACE(*attrstr) && len; --len, ++attrstr) ; if (len) { - const char *sstr = attrstr; + const char * const sstr = attrstr; for (; !isSPACE(*attrstr) && len; --len, ++attrstr) ; attrs = append_elem(OP_LIST, attrs, newSVOP(OP_CONST, 0, @@ -4157,7 +4157,7 @@ Perl_op_const_sv(pTHX_ const OP *o, CV *cv) o = cLISTOPo->op_first->op_sibling; for (; o; o = o->op_next) { - OPCODE type = o->op_type; + const OPCODE type = o->op_type; if (sv && o->op_next == o) return sv; diff --git a/perl.c b/perl.c index e7796a4..e2872c6 100644 --- a/perl.c +++ b/perl.c @@ -2301,7 +2301,7 @@ set and the variable does not exist then NULL is returned. HV* Perl_get_hv(pTHX_ const char *name, I32 create) { - GV* gv = gv_fetchpv(name, create, SVt_PVHV); + GV* const gv = gv_fetchpv(name, create, SVt_PVHV); if (create) return GvHVn(gv); if (gv) @@ -4753,11 +4753,11 @@ S_incpush(pTHX_ const char *dir, bool addsubdirs, bool addoldvers, bool usesep, * The intent is that /usr/local/bin/perl and .../../lib/perl5 * generates /usr/local/lib/perl5 */ - char *libpath = SvPVX(libdir); + const char *libpath = SvPVX(libdir); STRLEN libpath_len = SvCUR(libdir); if (libpath_len >= 4 && memEQ (libpath, ".../", 4)) { /* Game on! */ - SV *caret_X = get_sv("\030", 0); + SV * const caret_X = get_sv("\030", 0); /* Going to use the SV just as a scratch buffer holding a C string: */ SV *prefix_sv; diff --git a/pp_ctl.c b/pp_ctl.c index 7460d77..c53c6d5 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2343,8 +2343,7 @@ PP(pp_goto) } } else if (CvXSUB(cv)) { /* put GvAV(defgv) back onto stack */ - AV* av; - av = GvAV(PL_defgv); + AV* const av = GvAV(PL_defgv); items = AvFILLp(av) + 1; EXTEND(SP, items+1); /* @_ could have been extended. */ Copy(AvARRAY(av), SP + 1, items, SV*); @@ -2463,12 +2462,12 @@ PP(pp_goto) * We do not care about using sv to call CV; * it's for informational purposes only. */ - SV *sv = GvSV(PL_DBsub); + SV * const sv = GvSV(PL_DBsub); CV *gotocv; save_item(sv); if (PERLDB_SUB_NN) { - int type = SvTYPE(sv); + const int type = SvTYPE(sv); if (type < SVt_PVIV && type != SVt_IV) sv_upgrade(sv, SVt_PVIV); (void)SvIOK_on(sv); @@ -2684,12 +2683,12 @@ STATIC void S_save_lines(pTHX_ AV *array, SV *sv) { const char *s = SvPVX_const(sv); - const char *send = SvPVX_const(sv) + SvCUR(sv); + const char * const send = SvPVX_const(sv) + SvCUR(sv); I32 line = 1; while (s && s < send) { const char *t; - SV *tmpstr = NEWSV(85,0); + SV * const tmpstr = NEWSV(85,0); sv_upgrade(tmpstr, SVt_PVMG); t = strchr(s, '\n'); @@ -3015,7 +3014,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) /* Register with debugger: */ if (PERLDB_INTER && saveop->op_type == OP_REQUIRE) { - CV *cv = get_cv("DB::postponed", FALSE); + CV * const cv = get_cv("DB::postponed", FALSE); if (cv) { dSP; PUSHMARK(SP); @@ -3378,7 +3377,7 @@ PP(pp_require) PL_compiling.cop_io = Nullsv; if (filter_sub || filter_child_proc) { - SV *datasv = filter_add(run_user_filter, Nullsv); + SV * const datasv = filter_add(run_user_filter, Nullsv); IoLINES(datasv) = filter_has_file; IoFMT_GV(datasv) = (GV *)filter_child_proc; IoTOP_GV(datasv) = (GV *)filter_state; @@ -3417,7 +3416,8 @@ PP(pp_entereval) dVAR; dSP; register PERL_CONTEXT *cx; dPOPss; - const I32 gimme = GIMME_V, was = PL_sub_generation; + const I32 gimme = GIMME_V; + const I32 was = PL_sub_generation; char tbuf[TYPE_DIGITS(long) + 12]; char *tmpbuf = tbuf; char *safestr; @@ -3437,7 +3437,7 @@ PP(pp_entereval) /* switch to eval mode */ if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) { - SV *sv = sv_newmortal(); + SV * const sv = sv_newmortal(); Perl_sv_setpvf(aTHX_ sv, "_<(eval %lu)[%s:%"IVdf"]", (unsigned long)++PL_evalseq, CopFILE(PL_curcop), (IV)CopLINE(PL_curcop)); diff --git a/pp_hot.c b/pp_hot.c index 6d66beb..b4b73ad 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1201,9 +1201,9 @@ PP(pp_match) PUTBACK; /* EVAL blocks need stack_sp. */ s = SvPV_const(TARG, len); - strend = s + len; if (!s) DIE(aTHX_ "panic: pp_match"); + strend = s + len; rxtainted = ((pm->op_pmdynflags & PMdf_TAINTED) || (PL_tainted && (pm->op_pmflags & PMf_RETAINT))); TAINT_NOT; @@ -2941,10 +2941,10 @@ Perl_vivify_ref(pTHX_ SV *sv, U32 to_what) PP(pp_method) { dSP; - SV* sv = TOPs; + SV* const sv = TOPs; if (SvROK(sv)) { - SV* rsv = SvRV(sv); + SV* const rsv = SvRV(sv); if (SvTYPE(rsv) == SVt_PVCV) { SETs(rsv); RETURN; @@ -2958,7 +2958,7 @@ PP(pp_method) PP(pp_method_named) { dSP; - SV* sv = cSVOP_sv; + SV* const sv = cSVOP_sv; U32 hash = SvSHARED_HASH(sv); XPUSHs(method_common(sv, &hash)); diff --git a/regexec.c b/regexec.c index 802ed18..6a644d9 100644 --- a/regexec.c +++ b/regexec.c @@ -416,8 +416,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, char *check_at = Nullch; /* check substr found at this pos */ const I32 multiline = prog->reganch & PMf_MULTILINE; #ifdef DEBUGGING - char *i_strpos = strpos; - SV *dsv = PERL_DEBUG_PAD_ZERO(0); + const char * const i_strpos = strpos; + SV * const dsv = PERL_DEBUG_PAD_ZERO(0); #endif GET_RE_DEBUG_FLAGS_DECL; @@ -615,7 +615,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, if (check == (do_utf8 ? prog->float_utf8 : prog->float_substr)) { do_other_anchored: { - char *last = HOP3c(s, -start_shift, strbeg), *last1, *last2; + char * const last = HOP3c(s, -start_shift, strbeg); + char *last1, *last2; char *s1 = s; SV* must; @@ -861,7 +862,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, regstclass does not come from lookahead... */ /* If regstclass takes bytelength more than 1: If charlength==1, OK. This leaves EXACTF only, which is dealt with in find_byclass(). */ - const U8* str = (U8*)STRING(prog->regstclass); + const U8* const str = (U8*)STRING(prog->regstclass); const int cl_l = (PL_regkind[(U8)OP(prog->regstclass)] == EXACT ? CHR_DIST(str+STR_LEN(prog->regstclass), str) : 1); @@ -4670,8 +4671,8 @@ Perl_regclass_swash(pTHX_ register const regnode* node, bool doinit, SV** listsv const U32 n = ARG(node); if (PL_regdata->what[n] == 's') { - SV *rv = (SV*)PL_regdata->data[n]; - AV *av = (AV*)SvRV((SV*)rv); + SV * const rv = (SV*)PL_regdata->data[n]; + AV * const av = (AV*)SvRV((SV*)rv); SV **ary = AvARRAY(av); SV **a, **b; @@ -4737,7 +4738,7 @@ S_reginclass(pTHX_ register const regnode *n, register const U8* p, STRLEN* lenp match = TRUE; if (!match) { AV *av; - SV *sw = regclass_swash(n, TRUE, 0, (SV**)&av); + SV * const sw = regclass_swash(n, TRUE, 0, (SV**)&av); if (sw) { if (swash_fetch(sw, p, do_utf8)) @@ -4745,11 +4746,10 @@ S_reginclass(pTHX_ register const regnode *n, register const U8* p, STRLEN* lenp else if (flags & ANYOF_FOLD) { if (!match && lenp && av) { I32 i; - for (i = 0; i <= av_len(av); i++) { - SV* sv = *av_fetch(av, i, FALSE); + SV* const sv = *av_fetch(av, i, FALSE); STRLEN len; - const char *s = SvPV_const(sv, len); + const char * const s = SvPV_const(sv, len); if (len <= plen && memEQ(s, (char*)p, len)) { *lenp = len; diff --git a/toke.c b/toke.c index 9438a71..780855e 100644 --- a/toke.c +++ b/toke.c @@ -8950,7 +8950,7 @@ S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, SV *sv, SV *pv, const char *type) { dVAR; dSP; - HV *table = GvHV(PL_hintgv); /* ^H */ + HV * const table = GvHV(PL_hintgv); /* ^H */ SV *res; SV **cvp; SV *cv, *typesv; @@ -9047,7 +9047,7 @@ STATIC char * S_scan_word(pTHX_ register char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *slp) { register char *d = dest; - register char *e = d + destlen - 3; /* two-character token, ending NUL */ + register char * const e = d + destlen - 3; /* two-character token, ending NUL */ for (;;) { if (d >= e) Perl_croak(aTHX_ ident_too_long); diff --git a/util.c b/util.c index cc11915..8a04991 100644 --- a/util.c +++ b/util.c @@ -366,14 +366,13 @@ void Perl_fbm_compile(pTHX_ SV *sv, U32 flags) { const register U8 *s; - register U8 *table; register U32 i; STRLEN len; I32 rarest = 0; U32 frequency = 256; if (flags & FBMcf_TAIL) { - MAGIC *mg = SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL; + MAGIC * const mg = SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL; sv_catpvn(sv, "\n", 1); /* Taken into account in fbm_instr() */ if (mg && mg->mg_len >= 0) mg->mg_len++; @@ -385,6 +384,7 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) if (len > 2) { const unsigned char *sb; const U8 mlen = (len>255) ? 255 : (U8)len; + register U8 *table; Sv_Grow(sv, len + 256 + FBM_TABLE_OFFSET); table = (unsigned char*)(SvPVX_mutable(sv) + len + FBM_TABLE_OFFSET); @@ -1074,7 +1074,7 @@ S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8) GV *gv; CV *cv; /* sv_2cv might call Perl_croak() */ - SV *olddiehook = PL_diehook; + SV * const olddiehook = PL_diehook; assert(PL_diehook); ENTER; @@ -1116,7 +1116,7 @@ S_vdie_croak_common(pTHX_ const char* pat, va_list* args, STRLEN* msglen, const char *message; if (pat) { - SV *msv = vmess(pat, args); + SV * const msv = vmess(pat, args); if (PL_errors && SvCUR(PL_errors)) { sv_catsv(PL_errors, msv); message = SvPV_const(PL_errors, *msglen); @@ -1151,7 +1151,7 @@ Perl_vdie(pTHX_ const char* pat, va_list *args) "%p: die: curstack = %p, mainstack = %p\n", thr, PL_curstack, PL_mainstack)); - message = S_vdie_croak_common(aTHX_ pat, args, &msglen, &utf8); + message = vdie_croak_common(pat, args, &msglen, &utf8); PL_restartop = die_where(message, msglen); SvFLAGS(ERRSV) |= utf8;