if ((bctx.ff_pkt->flags & FO_COMPRESS) && bctx.ff_pkt->Compress_algo == COMPRESS_GZIP) {
if ((bctx.ff_pkt->flags & FO_SPARSE) || (bctx.ff_pkt->flags & FO_OFFSETS)) {
- bctx.cbuf = (Bytef *)jcr->compress_buf + OFFSET_FADDR_SIZE;
+ bctx.cbuf = (unsigned char *)jcr->compress_buf + OFFSET_FADDR_SIZE;
bctx.max_compress_len = jcr->compress_buf_size - OFFSET_FADDR_SIZE;
} else {
- bctx.cbuf = (Bytef *)jcr->compress_buf;
+ bctx.cbuf = (unsigned char *)jcr->compress_buf;
bctx.max_compress_len = jcr->compress_buf_size; /* set max length */
}
bctx.wbuf = jcr->compress_buf; /* compressed output here */
if ((bctx.ff_pkt->flags & FO_COMPRESS) && bctx.ff_pkt->Compress_algo == COMPRESS_LZO1X) {
if ((bctx.ff_pkt->flags & FO_SPARSE) || (bctx.ff_pkt->flags & FO_OFFSETS)) {
- bctx.cbuf = (Bytef *)jcr->compress_buf + OFFSET_FADDR_SIZE;
- bctx.cbuf2 = (Bytef *)jcr->compress_buf + OFFSET_FADDR_SIZE + sizeof(comp_stream_header);
+ bctx.cbuf = (unsigned char *)jcr->compress_buf + OFFSET_FADDR_SIZE;
+ bctx.cbuf2 = (unsigned char *)jcr->compress_buf + OFFSET_FADDR_SIZE + sizeof(comp_stream_header);
bctx.max_compress_len = jcr->compress_buf_size - OFFSET_FADDR_SIZE;
} else {
- bctx.cbuf = (Bytef *)jcr->compress_buf;
- bctx.cbuf2 = (Bytef *)jcr->compress_buf + sizeof(comp_stream_header);
+ bctx.cbuf = (unsigned char *)jcr->compress_buf;
+ bctx.cbuf2 = (unsigned char *)jcr->compress_buf + sizeof(comp_stream_header);
bctx.max_compress_len = jcr->compress_buf_size; /* set max length */
}
bctx.ch.magic = COMPRESS_LZO1X;
bctx.cipher_input = (uint8_t *)jcr->compress_buf; /* encrypt compressed data */
}
#endif
-#else
- bctx.max_compress_len = 0;
#endif
return true;
}
if (bctx.ff_pkt->flags & FO_COMPRESS && bctx.ff_pkt->Compress_algo == COMPRESS_GZIP && jcr->pZLIB_compress_workset) {
Dmsg3(400, "cbuf=0x%x rbuf=0x%x len=%u\n", bctx.cbuf, bctx.rbuf, sd->msglen);
- ((z_stream*)jcr->pZLIB_compress_workset)->next_in = (Bytef *)bctx.rbuf;
+ ((z_stream*)jcr->pZLIB_compress_workset)->next_in = (unsigned char *)bctx.rbuf;
((z_stream*)jcr->pZLIB_compress_workset)->avail_in = sd->msglen;
((z_stream*)jcr->pZLIB_compress_workset)->next_out = bctx.cbuf;
((z_stream*)jcr->pZLIB_compress_workset)->avail_out = bctx.max_compress_len;
uint32_t encrypted_len;
/* Compression variables */
-#if defined(HAVE_LIBZ) || defined(HAVE_LZO)
- uLong compress_len;
- uLong max_compress_len;
- Bytef *cbuf;
- Bytef *cbuf2;
-#endif
+ /* These are the same as used by libz, but I find it very
+ * uncomfortable to define variables like this rather than
+ * specifying a number of bits. Defining them here allows us
+ * to have code that compiles with and without libz and lzo.
+ *
+ * uLong == unsigned long int
+ * Bytef == unsigned char
+ */
+ unsigned long int max_compress_len;
+ unsigned long int compress_len;
+ unsigned char *cbuf;
+ unsigned char *cbuf2;
+
#ifdef HAVE_LZO
comp_stream_header ch;
#endif