diff options
author | Steve Peters <steve@fisharerojo.org> | 2005-04-18 14:09:25 -0500 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-04-19 09:55:51 +0000 |
commit | b162af07ec759e1ba6b84569e4963bc5c289d75f (patch) | |
tree | dae58f745e70011d6b87525617543b26a5ff39fe /pp_pack.c | |
parent | 9660f4819671f0b9100e5eabfa988ead3e799a1e (diff) | |
download | perl-b162af07ec759e1ba6b84569e4963bc5c289d75f.tar.gz |
Refactoring to Sv*_set() macros - patch #5
Message-ID: <20050419000925.GA21640@mccoy.peters.homeunix.org>
Date: Mon, 18 Apr 2005 19:09:25 -0500
p4raw-id: //depot/perl@24248
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -708,7 +708,7 @@ STMT_START { \ if (utf8) gl *= UTF8_EXPAND; \ if ((cur) + gl >= (start) + SvLEN(cat)) { \ *cur = '\0'; \ - SvCUR(cat) = (cur) - (start); \ + SvCUR_set((cat), (cur) - (start)); \ (start) = sv_exp_grow(aTHX_ cat, gl); \ (cur) = (start) + SvCUR(cat); \ } \ @@ -2444,7 +2444,7 @@ marked_upgrade(pTHX_ SV *sv, tempsym_t *sym_ptr) { if (SvOOK(sv)) { if (SvIVX(sv)) { - SvLEN(sv) += SvIVX(sv); + SvLEN_set(sv, SvLEN(sv) + SvIVX(sv)); from_start -= SvIVX(sv); SvIV_set(sv, 0); } @@ -2453,8 +2453,8 @@ marked_upgrade(pTHX_ SV *sv, tempsym_t *sym_ptr) { if (SvLEN(sv) != 0) Safefree(from_start); SvPV_set(sv, to_start); - SvCUR(sv) = to_ptr - to_start; - SvLEN(sv) = len; + SvCUR_set(sv, to_ptr - to_start); + SvLEN_set(sv, len); SvUTF8_on(sv); } @@ -2980,7 +2980,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) W_utf8: if (cur > end) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); GROWING(0, cat, start, cur, len+UTF8_MAXLEN); end = start+SvLEN(cat)-UTF8_MAXLEN; @@ -2993,7 +2993,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) if (auv >= 0x100) { if (!SvUTF8(cat)) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); marked_upgrade(aTHX_ cat, symptr); lookahead.flags |= FLAG_DO_UTF8; lookahead.strbeg = symptr->strbeg; @@ -3010,7 +3010,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) } if (cur >= end) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); GROWING(0, cat, start, cur, len+1); end = start+SvLEN(cat)-1; } @@ -3045,7 +3045,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) 0 : UNICODE_ALLOW_ANY); if (cur+(endb-buffer)*UTF8_EXPAND >= end) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); GROWING(0, cat, start, cur, len+(endb-buffer)*UTF8_EXPAND); end = start+SvLEN(cat); @@ -3054,7 +3054,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) } else { if (cur >= end) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); GROWING(0, cat, start, cur, len+UTF8_MAXLEN); end = start+SvLEN(cat)-UTF8_MAXLEN; } @@ -3287,7 +3287,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) if (anv < 0) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); Perl_croak(aTHX_ "Cannot compress negative numbers in pack"); } @@ -3533,7 +3533,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) if (!uni_to_bytes(aTHX_ &aptr, aend, buffer, todo, 'u' | TYPE_IS_PACK)) { *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); Perl_croak(aTHX_ "Assertion: string is shorter than advertised"); } end = doencodes(hunk, buffer, todo); @@ -3548,7 +3548,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) } } *cur = '\0'; - SvCUR(cat) = cur - start; + SvCUR_set(cat, cur - start); no_change: *symptr = lookahead; } |