Fix bug in DynaLoader, which has been passing a filename in dynamic
[p5sagit/p5-mst-13.2.git] / regexec.c
index 747b61b..94ad06f 100644 (file)
--- a/regexec.c
+++ b/regexec.c
            : (U8*)(pos + off)))
 #define HOPBACKc(pos, off) ((char*)    \
     ((PL_reg_match_utf8)               \
-       ? reghopmaybe3((U8*)pos, -off, ((U8*)(off < 0 ? PL_regeol : PL_bostr))) \
+       ? reghopmaybe3((U8*)pos, -off, (U8*)PL_bostr) \
     : (pos - off >= PL_bostr)          \
        ? (U8*)(pos - off)              \
     : (U8*)NULL)                       \
@@ -233,7 +233,7 @@ S_regcppop(pTHX_ const regexp *rex)
        );
     }
     DEBUG_EXECUTE_r(
-       if ((I32)(*PL_reglastparen + 1) <= rex->nparens) {
+       if (*PL_reglastparen + 1 <= rex->nparens) {
            PerlIO_printf(Perl_debug_log,
                          "     restoring \\%"IVdf"..\\%"IVdf" to undef\n",
                          (IV)(*PL_reglastparen + 1), (IV)rex->nparens);
@@ -250,7 +250,7 @@ S_regcppop(pTHX_ const regexp *rex)
      * building DynaLoader will fail:
      * "Error: '*' not in typemap in DynaLoader.xs, line 164"
      * --jhi */
-    for (i = *PL_reglastparen + 1; i <= rex->nparens; i++) {
+    for (i = *PL_reglastparen + 1; (U32)i <= rex->nparens; i++) {
        if (i > PL_regsize)
            PL_regstartp[i] = -1;
        PL_regendp[i] = -1;
@@ -383,7 +383,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
                         sv_uni_display(dsv, sv, 60, UNI_DISPLAY_REGEX) :
                         strpos;
         const int   len = PL_reg_match_utf8 ?
-                        strlen(s) : strend - strpos;
+                        (int)strlen(s) : strend - strpos;
         if (!PL_colorset)
              reginitcolors();
         if (PL_reg_match_utf8)
@@ -574,7 +574,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
                    && (!do_utf8
                        || ((t = reghopmaybe3_c(s, -(prog->check_offset_max), strpos))
                            && t > strpos)))
-                   /* EMPTY */;
+                   NOOP;
                else
                    t = strpos;
                t = HOP3c(t, prog->anchored_offset, strend);
@@ -1146,7 +1146,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, const char
                LOAD_UTF8_CHARCLASS_ALNUM();
                while (s + (uskip = UTF8SKIP(s)) <= strend) {
                    if (tmp == !(OP(c) == BOUND ?
-                                swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
+                                (bool)swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
                                 isALNUM_LC_utf8((U8*)s)))
                    {
                        tmp = !tmp;
@@ -1188,7 +1188,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, const char
                LOAD_UTF8_CHARCLASS_ALNUM();
                while (s + (uskip = UTF8SKIP(s)) <= strend) {
                    if (tmp == !(OP(c) == NBOUND ?
-                                swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
+                                (bool)swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
                                 isALNUM_LC_utf8((U8*)s)))
                        tmp = !tmp;
                    else if ((!reginfo || regtry(reginfo, s)))
@@ -1689,10 +1689,10 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
            ? pv_uni_display(dsv0, (U8*)prog->precomp, prog->prelen, 60,
                          UNI_DISPLAY_REGEX)
            : prog->precomp;
-       const int len0 = UTF ? SvCUR(dsv0) : prog->prelen;
+       const int len0 = UTF ? (int)SvCUR(dsv0) : prog->prelen;
        const char * const s1 = do_utf8 ? sv_uni_display(dsv1, sv, 60,
                                               UNI_DISPLAY_REGEX) : startpos;
-       const int len1 = do_utf8 ? SvCUR(dsv1) : strend - startpos;
+       const int len1 = do_utf8 ? (int)SvCUR(dsv1) : strend - startpos;
         if (!PL_colorset)
             reginitcolors();
         PerlIO_printf(Perl_debug_log,
@@ -1910,7 +1910,7 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
            len0 = UTF ? SvCUR(dsv0) : SvCUR(prop);
            s1 = UTF ?
              sv_uni_display(dsv1, sv, 60, UNI_DISPLAY_REGEX) : s;
-           len1 = UTF ? SvCUR(dsv1) : strend - s;
+           len1 = UTF ? (int)SvCUR(dsv1) : strend - s;
            PerlIO_printf(Perl_debug_log,
                          "Matching stclass \"%*.*s\" against \"%*.*s\"\n",
                          len0, len0, s0,
@@ -2561,18 +2561,18 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
                pv_uni_display(PERL_DEBUG_PAD(0), (U8*)(locinput - pref_len),
                               pref0_len, 60, UNI_DISPLAY_REGEX) :
                locinput - pref_len;
-             const int len0 = do_utf8 ? strlen(s0) : pref0_len;
+             const int len0 = do_utf8 ? (int)strlen(s0) : pref0_len;
              const char * const s1 = do_utf8 && OP(scan) != CANY ?
                pv_uni_display(PERL_DEBUG_PAD(1),
                               (U8*)(locinput - pref_len + pref0_len),
                               pref_len - pref0_len, 60, UNI_DISPLAY_REGEX) :
                locinput - pref_len + pref0_len;
-             const int len1 = do_utf8 ? strlen(s1) : pref_len - pref0_len;
+             const int len1 = do_utf8 ? (int)strlen(s1) : pref_len - pref0_len;
              const char * const s2 = do_utf8 && OP(scan) != CANY ?
                pv_uni_display(PERL_DEBUG_PAD(2), (U8*)locinput,
                               PL_regeol - locinput, 60, UNI_DISPLAY_REGEX) :
                locinput;
-             const int len2 = do_utf8 ? strlen(s2) : l;
+             const int len2 = do_utf8 ? (int)strlen(s2) : l;
              PerlIO_printf(Perl_debug_log,
                            "%4"IVdf" <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3"IVdf":%*s%s\n",
                            (IV)(locinput - PL_bostr),
@@ -2866,7 +2866,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
                            PerlIO_printf( Perl_debug_log, "%*s  %strying alternation #%d <%s> at 0x%p%s\n",
                                REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4],
                                st->u.trie.accept_buff[best].wordnum,
-                               tmp ? SvPV_nolen_const( *tmp ) : "not compiled under -Dr",scan,
+                               tmp ? SvPV_nolen_const( *tmp ) : "not compiled under -Dr", (void*)scan,
                                PL_colors[5] );
                        });
                        if ( best<st->u.trie.accepted ) {
@@ -3041,7 +3041,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_ALNUM();
                if (!(OP(scan) == ALNUM
-                     ? swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
+                     ? (bool)swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
                      : isALNUM_LC_utf8((U8*)locinput)))
                {
                    sayNO;
@@ -3064,7 +3064,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_ALNUM();
                if (OP(scan) == NALNUM
-                   ? swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
                    : isALNUM_LC_utf8((U8*)locinput))
                {
                    sayNO;
@@ -3129,7 +3129,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
                if (UTF8_IS_CONTINUED(nextchr)) {
                    LOAD_UTF8_CHARCLASS_SPACE();
                    if (!(OP(scan) == SPACE
-                         ? swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
+                         ? (bool)swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
                          : isSPACE_LC_utf8((U8*)locinput)))
                    {
                        sayNO;
@@ -3159,7 +3159,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_SPACE();
                if (OP(scan) == NSPACE
-                   ? swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
                    : isSPACE_LC_utf8((U8*)locinput))
                {
                    sayNO;
@@ -3182,7 +3182,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_DIGIT();
                if (!(OP(scan) == DIGIT
-                     ? swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
+                     ? (bool)swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
                      : isDIGIT_LC_utf8((U8*)locinput)))
                {
                    sayNO;
@@ -3205,7 +3205,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_DIGIT();
                if (OP(scan) == NDIGIT
-                   ? swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
                    : isDIGIT_LC_utf8((U8*)locinput))
                {
                    sayNO;