Change 16173 by gsar@rake on 2002/04/26 00:41:39
various signed/unsigned mismatch nits
Affected files ...
.... //depot/perl/ext/B/B.xs#72 edit
.... //depot/perl/ext/ByteLoader/ByteLoader.xs#18 edit
.... //depot/perl/ext/Data/Dumper/Dumper.xs#38 edit
.... //depot/perl/ext/Devel/DProf/DProf.xs#28 edit
.... //depot/perl/ext/Digest/MD5/MD5.xs#7 edit
.... //depot/perl/ext/Encode/Unicode/Unicode.xs#4 edit
.... //depot/perl/ext/File/Glob/bsd_glob.c#22 edit
.... //depot/perl/ext/IO/IO.xs#33 edit
.... //depot/perl/ext/Opcode/Opcode.xs#36 edit
.... //depot/perl/ext/PerlIO/encoding/encoding.xs#8 edit
.... //depot/perl/ext/Storable/Storable.xs#43 edit
.... //depot/perl/ext/Time/HiRes/HiRes.xs#27 edit
.... //depot/perl/regcomp.c#302 edit
Differences ...
==== //depot/perl/ext/B/B.xs#72 (text) ====
Index: perl/ext/B/B.xs
--- perl/ext/B/B.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/B/B.xs Thu Apr 25 18:45:05 2002
@@ -668,7 +668,7 @@
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;
==== //depot/perl/ext/ByteLoader/ByteLoader.xs#18 (text) ====
Index: perl/ext/ByteLoader/ByteLoader.xs
--- perl/ext/ByteLoader/ByteLoader.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/ByteLoader/ByteLoader.xs Thu Apr 25 18:45:05 2002
@@ -11,7 +11,7 @@
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';
==== //depot/perl/ext/Data/Dumper/Dumper.xs#38 (text) ====
Index: perl/ext/Data/Dumper/Dumper.xs
--- perl/ext/Data/Dumper/Dumper.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Data/Dumper/Dumper.xs Thu Apr 25 18:45:05 2002
@@ -147,10 +147,10 @@
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);
}
==== //depot/perl/ext/Devel/DProf/DProf.xs#28 (text) ====
Index: perl/ext/Devel/DProf/DProf.xs
--- perl/ext/Devel/DProf/DProf.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Devel/DProf/DProf.xs Thu Apr 25 18:45:05 2002
@@ -632,7 +632,7 @@
* 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);
==== //depot/perl/ext/Digest/MD5/MD5.xs#7 (text) ====
Index: perl/ext/Digest/MD5/MD5.xs
--- perl/ext/Digest/MD5/MD5.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Digest/MD5/MD5.xs Thu Apr 25 18:45:05 2002
@@ -80,10 +80,10 @@
#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) | \
==== //depot/perl/ext/Encode/Unicode/Unicode.xs#4 (text) ====
Index: perl/ext/Encode/Unicode/Unicode.xs
--- perl/ext/Encode/Unicode/Unicode.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Encode/Unicode/Unicode.xs Thu Apr 25 18:45:05 2002
@@ -61,7 +61,7 @@
d += SvCUR(result);
SvCUR_set(result,SvCUR(result)+size);
while (size--) {
- *d++ = value & 0xFF;
+ *d++ = (U8)(value & 0xFF);
value >>= 8;
}
break;
@@ -70,7 +70,7 @@
SvCUR_set(result,SvCUR(result)+size);
d += SvCUR(result);
while (size--) {
- *--d = value & 0xFF;
+ *--d = (U8)(value & 0xFF);
value >>= 8;
}
break;
==== //depot/perl/ext/File/Glob/bsd_glob.c#22 (text) ====
Index: perl/ext/File/Glob/bsd_glob.c
--- perl/ext/File/Glob/bsd_glob.c.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/File/Glob/bsd_glob.c Thu Apr 25 18:45:05 2002
@@ -520,7 +520,7 @@
/* 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;
@@ -1164,7 +1164,7 @@
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);
==== //depot/perl/ext/IO/IO.xs#33 (text) ====
Index: perl/ext/IO/IO.xs
--- perl/ext/IO/IO.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/IO/IO.xs Thu Apr 25 18:45:05 2002
@@ -242,7 +242,7 @@
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;
}
==== //depot/perl/ext/Opcode/Opcode.xs#36 (text) ====
Index: perl/ext/Opcode/Opcode.xs
--- perl/ext/Opcode/Opcode.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Opcode/Opcode.xs Thu Apr 25 18:45:05 2002
@@ -151,7 +151,7 @@
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);
}
@@ -178,7 +178,7 @@
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);
@@ -464,7 +464,7 @@
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);
==== //depot/perl/ext/PerlIO/encoding/encoding.xs#8 (text) ====
Index: perl/ext/PerlIO/encoding/encoding.xs
--- perl/ext/PerlIO/encoding/encoding.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/PerlIO/encoding/encoding.xs Thu Apr 25 18:45:05 2002
@@ -317,7 +317,7 @@
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;
@@ -427,7 +427,7 @@
PUTBACK;
s = SvPV(str, len);
count = PerlIO_write(PerlIONext(f),s,len);
- if (count != len) {
+ if ((STRLEN)count != len) {
code = -1;
}
FREETMPS;
@@ -447,7 +447,7 @@
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;
}
}
@@ -478,7 +478,7 @@
PUTBACK;
s = SvPV(str, len);
count = PerlIO_unread(PerlIONext(f),s,len);
- if (count != len) {
+ if ((STRLEN)count != len) {
code = -1;
}
FREETMPS;
==== //depot/perl/ext/Storable/Storable.xs#43 (text) ====
Index: perl/ext/Storable/Storable.xs
--- perl/ext/Storable/Storable.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Storable/Storable.xs Thu Apr 25 18:45:05 2002
@@ -2695,7 +2695,7 @@
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) {
@@ -3059,7 +3059,7 @@
: -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
@@ -3085,7 +3085,7 @@
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 *));
@@ -4479,7 +4479,7 @@
*/
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 */
@@ -4609,7 +4609,7 @@
#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 */
@@ -4773,7 +4773,7 @@
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 */
@@ -4826,7 +4826,7 @@
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))
@@ -4838,7 +4838,7 @@
*/
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))
@@ -5065,7 +5065,7 @@
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 */
==== //depot/perl/ext/Time/HiRes/HiRes.xs#27 (text) ====
Index: perl/ext/Time/HiRes/HiRes.xs
--- perl/ext/Time/HiRes/HiRes.xs.~1~ Thu Apr 25 18:45:05 2002
+++ perl/ext/Time/HiRes/HiRes.xs Thu Apr 25 18:45:05 2002
@@ -618,7 +618,7 @@
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);
==== //depot/perl/regcomp.c#302 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c.~1~ Thu Apr 25 18:45:05 2002
+++ perl/regcomp.c Thu Apr 25 18:45:05 2002
@@ -4775,7 +4775,6 @@
if (lv) {
if (sw) {
- UV i;
U8 s[UTF8_MAXLEN+1];
for (i = 0; i <= 256; i++) { /* just the first 256 */
End of Patch.