CODE:
sv_setpvn(sv, "PL_ppaddr[OP_", 13);
sv_catpv(sv, PL_op_name[o->op_type]);
- for (i=13; i<SvCUR(sv); ++i)
+ for (i=13; (STRLEN)i < SvCUR(sv); ++i)
SvPVX(sv)[i] = toUPPER(SvPVX(sv)[i]);
sv_catpv(sv, "]");
ST(0) = sv;
bl_getc(struct byteloader_fdata *data)
{
dTHX;
- if (SvCUR(data->datasv) <= data->next_out) {
+ if (SvCUR(data->datasv) <= (STRLEN)data->next_out) {
int result;
/* Run out of buffered data, so attempt to read some more */
*(SvPV_nolen (data->datasv)) = '\0';
if (k == '"' || k == '\\' || k == '$' || k == '@') {
*r++ = '\\';
- *r++ = k;
+ *r++ = (char)k;
}
else if (k < 0x80)
- *r++ = k;
+ *r++ = (char)k;
else {
r += sprintf(r, "\\x{%"UVxf"}", k);
}
* while we do this.
*/
{
- I32 warn_tmp = PL_dowarn;
+ bool warn_tmp = PL_dowarn;
PL_dowarn = 0;
newXS("DB::sub", XS_DB_sub, file);
newXS("DB::goto", XS_DB_goto, file);
#ifndef BYTESWAP
static void u2s(U32 u, U8* s)
{
- *s++ = u & 0xFF;
- *s++ = (u >> 8) & 0xFF;
- *s++ = (u >> 16) & 0xFF;
- *s = (u >> 24) & 0xFF;
+ *s++ = (U8)(u & 0xFF);
+ *s++ = (U8)((u >> 8) & 0xFF);
+ *s++ = (U8)((u >> 16) & 0xFF);
+ *s = (U8)((u >> 24) & 0xFF);
}
#define s2u(s,u) ((u) = (U32)(*s) | \
d += SvCUR(result);
SvCUR_set(result,SvCUR(result)+size);
while (size--) {
- *d++ = value & 0xFF;
+ *d++ = (U8)(value & 0xFF);
value >>= 8;
}
break;
SvCUR_set(result,SvCUR(result)+size);
d += SvCUR(result);
while (size--) {
- *--d = value & 0xFF;
+ *--d = (U8)(value & 0xFF);
value >>= 8;
}
break;
/* Copy up to the end of the string or / */
eb = &patbuf[patbuf_len - 1];
for (p = pattern + 1, h = (char *) patbuf;
- h < (char*)eb && *p && *p != BG_SLASH; *h++ = *p++)
+ h < (char*)eb && *p && *p != BG_SLASH; *h++ = (char)*p++)
;
*h = BG_EOS;
g_Ctoc(register const Char *str, char *buf, STRLEN len)
{
while (len--) {
- if ((*buf++ = *str++) == BG_EOS)
+ if ((*buf++ = (char)*str++) == BG_EOS)
return (0);
}
return (1);
for(i=1, j=0 ; j < nfd ; j++) {
fds[j].fd = SvIV(ST(i));
i++;
- fds[j].events = SvIV(ST(i));
+ fds[j].events = (short)SvIV(ST(i));
i++;
fds[j].revents = 0;
}
if (!SvOK(opset)) err = "undefined";
else if (!SvPOK(opset)) err = "wrong type";
- else if (SvCUR(opset) != opset_len) err = "wrong size";
+ else if (SvCUR(opset) != (STRLEN)opset_len) err = "wrong size";
if (err && fatal) {
croak("Invalid opset: %s", err);
}
else
bitmap[offset] &= ~(1 << bit);
}
- else if (SvPOK(bitspec) && SvCUR(bitspec) == opset_len) {
+ else if (SvPOK(bitspec) && SvCUR(bitspec) == (STRLEN)opset_len) {
STRLEN len;
char *specbits = SvPV(bitspec, len);
croak("panic: opcode %d (%s) out of range",myopcode,opname);
XPUSHs(sv_2mortal(newSVpv(op_desc[myopcode], 0)));
}
- else if (SvPOK(bitspec) && SvCUR(bitspec) == opset_len) {
+ else if (SvPOK(bitspec) && SvCUR(bitspec) == (STRLEN)opset_len) {
int b, j;
STRLEN n_a;
char *bitmap = SvPV(bitspec,n_a);
if (SvLEN(e->dataSV) && SvPVX(e->dataSV)) {
Safefree(SvPVX(e->dataSV));
}
- if (use > e->base.bufsiz) {
+ if (use > (SSize_t)e->base.bufsiz) {
if (e->flags & NEEDS_LINES) {
/* Have to grow buffer */
e->base.bufsiz = use;
PUTBACK;
s = SvPV(str, len);
count = PerlIO_write(PerlIONext(f),s,len);
- if (count != len) {
+ if ((STRLEN)count != len) {
code = -1;
}
FREETMPS;
if (e->dataSV && SvCUR(e->dataSV)) {
s = SvPV(e->dataSV, len);
count = PerlIO_unread(PerlIONext(f),s,len);
- if (count != len) {
+ if ((STRLEN)count != len) {
code = -1;
}
}
PUTBACK;
s = SvPV(str, len);
count = PerlIO_unread(PerlIONext(f),s,len);
- if (count != len) {
+ if ((STRLEN)count != len) {
code = -1;
}
FREETMPS;
PUTMARK(clen);
}
if (len2)
- WRITE(pv, len2); /* Final \0 is omitted */
+ WRITE(pv, (SSize_t)len2); /* Final \0 is omitted */
/* [<len3> <object-IDs>] */
if (flags & SHF_HAS_LIST) {
: -1));
if (cxt->fio)
- WRITE(magicstr, strlen(magicstr)); /* Don't write final \0 */
+ WRITE(magicstr, (SSize_t)strlen(magicstr)); /* Don't write final \0 */
/*
* Starting with 0.6, the "use_network_order" byte flag is also used to
sprintf(buf, "%lx", (unsigned long) BYTEORDER);
c = (unsigned char) strlen(buf);
PUTMARK(c);
- WRITE(buf, (unsigned int) c); /* Don't write final \0 */
+ WRITE(buf, (SSize_t)c); /* Don't write final \0 */
PUTMARK((unsigned char) sizeof(int));
PUTMARK((unsigned char) sizeof(long));
PUTMARK((unsigned char) sizeof(char *));
*/
RLEN(size); /* Get key size */
- KBUFCHK(size); /* Grow hash key read pool if needed */
+ KBUFCHK((STRLEN)size); /* Grow hash key read pool if needed */
if (size)
READ(kbuf, size);
kbuf[size] = '\0'; /* Mark string end, just in case */
#endif
RLEN(size); /* Get key size */
- KBUFCHK(size); /* Grow hash key read pool if needed */
+ KBUFCHK((STRLEN)size); /* Grow hash key read pool if needed */
if (size)
READ(kbuf, size);
kbuf[size] = '\0'; /* Mark string end, just in case */
if (c != SX_KEY)
(void) retrieve_other((stcxt_t *) 0, 0); /* Will croak out */
RLEN(size); /* Get key size */
- KBUFCHK(size); /* Grow hash key read pool if needed */
+ KBUFCHK((STRLEN)size); /* Grow hash key read pool if needed */
if (size)
READ(kbuf, size);
kbuf[size] = '\0'; /* Mark string end, just in case */
STRLEN len = sizeof(magicstr) - 1;
STRLEN old_len;
- READ(buf, len); /* Not null-terminated */
+ READ(buf, (SSize_t)len); /* Not null-terminated */
buf[len] = '\0'; /* Is now */
if (0 == strcmp(buf, magicstr))
*/
old_len = sizeof(old_magicstr) - 1;
- READ(&buf[len], old_len - len);
+ READ(&buf[len], (SSize_t)(old_len - len));
buf[old_len] = '\0'; /* Is now null-terminated */
if (strcmp(buf, old_magicstr))
default:
return (SV *) 0; /* Failed */
}
- KBUFCHK(len); /* Grow buffer as necessary */
+ KBUFCHK((STRLEN)len); /* Grow buffer as necessary */
if (len)
READ(kbuf, len);
kbuf[len] = '\0'; /* Mark string end */
if (items > 0) {
NV seconds = SvNV(ST(0));
if (seconds >= 0.0) {
- UV useconds = 1E6 * (seconds - (UV)seconds);
+ UV useconds = (UV)(1E6 * (seconds - (UV)seconds));
if (seconds >= 1.0)
sleep((UV)seconds);
usleep(useconds);
if (lv) {
if (sw) {
- UV i;
U8 s[UTF8_MAXLEN+1];
for (i = 0; i <= 256; i++) { /* just the first 256 */