summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deb.c5
-rw-r--r--mg.c9
-rw-r--r--op.c2
-rw-r--r--pod/perlapi.pod10
-rw-r--r--pp.c2
-rw-r--r--pp_sys.c2
-rw-r--r--reentr.c8
-rw-r--r--reentr.pl8
-rw-r--r--regexec.c4
-rw-r--r--sv.c2
10 files changed, 28 insertions, 24 deletions
diff --git a/deb.c b/deb.c
index 37d7a7c102..a3f0d4ff67 100644
--- a/deb.c
+++ b/deb.c
@@ -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
diff --git a/mg.c b/mg.c
index 14b237e44d..89f4c32910 100644
--- a/mg.c
+++ b/mg.c
@@ -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)
diff --git a/op.c b/op.c
index ada5a3de1a..015f26f908 100644
--- a/op.c
+++ b/op.c
@@ -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)
diff --git a/pp.c b/pp.c
index 54df53e6a5..5171e57569 100644
--- a/pp.c
+++ b/pp.c
@@ -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) {
diff --git a/pp_sys.c b/pp_sys.c
index 71f8d8b8bb..b79031c264 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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;
diff --git a/reentr.c b/reentr.c
index 9447fc3f58..ffe7eb0f1e 100644
--- a/reentr.c
+++ b/reentr.c
@@ -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;
}
diff --git a/reentr.pl b/reentr.pl
index 049b06eed1..84676d467d 100644
--- a/reentr.pl
+++ b/reentr.pl
@@ -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;
}
diff --git a/regexec.c b/regexec.c
index 1cd3857c7e..3e42f58794 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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;
diff --git a/sv.c b/sv.c
index bf9e575c5c..e431cff3f7 100644
--- a/sv.c
+++ b/sv.c
@@ -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;