Skip to content

Commit db137b4

Browse files
committed
MFH: Fix compiler warnings
1 parent fcede92 commit db137b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/bz2/bz2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static PHP_FUNCTION(bzcompress)
495495
+ .01 x length of data + 600 which is the largest size the results of the compression
496496
could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
497497
for pointing this out). */
498-
dest_len = source_len + (0.01 * source_len) + 600;
498+
dest_len = (unsigned int) (source_len + (0.01 * source_len) + 600);
499499

500500
/* Allocate the destination buffer */
501501
dest = emalloc(dest_len + 1);
@@ -559,15 +559,15 @@ static PHP_FUNCTION(bzdecompress)
559559
/* compression is better then 2:1, need to allocate more memory */
560560
bzs.avail_out = source_len;
561561
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
562-
dest = safe_erealloc(dest, 1, bzs.avail_out+1, size );
562+
dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size );
563563
bzs.next_out = dest + size;
564564
}
565565

566566
if (error == BZ_STREAM_END || error == BZ_OK) {
567567
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
568-
dest = safe_erealloc(dest, 1, size, 1);
568+
dest = safe_erealloc(dest, 1, (size_t) size, 1);
569569
dest[size] = '\0';
570-
RETVAL_STRINGL(dest, size, 0);
570+
RETVAL_STRINGL(dest, (int) size, 0);
571571
} else { /* real error */
572572
efree(dest);
573573
RETVAL_LONG(error);

0 commit comments

Comments
 (0)