Re-instate the old perl getcwd as _perl_getcwd, and use it if loading
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 9f81cf5..d943d14 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -425,7 +425,7 @@ static const scan_data_t zero_scan_data =
        MJD_OFFSET_DEBUG(("** (%d) offset of node %d is %d.\n",         \
                __LINE__, (node), (byte)));                             \
        if((node) < 0) {                                                \
-           Perl_croak(aTHX_ "value of node is %d in Offset macro", node); \
+           Perl_croak(aTHX_ "value of node is %d in Offset macro", (int)(node)); \
        } else {                                                        \
            RExC_offsets[2*(node)-1] = (byte);                          \
        }                                                               \
@@ -439,9 +439,9 @@ static const scan_data_t zero_scan_data =
 #define Set_Node_Length_To_R(node,len) STMT_START {                    \
     if (! SIZE_ONLY) {                                                 \
        MJD_OFFSET_DEBUG(("** (%d) size of node %d is %d.\n",           \
-               __LINE__, (node), (len)));                              \
+               __LINE__, (int)(node), (int)(len)));                    \
        if((node) < 0) {                                                \
-           Perl_croak(aTHX_ "value of node is %d in Length macro", node); \
+           Perl_croak(aTHX_ "value of node is %d in Length macro", (int)(node)); \
        } else {                                                        \
            RExC_offsets[2*(node)] = (len);                             \
        }                                                               \
@@ -5757,6 +5757,8 @@ Perl_regdump(pTHX_ regexp *r)
            PerlIO_printf(Perl_debug_log, "\n");
         });
     }
+#else
+    PERL_UNUSED_ARG(r);
 #endif /* DEBUGGING */
 }
 
@@ -5820,8 +5822,9 @@ Perl_regprop(pTHX_ SV *sv, const regnode *o)
     else if (k == ANYOF) {
        int i, rangestart = -1;
        const U8 flags = ANYOF_FLAGS(o);
-       const char * const anyofs[] = { /* Should be synchronized with
-                                        * ANYOF_ #xdefines in regcomp.h */
+
+       /* Should be synchronized with * ANYOF_ #xdefines in regcomp.h */
+       static const char * const anyofs[] = {
            "\\w",
            "\\W",
            "\\s",
@@ -5956,6 +5959,9 @@ Perl_regprop(pTHX_ SV *sv, const regnode *o)
     }
     else if (k == BRANCHJ && (OP(o) == UNLESSM || OP(o) == IFMATCH))
        Perl_sv_catpvf(aTHX_ sv, "[-%d]", o->flags);
+#else
+    PERL_UNUSED_ARG(sv);
+    PERL_UNUSED_ARG(o);
 #endif /* DEBUGGING */
 }
 
@@ -6072,7 +6078,7 @@ Perl_pregfree(pTHX_ struct regexp *r)
                        reg_trie_data *trie=(reg_trie_data*)r->data->data[n];
                        U32 refcount;
                        OP_REFCNT_LOCK;
-                       refcount = trie->refcount--;
+                       refcount = --trie->refcount;
                        OP_REFCNT_UNLOCK;
                        if ( !refcount ) {
                            Safefree(trie->charmap);
@@ -6218,8 +6224,8 @@ Perl_save_re_context(pTHX)
            for (i = 1; i <= rx->nparens; i++) {
                GV *mgv;
                char digits[TYPE_CHARS(long)];
-               sprintf(digits, "%lu", (long)i);
-               if ((mgv = gv_fetchpv(digits, FALSE, SVt_PV)))
+               const STRLEN len = my_sprintf(digits, "%lu", (long)i);
+               if ((mgv = gv_fetchpvn_flags(digits, len, FALSE, SVt_PV)))
                    save_scalar(mgv);
            }
        }