switch (xar->rd_encoding) {
case GZIP:
xar->stream.next_in = (Bytef *)(uintptr_t)b;
- xar->stream.avail_in = avail_in;
+ xar->stream.avail_in = (uInt)avail_in;
xar->stream.next_out = (unsigned char *)outbuff;
- xar->stream.avail_out = avail_out;
+ xar->stream.avail_out = (uInt)avail_out;
r = inflate(&(xar->stream), 0);
switch (r) {
case Z_OK: /* Decompressor made some progress.*/
#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
case BZIP2:
xar->bzstream.next_in = (char *)(uintptr_t)b;
- xar->bzstream.avail_in = avail_in;
+ xar->bzstream.avail_in = (unsigned int)avail_in;
xar->bzstream.next_out = (char *)outbuff;
- xar->bzstream.avail_out = avail_out;
+ xar->bzstream.avail_out = (unsigned int)avail_out;
r = BZ2_bzDecompress(&(xar->bzstream));
switch (r) {
case BZ_STREAM_END: /* Found end of stream. */
xar->toc_total += outbytes;
PRINT_TOC(d, outbytes);
- xr = XML_Parse(parser, d, outbytes, xar->toc_remaining == 0);
+ xr = XML_Parse(parser, d, (int)outbytes, xar->toc_remaining == 0);
__archive_read_consume(a, used);
if (xr == XML_STATUS_ERROR) {
XML_ParserFree(parser);
if (w > 0)
xar->bytes_remaining -= w;
else
- return (w);
+ return ((int)w);
}
file = xar->cur_file;
checksum_final(&(xar->e_sumwrk), &(file->data.e_sum));
/*
* Make a file name entry, "<name>".
*/
- l = ll = archive_strlen(&(file->basename));
+ l = ll = (int)archive_strlen(&(file->basename));
tmp = malloc(l);
if (tmp == NULL) {
archive_set_error(&a->archive, ENOMEM,
return (ARCHIVE_FATAL);
}
r = xmlTextWriterWriteBase64(writer, file->basename.s,
- 0, archive_strlen(&(file->basename)));
+ 0, (int)archive_strlen(&(file->basename)));
if (r < 0) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
p = strchr(fn, '/');
if (p == NULL) {
- if ((l = strlen(fn)) == 0)
+ if ((l = (int)strlen(fn)) == 0)
return (0);
} else
- l = p - fn;
+ l = (int)(p - fn);
if (l > n -1)
return (-1);
memcpy(name, fn, l);
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (Bytef *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (uInt)lastrm->avail_in;
strm->total_in = (uLong)lastrm->total_in;
strm->next_out = lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (uInt)lastrm->avail_out;
strm->total_out = (uLong)lastrm->total_out;
if (deflateInit2(strm, level, Z_DEFLATED,
(withheader)?15:-15,
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (Bytef *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (uInt)lastrm->avail_in;
strm->total_in = (uLong)lastrm->total_in;
strm->next_out = lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (uInt)lastrm->avail_out;
strm->total_out = (uLong)lastrm->total_out;
r = deflate(strm,
(action == ARCHIVE_Z_FINISH)? Z_FINISH: Z_NO_FLUSH);
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (unsigned int)lastrm->avail_in;
strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff);
strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32);
strm->next_out = (char *)lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (unsigned int)lastrm->avail_out;
strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
if (BZ2_bzCompressInit(strm, level, 0, 30) != BZ_OK) {
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (unsigned int)lastrm->avail_in;
strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff);
strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32);
strm->next_out = (char *)lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (unsigned int)lastrm->avail_out;
strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
r = BZ2_bzCompress(strm,