This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename S_dopoptogiven() to S_dopoptogivenfor()
authorDavid Mitchell <davem@iabyn.com>
Mon, 5 Oct 2015 14:50:18 +0000 (15:50 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:40 +0000 (08:59 +0000)
Since it searches the context stack for the next GIVEN *or* FOR LOOP
context, make the name better express its purpose.

embed.fnc
embed.h
pp_ctl.c
proto.h

index 32b04df..4afd109 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2062,7 +2062,7 @@ sR        |OP*    |dofindlabel    |NN OP *o|NN const char *label|STRLEN len \
 s      |MAGIC *|doparseform    |NN SV *sv
 snR    |bool   |num_overflow   |NV value|I32 fldsize|I32 frcsize
 sR     |I32    |dopoptoeval    |I32 startingblock
-sR     |I32    |dopoptogiven   |I32 startingblock
+sR     |I32    |dopoptogivenfor|I32 startingblock
 sR     |I32    |dopoptolabel   |NN const char *label|STRLEN len|U32 flags
 sR     |I32    |dopoptoloop    |I32 startingblock
 sR     |I32    |dopoptosub_at  |NN const PERL_CONTEXT* cxstk|I32 startingblock
diff --git a/embed.h b/embed.h
index a6486be..c574281 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define dofindlabel(a,b,c,d,e,f)       S_dofindlabel(aTHX_ a,b,c,d,e,f)
 #define doparseform(a)         S_doparseform(aTHX_ a)
 #define dopoptoeval(a)         S_dopoptoeval(aTHX_ a)
-#define dopoptogiven(a)                S_dopoptogiven(aTHX_ a)
+#define dopoptogivenfor(a)     S_dopoptogivenfor(aTHX_ a)
 #define dopoptolabel(a,b,c)    S_dopoptolabel(aTHX_ a,b,c)
 #define dopoptoloop(a)         S_dopoptoloop(aTHX_ a)
 #define dopoptosub_at(a,b)     S_dopoptosub_at(aTHX_ a,b)
index 518b755..f6b142e 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1452,8 +1452,10 @@ S_dopoptoloop(pTHX_ I32 startingblock)
     return i;
 }
 
+/* find the next GIVEN or FOR loop context block */
+
 STATIC I32
-S_dopoptogiven(pTHX_ I32 startingblock)
+S_dopoptogivenfor(pTHX_ I32 startingblock)
 {
     I32 i;
     for (i = startingblock; i >= 0; i--) {
@@ -1462,7 +1464,7 @@ S_dopoptogiven(pTHX_ I32 startingblock)
        default:
            continue;
        case CXt_GIVEN:
-           DEBUG_l( Perl_deb(aTHX_ "(dopoptogiven(): found given at cx=%ld)\n", (long)i));
+           DEBUG_l( Perl_deb(aTHX_ "(dopoptogivenfor(): found given at cx=%ld)\n", (long)i));
            return i;
        case CXt_LOOP_PLAIN:
            assert(!CxFOREACHDEF(cx));
@@ -1471,7 +1473,7 @@ S_dopoptogiven(pTHX_ I32 startingblock)
        case CXt_LOOP_LAZYSV:
        case CXt_LOOP_FOR:
            if (CxFOREACHDEF(cx)) {
-               DEBUG_l( Perl_deb(aTHX_ "(dopoptogiven(): found foreach at cx=%ld)\n", (long)i));
+               DEBUG_l( Perl_deb(aTHX_ "(dopoptogivenfor(): found foreach at cx=%ld)\n", (long)i));
                return i;
            }
        }
@@ -4992,7 +4994,7 @@ PP(pp_leavewhen)
     SV **newsp;
     PMOP *newpm;
 
-    cxix = dopoptogiven(cxstack_ix);
+    cxix = dopoptogivenfor(cxstack_ix);
     if (cxix < 0)
        /* diag_listed_as: Can't "when" outside a topicalizer */
        DIE(aTHX_ "Can't \"%s\" outside a topicalizer",
@@ -5064,7 +5066,7 @@ PP(pp_break)
     I32 cxix;
     PERL_CONTEXT *cx;
 
-    cxix = dopoptogiven(cxstack_ix); 
+    cxix = dopoptogivenfor(cxstack_ix);
     if (cxix < 0)
        DIE(aTHX_ "Can't \"break\" outside a given block");
 
diff --git a/proto.h b/proto.h
index cef94b5..48a740d 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4485,7 +4485,7 @@ STATIC MAGIC *    S_doparseform(pTHX_ SV *sv);
 STATIC I32     S_dopoptoeval(pTHX_ I32 startingblock)
                        __attribute__warn_unused_result__;
 
-STATIC I32     S_dopoptogiven(pTHX_ I32 startingblock)
+STATIC I32     S_dopoptogivenfor(pTHX_ I32 startingblock)
                        __attribute__warn_unused_result__;
 
 STATIC I32     S_dopoptolabel(pTHX_ const char *label, STRLEN len, U32 flags)