This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: move vars to inner scope
authorDavid Mitchell <davem@iabyn.com>
Thu, 18 May 2017 08:49:08 +0000 (09:49 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 7 Jun 2017 08:11:02 +0000 (09:11 +0100)
Add a new scope around the floating-point code, then move some
locals var declarations into that scope.

sv.c

diff --git a/sv.c b/sv.c
index d3a927f..073df74 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11915,11 +11915,6 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
        unsigned base = 0;
        IV iv = 0;
        UV uv = 0;
-        bool is_simple = TRUE; /* no fancy qualifiers */
-        STRLEN radix_len;  /* SvCUR(PL_numeric_radix_sv) */
-        vcatpvfn_long_double_t fv;
-        NV nv;
-       STRLEN float_need; /* what PL_efloatsize needs to become */
        const char *dotstr = ".";
        STRLEN dotstrlen = 1;
        I32 efix = 0; /* explicit format parameter index */
@@ -12614,6 +12609,15 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
        case 'f':
        case 'g': case 'G':
        case 'a': case 'A':
+
+        {
+            bool   is_simple;  /* no fancy qualifiers */
+            STRLEN radix_len;  /* SvCUR(PL_numeric_radix_sv) */
+            STRLEN float_need; /* what PL_efloatsize needs to become */
+
+            vcatpvfn_long_double_t fv;
+            NV                     nv;
+
            if (vectorize)
                goto unknown;
 
@@ -12957,6 +12961,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
 
 
            break;
+        }
 
            /* SPECIAL */