From: Steve Peters Date: Fri, 14 Oct 2005 03:46:24 +0000 (+0000) Subject: gcc complains when it sees variables declared X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d46e09a6299ee39ec954683a582d25f5ea086c7;p=p5sagit%2Fp5-mst-13.2.git gcc complains when it sees variables declared const register ... switched them all to register const ... p4raw-id: //depot/perl@25757 --- diff --git a/av.c b/av.c index 1b54065..2b28223 100644 --- a/av.c +++ b/av.c @@ -719,7 +719,7 @@ empty. */ I32 -Perl_av_len(pTHX_ const register AV *av) +Perl_av_len(pTHX_ register const AV *av) { return AvFILL(av); } diff --git a/pp.c b/pp.c index e8bafac..db16281 100644 --- a/pp.c +++ b/pp.c @@ -3601,7 +3601,7 @@ PP(pp_uc) } s = (U8*)SvPV_force_nomg(sv, len); if (len) { - const register U8 *send = s + len; + register const U8 *send = s + len; if (IN_LOCALE_RUNTIME) { TAINT; @@ -3728,7 +3728,7 @@ PP(pp_quotemeta) dSP; dTARGET; SV * const sv = TOPs; STRLEN len; - const register char *s = SvPV_const(sv,len); + register const char *s = SvPV_const(sv,len); SvUTF8_off(TARG); /* decontaminate */ if (len) { diff --git a/pp_hot.c b/pp_hot.c index 72f657d..a2890dc 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1173,8 +1173,8 @@ PP(pp_match) dSP; dTARG; register PMOP *pm = cPMOP; PMOP *dynpm = pm; - const register char *t; - const register char *s; + register const char *t; + register const char *s; const char *strend; I32 global; I32 r_flags = REXEC_CHECKED; diff --git a/regexec.c b/regexec.c index d19b82e..e058216 100644 --- a/regexec.c +++ b/regexec.c @@ -2407,7 +2407,7 @@ S_regmatch(pTHX_ regnode *prog) #if 0 I32 firstcp = PL_savestack_ix; #endif - const register bool do_utf8 = PL_reg_match_utf8; + register const bool do_utf8 = PL_reg_match_utf8; #ifdef DEBUGGING SV *dsv0 = PERL_DEBUG_PAD_ZERO(0); SV *dsv1 = PERL_DEBUG_PAD_ZERO(1); diff --git a/sv.c b/sv.c index 2f27a52..f2d0aba 100644 --- a/sv.c +++ b/sv.c @@ -6799,7 +6799,7 @@ thats_really_all_folks: screamer2: if (rslen) { - const register STDCHAR *bpe = buf + sizeof(buf); + register const STDCHAR *bpe = buf + sizeof(buf); bp = buf; while ((i = PerlIO_getc(fp)) != EOF && (*bp++ = (STDCHAR)i) != rslast && bp < bpe) ; /* keep reading */ @@ -7751,7 +7751,7 @@ Perl_sv_true(pTHX_ register SV *sv) if (!sv) return 0; if (SvPOK(sv)) { - const register XPV* tXpv; + register const XPV* tXpv; if ((tXpv = (XPV*)SvANY(sv)) && (tXpv->xpv_cur > 1 || (tXpv->xpv_cur && *sv->sv_u.svu_pv != '0'))) diff --git a/toke.c b/toke.c index cf81ce8..890e681 100644 --- a/toke.c +++ b/toke.c @@ -1170,7 +1170,7 @@ S_tokeq(pTHX_ SV *sv) STATIC I32 S_sublex_start(pTHX) { - const register I32 op_type = yylval.ival; + register const I32 op_type = yylval.ival; if (op_type == OP_NULL) { yylval.opval = PL_lex_op; diff --git a/util.c b/util.c index 8fa774f..d04d5d4 100644 --- a/util.c +++ b/util.c @@ -365,7 +365,7 @@ Analyses the string in order to make fast searches on it using fbm_instr() void Perl_fbm_compile(pTHX_ SV *sv, U32 flags) { - const register U8 *s; + register const U8 *s; register U32 i; STRLEN len; I32 rarest = 0; @@ -570,7 +570,7 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit { /* Do actual FBM. */ register const unsigned char *table = little + littlelen + FBM_TABLE_OFFSET; - const register unsigned char *oldlittle; + register const unsigned char *oldlittle; if (littlelen > (STRLEN)(bigend - big)) return Nullch; @@ -632,13 +632,13 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit char * Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift, I32 *old_posp, I32 last) { - const register unsigned char *big; + register const unsigned char *big; register I32 pos; register I32 previous; register I32 first; - const register unsigned char *little; + register const unsigned char *little; register I32 stop_pos; - const register unsigned char *littleend; + register const unsigned char *littleend; I32 found = 0; if (*old_posp == -1 @@ -680,7 +680,7 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift } big -= previous; do { - const register unsigned char *s, *x; + register const unsigned char *s, *x; if (pos >= stop_pos) break; if (big[pos] != first) continue; @@ -1563,7 +1563,7 @@ I32 Perl_setenv_getix(pTHX_ const char *nam) { register I32 i; - const register I32 len = strlen(nam); + register const I32 len = strlen(nam); for (i = 0; environ[i]; i++) { if (