diff options
-rw-r--r-- | deb.c | 5 | ||||
-rw-r--r-- | mg.c | 9 | ||||
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | pod/perlapi.pod | 10 | ||||
-rw-r--r-- | pp.c | 2 | ||||
-rw-r--r-- | pp_sys.c | 2 | ||||
-rw-r--r-- | reentr.c | 8 | ||||
-rw-r--r-- | reentr.pl | 8 | ||||
-rw-r--r-- | regexec.c | 4 | ||||
-rw-r--r-- | sv.c | 2 |
10 files changed, 28 insertions, 24 deletions
@@ -41,15 +41,14 @@ Perl_deb_nocontext(const char *pat, ...) void Perl_deb(pTHX_ const char *pat, ...) { -#ifdef DEBUGGING va_list args; va_start(args, pat); +#ifdef DEBUGGING vdeb(pat, &args); - va_end(args); #else PERL_UNUSED_CONTEXT; - PERL_UNUSED_ARG(pat); #endif /* DEBUGGING */ + va_end(args); } void @@ -1317,6 +1317,9 @@ Perl_csighandler(int sig) #else dTHX; #endif +#if defined(HAS_SIGACTION) && defined(SA_SIGINFO) + va_list args; +#endif #ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS (void) rsignal(sig, PL_csighandlerp); if (PL_sig_ignoring[sig]) return; @@ -1329,6 +1332,9 @@ Perl_csighandler(int sig) exit(1); #endif #endif +#if defined(HAS_SIGACTION) && defined(SA_SIGINFO) + va_start(args, sig); +#endif if ( #ifdef SIGILL sig == SIGILL || @@ -1345,6 +1351,9 @@ Perl_csighandler(int sig) (*PL_sighandlerp)(sig); else S_raise_signal(aTHX_ sig); +#if defined(HAS_SIGACTION) && defined(SA_SIGINFO) + va_end(args); +#endif } #if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS) || defined(FAKE_DEFAULT_SIGNAL_HANDLERS) @@ -3971,7 +3971,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right) PL_modcount = 0; /* Grandfathering $[ assignment here. Bletch.*/ /* Only simple assignments like C<< ($[) = 1 >> are allowed */ - PL_eval_start = (left->op_type == OP_CONST) ? right : 0; + PL_eval_start = (left->op_type == OP_CONST) ? right : NULL; left = mod(left, OP_AASSIGN); if (PL_eval_start) PL_eval_start = 0; diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 702cd50197..c8ac82746d 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -5167,11 +5167,11 @@ X<newSVpvn_share> Creates a new SV with its SvPVX_const pointing to a shared string in the string table. If the string does not already exist in the table, it is created -first. Turns on READONLY and FAKE. The string's hash is stored in the UV -slot of the SV; if the C<hash> parameter is non-zero, that value is used; -otherwise the hash is computed. The idea here is that as the string table -is used for shared hash keys these strings will have SvPVX_const == HeKEY and -hash lookup will avoid string compare. +first. Turns on READONLY and FAKE. If the C<hash> parameter is non-zero, that +value is used; otherwise the hash is computed. The string's hash can be later +be retrieved from the SV with the C<SvSHARED_HASH()> macro. The idea here is +that as the string table is used for shared hash keys these strings will have +SvPVX_const == HeKEY and hash lookup will avoid string compare. SV* newSVpvn_share(const char* s, I32 len, U32 hash) @@ -4066,7 +4066,7 @@ PP(pp_hslice) } he = hv_fetch_ent(hv, keysv, lval, 0); - svp = he ? &HeVAL(he) : 0; + svp = he ? &HeVAL(he) : NULL; if (lval) { if (!svp || *svp == &PL_sv_undef) { @@ -476,7 +476,7 @@ PP(pp_die) } else { tmpsv = TOPs; - tmps = SvROK(tmpsv) ? NULL : SvPV_const(tmpsv, len); + tmps = SvROK(tmpsv) ? (const char *)NULL : SvPV_const(tmpsv, len); } if (!tmps || !len) { SV * const error = ERRSV; @@ -313,6 +313,8 @@ Perl_reentrant_retry(const char *f, ...) { dTHX; void *retptr = NULL; + va_list ap; + va_start(ap, f); #ifdef USE_REENTRANT_API # if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) void *p0; @@ -326,9 +328,6 @@ Perl_reentrant_retry(const char *f, ...) # if defined(USE_HOSTENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) int anint; # endif - va_list ap; - - va_start(ap, f); switch (PL_op->op_type) { #ifdef USE_HOSTENT_BUFFER @@ -531,11 +530,10 @@ Perl_reentrant_retry(const char *f, ...) /* Not known how to retry, so just fail. */ break; } - - va_end(ap); #else PERL_UNUSED_ARG(f); #endif + va_end(ap); return retptr; } @@ -856,6 +856,8 @@ Perl_reentrant_retry(const char *f, ...) { dTHX; void *retptr = NULL; + va_list ap; + va_start(ap, f); #ifdef USE_REENTRANT_API # if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) void *p0; @@ -869,9 +871,6 @@ Perl_reentrant_retry(const char *f, ...) # if defined(USE_HOSTENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) int anint; # endif - va_list ap; - - va_start(ap, f); switch (PL_op->op_type) { #ifdef USE_HOSTENT_BUFFER @@ -1074,11 +1073,10 @@ Perl_reentrant_retry(const char *f, ...) /* Not known how to retry, so just fail. */ break; } - - va_end(ap); #else PERL_UNUSED_ARG(f); #endif + va_end(ap); return retptr; } @@ -5572,8 +5572,8 @@ Perl_regclass_swash(pTHX_ const regexp *prog, register const regnode* node, bool * documentation of these array elements. */ si = *ary; - a = SvROK(ary[1]) ? &ary[1] : 0; - b = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : 0; + a = SvROK(ary[1]) ? &ary[1] : NULL; + b = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : NULL; if (a) sw = *a; @@ -5397,7 +5397,7 @@ Perl_sv_len_utf8(pTHX_ register SV *sv) if (PL_utf8cache) { STRLEN ulen; - MAGIC *mg = SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : 0; + MAGIC *mg = SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL; if (mg && mg->mg_len != -1) { ulen = mg->mg_len; |