This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename op_aux field from 'size' to 'ssize'
authorDavid Mitchell <davem@iabyn.com>
Mon, 13 Nov 2017 11:03:15 +0000 (11:03 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 13 Nov 2017 12:23:19 +0000 (12:23 +0000)
This part of the op_aux union was added for OP_MULTICONCAT; its actually
of type SSize_t, so rename it to ssize to better reflect that it's signed.

This should make no functional difference.

dump.c
ext/B/B.xs
op.c
op.h
pp_hot.c

diff --git a/dump.c b/dump.c
index bf01207..5dac007 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -2757,10 +2757,10 @@ Perl_multiconcat_stringify(pTHX_ const OP *o)
 
     nargs = aux[PERL_MULTICONCAT_IX_NARGS].uv;
     s   = aux[PERL_MULTICONCAT_IX_PLAIN_PV].pv;
-    len = aux[PERL_MULTICONCAT_IX_PLAIN_LEN].size;
+    len = aux[PERL_MULTICONCAT_IX_PLAIN_LEN].ssize;
     if (!s) {
         s   = aux[PERL_MULTICONCAT_IX_UTF8_PV].pv;
-        len = aux[PERL_MULTICONCAT_IX_UTF8_LEN].size;
+        len = aux[PERL_MULTICONCAT_IX_UTF8_LEN].ssize;
         sv_catpvs(out, "UTF8 ");
     }
     pv_pretty(out, s, len, 50,
@@ -2772,7 +2772,7 @@ Perl_multiconcat_stringify(pTHX_ const OP *o)
     lens = aux + PERL_MULTICONCAT_IX_LENGTHS;
     nargs++;
     while (nargs-- > 0) {
-        Perl_sv_catpvf(aTHX_ out, ",%" IVdf, (IV)lens->size);
+        Perl_sv_catpvf(aTHX_ out, ",%" IVdf, (IV)lens->ssize);
         lens++;
     }
     return out;
index fc36a36..1190985 100644 (file)
@@ -1260,10 +1260,10 @@ aux_list(o, cv)
                 PUSHs(sv_2mortal(newSViv(nargs)));
 
                 p   = aux[PERL_MULTICONCAT_IX_PLAIN_PV].pv;
-                len = aux[PERL_MULTICONCAT_IX_PLAIN_LEN].size;
+                len = aux[PERL_MULTICONCAT_IX_PLAIN_LEN].ssize;
                 if (!p) {
                     p   = aux[PERL_MULTICONCAT_IX_UTF8_PV].pv;
-                    len = aux[PERL_MULTICONCAT_IX_UTF8_LEN].size;
+                    len = aux[PERL_MULTICONCAT_IX_UTF8_LEN].ssize;
                     utf8 = SVf_UTF8;
                 }
                 sv = newSVpvn(p, len);
@@ -1275,7 +1275,7 @@ aux_list(o, cv)
                 if (utf8) {
                     U8 *p = (U8*)SvPVX(sv);
                     while (nargs--) {
-                        SSize_t bytes = lens->size;
+                        SSize_t bytes = lens->ssize;
                         SSize_t chars;
                         if (bytes <= 0)
                             chars = bytes;
@@ -1290,7 +1290,7 @@ aux_list(o, cv)
                 }
                 else {
                     while (nargs--) {
-                        PUSHs(sv_2mortal(newSViv(lens->size)));
+                        PUSHs(sv_2mortal(newSViv(lens->ssize)));
                         lens++;
                     }
                 }
diff --git a/op.c b/op.c
index 15fe1af..762cd21 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3095,14 +3095,14 @@ S_maybe_multiconcat(pTHX_ OP *o)
             if (*p == '%') {
                 p++;
                 if (*p != '%') {
-                    (lenp++)->size = q - oldq;
+                    (lenp++)->ssize = q - oldq;
                     oldq = q;
                     continue;
                 }
             }
             *q++ = *p;
         }
-        lenp->size = q - oldq;
+        lenp->ssize = q - oldq;
         assert((STRLEN)(q - const_str) == total_len);
 
         /* Attach all the args (i.e. the kids of the sprintf) to o (which
@@ -3123,7 +3123,7 @@ S_maybe_multiconcat(pTHX_ OP *o)
         p = const_str;
         lenp = aux + PERL_MULTICONCAT_IX_LENGTHS;
 
-        lenp->size = -1;
+        lenp->ssize = -1;
 
         /* Concatenate all const strings into const_str.
          * Note that args[] contains the RHS args in reverse order, so
@@ -3133,15 +3133,15 @@ S_maybe_multiconcat(pTHX_ OP *o)
         for (argp = toparg; argp >= args; argp--) {
             if (!argp->p)
                 /* not a const op */
-                (++lenp)->size = -1;
+                (++lenp)->ssize = -1;
             else {
                 STRLEN l = argp->len;
                 Copy(argp->p, p, l, char);
                 p += l;
-                if (lenp->size == -1)
-                    lenp->size = l;
+                if (lenp->ssize == -1)
+                    lenp->ssize = l;
                 else
-                    lenp->size += l;
+                    lenp->ssize += l;
             }
         }
 
@@ -3217,9 +3217,9 @@ S_maybe_multiconcat(pTHX_ OP *o)
 
     aux[PERL_MULTICONCAT_IX_NARGS].uv       = nargs;
     aux[PERL_MULTICONCAT_IX_PLAIN_PV].pv    = utf8 ? NULL : const_str;
-    aux[PERL_MULTICONCAT_IX_PLAIN_LEN].size = utf8 ?    0 : total_len;
+    aux[PERL_MULTICONCAT_IX_PLAIN_LEN].ssize = utf8 ?    0 : total_len;
     aux[PERL_MULTICONCAT_IX_UTF8_PV].pv     = const_str;
-    aux[PERL_MULTICONCAT_IX_UTF8_LEN].size  = total_len;
+    aux[PERL_MULTICONCAT_IX_UTF8_LEN].ssize  = total_len;
 
     /* if variant > 0, calculate a variant const string and lengths where
      * the utf8 version of the string will take 'variant' more bytes than
@@ -3234,16 +3234,16 @@ S_maybe_multiconcat(pTHX_ OP *o)
         UV                 n;
 
         aux[PERL_MULTICONCAT_IX_UTF8_PV].pv    = up;
-        aux[PERL_MULTICONCAT_IX_UTF8_LEN].size = ulen;
+        aux[PERL_MULTICONCAT_IX_UTF8_LEN].ssize = ulen;
 
         for (n = 0; n < (nargs + 1); n++) {
             SSize_t i;
             char * orig_up = up;
-            for (i = (lens++)->size; i > 0; i--) {
+            for (i = (lens++)->ssize; i > 0; i--) {
                 U8 c = *p++;
                 append_utf8_from_native_byte(c, (U8**)&up);
             }
-            (ulens++)->size = (i < 0) ? i : up - orig_up;
+            (ulens++)->ssize = (i < 0) ? i : up - orig_up;
         }
     }
 
diff --git a/op.h b/op.h
index 513fc65..eb62c94 100644 (file)
--- a/op.h
+++ b/op.h
@@ -189,7 +189,7 @@ typedef union  {
     IV        iv;
     UV        uv;
     char      *pv;
-    SSize_t   size;
+    SSize_t   ssize;
 } UNOP_AUX_item;
 
 #ifdef USE_ITHREADS
index d980db8..8a66b90 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -523,8 +523,8 @@ PP(pp_multiconcat)
 
                     if (   svpv_end == svpv_buf + 1
                            /* no const string segments */
-                        && aux[PERL_MULTICONCAT_IX_LENGTHS].size     == -1
-                        && aux[PERL_MULTICONCAT_IX_LENGTHS + 1].size == -1
+                        && aux[PERL_MULTICONCAT_IX_LENGTHS].ssize     == -1
+                        && aux[PERL_MULTICONCAT_IX_LENGTHS + 1].ssize == -1
                     ) {
                         /* special case: if the overloaded sv is the
                          * second arg in the concat chain, stop at the
@@ -588,8 +588,8 @@ PP(pp_multiconcat)
                         && is_append
                         && nargs == 1
                         /* no const string segments */
-                        && aux[PERL_MULTICONCAT_IX_LENGTHS].size   == -1
-                        && aux[PERL_MULTICONCAT_IX_LENGTHS+1].size == -1)
+                        && aux[PERL_MULTICONCAT_IX_LENGTHS].ssize   == -1
+                        && aux[PERL_MULTICONCAT_IX_LENGTHS+1].ssize == -1)
                     {
                         /* special-case $tied .= $tied.
                          *
@@ -779,7 +779,7 @@ PP(pp_multiconcat)
     {
         SSize_t len;
         len = aux[dst_utf8 ? PERL_MULTICONCAT_IX_UTF8_LEN
-                           : PERL_MULTICONCAT_IX_PLAIN_LEN].size;
+                           : PERL_MULTICONCAT_IX_PLAIN_LEN].ssize;
         slow_concat = cBOOL(len);
         grow += len;
     }
@@ -888,7 +888,7 @@ PP(pp_multiconcat)
 
             UNOP_AUX_item *lens = const_lens;
                                 /* length of first const string segment */
-            STRLEN offset       = lens->size > 0 ? lens->size : 0;
+            STRLEN offset       = lens->ssize > 0 ? lens->ssize : 0;
 
             assert(targ_chain);
             svpv_p = svpv_base;
@@ -902,7 +902,7 @@ PP(pp_multiconcat)
                 if (len < 0)  /* variant args have this */
                     len = -len;
                 offset += (STRLEN)len;
-                len = (++lens)->size;
+                len = (++lens)->ssize;
                 offset += (len >= 0) ? (STRLEN)len : 0;
                 if (!offset) {
                     /* all args and consts so far are empty; update
@@ -979,7 +979,7 @@ PP(pp_multiconcat)
         svpv_p = svpv_base - 1;
 
         for (;;) {
-            SSize_t len = (const_lens++)->size;
+            SSize_t len = (const_lens++)->ssize;
 
             /* append next const string segment */
             if (len > 0) {
@@ -1055,8 +1055,8 @@ PP(pp_multiconcat)
                                 * (including constant strings), so would
                                 * form part of the first concat */
             bool first_concat = (    n == 0
-                                 || (n == 1 && const_lens[-2].size < 0
-                                            && const_lens[-1].size < 0));
+                                 || (n == 1 && const_lens[-2].ssize < 0
+                                            && const_lens[-1].ssize < 0));
             int  f_assign     = first_concat ? 0 : AMGf_assign;
 
             left = dsv;
@@ -1066,7 +1066,7 @@ PP(pp_multiconcat)
                 for (i = 0; i < 2; i++) {
                     if (i) {
                         /* append next const string segment */
-                        STRLEN len = (STRLEN)((const_lens++)->size);
+                        STRLEN len = (STRLEN)((const_lens++)->ssize);
                         /* a length of -1 implies no constant string
                          * rather than a zero-length one, e.g.
                          * ($a . $b) versus ($a . "" . $b)
@@ -1099,7 +1099,7 @@ PP(pp_multiconcat)
                              * before we broke from the loop earlier */
                             getmg = TRUE;
 
-                        if (first_concat && n == 0 && const_lens[-1].size < 0) {
+                        if (first_concat && n == 0 && const_lens[-1].ssize < 0) {
                             /* nothing before the current arg; repeat the
                              * loop to get a second arg */
                             left = right;