From: Marcus Holland-Moritz Date: Sun, 23 Apr 2006 04:47:04 +0000 (+0200) Subject: A couple of casts to PADOFFSET. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f7d9405237a9031cae5810788f8ca1931499cc8;p=p5sagit%2Fp5-mst-13.2.git A couple of casts to PADOFFSET. 2nd patch from : Subject: Re: [PATCH] cleanup 212 warnings emitted by gcc-4.2 Message-ID: <20060423044704.6a383ee8@r2d2> p4raw-id: //depot/perl@27945 --- diff --git a/op.c b/op.c index ec4cb3a..52717a2 100644 --- a/op.c +++ b/op.c @@ -2013,7 +2013,7 @@ STATIC OP * S_newDEFSVOP(pTHX) { dVAR; - const I32 offset = pad_findmy("$_"); + const PADOFFSET offset = pad_findmy("$_"); if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS_isOUR(offset)) { return newSVREF(newGVOP(OP_GV, 0, PL_defgv)); } @@ -4476,7 +4476,7 @@ Perl_newFOROP(pTHX_ I32 flags, char *label, line_t forline, OP *sv, OP *expr, OP iterpflags |= OPpITER_DEF; } else { - const I32 offset = pad_findmy("$_"); + const PADOFFSET offset = pad_findmy("$_"); if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS_isOUR(offset)) { sv = newGVOP(OP_GV, 0, PL_defgv); } @@ -6528,7 +6528,7 @@ Perl_ck_grep(pTHX_ OP *o) LOGOP *gwop = NULL; OP *kid; const OPCODE type = o->op_type == OP_GREPSTART ? OP_GREPWHILE : OP_MAPWHILE; - I32 offset; + PADOFFSET offset; o->op_ppaddr = PL_ppaddr[OP_GREPSTART]; /* don't allocate gwop here, as we may leak it if PL_error_count > 0 */ @@ -6766,7 +6766,7 @@ Perl_ck_match(pTHX_ OP *o) { dVAR; if (o->op_type != OP_QR && PL_compcv) { - const I32 offset = pad_findmy("$_"); + const PADOFFSET offset = pad_findmy("$_"); if (offset != NOT_IN_PAD && !(PAD_COMPNAME_FLAGS_isOUR(offset))) { o->op_targ = offset; o->op_private |= OPpTARGET_MY; diff --git a/pad.c b/pad.c index 2d2bade..95a8d42 100644 --- a/pad.c +++ b/pad.c @@ -592,9 +592,9 @@ Perl_pad_findmy(pTHX_ const char *name) SV **name_svp; pad_peg("pad_findmy"); - offset = pad_findlex(name, PL_compcv, PL_cop_seqmax, 1, + offset = pad_findlex(name, PL_compcv, PL_cop_seqmax, 1, NULL, &out_sv, &out_flags); - if (offset != NOT_IN_PAD) + if ((PADOFFSET)offset != NOT_IN_PAD) return offset; /* look for an our that's being introduced; this allows @@ -814,7 +814,7 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, if (!CvOUTSIDE(cv)) return NOT_IN_PAD; - + /* out_capture non-null means caller wants us to capture lex; in * addition we capture ourselves unless it's an ANON/format */ new_capturep = out_capture ? out_capture : @@ -822,9 +822,9 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, offset = pad_findlex(name, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv), 1, new_capturep, out_name_sv, out_flags); - if (offset == NOT_IN_PAD) + if ((PADOFFSET)offset == NOT_IN_PAD) return NOT_IN_PAD; - + /* found in an outer CV. Add appropriate fake entry to this pad */ /* don't add new fake entries (via eval) to CVs that we have already diff --git a/pp.c b/pp.c index 7a70e15..6136d21 100644 --- a/pp.c +++ b/pp.c @@ -4345,7 +4345,7 @@ PP(pp_reverse) register I32 tmp; dTARGET; STRLEN len; - I32 padoff_du; + PADOFFSET padoff_du; SvUTF8_off(TARG); /* decontaminate */ if (SP - MARK > 1) diff --git a/toke.c b/toke.c index 6076484..cd07c81 100644 --- a/toke.c +++ b/toke.c @@ -6670,7 +6670,7 @@ S_pending_ident(pTHX) { dVAR; register char *d; - register I32 tmp = 0; + register PADOFFSET tmp = 0; /* pit holds the identifier we read and pending_ident is reset */ char pit = PL_pending_ident; PL_pending_ident = 0; @@ -11136,7 +11136,7 @@ S_scan_inputsymbol(pTHX_ char *start) filehandle */ if (*d == '$') { - I32 tmp; + PADOFFSET tmp; /* try to find it in the pad for this block, otherwise find add symbol table ops