sv_catpvf holds no advantage over sv_catpv when the "pattern" isn't.
Nicholas Clark [Fri, 14 Jan 2005 09:28:14 +0000 (09:28 +0000)]
p4raw-id: //depot/perl@23798

op.c
regcomp.c
toke.c
utf8.c

diff --git a/op.c b/op.c
index 38a10df..ab9f374 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4045,7 +4045,7 @@ Perl_cv_ckproto(pTHX_ CV *cv, GV *gv, char *p)
        if (SvPOK(cv))
            Perl_sv_catpvf(aTHX_ msg, " (%"SVf")", (SV *)cv);
        else
-           Perl_sv_catpvf(aTHX_ msg, ": none");
+           Perl_sv_catpv(aTHX_ msg, ": none");
        sv_catpv(msg, " vs ");
        if (p)
            Perl_sv_catpvf(aTHX_ msg, "(%s)", p);
index a2959a3..d3a0ab1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -3771,7 +3771,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isALNUM(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsWord\n");    
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsWord\n");     
                    break;
                case ANYOF_NALNUM:
                    if (LOC)
@@ -3781,7 +3781,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isALNUM(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsWord\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsWord\n");
                    break;
                case ANYOF_ALNUMC:
                    if (LOC)
@@ -3791,7 +3791,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isALNUMC(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlnum\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsAlnum\n");
                    break;
                case ANYOF_NALNUMC:
                    if (LOC)
@@ -3801,7 +3801,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isALNUMC(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlnum\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsAlnum\n");
                    break;
                case ANYOF_ALPHA:
                    if (LOC)
@@ -3811,7 +3811,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isALPHA(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlpha\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsAlpha\n");
                    break;
                case ANYOF_NALPHA:
                    if (LOC)
@@ -3821,7 +3821,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isALPHA(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlpha\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsAlpha\n");
                    break;
                case ANYOF_ASCII:
                    if (LOC)
@@ -3837,7 +3837,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                        }
 #endif /* EBCDIC */
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsASCII\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsASCII\n");
                    break;
                case ANYOF_NASCII:
                    if (LOC)
@@ -3853,7 +3853,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                        }
 #endif /* EBCDIC */
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsASCII\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsASCII\n");
                    break;
                case ANYOF_BLANK:
                    if (LOC)
@@ -3863,7 +3863,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isBLANK(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsBlank\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsBlank\n");
                    break;
                case ANYOF_NBLANK:
                    if (LOC)
@@ -3873,7 +3873,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isBLANK(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsBlank\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsBlank\n");
                    break;
                case ANYOF_CNTRL:
                    if (LOC)
@@ -3883,7 +3883,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isCNTRL(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsCntrl\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsCntrl\n");
                    break;
                case ANYOF_NCNTRL:
                    if (LOC)
@@ -3893,7 +3893,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isCNTRL(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsCntrl\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsCntrl\n");
                    break;
                case ANYOF_DIGIT:
                    if (LOC)
@@ -3903,7 +3903,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                        for (value = '0'; value <= '9'; value++)
                            ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsDigit\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsDigit\n");
                    break;
                case ANYOF_NDIGIT:
                    if (LOC)
@@ -3915,7 +3915,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                        for (value = '9' + 1; value < 256; value++)
                            ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsDigit\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsDigit\n");
                    break;
                case ANYOF_GRAPH:
                    if (LOC)
@@ -3925,7 +3925,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isGRAPH(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsGraph\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsGraph\n");
                    break;
                case ANYOF_NGRAPH:
                    if (LOC)
@@ -3935,7 +3935,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isGRAPH(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsGraph\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsGraph\n");
                    break;
                case ANYOF_LOWER:
                    if (LOC)
@@ -3945,7 +3945,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isLOWER(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsLower\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsLower\n");
                    break;
                case ANYOF_NLOWER:
                    if (LOC)
@@ -3955,7 +3955,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isLOWER(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsLower\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsLower\n");
                    break;
                case ANYOF_PRINT:
                    if (LOC)
@@ -3965,7 +3965,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isPRINT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPrint\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsPrint\n");
                    break;
                case ANYOF_NPRINT:
                    if (LOC)
@@ -3975,7 +3975,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isPRINT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPrint\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsPrint\n");
                    break;
                case ANYOF_PSXSPC:
                    if (LOC)
@@ -3985,7 +3985,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isPSXSPC(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsSpace\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsSpace\n");
                    break;
                case ANYOF_NPSXSPC:
                    if (LOC)
@@ -3995,7 +3995,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isPSXSPC(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsSpace\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsSpace\n");
                    break;
                case ANYOF_PUNCT:
                    if (LOC)
@@ -4005,7 +4005,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isPUNCT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPunct\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsPunct\n");
                    break;
                case ANYOF_NPUNCT:
                    if (LOC)
@@ -4015,7 +4015,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isPUNCT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPunct\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsPunct\n");
                    break;
                case ANYOF_SPACE:
                    if (LOC)
@@ -4025,7 +4025,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isSPACE(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsSpacePerl\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsSpacePerl\n");
                    break;
                case ANYOF_NSPACE:
                    if (LOC)
@@ -4035,7 +4035,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isSPACE(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsSpacePerl\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsSpacePerl\n");
                    break;
                case ANYOF_UPPER:
                    if (LOC)
@@ -4045,7 +4045,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isUPPER(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsUpper\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsUpper\n");
                    break;
                case ANYOF_NUPPER:
                    if (LOC)
@@ -4055,7 +4055,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isUPPER(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsUpper\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsUpper\n");
                    break;
                case ANYOF_XDIGIT:
                    if (LOC)
@@ -4065,7 +4065,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (isXDIGIT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsXDigit\n");
+                   Perl_sv_catpv(aTHX_ listsv, "+utf8::IsXDigit\n");
                    break;
                case ANYOF_NXDIGIT:
                    if (LOC)
@@ -4075,7 +4075,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                            if (!isXDIGIT(value))
                                ANYOF_BITMAP_SET(ret, value);
                    }
-                   Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsXDigit\n");
+                   Perl_sv_catpv(aTHX_ listsv, "!utf8::IsXDigit\n");
                    break;
                case ANYOF_MAX:
                    /* this is to handle \p and \P */
diff --git a/toke.c b/toke.c
index eb8a581..b4222f6 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -285,11 +285,11 @@ S_tokereport(pTHX_ char* s, I32 rv)
            }
        }
        if (name)
-           Perl_sv_catpvf(aTHX_ report, "%s", name);
+           Perl_sv_catpv(aTHX_ report, name);
        else if ((char)rv > ' ' && (char)rv < '~')
            Perl_sv_catpvf(aTHX_ report, "'%c'", (char)rv);
        else if (!rv)
-           Perl_sv_catpvf(aTHX_ report, "EOF");
+           Perl_sv_catpv(aTHX_ report, "EOF");
        else
            Perl_sv_catpvf(aTHX_ report, "?? %"IVdf, (IV)rv);
        switch (type) {
diff --git a/utf8.c b/utf8.c
index 4cd5509..c2e9f65 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -477,7 +477,7 @@ malformed:
        switch (warning) {
        case 0: /* Intentionally empty. */ break;
        case UTF8_WARN_EMPTY:
-           Perl_sv_catpvf(aTHX_ sv, "(empty string)");
+           Perl_sv_catpv(aTHX_ sv, "(empty string)");
            break;
        case UTF8_WARN_CONTINUATION:
            Perl_sv_catpvf(aTHX_ sv, "(unexpected continuation byte 0x%02"UVxf", with no preceding start byte)", uv);
@@ -514,7 +514,7 @@ malformed:
            Perl_sv_catpvf(aTHX_ sv, "(character 0x%04"UVxf")", uv);
            break;
        default:
-           Perl_sv_catpvf(aTHX_ sv, "(unknown reason)");
+           Perl_sv_catpv(aTHX_ sv, "(unknown reason)");
            break;
        }
        
@@ -1866,17 +1866,17 @@ Perl_pv_uni_display(pTHX_ SV *dsv, U8 *spv, STRLEN len, STRLEN pvlim, UV flags)
             if (!ok && (flags & UNI_DISPLAY_BACKSLASH)) {
                 switch (u & 0xFF) {
                 case '\n':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\n"); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\n"); ok = TRUE; break;
                 case '\r':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\r"); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\r"); ok = TRUE; break;
                 case '\t':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\t"); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\t"); ok = TRUE; break;
                 case '\f':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\f"); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\f"); ok = TRUE; break;
                 case '\a':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\a"); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\a"); ok = TRUE; break;
                 case '\\':
-                    Perl_sv_catpvf(aTHX_ dsv, "\\\\" ); ok = TRUE; break;
+                    Perl_sv_catpv(aTHX_ dsv, "\\\\" ); ok = TRUE; break;
                 default: break;
                 }
             }