This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typo fix in perlretut by Simon Taylor
[perl5.git] / regcomp.c
index b504760..da245b1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -998,7 +998,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs
                });
 
            } else {
-               /*EMPTY*/;   /* It's a dupe. So ignore it. */
+               NOOP;   /* It's a dupe. So ignore it. */
            }
 
         } /* end second pass */
@@ -1204,7 +1204,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs
                 });
 
             } else {
-               /*EMPTY*/;  /* Its a dupe. So ignore it. */
+               NOOP;  /* Its a dupe. So ignore it. */
             }
 
         } /* end second pass */
@@ -2938,7 +2938,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
       again:
        if (PL_regkind[(U8)OP(first)] == EXACT) {
            if (OP(first) == EXACT)
-               /*EMPTY*/;      /* Empty, get anchored substr later. */
+               NOOP;   /* Empty, get anchored substr later. */
            else if ((OP(first) == EXACTF || OP(first) == EXACTFL))
                r->regstclass = first;
        }
@@ -5786,7 +5786,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
                       len, s,
                       PL_colors[1]);
     } else if (k == TRIE) {
-       /*EMPTY*/;
+       NOOP;
        /* print the details od the trie in dumpuntil instead, as
         * prog->data isn't available here */
     } else if (k == CURLY) {
@@ -5863,7 +5863,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
        }
 
        if (o->flags & ANYOF_CLASS)
-           for (i = 0; i < sizeof(anyofs)/sizeof(char*); i++)
+           for (i = 0; i < (int)(sizeof(anyofs)/sizeof(char*)); i++)
                if (ANYOF_CLASS_TEST(o,i))
                    sv_catpv(sv, anyofs[i]);
 
@@ -6184,7 +6184,11 @@ Perl_save_re_context(pTHX)
            U32 i;
            for (i = 1; i <= rx->nparens; i++) {
                char digits[TYPE_CHARS(long)];
+#ifdef USE_SNPRINTF
+               const STRLEN len = snprintf(digits, sizeof(digits), "%lu", (long)i);
+#else
                const STRLEN len = my_sprintf(digits, "%lu", (long)i);
+#endif /* #ifdef USE_SNPRINTF */
                GV *const *const gvp
                    = (GV**)hv_fetch(PL_defstash, digits, len, 0);