summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-08-04 11:58:27 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-08-07 08:15:39 +0000
commit10edeb5d2457364a70a6848a864cfa6b89dfc882 (patch)
tree901034210efd6983fe16b782168144371eb95631 /op.c
parent435fbc73c32c7bd8a6a0cdb8a1ea0ca077918585 (diff)
downloadperl-10edeb5d2457364a70a6848a864cfa6b89dfc882.tar.gz
g++ large patch
Message-ID: <44D2E203.5050201@iki.fi> p4raw-id: //depot/perl@28662
Diffstat (limited to 'op.c')
-rw-r--r--op.c66
1 files changed, 40 insertions, 26 deletions
diff --git a/op.c b/op.c
index 1a4ab2dfae..0d48328174 100644
--- a/op.c
+++ b/op.c
@@ -1875,10 +1875,12 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
|| ltype == OP_PADHV) && ckWARN(WARN_MISC))
{
const char * const desc
- = PL_op_desc[(rtype == OP_SUBST || rtype == OP_TRANS)
- ? rtype : OP_MATCH];
- const char * const sample = ((ltype == OP_RV2AV || ltype == OP_PADAV)
- ? "@array" : "%hash");
+ = PL_op_desc[(rtype == OP_SUBST || rtype == OP_TRANS) ?
+ (int)rtype : OP_MATCH];
+ const char * const sample =
+ (const char *)
+ (((ltype == OP_RV2AV || ltype == OP_PADAV)
+ ? "@array" : "%hash"));
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Applying %s to %s will act on scalar(%s)",
desc, sample, sample);
@@ -4553,7 +4555,7 @@ Perl_newFOROP(pTHX_ I32 flags, char *label, line_t forline, OP *sv, OP *expr, OP
loop = tmp;
}
#else
- loop = PerlMemShared_realloc(loop, sizeof(LOOP));
+ loop = (LOOP*)PerlMemShared_realloc(loop, sizeof(LOOP));
#endif
loop->op_targ = padoff;
wop = newWHILEOP(flags, 1, loop, forline, newOP(OP_ITER, 0), block, cont, 0);
@@ -4574,9 +4576,10 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label)
if (label->op_type == OP_STUB && (label->op_flags & OPf_PARENS))
o = newOP(type, OPf_SPECIAL);
else {
- o = newPVOP(type, 0, savepv(label->op_type == OP_CONST
- ? SvPVx_nolen_const(((SVOP*)label)->op_sv)
- : ""));
+ o = newPVOP(type, 0,
+ savepv(label->op_type == OP_CONST
+ ? SvPVx_nolen_const(((SVOP*)label)->op_sv)
+ : (const char *)""));
}
#ifdef PERL_MAD
op_getmad(label,o,'L');
@@ -5034,8 +5037,9 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
aname = NULL;
gv = name ? gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV)
- : gv_fetchpv(aname ? aname
- : (PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
+ : gv_fetchpv((const char *)
+ (aname ? aname
+ : (PL_curstash ? "__ANON__" : "__ANON__::__ANON__")),
gv_fetch_flags, SVt_PVCV);
if (!PL_madskills) {
@@ -5128,8 +5132,10 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
- CvCONST(cv) ? "Constant subroutine %s redefined"
- : "Subroutine %s redefined", name);
+ (const char *)
+ (CvCONST(cv)
+ ? "Constant subroutine %s redefined"
+ : "Subroutine %s redefined"), name);
CopLINE_set(PL_curcop, oldline);
}
#ifdef PERL_MAD
@@ -5510,9 +5516,11 @@ CV *
Perl_newXS(pTHX_ const char *name, XSUBADDR_t subaddr, const char *filename)
{
dVAR;
- GV * const gv = gv_fetchpv(name ? name :
- (PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
- GV_ADDMULTI, SVt_PVCV);
+ GV * const gv =
+ gv_fetchpv((const char *)
+ (name ? name :
+ (PL_curstash ? "__ANON__" : "__ANON__::__ANON__")),
+ GV_ADDMULTI, SVt_PVCV);
register CV *cv;
if (!subaddr)
@@ -5538,9 +5546,11 @@ Perl_newXS(pTHX_ const char *name, XSUBADDR_t subaddr, const char *filename)
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
- CvCONST(cv) ? "Constant subroutine %s redefined"
- : "Subroutine %s redefined"
- ,name);
+ (const char *)
+ (CvCONST(cv)
+ ? "Constant subroutine %s redefined"
+ : "Subroutine %s redefined"),
+ name);
CopLINE_set(PL_curcop, oldline);
}
}
@@ -5636,7 +5646,7 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block)
#ifdef GV_UNIQUE_CHECK
if (GvUNIQUE(gv)) {
- Perl_croak(aTHX_ "Bad symbol for form (GV is unique)");
+ Perl_croak(aTHX_ (const char*)"Bad symbol for form (GV is unique)");
}
#endif
GvMULTI_on(gv);
@@ -5646,8 +5656,10 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block)
if (PL_copline != NOLINE)
CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
- o ? "Format %"SVf" redefined"
- : "Format STDOUT redefined", (void*)cSVOPo->op_sv);
+ (const char *)
+ (o
+ ? "Format %"SVf" redefined"
+ : "Format STDOUT redefined"), (void*)cSVOPo->op_sv);
CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
@@ -6422,8 +6434,9 @@ Perl_ck_fun(pTHX_ OP *o)
if (op) {
SV *tmpstr = NULL;
const char * const a =
- kid->op_type == OP_AELEM ?
- "[]" : "{}";
+ (const char *)
+ (kid->op_type == OP_AELEM ?
+ "[]" : "{}");
if (((op->op_type == OP_RV2AV) ||
(op->op_type == OP_RV2HV)) &&
(firstop = ((UNOP*)op)->op_first) &&
@@ -7279,7 +7292,7 @@ Perl_ck_join(pTHX_ OP *o)
if (kid && kid->op_type == OP_MATCH) {
if (ckWARN(WARN_SYNTAX)) {
const REGEXP *re = PM_GETRE(kPMOP);
- const char *pmstr = re ? re->precomp : "STRING";
+ const char *pmstr = (const char *)(re ? re->precomp : "STRING");
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"/%s/ should probably be written as \"%s\"",
pmstr, pmstr);
@@ -7383,8 +7396,9 @@ Perl_ck_subr(pTHX_ OP *o)
arg++;
if (o3->op_type != OP_REFGEN && o3->op_type != OP_UNDEF)
bad_type(arg,
- arg == 1 ? "block or sub {}" : "sub {}",
- gv_ename(namegv), o3);
+ (const char*)
+ (arg == 1 ? "block or sub {}" : "sub {}"),
+ gv_ename(namegv), o3);
break;
case '*':
/* '*' allows any scalar type, including bareword */