diff options
author | Andy Lester <andy@petdance.com> | 2005-12-22 04:57:17 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-22 17:09:59 +0000 |
commit | c445ea15829fa1ef23c4453a817f9c096a56a192 (patch) | |
tree | b82a090e6005af218bbc846b84e47ce12b81d39e /sv.c | |
parent | efa32bb49fad39e670c055d4b6f557a0d2e1a8a2 (diff) | |
download | perl-c445ea15829fa1ef23c4453a817f9c096a56a192.tar.gz |
Ho! Ho! Ho! Santa brings consting!
Message-ID: <20051222165717.GA2874@petdance.com>
p4raw-id: //depot/perl@26450
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 29 |
1 files changed, 13 insertions, 16 deletions
@@ -2455,7 +2455,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) (SVs_OBJECT|SVf_OK|SVs_GMG|SVs_SMG|SVs_RMG)) == (SVs_OBJECT|SVs_SMG)) && (mg = mg_find(referent, PERL_MAGIC_qr))) { - return S_stringify_regexp(aTHX_ sv, mg, lp); + return stringify_regexp(sv, mg, lp); } else { const char *const typestr = sv_reftype(referent, 0); @@ -7611,8 +7611,6 @@ Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted); } -/* private function for use in sv_vcatpvfn via the EXPECT_NUMBER macro */ - STATIC I32 S_expect_number(pTHX_ char** pattern) { @@ -7631,10 +7629,9 @@ S_expect_number(pTHX_ char** pattern) } return var; } -#define EXPECT_NUMBER(pattern, var) (var = S_expect_number(aTHX_ &pattern)) -static char * -F0convert(NV nv, char *endbuf, STRLEN *len) +STATIC char * +S_F0convert(NV nv, char *endbuf, STRLEN *len) { const int neg = nv < 0; UV uv; @@ -7783,7 +7780,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN zeros = 0; bool has_precis = FALSE; STRLEN precis = 0; - I32 osvix = svix; + const I32 osvix = svix; bool is_utf8 = FALSE; /* is this item utf8? */ #ifdef HAS_LDBL_SPRINTF_BUG /* This is to try to fix a bug with irix/nonstop-ux/powerux and @@ -7870,7 +7867,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN n = 0; if (*q == '-') sv = *q++; - EXPECT_NUMBER(q, n); + n = expect_number(&q); if (*q++ == 'p') { if (sv) { /* SVf */ if (n) { @@ -7899,7 +7896,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV q = r; } - if (EXPECT_NUMBER(q, width)) { + if ( (width = expect_number(&q)) ) { if (*q == '$') { ++q; efix = width; @@ -7940,7 +7937,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV tryasterisk: if (*q == '*') { q++; - if (EXPECT_NUMBER(q, ewix)) + if ( (ewix = expect_number(&q)) ) if (*q++ != '$') goto unknown; asterisk = TRUE; @@ -7962,7 +7959,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV { if( *q == '0' ) fill = *q++; - EXPECT_NUMBER(q, width); + width = expect_number(&q); } if (vectorize) { @@ -8036,7 +8033,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV q++; if (*q == '*') { q++; - if (EXPECT_NUMBER(q, epix) && *q++ != '$') + if ( ((epix = expect_number(&q))) && (*q++ != '$') ) goto unknown; /* XXX: todo, support specified precision parameter */ if (epix) @@ -9010,7 +9007,7 @@ Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS* param) if (mg->mg_type == PERL_MAGIC_overload_table && AMT_AMAGIC((AMT*)mg->mg_ptr)) { - AMT * const amtp = (AMT*)mg->mg_ptr; + const AMT * const amtp = (AMT*)mg->mg_ptr; AMT * const namtp = (AMT*)nmg->mg_ptr; I32 i; for (i = 1; i < NofAMmeth; i++) { @@ -9136,7 +9133,7 @@ void Perl_ptr_table_clear(pTHX_ PTR_TBL_t *tbl) { if (tbl && tbl->tbl_items) { - register PTR_TBL_ENT_t **array = tbl->tbl_ary; + register PTR_TBL_ENT_t * const * const array = tbl->tbl_ary; UV riter = tbl->tbl_max; do { @@ -9539,8 +9536,8 @@ Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max, CLONE_PARAMS* param) ptr_table_store(PL_ptr_table, cxs, ncxs); while (ix >= 0) { - PERL_CONTEXT *cx = &cxs[ix]; - PERL_CONTEXT *ncx = &ncxs[ix]; + PERL_CONTEXT * const cx = &cxs[ix]; + PERL_CONTEXT * const ncx = &ncxs[ix]; ncx->cx_type = cx->cx_type; if (CxTYPE(cx) == CXt_SUBST) { Perl_croak(aTHX_ "Cloning substitution context is unimplemented"); |