bytes = (newmax + 1) * sizeof(SV*);
#define MALLOC_OVERHEAD 16
itmp = MALLOC_OVERHEAD;
- while (itmp - MALLOC_OVERHEAD < bytes)
+ while ((MEM_SIZE)(itmp - MALLOC_OVERHEAD) < bytes)
itmp += itmp;
itmp -= MALLOC_OVERHEAD;
itmp /= sizeof(SV*);
#define PUSHSUB(cx) \
cx->blk_sub.cv = cv; \
- cx->blk_sub.olddepth = CvDEPTH(cv); \
+ cx->blk_sub.olddepth = (U16)CvDEPTH(cv); \
cx->blk_sub.hasargs = hasargs; \
cx->blk_sub.lval = PL_op->op_private & \
(OPpLVAL_INTRO|OPpENTERSUB_INARGS);
cx->blk_oldscopesp = PL_scopestack_ix, \
cx->blk_oldretsp = PL_retstack_ix, \
cx->blk_oldpm = PL_curpm, \
- cx->blk_gimme = gimme; \
+ cx->blk_gimme = (U8)gimme; \
DEBUG_l( PerlIO_printf(Perl_debug_log, "Entering block %ld, type %s\n", \
(long)cxstack_ix, PL_block_type[CxTYPE(cx)]); )
while (s < send) {
if ((ch = tbl[*s]) >= 0) {
matches++;
- *s++ = ch;
+ *s++ = (U8)ch;
}
else
s++;
U8* p = send;
while (s < send) {
if ((ch = tbl[*s]) >= 0) {
- *d = ch;
+ *d = (U8)ch;
matches++;
if (p != d - 1 || *p != *d)
p = d++;
while (s < send) {
if ((ch = tbl[*s]) >= 0) {
matches++;
- *d++ = ch;
+ *d++ = (U8)ch;
}
else if (ch == -1) /* -1 is unmapped character */
*d++ = *s;
ch = (rlen == 0) ? comp :
(comp - 0x100 < rlen) ?
tbl[comp+1] : tbl[0x100+rlen];
- if (ch != pch) {
+ if ((UV)ch != pch) {
d = uvchr_to_utf8(d, ch);
- pch = ch;
+ pch = (UV)ch;
}
s += len;
continue;
}
else if ((ch = tbl[comp]) >= 0) {
matches++;
- if (ch != pch) {
+ if ((UV)ch != pch) {
d = uvchr_to_utf8(d, ch);
- pch = ch;
+ pch = (UV)ch;
}
s += len;
continue;
else {
offset >>= 3; /* turn into byte offset */
if (size == 16) {
- if (offset >= srclen)
+ if ((STRLEN)offset >= srclen)
retnum = 0;
else
retnum = (UV) s[offset] << 8;
}
else if (size == 32) {
- if (offset >= srclen)
+ if ((STRLEN)offset >= srclen)
retnum = 0;
- else if (offset + 1 >= srclen)
+ else if ((STRLEN)(offset + 1) >= srclen)
retnum =
((UV) s[offset ] << 24);
- else if (offset + 2 >= srclen)
+ else if ((STRLEN)(offset + 2) >= srclen)
retnum =
((UV) s[offset ] << 24) +
((UV) s[offset + 1] << 16);
else {
offset >>= 3; /* turn into byte offset */
if (size == 8)
- s[offset ] = lval & 0xff;
+ s[offset ] = (U8)( lval & 0xff);
else if (size == 16) {
- s[offset ] = (lval >> 8) & 0xff;
- s[offset+1] = lval & 0xff;
+ s[offset ] = (U8)((lval >> 8) & 0xff);
+ s[offset+1] = (U8)( lval & 0xff);
}
else if (size == 32) {
- s[offset ] = (lval >> 24) & 0xff;
- s[offset+1] = (lval >> 16) & 0xff;
- s[offset+2] = (lval >> 8) & 0xff;
- s[offset+3] = lval & 0xff;
+ s[offset ] = (U8)((lval >> 24) & 0xff);
+ s[offset+1] = (U8)((lval >> 16) & 0xff);
+ s[offset+2] = (U8)((lval >> 8) & 0xff);
+ s[offset+3] = (U8)( lval & 0xff);
}
#ifdef UV_IS_QUAD
else if (size == 64) {
if (ckWARN(WARN_PORTABLE))
Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
"Bit vector size > 32 non-portable");
- s[offset ] = (lval >> 56) & 0xff;
- s[offset+1] = (lval >> 48) & 0xff;
- s[offset+2] = (lval >> 40) & 0xff;
- s[offset+3] = (lval >> 32) & 0xff;
- s[offset+4] = (lval >> 24) & 0xff;
- s[offset+5] = (lval >> 16) & 0xff;
- s[offset+6] = (lval >> 8) & 0xff;
- s[offset+7] = lval & 0xff;
+ s[offset ] = (U8)((lval >> 56) & 0xff);
+ s[offset+1] = (U8)((lval >> 48) & 0xff);
+ s[offset+2] = (U8)((lval >> 40) & 0xff);
+ s[offset+3] = (U8)((lval >> 32) & 0xff);
+ s[offset+4] = (U8)((lval >> 24) & 0xff);
+ s[offset+5] = (U8)((lval >> 16) & 0xff);
+ s[offset+6] = (U8)((lval >> 8) & 0xff);
+ s[offset+7] = (U8)( lval & 0xff);
}
#endif
}
else if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
STRLEN n_a;
dc = SvPV_force(sv, n_a);
- if (SvCUR(sv) < len) {
- dc = SvGROW(sv, len + 1);
+ if (SvCUR(sv) < (STRLEN)len) {
+ dc = SvGROW(sv, (STRLEN)(len + 1));
(void)memzero(dc + SvCUR(sv), len - SvCUR(sv) + 1);
}
if (optype != OP_BIT_AND && (left_utf || right_utf))
*dc++ = *lc++ | *rc++;
mop_up:
len = lensave;
- if (rightlen > len)
+ if (rightlen > (STRLEN)len)
sv_catpvn(sv, rsave + len, rightlen - len);
- else if (leftlen > len)
+ else if (leftlen > (STRLEN)len)
sv_catpvn(sv, lsave + len, leftlen - len);
else
*SvEND(sv) = '\0';
PerlIO_printf(file, " (");
Zero(freq, FREQ_MAX + 1, int);
- for (i = 0; i <= HvMAX(sv); i++) {
+ for (i = 0; (STRLEN)i <= HvMAX(sv); i++) {
HE* h; int count = 0;
for (h = HvARRAY(sv)[i]; h; h = HeNEXT(h))
count++;
SV *dumpop = perl_get_sv("Devel::Peek::dump_ops", FALSE);
I32 save_dumpindent = PL_dumpindent;
PL_dumpindent = 2;
- do_sv_dump(0, Perl_debug_log, sv, 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
+ do_sv_dump(0, Perl_debug_log, sv, 0, lim,
+ (bool)(dumpop && SvTRUE(dumpop)), pv_lim);
PL_dumpindent = save_dumpindent;
}
for (i=1; i<items; i++) {
PerlIO_printf(Perl_debug_log, "Elt No. %ld 0x%"UVxf"\n", i - 1, PTR2UV(ST(i)));
- do_sv_dump(0, Perl_debug_log, ST(i), 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
+ do_sv_dump(0, Perl_debug_log, ST(i), 0, lim,
+ (bool)(dumpop && SvTRUE(dumpop)), pv_lim);
}
PL_dumpindent = save_dumpindent;
}
if (mg && amtp->was_ok_am == PL_amagic_generation
&& amtp->was_ok_sub == PL_sub_generation)
- return AMT_OVERLOADED(amtp);
+ return (bool)AMT_OVERLOADED(amtp);
sv_unmagic((SV*)stash, PERL_MAGIC_overload_table);
DEBUG_o( Perl_deb(aTHX_ "Recalcing overload magic in package %s\n",HvNAME(stash)) );
}
#ifdef ENV_IS_CASELESS
else if (mg_find((SV*)hv, PERL_MAGIC_env)) {
- U32 i;
+ I32 i;
for (i = 0; i < klen; ++i)
if (isLOWER(key[i])) {
char *nkey = strupr(SvPVX(sv_2mortal(newSVpvn(key,klen))));
for (; entry; entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
for (; entry; entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
for (entry = *oentry; entry; i=0, entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
xhv->xhv_keys++; /* HvKEYS(hv)++ */
if (i) { /* initial entry? */
xhv->xhv_fill++; /* HvFILL(hv)++ */
- if (xhv->xhv_keys > xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
+ if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
hsplit(hv);
}
for (; entry; i=0, entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
xhv->xhv_keys++; /* HvKEYS(hv)++ */
if (i) { /* initial entry? */
xhv->xhv_fill++; /* HvFILL(hv)++ */
- if (xhv->xhv_keys > xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
+ if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
hsplit(hv);
}
for (; entry; i=0, oentry = &HeNEXT(entry), entry = *oentry) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
for (; entry; i=0, oentry = &HeNEXT(entry), entry = *oentry) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
for (; entry; entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
- if (HeKLEN(entry) != klen)
+ if (HeKLEN(entry) != (I32)klen)
continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
continue;
bep = aep+oldsize;
for (oentry = aep, entry = *aep; entry; entry = *oentry) {
- if ((HeHASH(entry) & newsize) != i) {
+ if ((HeHASH(entry) & newsize) != (U32)i) {
*oentry = HeNEXT(entry);
HeNEXT(entry) = *bep;
if (!*bep)
if (!SvMAGICAL((SV *)ohv)) {
/* It's an ordinary hash, so copy it fast. AMS 20010804 */
- int i, shared = !!HvSHAREKEYS(ohv);
+ STRLEN i;
+ bool shared = !!HvSHAREKEYS(ohv);
HE **ents, **oents = (HE **)HvARRAY(ohv);
char *a;
New(0, a, PERL_HV_ARRAY_ALLOC_BYTES(hv_max+1), char);
}
while (!entry) {
xhv->xhv_riter++; /* HvRITER(hv)++ */
- if (xhv->xhv_riter > xhv->xhv_max /* HvRITER(hv) > HvMAX(hv) */) {
+ if (xhv->xhv_riter > (I32)xhv->xhv_max /* HvRITER(hv) > HvMAX(hv) */) {
xhv->xhv_riter = -1; /* HvRITER(hv) = -1 */
break;
}
xhv->xhv_keys++; /* HvKEYS(hv)++ */
if (i) { /* initial entry? */
xhv->xhv_fill++; /* HvFILL(hv)++ */
- if (xhv->xhv_keys > xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
+ if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
hsplit(PL_strtab);
}
}
SSize_t mult = fb - fa;
if (mult < 1)
Perl_croak(aTHX_ "strxfrm() gets absurd");
- PL_collxfrm_base = (fa > mult) ? (fa - mult) : 0;
+ PL_collxfrm_base = (fa > (Size_t)mult) ? (fa - mult) : 0;
PL_collxfrm_mult = mult;
}
}
xused = strxfrm(xbuf + xout, s + xin, xAlloc - xout);
if (xused == -1)
goto bad;
- if (xused < xAlloc - xout)
+ if ((STRLEN)xused < xAlloc - xout)
break;
xAlloc = (2 * xAlloc) + 1;
Renew(xbuf, xAlloc, char);
paren = mg->mg_len;
if (paren < 0)
return 0;
- if (paren <= rx->nparens &&
+ if (paren <= (I32)rx->nparens &&
(s = rx->startp[paren]) != -1 &&
(t = rx->endp[paren]) != -1)
{
paren = atoi(mg->mg_ptr); /* $& is in [0] */
getparen:
- if (paren <= rx->nparens &&
+ if (paren <= (I32)rx->nparens &&
(s1 = rx->startp[paren]) != -1 &&
(t1 = rx->endp[paren]) != -1)
{
*/
paren = atoi(mg->mg_ptr); /* $& is in [0] */
getparen:
- if (paren <= rx->nparens &&
+ if (paren <= (I32)rx->nparens &&
(s1 = rx->startp[paren]) != -1 &&
(t1 = rx->endp[paren]) != -1)
{
svp = av_fetch(GvAV(gv),
atoi(MgPV(mg,n_a)), FALSE);
if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp))))
- o->op_private = i;
+ o->op_private = (U8)i;
return 0;
}
if (pos < 0)
pos = 0;
}
- else if (pos > len)
+ else if (pos > (SSize_t)len)
pos = len;
if (ulen) {
if (SvUTF8(lsv))
sv_pos_u2b(lsv, &offs, &rem);
- if (offs > len)
+ if (offs > (I32)len)
offs = len;
- if (rem + offs > len)
+ if (rem + offs > (I32)len)
rem = len - offs;
sv_setpvn(sv, tmps + offs, (STRLEN)rem);
if (SvUTF8(lsv))
sv_setsv(PL_bodytarget, sv);
break;
case '\003': /* ^C */
- PL_minus_c = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
+ PL_minus_c = (bool)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
break;
case '\004': /* ^D */
}
s = SvPV_force(sv,len);
i = len;
- if (i >= PL_origalen) {
+ if (i >= (I32)PL_origalen) {
i = PL_origalen;
/* don't allow system to limit $0 seen by script */
/* SvCUR_set(sv, i); *SvEND(sv) = '\0'; */
Copy(s, PL_origargv[0], i, char);
s = PL_origargv[0]+i;
*s++ = '\0';
- while (++i < PL_origalen)
+ while (++i < (I32)PL_origalen)
*s++ = ' ';
s = PL_origargv[0]+i;
for (i = 1; i < PL_origargc; i++)
SV **svp = AvARRAY(PL_comppad_name);
HV *ourstash = (PL_curstash ? PL_curstash : PL_defstash);
PADOFFSET top = AvFILLp(PL_comppad_name);
- for (off = top; off > PL_comppad_name_floor; off--) {
+ for (off = top; (I32)off > PL_comppad_name_floor; off--) {
if ((sv = svp[off])
&& sv != &PL_sv_undef
&& (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0)
for (off = AvFILLp(curname); off > 0; off--) {
if ((sv = svp[off]) &&
sv != &PL_sv_undef &&
- seq <= SvIVX(sv) &&
- seq > I_32(SvNVX(sv)) &&
+ seq <= (U32)SvIVX(sv) &&
+ seq > (U32)I_32(SvNVX(sv)) &&
strEQ(SvPVX(sv), name))
{
I32 depth;
if ((sv = svp[off]) &&
sv != &PL_sv_undef &&
(!SvIVX(sv) ||
- (seq <= SvIVX(sv) &&
- seq > I_32(SvNVX(sv)))) &&
+ (seq <= (U32)SvIVX(sv) &&
+ seq > (U32)I_32(SvNVX(sv)))) &&
strEQ(SvPVX(sv), name))
{
if (SvIVX(sv) || SvFLAGS(sv) & SVpad_OUR)
}
type = o->op_type;
if (type == OP_NULL)
- type = o->op_targ;
+ type = (OPCODE)o->op_targ;
/* COP* is not cleared by op_clear() so that we may track line
* numbers etc even after null() */
PL_copline = copline; /* XXX newSTATEOP may reset PL_copline */
LEAVE_SCOPE(floor);
PL_pad_reset_pending = FALSE;
- PL_compiling.op_private = PL_hints;
+ PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
if (needblockscope)
PL_hints |= HINT_BLOCK_SCOPE; /* propagate out */
pad_leavemy(PL_comppad_name_fill);
if (!(PL_opargs[type] & OA_MARK))
op_null(cLISTOPo->op_first);
- o->op_type = type;
+ o->op_type = (OPCODE)type;
o->op_ppaddr = PL_ppaddr[type];
o->op_flags |= flags;
NewOp(1101, listop, 1, LISTOP);
- listop->op_type = type;
+ listop->op_type = (OPCODE)type;
listop->op_ppaddr = PL_ppaddr[type];
if (first || last)
flags |= OPf_KIDS;
- listop->op_flags = flags;
+ listop->op_flags = (U8)flags;
if (!last && first)
last = first;
{
OP *o;
NewOp(1101, o, 1, OP);
- o->op_type = type;
+ o->op_type = (OPCODE)type;
o->op_ppaddr = PL_ppaddr[type];
- o->op_flags = flags;
+ o->op_flags = (U8)flags;
o->op_next = o;
- o->op_private = 0 + (flags >> 8);
+ o->op_private = (U8)(0 | (flags >> 8));
if (PL_opargs[type] & OA_RETSCALAR)
scalar(o);
if (PL_opargs[type] & OA_TARGET)
first = force_list(first);
NewOp(1101, unop, 1, UNOP);
- unop->op_type = type;
+ unop->op_type = (OPCODE)type;
unop->op_ppaddr = PL_ppaddr[type];
unop->op_first = first;
unop->op_flags = flags | OPf_KIDS;
- unop->op_private = 1 | (flags >> 8);
+ unop->op_private = (U8)(1 | (flags >> 8));
unop = (UNOP*) CHECKOP(type, unop);
if (unop->op_next)
return (OP*)unop;
if (!first)
first = newOP(OP_NULL, 0);
- binop->op_type = type;
+ binop->op_type = (OPCODE)type;
binop->op_ppaddr = PL_ppaddr[type];
binop->op_first = first;
binop->op_flags = flags | OPf_KIDS;
if (!last) {
last = first;
- binop->op_private = 1 | (flags >> 8);
+ binop->op_private = (U8)(1 | (flags >> 8));
}
else {
- binop->op_private = 2 | (flags >> 8);
+ binop->op_private = (U8)(2 | (flags >> 8));
first->op_sibling = last;
}
binop = (BINOP*)CHECKOP(type, binop);
- if (binop->op_next || binop->op_type != type)
+ if (binop->op_next || binop->op_type != (OPCODE)type)
return (OP*)binop;
binop->op_last = binop->op_first->op_sibling;
tbl = (short*)cPVOPo->op_pv;
if (complement) {
Zero(tbl, 256, short);
- for (i = 0; i < tlen; i++)
+ for (i = 0; i < (I32)tlen; i++)
tbl[t[i]] = -1;
for (i = 0, j = 0; i < 256; i++) {
if (!tbl[i]) {
- if (j >= rlen) {
+ if (j >= (I32)rlen) {
if (del)
tbl[i] = -2;
else if (rlen)
tbl[i] = r[j-1];
else
- tbl[i] = i;
+ tbl[i] = (short)i;
}
else {
if (i < 128 && r[j] >= 128)
if (!squash)
o->op_private |= OPpTRANS_IDENTICAL;
}
- else if (j >= rlen)
+ else if (j >= (I32)rlen)
j = rlen - 1;
else
cPVOPo->op_pv = (char*)Renew(tbl, 0x101+rlen-j, short);
tbl[0x100] = rlen - j;
- for (i=0; i < rlen - j; i++)
+ for (i=0; i < (I32)rlen - j; i++)
tbl[0x101+i] = r[j+i];
}
}
}
for (i = 0; i < 256; i++)
tbl[i] = -1;
- for (i = 0, j = 0; i < tlen; i++,j++) {
- if (j >= rlen) {
+ for (i = 0, j = 0; i < (I32)tlen; i++,j++) {
+ if (j >= (I32)rlen) {
if (del) {
if (tbl[t[i]] == -1)
tbl[t[i]] = -2;
PMOP *pmop;
NewOp(1101, pmop, 1, PMOP);
- pmop->op_type = type;
+ pmop->op_type = (OPCODE)type;
pmop->op_ppaddr = PL_ppaddr[type];
- pmop->op_flags = flags;
- pmop->op_private = 0 | (flags >> 8);
+ pmop->op_flags = (U8)flags;
+ pmop->op_private = (U8)(0 | (flags >> 8));
if (PL_hints & HINT_RE_TAINT)
pmop->op_pmpermflags |= PMf_RETAINT;
if (pm->op_pmflags & PMf_EVAL) {
curop = 0;
if (CopLINE(PL_curcop) < PL_multi_end)
- CopLINE_set(PL_curcop, PL_multi_end);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_end);
}
#ifdef USE_5005THREADS
else if (repl->op_type == OP_THREADSV
{
SVOP *svop;
NewOp(1101, svop, 1, SVOP);
- svop->op_type = type;
+ svop->op_type = (OPCODE)type;
svop->op_ppaddr = PL_ppaddr[type];
svop->op_sv = sv;
svop->op_next = (OP*)svop;
- svop->op_flags = flags;
+ svop->op_flags = (U8)flags;
if (PL_opargs[type] & OA_RETSCALAR)
scalar((OP*)svop);
if (PL_opargs[type] & OA_TARGET)
{
PADOP *padop;
NewOp(1101, padop, 1, PADOP);
- padop->op_type = type;
+ padop->op_type = (OPCODE)type;
padop->op_ppaddr = PL_ppaddr[type];
padop->op_padix = pad_alloc(type, SVs_PADTMP);
SvREFCNT_dec(PL_curpad[padop->op_padix]);
PL_curpad[padop->op_padix] = sv;
SvPADTMP_on(sv);
padop->op_next = (OP*)padop;
- padop->op_flags = flags;
+ padop->op_flags = (U8)flags;
if (PL_opargs[type] & OA_RETSCALAR)
scalar((OP*)padop);
if (PL_opargs[type] & OA_TARGET)
{
PVOP *pvop;
NewOp(1101, pvop, 1, PVOP);
- pvop->op_type = type;
+ pvop->op_type = (OPCODE)type;
pvop->op_ppaddr = PL_ppaddr[type];
pvop->op_pv = pv;
pvop->op_next = (OP*)pvop;
- pvop->op_flags = flags;
+ pvop->op_flags = (U8)flags;
if (PL_opargs[type] & OA_RETSCALAR)
scalar((OP*)pvop);
if (PL_opargs[type] & OA_TARGET)
}
curop = list(force_list(left));
o = newBINOP(OP_AASSIGN, flags, list(force_list(right)), curop);
- o->op_private = 0 | (flags >> 8);
+ o->op_private = (U8)(0 | (flags >> 8));
for (curop = ((LISTOP*)curop)->op_first;
curop; curop = curop->op_sibling)
{
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
GV *gv = cGVOPx_gv(curop);
- if (gv == PL_defgv || SvCUR(gv) == PL_generation)
+ if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
break;
SvCUR(gv) = PL_generation;
}
curop->op_type == OP_PADANY) {
SV **svp = AvARRAY(PL_comppad_name);
SV *sv = svp[curop->op_targ];
- if (SvCUR(sv) == PL_generation)
+ if ((int)SvCUR(sv) == PL_generation)
break;
SvCUR(sv) = PL_generation; /* (SvCUR not used any more) */
}
#else
GV *gv = (GV*)((PMOP*)curop)->op_pmreplroot;
#endif
- if (gv == PL_defgv || SvCUR(gv) == PL_generation)
+ if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
break;
SvCUR(gv) = PL_generation;
}
cop->op_type = OP_NEXTSTATE;
cop->op_ppaddr = PL_ppaddr[ OP_NEXTSTATE ];
}
- cop->op_flags = flags;
- cop->op_private = (PL_hints & HINT_PRIVATE_MASK);
+ cop->op_flags = (U8)flags;
+ cop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
#ifdef NATIVE_HINTS
cop->op_private |= NATIVE_HINTS;
#endif
|| k1->op_type == OP_EACH)
{
warnop = ((k1->op_type == OP_NULL)
- ? k1->op_targ : k1->op_type);
+ ? (OPCODE)k1->op_targ : k1->op_type);
}
break;
}
NewOp(1101, logop, 1, LOGOP);
- logop->op_type = type;
+ logop->op_type = (OPCODE)type;
logop->op_ppaddr = PL_ppaddr[type];
logop->op_first = first;
logop->op_flags = flags | OPf_KIDS;
logop->op_other = LINKLIST(other);
- logop->op_private = 1 | (flags >> 8);
+ logop->op_private = (U8)(1 | (flags >> 8));
/* establish postfix order */
logop->op_next = LINKLIST(first);
logop->op_ppaddr = PL_ppaddr[OP_COND_EXPR];
logop->op_first = first;
logop->op_flags = flags | OPf_KIDS;
- logop->op_private = 1 | (flags >> 8);
+ logop->op_private = (U8)(1 | (flags >> 8));
logop->op_other = LINKLIST(trueop);
logop->op_next = LINKLIST(falseop);
range->op_flags = OPf_KIDS;
leftstart = LINKLIST(left);
range->op_other = LINKLIST(right);
- range->op_private = 1 | (flags >> 8);
+ range->op_private = (U8)(1 | (flags >> 8));
left->op_sibling = right;
next = unstack;
cont = append_elem(OP_LINESEQ, cont, unstack);
if ((line_t)whileline != NOLINE) {
- PL_copline = whileline;
+ PL_copline = (line_t)whileline;
cont = append_elem(OP_LINESEQ, cont,
newSTATEOP(0, Nullch, Nullop));
}
redo = LINKLIST(listop);
if (expr) {
- PL_copline = whileline;
+ PL_copline = (line_t)whileline;
scalar(listop);
o = new_logop(OP_AND, 0, &expr, &listop);
if (o == expr && o->op_type == OP_CONST && !SvTRUE(cSVOPo->op_sv)) {
call_list(oldscope, PL_beginav);
PL_curcop = &PL_compiling;
- PL_compiling.op_private = PL_hints;
+ PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
LEAVE;
}
else if (strEQ(s, "END") && !PL_error_count) {
OP *
Perl_ck_bitop(pTHX_ OP *o)
{
- o->op_private = PL_hints;
+ o->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
return o;
}
else if (!rschar && numlen >= 2)
PL_rs = newSVpvn("", 0);
else {
- char ch = rschar;
+ char ch = (char)rschar;
PL_rs = newSVpvn(&ch, 1);
}
return s + numlen;
END_EXTERN_C
struct am_table {
- long was_ok_sub;
+ U32 was_ok_sub;
long was_ok_am;
U32 flags;
CV* table[NofAMmeth];
long fallback;
};
struct am_table_short {
- long was_ok_sub;
+ U32 was_ok_sub;
long was_ok_am;
U32 flags;
};
* Skip to write part
*/
const char *s = strchr(type, 0);
- if (s && (s - type) < len) {
+ if (s && (STRLEN)(s - type) < len) {
type = s + 1;
}
}
SSize_t avail = PerlIO_get_cnt(f);
SSize_t take = 0;
if (avail > 0)
- take = (count < avail) ? count : avail;
+ take = ((SSize_t)count < avail) ? count : avail;
if (take > 0) {
STDCHAR *ptr = PerlIO_get_ptr(f);
Copy(ptr, buf, take, STDCHAR);
if (avail > 0) {
STDCHAR *ptr = PerlIO_get_ptr(n);
SSize_t cnt = avail;
- if (avail > b->bufsiz)
+ if (avail > (SSize_t)b->bufsiz)
avail = b->bufsiz;
Copy(ptr, b->buf, avail, STDCHAR);
PerlIO_set_ptrcnt(n, ptr + avail, cnt - avail);
{
SSize_t avail = PerlIO_get_cnt(f);
SSize_t got = 0;
- if (count < avail)
+ if ((SSize_t)count < avail)
avail = count;
if (avail > 0)
got = PerlIOBuf_read(aTHX_ f, vbuf, avail);
- if (got >= 0 && got < count) {
+ if (got >= 0 && got < (SSize_t)count) {
SSize_t more =
PerlIO_read(f, ((STDCHAR *) vbuf) + got, count - got);
if (more >= 0 || got == 0)
case 2:
#line 136 "perly.y"
{ if (PL_copline > (line_t)yyvsp[-3].ival)
- PL_copline = yyvsp[-3].ival;
+ PL_copline = (line_t)yyvsp[-3].ival;
yyval.opval = block_end(yyvsp[-2].ival, yyvsp[-1].opval); }
break;
case 3:
case 5:
#line 156 "perly.y"
{ if (PL_copline > (line_t)yyvsp[-3].ival)
- PL_copline = yyvsp[-3].ival;
+ PL_copline = (line_t)yyvsp[-3].ival;
yyval.opval = block_end(yyvsp[-2].ival, yyvsp[-1].opval); }
break;
case 6:
break;
case 20:
#line 209 "perly.y"
-{ yyval.opval = newFOROP(0, Nullch, yyvsp[-1].ival,
+{ yyval.opval = newFOROP(0, Nullch, (line_t)yyvsp[-1].ival,
Nullop, yyvsp[0].opval, yyvsp[-2].opval, Nullop); }
break;
case 21:
break;
case 23:
#line 219 "perly.y"
-{ PL_copline = yyvsp[-5].ival;
+{ PL_copline = (line_t)yyvsp[-5].ival;
yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval);
PL_hints |= HINT_BLOCK_SCOPE; }
break;
case 24:
#line 226 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval)); }
break;
case 25:
#line 230 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval)); }
break;
break;
case 28:
#line 244 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newSTATEOP(0, yyvsp[-7].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
break;
case 29:
#line 250 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newSTATEOP(0, yyvsp[-7].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
case 30:
#line 256 "perly.y"
{ yyval.opval = block_end(yyvsp[-6].ival,
- newFOROP(0, yyvsp[-9].pval, yyvsp[-8].ival, yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
+ newFOROP(0, yyvsp[-9].pval, (line_t)yyvsp[-8].ival, yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 31:
#line 259 "perly.y"
{ yyval.opval = block_end(yyvsp[-4].ival,
- newFOROP(0, yyvsp[-8].pval, yyvsp[-7].ival, mod(yyvsp[-6].opval, OP_ENTERLOOP),
+ newFOROP(0, yyvsp[-8].pval, (line_t)yyvsp[-7].ival, mod(yyvsp[-6].opval, OP_ENTERLOOP),
yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 32:
#line 263 "perly.y"
{ yyval.opval = block_end(yyvsp[-4].ival,
- newFOROP(0, yyvsp[-7].pval, yyvsp[-6].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
+ newFOROP(0, yyvsp[-7].pval, (line_t)yyvsp[-6].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 33:
#line 267 "perly.y"
{ OP *forop;
- PL_copline = yyvsp[-9].ival;
+ PL_copline = (line_t)yyvsp[-9].ival;
forop = newSTATEOP(0, yyvsp[-10].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
yyvsp[-9].ival, scalar(yyvsp[-4].opval),
/* An ordinary block */
block : '{' remember lineseq '}'
{ if (PL_copline > (line_t)$1)
- PL_copline = $1;
+ PL_copline = (line_t)$1;
$$ = block_end($2, $3); }
;
mblock : '{' mremember lineseq '}'
{ if (PL_copline > (line_t)$1)
- PL_copline = $1;
+ PL_copline = (line_t)$1;
$$ = block_end($2, $3); }
;
| expr UNTIL iexpr
{ $$ = newLOOPOP(OPf_PARENS, 1, $3, $1);}
| expr FOR expr
- { $$ = newFOROP(0, Nullch, $2,
+ { $$ = newFOROP(0, Nullch, (line_t)$2,
Nullop, $3, $1, Nullop); }
;
| ELSE mblock
{ ($2)->op_flags |= OPf_PARENS; $$ = scope($2); }
| ELSIF '(' mexpr ')' mblock else
- { PL_copline = $1;
+ { PL_copline = (line_t)$1;
$$ = newCONDOP(0, $3, scope($5), $6);
PL_hints |= HINT_BLOCK_SCOPE; }
;
/* Real conditional expressions */
cond : IF '(' remember mexpr ')' mblock else
- { PL_copline = $1;
+ { PL_copline = (line_t)$1;
$$ = block_end($3,
newCONDOP(0, $4, scope($6), $7)); }
| UNLESS '(' remember miexpr ')' mblock else
- { PL_copline = $1;
+ { PL_copline = (line_t)$1;
$$ = block_end($3,
newCONDOP(0, $4, scope($6), $7)); }
;
/* Loops: while, until, for, and a bare block */
loop : label WHILE '(' remember mtexpr ')' mblock cont
- { PL_copline = $2;
+ { PL_copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, $1,
newWHILEOP(0, 1, (LOOP*)Nullop,
$2, $5, $7, $8))); }
| label UNTIL '(' remember miexpr ')' mblock cont
- { PL_copline = $2;
+ { PL_copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, $1,
newWHILEOP(0, 1, (LOOP*)Nullop,
$2, $5, $7, $8))); }
| label FOR MY remember my_scalar '(' mexpr ')' mblock cont
{ $$ = block_end($4,
- newFOROP(0, $1, $2, $5, $7, $9, $10)); }
+ newFOROP(0, $1, (line_t)$2, $5, $7, $9, $10)); }
| label FOR scalar '(' remember mexpr ')' mblock cont
{ $$ = block_end($5,
- newFOROP(0, $1, $2, mod($3, OP_ENTERLOOP),
+ newFOROP(0, $1, (line_t)$2, mod($3, OP_ENTERLOOP),
$6, $8, $9)); }
| label FOR '(' remember mexpr ')' mblock cont
{ $$ = block_end($4,
- newFOROP(0, $1, $2, Nullop, $5, $7, $8)); }
+ newFOROP(0, $1, (line_t)$2, Nullop, $5, $7, $8)); }
| label FOR '(' remember mnexpr ';' mtexpr ';' mnexpr ')' mblock
/* basically fake up an initialize-while lineseq */
{ OP *forop;
- PL_copline = $2;
+ PL_copline = (line_t)$2;
forop = newSTATEOP(0, $1,
newWHILEOP(0, 1, (LOOP*)Nullop,
$2, scalar($7),
EXTEND(SP, maxarg);
if (SvMAGICAL(TARG)) {
U32 i;
- for (i=0; i < maxarg; i++) {
+ for (i=0; i < (U32)maxarg; i++) {
SV **svp = av_fetch((AV*)TARG, i, FALSE);
SP[i+1] = (svp) ? *svp : &PL_sv_undef;
}
sv_pos_u2b(big, &offset, 0);
if (offset < 0)
offset = 0;
- else if (offset > biglen)
+ else if (offset > (I32)biglen)
offset = biglen;
if (!(tmps2 = fbm_instr((unsigned char*)tmps + offset,
(unsigned char*)tmps + biglen, little, 0)))
}
if (offset < 0)
offset = 0;
- else if (offset > blen)
+ else if (offset > (I32)blen)
offset = blen;
if (!(tmps2 = rninstr(tmps, tmps + offset,
tmps2, tmps2 + llen)))
(void)SvUPGRADE(TARG,SVt_PV);
if (value > 255 && !IN_BYTES) {
- SvGROW(TARG, UNISKIP(value)+1);
+ SvGROW(TARG, (STRLEN)UNISKIP(value)+1);
tmps = (char*)uvchr_to_utf8_flags((U8*)SvPVX(TARG), value, 0);
SvCUR_set(TARG, tmps - SvPVX(TARG));
*tmps = '\0';
SvGROW(TARG,2);
SvCUR_set(TARG, 1);
tmps = SvPVX(TARG);
- *tmps++ = value;
+ *tmps++ = (char)value;
*tmps = '\0';
(void)SvPOK_only(TARG);
if (PL_encoding)
tend = uvchr_to_utf8(tmpbuf, uv);
- if (!SvPADTMP(sv) || tend - tmpbuf != ulen || SvREADONLY(sv)) {
+ if (!SvPADTMP(sv) || (STRLEN)(tend - tmpbuf) != ulen || SvREADONLY(sv)) {
dTARGET;
sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
while (down > up) {
tmp = *up;
*up++ = *down;
- *down-- = tmp;
+ *down-- = (char)tmp;
}
}
}
while (down > up) {
tmp = *up;
*up++ = *down;
- *down-- = tmp;
+ *down-- = (char)tmp;
}
(void)SvPOK_only_UTF8(TARG);
}
(void)SvUTF8_on(dstr);
XPUSHs(dstr);
if (rx->nparens) {
- for (i = 1; i <= rx->nparens; i++) {
+ for (i = 1; i <= (I32)rx->nparens; i++) {
s = rx->startp[i] + orig;
m = rx->endp[i] + orig;
/* Check against the last compiled regexp. */
if (!PM_GETRE(pm) || !PM_GETRE(pm)->precomp ||
- PM_GETRE(pm)->prelen != len ||
+ PM_GETRE(pm)->prelen != (I32)len ||
memNE(PM_GETRE(pm)->precomp, t, len))
{
if (PM_GETRE(pm)) {
itemsize = len;
if (DO_UTF8(sv)) {
itemsize = sv_len_utf8(sv);
- if (itemsize != len) {
+ if (itemsize != (I32)len) {
I32 itembytes;
if (itemsize > fieldsize) {
itemsize = fieldsize;
itemsize = len;
if (DO_UTF8(sv)) {
itemsize = sv_len_utf8(sv);
- if (itemsize != len) {
+ if (itemsize != (I32)len) {
I32 itembytes;
if (itemsize <= fieldsize) {
send = chophere = s + itemsize;
register CV *cv;
register PERL_CONTEXT *cx;
I32 gimme = G_ARRAY;
- I32 hasargs;
+ U8 hasargs;
GV *gv;
gv = PL_DBgv;
cx->blk_sub.hasargs = 0;
}
cx->blk_sub.cv = cv;
- cx->blk_sub.olddepth = CvDEPTH(cv);
+ cx->blk_sub.olddepth = (U16)CvDEPTH(cv);
CvDEPTH(cv)++;
if (CvDEPTH(cv) < 2)
(void)SvREFCNT_inc(cv);
*avp = (AV*)SvREFCNT_inc(PL_comppad);
LEAVE;
if (PL_curcop == &PL_compiling)
- PL_compiling.op_private = PL_hints;
+ PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
#ifdef OP_IN_REGISTER
op = PL_opsave;
#endif
MUTEX_UNLOCK(&PL_eval_mutex);
#endif /* USE_5005THREADS */
ret = doeval(gimme, NULL);
- if (PERLDB_INTER && was != PL_sub_generation /* Some subs defined here. */
+ if (PERLDB_INTER && was != (I32)PL_sub_generation /* Some subs defined here. */
&& ret != PL_op->op_next) { /* Successive compilation. */
strcpy(safestr, "_<(eval )"); /* Anything fake and short. */
}
if (postspace)
*fpc++ = FF_SPACE;
*fpc++ = FF_LITERAL;
- *fpc++ = arg;
+ *fpc++ = (U16)arg;
}
postspace = FALSE;
if (s <= send)
skipspaces--;
if (skipspaces) {
*fpc++ = FF_SKIP;
- *fpc++ = skipspaces;
+ *fpc++ = (U16)skipspaces;
}
skipspaces = 0;
if (s <= send)
arg = fpc - linepc + 1;
else
arg = 0;
- *fpc++ = arg;
+ *fpc++ = (U16)arg;
}
if (s < send) {
linepc = fpc;
arg = (s - base) - 1;
if (arg) {
*fpc++ = FF_LITERAL;
- *fpc++ = arg;
+ *fpc++ = (U16)arg;
}
base = s - 1;
}
*fpc++ = s - base; /* fieldsize for FETCH */
*fpc++ = FF_DECIMAL;
- *fpc++ = arg;
+ *fpc++ = (U16)arg;
}
else if (*s == '0' && s[1] == '#') { /* Zero padded decimals */
arg = ischop ? 512 : 0;
}
*fpc++ = s - base; /* fieldsize for FETCH */
*fpc++ = FF_0DECIMAL;
- *fpc++ = arg;
+ *fpc++ = (U16)arg;
}
else {
I32 prespace = 0;
*fpc++ = ischop ? FF_CHECKCHOP : FF_CHECKNL;
if (prespace)
- *fpc++ = prespace;
+ *fpc++ = (U16)prespace;
*fpc++ = FF_ITEM;
if (ismore)
*fpc++ = FF_MORE;
EXTEND(SP, maxarg);
if (SvRMAGICAL(av)) {
U32 i;
- for (i=0; i < maxarg; i++) {
+ for (i=0; i < (U32)maxarg; i++) {
SV **svp = av_fetch(av, i, FALSE);
SP[i+1] = (svp) ? *svp : &PL_sv_undef;
}
rx = PM_GETRE(pm);
}
- if (rx->minlen > len)
+ if (rx->minlen > (I32)len)
goto failure;
truebase = t = s;
}
/* can do inplace substitution? */
- if (c && clen <= rx->minlen && (once || !(r_flags & REXEC_COPY_STR))
+ if (c && (I32)clen <= rx->minlen && (once || !(r_flags & REXEC_COPY_STR))
&& !(rx->reganch & ROPT_LOOKBEHIND_SEEN)) {
if (!CALLREGEXEC(aTHX_ rx, s, strend, orig, 0, TARG, NULL,
r_flags | REXEC_CHECKED))
t--;
while (t > s) {
i = ((*t - '0') << 7) + m;
- *(t--) = '0' + (i % 10);
- m = i / 10;
+ *(t--) = '0' + (char)(i % 10);
+ m = (char)(i / 10);
}
return (sv);
}
case 'U': /* XXXX Is it correct? */
case 'w':
case 'u':
- buf[0] = datumtype;
+ buf[0] = (char)datumtype;
buf[1] = 0;
Perl_croak(aTHX_ "%s not allowed in length fields", buf);
case ',': /* grandfather in commas but with a warning */
#if defined(HAS_LONG_DOUBLE) && defined(USE_LONG_DOUBLE)
long double aldouble;
#endif
- bool do_utf8 = flags & UNPACK_DO_UTF8;
+ bool do_utf8 = (flags & UNPACK_DO_UTF8) != 0;
while ((pat = next_symbol(pat, patend)) < patend) {
datumtype = *pat++ & 0xFF;
sv = Perl_newSVpvf(aTHX_ "%.*"UVf, (int)TYPE_DIGITS(UV), auv);
while (s < strend) {
- sv = mul128(sv, *s & 0x7f);
+ sv = mul128(sv, (U8)(*s & 0x7f));
if (!(*s++ & 0x80)) {
bytes = 0;
break;
d = PL_uudmap[*(U8*)s++] & 077;
else
d = 0;
- hunk[0] = (a << 2) | (b >> 4);
- hunk[1] = (b << 4) | (c >> 2);
- hunk[2] = (c << 6) | d;
+ hunk[0] = (char)((a << 2) | (b >> 4));
+ hunk[1] = (char)((b << 4) | (c >> 2));
+ hunk[2] = (char)((c << 6) | d);
sv_catpvn(sv, hunk, (len > 3) ? 3 : len);
len -= 3;
}
/* FALL THROUGH */
case 'X':
shrink:
- if (SvCUR(cat) < len)
+ if ((I32)SvCUR(cat) < len)
Perl_croak(aTHX_ "X outside of string");
SvCUR(cat) -= len;
*SvEND(cat) = '\0';
if (datumtype == 'Z')
++len;
}
- if (fromlen >= len) {
+ if ((I32)fromlen >= len) {
sv_catpvn(cat, aptr, len);
if (datumtype == 'Z')
*(SvEND(cat)-1) = '\0';
SvCUR(cat) += (len+7)/8;
SvGROW(cat, SvCUR(cat) + 1);
aptr = SvPVX(cat) + aint;
- if (len > fromlen)
+ if (len > (I32)fromlen)
len = fromlen;
aint = len;
items = 0;
SvCUR(cat) += (len+1)/2;
SvGROW(cat, SvCUR(cat) + 1);
aptr = SvPVX(cat) + aint;
- if (len > fromlen)
+ if (len > (I32)fromlen)
len = fromlen;
aint = len;
items = 0;
UV auv = SvUV(fromstr);
do {
- *--in = (auv & 0x7f) | 0x80;
+ *--in = (char)((auv & 0x7f) | 0x80);
auv >>= 7;
} while (auv);
buf[sizeof(buf) - 1] &= 0x7f; /* clear continue bit */
while (fromlen > 0) {
I32 todo;
- if (fromlen > len)
+ if ((I32)fromlen > len)
todo = len;
else
todo = fromlen;
register size_t n, j;
register SV **q;
for (n = num_elts, q = array; n > 1; ) {
- j = n-- * Drand01();
+ j = (size_t)(n-- * Drand01());
temp = q[j];
q[j] = q[n];
q[n] = temp;
ENTER;
PUSHSTACKi(PERLSI_MAGIC);
PUSHMARK(SP);
- EXTEND(SP,items);
+ EXTEND(SP,(I32)items);
while (items--)
PUSHs(*MARK++);
PUTBACK;
ENTER;
PUSHSTACKi(PERLSI_MAGIC);
PUSHMARK(SP);
- EXTEND(SP,items);
+ EXTEND(SP,(I32)items);
while (items--)
PUSHs(*MARK++);
PUTBACK;
if (bufsize >= 256)
bufsize = 255;
#endif
- buffer = SvGROW(bufsv, length+1);
+ buffer = SvGROW(bufsv, (STRLEN)(length+1));
/* 'offset' means 'flags' here */
count = PerlSock_recvfrom(PerlIO_fileno(IoIFP(io)), buffer, length, offset,
(struct sockaddr *)namebuf, &bufsize);
blen = sv_len_utf8(bufsv);
}
if (offset < 0) {
- if (-offset > blen)
+ if (-offset > (int)blen)
DIE(aTHX_ "Offset outside string");
offset += blen;
}
}
more_bytes:
bufsize = SvCUR(bufsv);
- buffer = SvGROW(bufsv, length+offset+1);
+ buffer = SvGROW(bufsv, (STRLEN)(length+offset+1));
if (offset > bufsize) { /* Zero any newly allocated space */
Zero(buffer+bufsize, offset-bufsize, char);
}
if (MARK < SP) {
offset = SvIVx(*++MARK);
if (offset < 0) {
- if (-offset > blen)
+ if (-offset > (IV)blen)
DIE(aTHX_ "Offset outside string");
offset += blen;
- } else if (offset >= blen && blen > 0)
+ } else if (offset >= (IV)blen && blen > 0)
DIE(aTHX_ "Offset outside string");
} else
offset = 0;
I32 value;
STRLEN n_a;
int result;
- int pp[2];
I32 did_pipes = 0;
if (PL_tainting) {
PERL_FLUSHALL_FOR_CHILD;
#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(OS2) || defined(PERL_MICRO)
{
- Pid_t childpid;
- int status;
- Sigsave_t ihand,qhand; /* place to save signals during system() */
-
- if (PerlProc_pipe(pp) >= 0)
- did_pipes = 1;
- while ((childpid = PerlProc_fork()) == -1) {
- if (errno != EAGAIN) {
- value = -1;
- SP = ORIGMARK;
- PUSHi(value);
- if (did_pipes) {
- PerlLIO_close(pp[0]);
- PerlLIO_close(pp[1]);
- }
- RETURN;
- }
- sleep(5);
- }
- if (childpid > 0) {
- if (did_pipes)
- PerlLIO_close(pp[1]);
+ Pid_t childpid;
+ int pp[2];
+
+ if (PerlProc_pipe(pp) >= 0)
+ did_pipes = 1;
+ while ((childpid = PerlProc_fork()) == -1) {
+ if (errno != EAGAIN) {
+ value = -1;
+ SP = ORIGMARK;
+ PUSHi(value);
+ if (did_pipes) {
+ PerlLIO_close(pp[0]);
+ PerlLIO_close(pp[1]);
+ }
+ RETURN;
+ }
+ sleep(5);
+ }
+ if (childpid > 0) {
+ Sigsave_t ihand,qhand; /* place to save signals during system() */
+ int status;
+
+ if (did_pipes)
+ PerlLIO_close(pp[1]);
#ifndef PERL_MICRO
- rsignal_save(SIGINT, SIG_IGN, &ihand);
- rsignal_save(SIGQUIT, SIG_IGN, &qhand);
+ rsignal_save(SIGINT, SIG_IGN, &ihand);
+ rsignal_save(SIGQUIT, SIG_IGN, &qhand);
#endif
- do {
- result = wait4pid(childpid, &status, 0);
- } while (result == -1 && errno == EINTR);
+ do {
+ result = wait4pid(childpid, &status, 0);
+ } while (result == -1 && errno == EINTR);
#ifndef PERL_MICRO
- (void)rsignal_restore(SIGINT, &ihand);
- (void)rsignal_restore(SIGQUIT, &qhand);
-#endif
- STATUS_NATIVE_SET(result == -1 ? -1 : status);
- do_execfree(); /* free any memory child malloced on fork */
- SP = ORIGMARK;
- if (did_pipes) {
- int errkid;
- int n = 0, n1;
-
- while (n < sizeof(int)) {
- n1 = PerlLIO_read(pp[0],
- (void*)(((char*)&errkid)+n),
- (sizeof(int)) - n);
- if (n1 <= 0)
- break;
- n += n1;
- }
- PerlLIO_close(pp[0]);
- if (n) { /* Error */
- if (n != sizeof(int))
- DIE(aTHX_ "panic: kid popen errno read");
- errno = errkid; /* Propagate errno from kid */
- STATUS_CURRENT = -1;
- }
- }
- PUSHi(STATUS_CURRENT);
- RETURN;
- }
- if (did_pipes) {
- PerlLIO_close(pp[0]);
+ (void)rsignal_restore(SIGINT, &ihand);
+ (void)rsignal_restore(SIGQUIT, &qhand);
+#endif
+ STATUS_NATIVE_SET(result == -1 ? -1 : status);
+ do_execfree(); /* free any memory child malloced on fork */
+ SP = ORIGMARK;
+ if (did_pipes) {
+ int errkid;
+ int n = 0, n1;
+
+ while (n < sizeof(int)) {
+ n1 = PerlLIO_read(pp[0],
+ (void*)(((char*)&errkid)+n),
+ (sizeof(int)) - n);
+ if (n1 <= 0)
+ break;
+ n += n1;
+ }
+ PerlLIO_close(pp[0]);
+ if (n) { /* Error */
+ if (n != sizeof(int))
+ DIE(aTHX_ "panic: kid popen errno read");
+ errno = errkid; /* Propagate errno from kid */
+ STATUS_CURRENT = -1;
+ }
+ }
+ PUSHi(STATUS_CURRENT);
+ RETURN;
+ }
+ if (did_pipes) {
+ PerlLIO_close(pp[0]);
#if defined(HAS_FCNTL) && defined(F_SETFD)
- fcntl(pp[1], F_SETFD, FD_CLOEXEC);
+ fcntl(pp[1], F_SETFD, FD_CLOEXEC);
#endif
- }
+ }
}
if (PL_op->op_flags & OPf_STACKED) {
SV *really = *++MARK;
else if (which == OP_GSBYPORT) {
#ifdef HAS_GETSERVBYPORT
char *proto = POPpbytex;
- unsigned short port = POPu;
+ unsigned short port = (unsigned short)POPu;
#ifdef HAS_HTONS
port = PerlSock_htons(port);
#define SCF_DO_STCLASS (SCF_DO_STCLASS_AND|SCF_DO_STCLASS_OR)
#define SCF_WHILEM_VISITED_POS 0x2000
-#define UTF RExC_utf8
-#define LOC (RExC_flags16 & PMf_LOCALE)
-#define FOLD (RExC_flags16 & PMf_FOLD)
+#define UTF (RExC_utf8 != 0)
+#define LOC ((RExC_flags16 & PMf_LOCALE) != 0)
+#define FOLD ((RExC_flags16 & PMf_FOLD) != 0)
#define OOB_UNICODE 12345678
#define OOB_NAMEDCLASS -1
if (OP(nxt) != CLOSE)
goto nogo;
/* Now we know that nxt2 is the only contents: */
- oscan->flags = ARG(nxt);
+ oscan->flags = (U8)ARG(nxt);
OP(oscan) = CURLYN;
OP(nxt1) = NOTHING; /* was OPEN. */
#ifdef DEBUGGING
if (OP(nxt) != CLOSE)
FAIL("Panic opt close");
- oscan->flags = ARG(nxt);
+ oscan->flags = (U8)ARG(nxt);
OP(nxt1) = OPTIMIZED; /* was OPEN. */
OP(nxt) = OPTIMIZED; /* was CLOSE. */
#ifdef DEBUGGING
if (OP(PREVOPER(nxt)) == NOTHING) /* LONGJMP */
nxt += ARG(nxt);
- PREVOPER(nxt)->flags = data->whilem_c
- | (RExC_whilem_seen << 4); /* On WHILEM */
+ PREVOPER(nxt)->flags = (U8)(data->whilem_c
+ | (RExC_whilem_seen << 4)); /* On WHILEM */
}
if (data && fl & (SF_HAS_PAR|SF_IN_PAR))
pars++;
else if (minnext > U8_MAX) {
vFAIL2("Lookbehind longer than %"UVuf" not implemented", (UV)U8_MAX);
}
- scan->flags = minnext;
+ scan->flags = (U8)minnext;
}
if (data && data_fake.flags & (SF_HAS_PAR|SF_IN_PAR))
pars++;
pars++;
}
else if (OP(scan) == CLOSE) {
- if (ARG(scan) == is_par) {
+ if ((I32)ARG(scan) == is_par) {
next = regnext(scan);
if ( next && (OP(next) != WHILEM) && next < last)
RExC_emit_start = r->program;
RExC_emit = r->program;
/* Store the count of eval-groups for security checks: */
- RExC_emit->next_off = ((RExC_seen_evals > U16_MAX) ? U16_MAX : RExC_seen_evals);
+ RExC_emit->next_off = (U16)((RExC_seen_evals > U16_MAX) ? U16_MAX : RExC_seen_evals);
REGC((U8)REG_MAGIC, (char*) RExC_emit++);
r->data = 0;
if (reg(pRExC_state, 0, &flags) == NULL)
if ((!(r->anchored_substr || r->anchored_utf8) || r->anchored_offset)
&& stclass_flag
&& !(data.start_class->flags & ANYOF_EOS)
- && !cl_is_anything(data.start_class)) {
+ && !cl_is_anything(data.start_class))
+ {
I32 n = add_data(pRExC_state, 1, "f");
New(1006, RExC_rx->data->data[n], 1,
r->check_substr = r->check_utf8 = r->anchored_substr = r->anchored_utf8
= r->float_substr = r->float_utf8 = Nullsv;
if (!(data.start_class->flags & ANYOF_EOS)
- && !cl_is_anything(data.start_class)) {
+ && !cl_is_anything(data.start_class))
+ {
I32 n = add_data(pRExC_state, 1, "f");
New(1006, RExC_rx->data->data[n], 1,
static char parens[] = "=!<,>";
if (paren && (p = strchr(parens, paren))) {
- int node = ((p - parens) % 2) ? UNLESSM : IFMATCH;
+ U8 node = ((p - parens) % 2) ? UNLESSM : IFMATCH;
int flag = (p - parens) > 1;
if (paren == '>')
/* Check for proper termination. */
if (paren) {
- RExC_flags16 = oregflags;
+ RExC_flags16 = (U16)oregflags;
if (RExC_parse >= RExC_end || *nextchar(pRExC_state) != ')') {
RExC_parse = oregcomp_parse;
vFAIL("Unmatched (");
if (max && max < min)
vFAIL("Can't do {n,m} with n > m");
if (!SIZE_ONLY) {
- ARG1_SET(ret, min);
- ARG2_SET(ret, max);
+ ARG1_SET(ret, (U16)min);
+ ARG2_SET(ret, (U16)max);
}
goto nest_check;
Set_Node_Length(ret, 2); /* MJD */
break;
case 'w':
- ret = reg_node(pRExC_state, LOC ? ALNUML : ALNUM);
+ ret = reg_node(pRExC_state, (U8)(LOC ? ALNUML : ALNUM));
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
break;
case 'W':
- ret = reg_node(pRExC_state, LOC ? NALNUML : NALNUM);
+ ret = reg_node(pRExC_state, (U8)(LOC ? NALNUML : NALNUM));
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
case 'b':
RExC_seen_zerolen++;
RExC_seen |= REG_SEEN_LOOKBEHIND;
- ret = reg_node(pRExC_state, LOC ? BOUNDL : BOUND);
+ ret = reg_node(pRExC_state, (U8)(LOC ? BOUNDL : BOUND));
*flagp |= SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
case 'B':
RExC_seen_zerolen++;
RExC_seen |= REG_SEEN_LOOKBEHIND;
- ret = reg_node(pRExC_state, LOC ? NBOUNDL : NBOUND);
+ ret = reg_node(pRExC_state, (U8)(LOC ? NBOUNDL : NBOUND));
*flagp |= SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
break;
case 's':
- ret = reg_node(pRExC_state, LOC ? SPACEL : SPACE);
+ ret = reg_node(pRExC_state, (U8)(LOC ? SPACEL : SPACE));
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
break;
case 'S':
- ret = reg_node(pRExC_state, LOC ? NSPACEL : NSPACE);
+ ret = reg_node(pRExC_state, (U8)(LOC ? NSPACEL : NSPACE));
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */
while (isDIGIT(*RExC_parse))
RExC_parse++;
- if (!SIZE_ONLY && num > RExC_rx->nparens)
+ if (!SIZE_ONLY && num > (I32)RExC_rx->nparens)
vFAIL("Reference to nonexistent group");
RExC_sawback = 1;
- ret = reganode(pRExC_state, FOLD
- ? (LOC ? REFFL : REFF)
- : REF, num);
+ ret = reganode(pRExC_state,
+ (U8)(FOLD ? (LOC ? REFFL : REFF) : REF),
+ num);
*flagp |= HASWIDTH;
/* override incorrect value set in reganode MJD */
defchar:
ender = 0;
- ret = reg_node(pRExC_state, FOLD
- ? (LOC ? EXACTFL : EXACTF)
- : EXACT);
+ ret = reg_node(pRExC_state,
+ (U8)(FOLD ? (LOC ? EXACTFL : EXACTF) : EXACT));
s = STRING(ret);
for (len = 0, p = RExC_parse - 1;
len < 127 && p < RExC_end;
}
else {
len++;
- REGC(ender, s++);
+ REGC((char)ender, s++);
}
break;
}
len--;
}
else
- REGC(ender, s++);
+ REGC((char)ender, s++);
}
loopdone:
RExC_parse = p - 1;
} /* end of namedclass \blah */
if (range) {
- if (prevvalue > value) /* b-a */ {
+ if (prevvalue > (IV)value) /* b-a */ {
Simple_vFAIL4("Invalid [] range \"%*.*s\"",
RExC_parse - rangebegin,
RExC_parse - rangebegin,
* character, insert also the folded version
* to the charclass. */
if (f != value) {
- if (foldlen == UNISKIP(f))
+ if (foldlen == (STRLEN)UNISKIP(f))
Perl_sv_catpvf(aTHX_ listsv,
"%04"UVxf"\n", f);
else {
) {
for (value = 0; value < 256; ++value) {
if (ANYOF_BITMAP_TEST(ret, value)) {
- IV fold = PL_fold[value];
+ UV fold = PL_fold[value];
if (fold != value)
ANYOF_BITMAP_SET(ret, fold);
#define RF_evaled 4 /* Did an EVAL with setting? */
#define RF_utf8 8 /* String contains multibyte chars? */
-#define UTF (PL_reg_flags & RF_utf8)
+#define UTF ((PL_reg_flags & RF_utf8) != 0)
#define RS_init 1 /* eval environment created */
#define RS_set 2 /* replsv value is set */
);
}
DEBUG_r(
- if (*PL_reglastparen + 1 <= PL_regnpar) {
+ if ((I32)(*PL_reglastparen + 1) <= PL_regnpar) {
PerlIO_printf(Perl_debug_log,
" restoring \\%"IVdf"..\\%"IVdf" to undef\n",
(IV)(*PL_reglastparen + 1), (IV)PL_regnpar);
* building DynaLoader will fail:
* "Error: '*' not in typemap in DynaLoader.xs, line 164"
* --jhi */
- for (paren = *PL_reglastparen + 1; paren <= PL_regnpar; paren++) {
- if (paren > PL_regsize)
+ for (paren = *PL_reglastparen + 1; (I32)paren <= PL_regnpar; paren++) {
+ if ((I32)paren > PL_regsize)
PL_regstartp[paren] = -1;
PL_regendp[paren] = -1;
}
if ( c == c1
&& (ln == len ||
ibcmp_utf8(s, (char **)0, 0, do_utf8,
- m, (char **)0, ln, UTF))
+ m, (char **)0, ln, (bool)UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
else {
!ibcmp_utf8((char *) foldbuf,
(char **)0, foldlen, do_utf8,
m,
- (char **)0, ln, UTF))
+ (char **)0, ln, (bool)UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
}
if ( (c == c1 || c == c2)
&& (ln == len ||
ibcmp_utf8(s, (char **)0, 0, do_utf8,
- m, (char **)0, ln, UTF))
+ m, (char **)0, ln, (bool)UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
else {
!ibcmp_utf8((char *) foldbuf,
(char **)0, foldlen, do_utf8,
m,
- (char **)0, ln, UTF))
+ (char **)0, ln, (bool)UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
}
sp = prog->startp;
ep = prog->endp;
if (prog->nparens) {
- for (i = prog->nparens; i > *PL_reglastparen; i--) {
+ for (i = prog->nparens; i > (I32)*PL_reglastparen; i--) {
*++sp = -1;
*++ep = -1;
}
case EXACT:
s = STRING(scan);
ln = STR_LEN(scan);
- if (do_utf8 != (UTF!=0)) {
+ if (do_utf8 != UTF) {
/* The target and the pattern have differing utf8ness. */
char *l = locinput;
char *e = s + ln;
char *l = locinput;
char *e = PL_regeol;
- if (ibcmp_utf8(s, 0, ln, UTF,
+ if (ibcmp_utf8(s, 0, ln, (bool)UTF,
l, &e, 0, do_utf8)) {
/* One more case for the sharp s:
* pack("U0U*", 0xDF) =~ /ss/i,
n = ARG(scan); /* which paren pair */
ln = PL_regstartp[n];
PL_reg_leftiter = PL_reg_maxiter; /* Void cache */
- if (*PL_reglastparen < n || ln == -1)
+ if ((I32)*PL_reglastparen < n || ln == -1)
sayNO; /* Do not match unless seen CLOSEn. */
if (ln == PL_regendp[n])
break;
n = ARG(scan); /* which paren pair */
PL_regstartp[n] = PL_reg_start_tmp[n] - PL_bostr;
PL_regendp[n] = locinput - PL_bostr;
- if (n > *PL_reglastparen)
+ if (n > (I32)*PL_reglastparen)
*PL_reglastparen = n;
*PL_reglastcloseparen = n;
break;
case GROUPP:
n = ARG(scan); /* which paren pair */
- sw = (*PL_reglastparen >= n && PL_regendp[n] != -1);
+ sw = ((I32)*PL_reglastparen >= n && PL_regendp[n] != -1);
break;
case IFTHEN:
PL_reg_leftiter = PL_reg_maxiter; /* Void cache */
PL_regcc = &cc;
/* XXXX Probably it is better to teach regpush to support
parenfloor > PL_regsize... */
- if (parenfloor > *PL_reglastparen)
+ if (parenfloor > (I32)*PL_reglastparen)
parenfloor = *PL_reglastparen; /* Pessimization... */
cc.parenfloor = parenfloor;
cc.cur = -1;
if (PL_reg_leftiter-- == 0) {
I32 size = (PL_reg_maxiter + 7)/8;
if (PL_reg_poscache) {
- if (PL_reg_poscache_size < size) {
+ if ((I32)PL_reg_poscache_size < size) {
Renew(PL_reg_poscache, size, char);
PL_reg_poscache_size = size;
}
if (paren) {
if (paren > PL_regsize)
PL_regsize = paren;
- if (paren > *PL_reglastparen)
+ if (paren > (I32)*PL_reglastparen)
*PL_reglastparen = paren;
}
scan = NEXTOPER(scan) + NODE_STEP_REGNODE;
ln = PL_regstartp[n];
/* assume yes if we haven't seen CLOSEn */
if (
- *PL_reglastparen < n ||
+ (I32)*PL_reglastparen < n ||
ln == -1 ||
ln == PL_regendp[n]
) {
ln = PL_regstartp[n];
/* assume yes if we haven't seen CLOSEn */
if (
- *PL_reglastparen < n ||
+ (I32)*PL_reglastparen < n ||
ln == -1 ||
ln == PL_regendp[n]
) {
paren = scan->flags; /* Which paren to set */
if (paren > PL_regsize)
PL_regsize = paren;
- if (paren > *PL_reglastparen)
+ if (paren > (I32)*PL_reglastparen)
*PL_reglastparen = paren;
ln = ARG1(scan); /* min to match */
n = ARG2(scan); /* max to match */
ln = PL_regstartp[n];
/* assume yes if we haven't seen CLOSEn */
if (
- *PL_reglastparen < n ||
+ (I32)*PL_reglastparen < n ||
ln == -1 ||
ln == PL_regendp[n]
) {
utf8n_to_uvchr((U8*)locinput,
UTF8_MAXLEN, &len,
ckWARN(WARN_UTF8) ?
- 0 : UTF8_ALLOW_ANY) != c1) {
+ 0 : UTF8_ALLOW_ANY) != (UV)c1) {
locinput += len;
count++;
}
UTF8_MAXLEN, &len,
ckWARN(WARN_UTF8) ?
0 : UTF8_ALLOW_ANY);
- if (c == c1 || c == c2)
+ if (c == (UV)c1 || c == (UV)c2)
break;
locinput += len;
count++;
else
c = UCHARAT(PL_reginput);
/* If it could work, try it. */
- if (c == c1 || c == c2)
+ if (c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
REGCP_UNWIND(lastcp);
c = UCHARAT(PL_reginput);
}
/* If it could work, try it. */
- if (c1 == -1000 || c == c1 || c == c2)
+ if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
REGCP_UNWIND(lastcp);
c = UCHARAT(PL_reginput);
}
/* If it could work, try it. */
- if (c1 == -1000 || c == c1 || c == c2)
+ if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
REGCP_UNWIND(lastcp);
if (ANYOF_BITMAP_TEST(n, c))
match = TRUE;
else if (flags & ANYOF_FOLD) {
- I32 f;
+ U8 f;
if (flags & ANYOF_LOCALE) {
PL_reg_flags |= RF_tainted;
sign = 1;
}
do {
- *--ptr = '0' + (uv % 10);
+ *--ptr = '0' + (char)(uv % 10);
} while (uv /= 10);
if (sign)
*--ptr = '-';
int left = 0;
int right = 4;
char need_newline = 0;
- U16 reganch = (re->reganch & PMf_COMPILETIME) >> 12;
+ U16 reganch = (U16)((re->reganch & PMf_COMPILETIME) >> 12);
while((ch = *fptr++)) {
if(reganch & 1) {
ptr = uiv_2buf(buf, 0, SvUVX(sv), 1, &ebuf);
else
ptr = uiv_2buf(buf, SvIVX(sv), 0, 0, &ebuf);
- SvGROW(sv, ebuf - ptr + 1); /* inlined from sv_setpvn */
+ SvGROW(sv, (STRLEN)(ebuf - ptr + 1)); /* inlined from sv_setpvn */
Move(ptr,SvPVX(sv),ebuf - ptr,char);
SvCUR_set(sv, ebuf - ptr);
s = SvEND(sv);
default:
if (SvGMAGICAL(sstr) && (flags & SV_GMAGIC)) {
mg_get(sstr);
- if (SvTYPE(sstr) != stype) {
+ if ((int)SvTYPE(sstr) != stype) {
stype = SvTYPE(sstr);
if (stype == SVt_PVGV && dtype <= SVt_PVGV)
goto glob_assign;
if (stype == SVt_PVLV)
(void)SvUPGRADE(dstr, SVt_PVNV);
else
- (void)SvUPGRADE(dstr, stype);
+ (void)SvUPGRADE(dstr, (U32)stype);
}
sflags = SvFLAGS(sstr);
return;
s = (U8*)SvPV(sv, len);
- if (len < *offsetp)
+ if ((I32)len < *offsetp)
Perl_croak(aTHX_ "panic: sv_pos_b2u: bad byte offset");
send = s + *offsetp;
len = 0;
/* Grab the size of the record we're getting */
recsize = SvIV(SvRV(PL_rs));
(void)SvPOK_only(sv); /* Validate pointer */
- buffer = SvGROW(sv, recsize + 1);
+ buffer = SvGROW(sv, (STRLEN)(recsize + 1));
/* Go yank in */
#ifdef VMS
/* VMS wants read instead of fread, because fread doesn't respect */
cnt = PerlIO_get_cnt(fp); /* get count into register */
(void)SvPOK_only(sv); /* validate pointer */
- if (SvLEN(sv) - append <= cnt + 1) { /* make sure we have the room */
- if (cnt > 80 && SvLEN(sv) > append) {
+ if ((I32)(SvLEN(sv) - append) <= cnt + 1) { /* make sure we have the room */
+ if (cnt > 80 && (I32)SvLEN(sv) > append) {
shortbuffered = cnt - SvLEN(sv) + append + 1;
cnt -= shortbuffered;
}
else {
shortbuffered = 0;
/* remember that cnt can be negative */
- SvGROW(sv, append + (cnt <= 0 ? 2 : (cnt + 1)));
+ SvGROW(sv, (STRLEN)(append + (cnt <= 0 ? 2 : (cnt + 1))));
}
}
else
SvGROW(sv, bpx + cnt + 2);
bp = (STDCHAR*)SvPVX(sv) + bpx; /* unbox after relocation */
- *bp++ = i; /* store character from PerlIO_getc */
+ *bp++ = (STDCHAR)i; /* store character from PerlIO_getc */
if (rslen && (STDCHAR)i == rslast) /* all done for now? */
goto thats_all_folks;
}
thats_all_folks:
- if ((rslen > 1 && (bp - (STDCHAR*)SvPVX(sv) < rslen)) ||
+ if ((rslen > 1 && (STRLEN)(bp - (STDCHAR*)SvPVX(sv)) < rslen) ||
memNE((char*)bp - rslen, rsptr, rslen))
goto screamer; /* go back to the fray */
thats_really_all_folks:
if (rslen) {
register STDCHAR *bpe = buf + sizeof(buf);
bp = buf;
- while ((i = PerlIO_getc(fp)) != EOF && (*bp++ = i) != rslast && bp < bpe)
+ while ((i = PerlIO_getc(fp)) != EOF && (*bp++ = (STDCHAR)i) != rslast && bp < bpe)
; /* keep reading */
cnt = bp - buf;
}
SvGROW(sv, SvCUR(sv) + need + dotstrlen + 1);
p = SvEND(sv);
if (esignlen && fill == '0') {
- for (i = 0; i < esignlen; i++)
+ for (i = 0; i < (int)esignlen; i++)
*p++ = esignbuf[i];
}
if (gap && !left) {
p += gap;
}
if (esignlen && fill != '0') {
- for (i = 0; i < esignlen; i++)
+ for (i = 0; i < (int)esignlen; i++)
*p++ = esignbuf[i];
}
if (zeros) {
PERL_HV_ARRAY_ALLOC_BYTES(dxhv->xhv_max+1), char);
while (i <= sxhv->xhv_max) {
((HE**)dxhv->xhv_array)[i] = he_dup(((HE**)sxhv->xhv_array)[i],
- !!HvSHAREKEYS(sstr), param);
+ (bool)!!HvSHAREKEYS(sstr),
+ param);
++i;
}
- dxhv->xhv_eiter = he_dup(sxhv->xhv_eiter, !!HvSHAREKEYS(sstr), param);
+ dxhv->xhv_eiter = he_dup(sxhv->xhv_eiter,
+ (bool)!!HvSHAREKEYS(sstr), param);
}
else {
SvPVX(dstr) = Nullch;
s = tmpbuf;
}
else {
- *tmpbuf = PL_multi_close;
+ *tmpbuf = (char)PL_multi_close;
tmpbuf[1] = '\0';
s = tmpbuf;
}
PL_expect = x;
PL_bufptr = s;
PL_last_lop = PL_oldbufptr;
- PL_last_lop_op = f;
+ PL_last_lop_op = (OPCODE)f;
if (PL_nexttoke)
return LSTOP;
if (*s == '(')
*PL_lex_casestack = '\0';
PL_lex_starts = 0;
PL_lex_state = LEX_INTERPCONCAT;
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
PL_lex_inwhat = PL_sublex_info.sub_inwhat;
if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST)
else
#endif
for (i = min; i <= max; i++)
- *d++ = i;
+ *d++ = (char)i;
/* mark the range as done, and continue */
dorange = FALSE;
while (src >= (U8 *)SvPVX(sv)) {
if (!NATIVE_IS_INVARIANT(*src)) {
U8 ch = NATIVE_TO_ASCII(*src);
- *dst-- = UTF8_EIGHT_BIT_LO(ch);
- *dst-- = UTF8_EIGHT_BIT_HI(ch);
+ *dst-- = (U8)UTF8_EIGHT_BIT_LO(ch);
+ *dst-- = (U8)UTF8_EIGHT_BIT_HI(ch);
}
else {
*dst-- = *src;
*d = '\0';
sv_utf8_upgrade(sv);
/* this just broke our allocation above... */
- SvGROW(sv, send - start);
+ SvGROW(sv, (STRLEN)(send - start));
d = SvPVX(sv) + SvCUR(sv);
has_utf8 = TRUE;
}
- if (len > e - s + 4) { /* I _guess_ 4 is \N{} --jhi */
+ if (len > (STRLEN)(e - s + 4)) { /* I _guess_ 4 is \N{} --jhi */
char *odest = SvPVX(sv);
SvGROW(sv, (SvLEN(sv) + len - (e - s + 4)));
int old_len = SvCUR(buf_sv) ;
/* ensure buf_sv is large enough */
- SvGROW(buf_sv, old_len + maxlen) ;
+ SvGROW(buf_sv, (STRLEN)(old_len + maxlen)) ;
if ((len = PerlIO_read(PL_rsfp, SvPVX(buf_sv) + old_len, maxlen)) <= 0){
if (PerlIO_error(PL_rsfp))
return -1; /* error */
"### Saw case modifier at '%s'\n", PL_bufptr); });
s = PL_bufptr + 1;
if (strnEQ(s, "L\\u", 3) || strnEQ(s, "U\\l", 3))
- tmp = *s, *s = s[2], s[2] = tmp; /* misordered... */
+ tmp = *s, *s = s[2], s[2] = (char)tmp; /* misordered... */
if (strchr("LU", *s) &&
(strchr(PL_lex_casestack, 'L') || strchr(PL_lex_casestack, 'U')))
{
if (!PL_preprocess)
bof = PerlIO_tell(PL_rsfp) == SvCUR(PL_linestr);
#else
- bof = PerlIO_tell(PL_rsfp) == SvCUR(PL_linestr);
+ bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);
#endif
if (bof) {
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
break;
}
if (ftst) {
- PL_last_lop_op = ftst;
+ PL_last_lop_op = (OPCODE)ftst;
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw file test %c\n", (int)ftst);
} );
CopLINE_inc(PL_curcop);
}
if (s >= bufend) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(herewas,bufptr,d-bufptr+1);
CopLINE_inc(PL_curcop);
}
if (s >= PL_bufend) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(tmpstr,d+1,s-d);
while (s >= PL_bufend) { /* multiple line string? */
if (!outer ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
CopLINE_inc(PL_curcop);
if (!PL_rsfp ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
sv_free(sv);
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
return Nullch;
}
/* we read a line, so increment our line counter */
if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (subgen = GvSV(gv))
&& (hv = GvHV(gv)))
{
- if (SvIV(subgen) == PL_sub_generation) {
+ if (SvIV(subgen) == (IV)PL_sub_generation) {
SV* sv;
SV** svp = (SV**)hv_fetch(hv, name, len, FALSE);
if (svp && (sv = *svp) != (SV*)&PL_sv_undef) {
/* I don't care how many parameters were passed in, but I want to avoid
the unused variable warning. */
- items = HvPLACEHOLDERS(hv);
+ items = (I32)HvPLACEHOLDERS(hv);
if (items) {
HE *entry;
"Unicode character 0x%04"UVxf" is illegal", uv);
}
if (UNI_IS_INVARIANT(uv)) {
- *d++ = UTF_TO_NATIVE(uv);
+ *d++ = (U8)UTF_TO_NATIVE(uv);
return d;
}
#if defined(EBCDIC)
STRLEN len = UNISKIP(uv);
U8 *p = d+len-1;
while (p > d) {
- *p-- = UTF_TO_NATIVE((uv & UTF_CONTINUATION_MASK) | UTF_CONTINUATION_MARK);
+ *p-- = (U8)UTF_TO_NATIVE((uv & UTF_CONTINUATION_MASK) | UTF_CONTINUATION_MARK);
uv >>= UTF_ACCUMULATION_SHIFT;
}
- *p = UTF_TO_NATIVE((uv & UTF_START_MASK(len)) | UTF_START_MARK(len));
+ *p = (U8)UTF_TO_NATIVE((uv & UTF_START_MASK(len)) | UTF_START_MARK(len));
return d+len;
}
#else /* Non loop style */
if (uv < 0x800) {
- *d++ = (( uv >> 6) | 0xc0);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 6) | 0xc0);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
if (uv < 0x10000) {
- *d++ = (( uv >> 12) | 0xe0);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 12) | 0xe0);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
if (uv < 0x200000) {
- *d++ = (( uv >> 18) | 0xf0);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 18) | 0xf0);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
if (uv < 0x4000000) {
- *d++ = (( uv >> 24) | 0xf8);
- *d++ = (((uv >> 18) & 0x3f) | 0x80);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 24) | 0xf8);
+ *d++ = (U8)(((uv >> 18) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
if (uv < 0x80000000) {
- *d++ = (( uv >> 30) | 0xfc);
- *d++ = (((uv >> 24) & 0x3f) | 0x80);
- *d++ = (((uv >> 18) & 0x3f) | 0x80);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 30) | 0xfc);
+ *d++ = (U8)(((uv >> 24) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 18) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
#ifdef HAS_QUAD
if (uv < UTF8_QUAD_MAX)
#endif
{
- *d++ = 0xfe; /* Can't match U+FEFF! */
- *d++ = (((uv >> 30) & 0x3f) | 0x80);
- *d++ = (((uv >> 24) & 0x3f) | 0x80);
- *d++ = (((uv >> 18) & 0x3f) | 0x80);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = 0xfe; /* Can't match U+FEFF! */
+ *d++ = (U8)(((uv >> 30) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 24) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 18) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
#ifdef HAS_QUAD
{
- *d++ = 0xff; /* Can't match U+FFFE! */
- *d++ = 0x80; /* 6 Reserved bits */
- *d++ = (((uv >> 60) & 0x0f) | 0x80); /* 2 Reserved bits */
- *d++ = (((uv >> 54) & 0x3f) | 0x80);
- *d++ = (((uv >> 48) & 0x3f) | 0x80);
- *d++ = (((uv >> 42) & 0x3f) | 0x80);
- *d++ = (((uv >> 36) & 0x3f) | 0x80);
- *d++ = (((uv >> 30) & 0x3f) | 0x80);
- *d++ = (((uv >> 24) & 0x3f) | 0x80);
- *d++ = (((uv >> 18) & 0x3f) | 0x80);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = 0xff; /* Can't match U+FFFE! */
+ *d++ = 0x80; /* 6 Reserved bits */
+ *d++ = (U8)(((uv >> 60) & 0x0f) | 0x80); /* 2 Reserved bits */
+ *d++ = (U8)(((uv >> 54) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 48) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 42) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 36) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 30) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 24) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 18) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
return d;
}
#endif
s++;
}
- if (UNISKIP(uv) < len)
+ if ((STRLEN)UNISKIP(uv) < len)
return 0;
return len;
!(flags & UTF8_ALLOW_SURROGATE)) {
warning = UTF8_WARN_SURROGATE;
goto malformed;
- } else if ((expectlen > UNISKIP(uv)) &&
+ } else if ((expectlen > (STRLEN)UNISKIP(uv)) &&
!(flags & UTF8_ALLOW_LONG)) {
warning = UTF8_WARN_LONG;
goto malformed;
while (s < send) {
UV uv = NATIVE_TO_ASCII(*s++);
if (UNI_IS_INVARIANT(uv))
- *d++ = UTF_TO_NATIVE(uv);
+ *d++ = (U8)UTF_TO_NATIVE(uv);
else {
- *d++ = UTF8_EIGHT_BIT_HI(uv);
- *d++ = UTF8_EIGHT_BIT_LO(uv);
+ *d++ = (U8)UTF8_EIGHT_BIT_HI(uv);
+ *d++ = (U8)UTF8_EIGHT_BIT_LO(uv);
}
}
*d = '\0';
UV uv = (p[0] << 8) + p[1]; /* UTF-16BE */
p += 2;
if (uv < 0x80) {
- *d++ = uv;
+ *d++ = (U8)uv;
continue;
}
if (uv < 0x800) {
- *d++ = (( uv >> 6) | 0xc0);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 6) | 0xc0);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
continue;
}
if (uv >= 0xd800 && uv < 0xdbff) { /* surrogates */
uv = ((uv - 0xd800) << 10) + (low - 0xdc00) + 0x10000;
}
if (uv < 0x10000) {
- *d++ = (( uv >> 12) | 0xe0);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 12) | 0xe0);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
continue;
}
else {
- *d++ = (( uv >> 18) | 0xf0);
- *d++ = (((uv >> 12) & 0x3f) | 0x80);
- *d++ = (((uv >> 6) & 0x3f) | 0x80);
- *d++ = (( uv & 0x3f) | 0x80);
+ *d++ = (U8)(( uv >> 18) | 0xf0);
+ *d++ = (U8)(((uv >> 12) & 0x3f) | 0x80);
+ *d++ = (U8)(((uv >> 6) & 0x3f) | 0x80);
+ *d++ = (U8)(( uv & 0x3f) | 0x80);
continue;
}
}
* descendant of isalnum(3), in other words, it doesn't
* contain the '_'. --jhi */
PL_utf8_alnum = swash_init("utf8", "IsWord", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_alnum, p, TRUE);
+ return swash_fetch(PL_utf8_alnum, p, TRUE) != 0;
/* return *p == '_' || is_utf8_alpha(p) || is_utf8_digit(p); */
#ifdef SURPRISINGLY_SLOWER /* probably because alpha is usually true */
if (!PL_utf8_alnum)
PL_utf8_alnum = swash_init("utf8", "",
sv_2mortal(newSVpv("+utf8::IsAlpha\n+utf8::IsDigit\n005F\n",0)), 0, 0);
- return swash_fetch(PL_utf8_alnum, p, TRUE);
+ return swash_fetch(PL_utf8_alnum, p, TRUE) != 0;
#endif
}
return FALSE;
if (!PL_utf8_alnum)
PL_utf8_alnum = swash_init("utf8", "IsAlnumC", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_alnum, p, TRUE);
+ return swash_fetch(PL_utf8_alnum, p, TRUE) != 0;
/* return is_utf8_alpha(p) || is_utf8_digit(p); */
#ifdef SURPRISINGLY_SLOWER /* probably because alpha is usually true */
if (!PL_utf8_alnum)
PL_utf8_alnum = swash_init("utf8", "",
sv_2mortal(newSVpv("+utf8::IsAlpha\n+utf8::IsDigit\n005F\n",0)), 0, 0);
- return swash_fetch(PL_utf8_alnum, p, TRUE);
+ return swash_fetch(PL_utf8_alnum, p, TRUE) != 0;
#endif
}
return FALSE;
if (!PL_utf8_idstart) /* is_utf8_idstart would be more logical. */
PL_utf8_idstart = swash_init("utf8", "IdStart", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_idstart, p, TRUE);
+ return swash_fetch(PL_utf8_idstart, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_idcont)
PL_utf8_idcont = swash_init("utf8", "IdContinue", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_idcont, p, TRUE);
+ return swash_fetch(PL_utf8_idcont, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_alpha)
PL_utf8_alpha = swash_init("utf8", "IsAlpha", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_alpha, p, TRUE);
+ return swash_fetch(PL_utf8_alpha, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_ascii)
PL_utf8_ascii = swash_init("utf8", "IsAscii", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_ascii, p, TRUE);
+ return swash_fetch(PL_utf8_ascii, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_space)
PL_utf8_space = swash_init("utf8", "IsSpacePerl", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_space, p, TRUE);
+ return swash_fetch(PL_utf8_space, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_digit)
PL_utf8_digit = swash_init("utf8", "IsDigit", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_digit, p, TRUE);
+ return swash_fetch(PL_utf8_digit, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_upper)
PL_utf8_upper = swash_init("utf8", "IsUpper", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_upper, p, TRUE);
+ return swash_fetch(PL_utf8_upper, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_lower)
PL_utf8_lower = swash_init("utf8", "IsLower", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_lower, p, TRUE);
+ return swash_fetch(PL_utf8_lower, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_cntrl)
PL_utf8_cntrl = swash_init("utf8", "IsCntrl", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_cntrl, p, TRUE);
+ return swash_fetch(PL_utf8_cntrl, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_graph)
PL_utf8_graph = swash_init("utf8", "IsGraph", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_graph, p, TRUE);
+ return swash_fetch(PL_utf8_graph, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_print)
PL_utf8_print = swash_init("utf8", "IsPrint", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_print, p, TRUE);
+ return swash_fetch(PL_utf8_print, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_punct)
PL_utf8_punct = swash_init("utf8", "IsPunct", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_punct, p, TRUE);
+ return swash_fetch(PL_utf8_punct, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_xdigit)
PL_utf8_xdigit = swash_init("utf8", "IsXDigit", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_xdigit, p, TRUE);
+ return swash_fetch(PL_utf8_xdigit, p, TRUE) != 0;
}
bool
return FALSE;
if (!PL_utf8_mark)
PL_utf8_mark = swash_init("utf8", "IsM", &PL_sv_undef, 0, 0);
- return swash_fetch(PL_utf8_mark, p, TRUE);
+ return swash_fetch(PL_utf8_mark, p, TRUE) != 0;
}
/*
char* pv = SvPV(tokenbufsv, len);
Copy(pv, PL_tokenbuf, len+1, char);
- PL_curcop->op_private = PL_hints;
+ PL_curcop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
}
if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV) {
if (SvPOK(retval))
UV c = NATIVE_TO_ASCII(*ptr);
if (!do_utf8 && !UNI_IS_INVARIANT(c)) {
- tmputf8[0] = UTF8_EIGHT_BIT_HI(c);
- tmputf8[1] = UTF8_EIGHT_BIT_LO(c);
+ tmputf8[0] = (U8)UTF8_EIGHT_BIT_HI(c);
+ tmputf8[1] = (U8)UTF8_EIGHT_BIT_LO(c);
ptr = tmputf8;
}
/* Given a UTF-X encoded char 0xAA..0xYY,0xZZ
FREETMPS;
LEAVE;
if (PL_curcop == &PL_compiling)
- PL_curcop->op_private = PL_hints;
+ PL_curcop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
svp = hv_store(hv, (char*)ptr, klen, retval, 0);
if (pe1)
e1 = *(U8**)pe1;
- if (e1 == 0 || (l1 && l1 < e1 - (U8*)s1))
+ if (e1 == 0 || (l1 && l1 < (UV)(e1 - (U8*)s1)))
f1 = (U8*)s1 + l1;
if (pe2)
e2 = *(U8**)pe2;
- if (e2 == 0 || (l2 && l2 < e2 - (U8*)s2))
+ if (e2 == 0 || (l2 && l2 < (UV)(e2 - (U8*)s2)))
f2 = (U8*)s2 + l2;
if ((e1 == 0 && f1 == 0) || (e2 == 0 && f2 == 0) || (f1 == 0 && f2 == 0))
}
}
BmRARE(sv) = s[rarest];
- BmPREVIOUS(sv) = rarest;
+ BmPREVIOUS(sv) = (U16)rarest;
BmUSEFUL(sv) = 100; /* Initial value */
if (flags & FBMcf_TAIL)
SvTAIL_on(sv);
register STRLEN littlelen = l;
register I32 multiline = flags & FBMrf_MULTILINE;
- if (bigend - big < littlelen) {
+ if ((STRLEN)(bigend - big) < littlelen) {
if ( SvTAIL(littlestr)
- && (bigend - big == littlelen - 1)
+ && ((STRLEN)(bigend - big) == littlelen - 1)
&& (littlelen == 1
|| (*big == *little &&
memEQ((char *)big, (char *)little, littlelen - 1))))
register unsigned char *table = little + littlelen + FBM_TABLE_OFFSET;
register unsigned char *oldlittle;
- if (littlelen > bigend - big)
+ if (littlelen > (STRLEN)(bigend - big))
return Nullch;
--littlelen; /* Last char found by table lookup */
hv_iterinit(PL_pidstatus);
if ((entry = hv_iternext(PL_pidstatus))) {
+ SV *sv;
+ char spid[TYPE_CHARS(int)];
+
pid = atoi(hv_iterkey(entry,(I32*)statusp));
sv = hv_iterval(PL_pidstatus,entry);
*statusp = SvIVX(sv);
case 2:
#line 136 "perly.y"
{ if (PL_copline > (line_t)yyvsp[-3].ival)
- PL_copline = yyvsp[-3].ival;
+ PL_copline = (line_t)yyvsp[-3].ival;
yyval.opval = block_end(yyvsp[-2].ival, yyvsp[-1].opval); }
break;
case 3:
case 5:
#line 156 "perly.y"
{ if (PL_copline > (line_t)yyvsp[-3].ival)
- PL_copline = yyvsp[-3].ival;
+ PL_copline = (line_t)yyvsp[-3].ival;
yyval.opval = block_end(yyvsp[-2].ival, yyvsp[-1].opval); }
break;
case 6:
break;
case 20:
#line 209 "perly.y"
-{ yyval.opval = newFOROP(0, Nullch, yyvsp[-1].ival,
+{ yyval.opval = newFOROP(0, Nullch, (line_t)yyvsp[-1].ival,
Nullop, yyvsp[0].opval, yyvsp[-2].opval, Nullop); }
break;
case 21:
break;
case 23:
#line 219 "perly.y"
-{ PL_copline = yyvsp[-5].ival;
+{ PL_copline = (line_t)yyvsp[-5].ival;
yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval);
PL_hints |= HINT_BLOCK_SCOPE; }
break;
case 24:
#line 226 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval)); }
break;
case 25:
#line 230 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval)); }
break;
break;
case 28:
#line 244 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newSTATEOP(0, yyvsp[-7].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
break;
case 29:
#line 250 "perly.y"
-{ PL_copline = yyvsp[-6].ival;
+{ PL_copline = (line_t)yyvsp[-6].ival;
yyval.opval = block_end(yyvsp[-4].ival,
newSTATEOP(0, yyvsp[-7].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
case 30:
#line 256 "perly.y"
{ yyval.opval = block_end(yyvsp[-6].ival,
- newFOROP(0, yyvsp[-9].pval, yyvsp[-8].ival, yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
+ newFOROP(0, yyvsp[-9].pval, (line_t)yyvsp[-8].ival, yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 31:
#line 259 "perly.y"
{ yyval.opval = block_end(yyvsp[-4].ival,
- newFOROP(0, yyvsp[-8].pval, yyvsp[-7].ival, mod(yyvsp[-6].opval, OP_ENTERLOOP),
+ newFOROP(0, yyvsp[-8].pval, (line_t)yyvsp[-7].ival, mod(yyvsp[-6].opval, OP_ENTERLOOP),
yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 32:
#line 263 "perly.y"
{ yyval.opval = block_end(yyvsp[-4].ival,
- newFOROP(0, yyvsp[-7].pval, yyvsp[-6].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
+ newFOROP(0, yyvsp[-7].pval, (line_t)yyvsp[-6].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval)); }
break;
case 33:
#line 267 "perly.y"
{ OP *forop;
- PL_copline = yyvsp[-9].ival;
+ PL_copline = (line_t)yyvsp[-9].ival;
forop = newSTATEOP(0, yyvsp[-10].pval,
newWHILEOP(0, 1, (LOOP*)Nullop,
yyvsp[-9].ival, scalar(yyvsp[-4].opval),
* want to free() argv after main() returns. As luck would have it,
* Borland's CRT does the right thing to argv[0] already. */
char szModuleName[MAX_PATH];
- char *ptr;
GetModuleFileName(NULL, szModuleName, sizeof(szModuleName));
(void)win32_longpath(szModuleName);
char *ptr;
char *optr;
char *strip;
- int oldsize, newsize;
STRLEN baselen;
va_start(ap, trailing_path);
dTHX;
char regstr[40];
char pathstr[MAX_PATH+1];
- DWORD datalen;
- int len, newsize;
SV *sv1 = Nullsv;
SV *sv2 = Nullsv;
dTHX;
long child = w32_num_children;
while (--child >= 0) {
- if (w32_child_pids[child] == pid)
+ if ((int)w32_child_pids[child] == pid)
return child;
}
return -1;
dTHX;
long child = w32_num_pseudo_children;
while (--child >= 0) {
- if (w32_pseudo_child_pids[child] == pid)
+ if ((int)w32_pseudo_child_pids[child] == pid)
return child;
}
return -1;
#if defined(WIN64) || defined(USE_LARGE_FILES)
res = _wstati64(pwbuffer, sbuf);
#else
- res = _wstat(pwbuffer, sbuf);
+ res = _wstat(pwbuffer, (struct _stat*)sbuf);
#endif
}
else {
}
}
-FAILED:
errno = GetLastError();
return -1;
}
if (*pathstr == '"') { /* foo;"baz;etc";bar */
pathstr++; /* skip initial '"' */
while (*pathstr && *pathstr != '"') {
- if (curfullcmd-fullcmd < MAX_PATH-cmdlen-5)
+ if ((STRLEN)(curfullcmd-fullcmd) < MAX_PATH-cmdlen-5)
*curfullcmd++ = *pathstr;
pathstr++;
}
pathstr++; /* skip trailing '"' */
}
else {
- if (curfullcmd-fullcmd < MAX_PATH-cmdlen-5)
+ if ((STRLEN)(curfullcmd-fullcmd) < MAX_PATH-cmdlen-5)
*curfullcmd++ = *pathstr;
pathstr++;
}
*curfullcmd++ = '\\';
}
}
-GIVE_UP:
+
Safefree(fullcmd);
return Nullch;
}
int r;
#ifdef USE_SOCKETS_AS_HANDLES
Perl_fd_set dummy;
- int i, fd, bit, offset;
+ int i, fd;
FD_SET nrd, nwr, nex, *prd, *pwr, *pex;
/* winsock seems incapable of dealing with all three null fd_sets,