match the unsigned char type used by the zlib interface ok stsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/lib/deflate.c b/lib/deflate.c
index 02f9a9d..df0038f 100644
--- a/lib/deflate.c
+++ b/lib/deflate.c
@@ -80,7 +80,7 @@ done:
}
static void
-csum_output(struct got_deflate_checksum *csum, const char *buf, size_t len)
+csum_output(struct got_deflate_checksum *csum, const uint8_t *buf, size_t len)
{
if (csum->output_crc)
*csum->output_crc = crc32(*csum->output_crc, buf, len);
diff --git a/lib/got_lib_deflate.h b/lib/got_lib_deflate.h
index bb41647..6eee636 100644
--- a/lib/got_lib_deflate.h
+++ b/lib/got_lib_deflate.h
@@ -24,9 +24,9 @@ struct got_deflate_checksum {
struct got_deflate_buf {
z_stream z;
- char *inbuf;
+ uint8_t *inbuf;
size_t inlen;
- char *outbuf;
+ uint8_t *outbuf;
size_t outlen;
int flags;
#define GOT_DEFLATE_F_HAVE_MORE 0x01
diff --git a/lib/got_lib_inflate.h b/lib/got_lib_inflate.h
index 3833fed..4ddc5aa 100644
--- a/lib/got_lib_inflate.h
+++ b/lib/got_lib_inflate.h
@@ -30,9 +30,9 @@ struct got_inflate_checksum {
struct got_inflate_buf {
z_stream z;
- char *inbuf;
+ uint8_t *inbuf;
size_t inlen;
- char *outbuf;
+ uint8_t *outbuf;
size_t outlen;
int flags;
#define GOT_INFLATE_F_HAVE_MORE 0x01
diff --git a/lib/inflate.c b/lib/inflate.c
index e68e173..68d7827 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -84,7 +84,7 @@ done:
}
static void
-csum_input(struct got_inflate_checksum *csum, const char *buf, size_t len)
+csum_input(struct got_inflate_checksum *csum, const uint8_t *buf, size_t len)
{
if (csum->input_crc)
*csum->input_crc = crc32(*csum->input_crc, buf, len);
@@ -94,7 +94,7 @@ csum_input(struct got_inflate_checksum *csum, const char *buf, size_t len)
}
static void
-csum_output(struct got_inflate_checksum *csum, const char *buf, size_t len)
+csum_output(struct got_inflate_checksum *csum, const uint8_t *buf, size_t len)
{
if (csum->output_crc)
*csum->output_crc = crc32(*csum->output_crc, buf, len);
@@ -119,7 +119,7 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp,
if (consumed)
*consumed = 0;
do {
- char *csum_in = NULL, *csum_out = NULL;
+ uint8_t *csum_in = NULL, *csum_out = NULL;
size_t csum_avail_in = 0, csum_avail_out = 0;
if (z->avail_in == 0) {
@@ -179,7 +179,7 @@ got_inflate_read_fd(struct got_inflate_buf *zb, int fd, size_t *outlenp,
if (consumed)
*consumed = 0;
do {
- char *csum_in = NULL, *csum_out = NULL;
+ uint8_t *csum_in = NULL, *csum_out = NULL;
size_t csum_avail_in = 0, csum_avail_out = 0;
if (z->avail_in == 0) {
@@ -238,7 +238,7 @@ got_inflate_read_mmap(struct got_inflate_buf *zb, uint8_t *map, size_t offset,
*consumed = 0;
do {
- char *csum_in = NULL, *csum_out = NULL;
+ uint8_t *csum_in = NULL, *csum_out = NULL;
size_t csum_avail_in = 0, csum_avail_out = 0;
size_t last_total_in = zb->z.total_in;
diff --git a/lib/object_parse.c b/lib/object_parse.c
index 4c0fd4f..dfcc909 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -210,7 +210,7 @@ got_object_read_header(struct got_object **obj, int fd)
{
const struct got_error *err;
struct got_inflate_buf zb;
- char *buf;
+ uint8_t *buf;
const size_t zbsize = 64;
size_t outlen, totlen;
int nbuf = 1;
@@ -234,7 +234,7 @@ got_object_read_header(struct got_object **obj, int fd)
break;
totlen += outlen;
if (memchr(zb.outbuf, '\0', outlen) == NULL) {
- char *newbuf;
+ uint8_t *newbuf;
nbuf++;
newbuf = recallocarray(buf, nbuf - 1, nbuf, zbsize);
if (newbuf == NULL) {