remove insize arg from inflate_read()
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
diff --git a/lib/object.c b/lib/object.c
index 58a2acc..1777172 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -157,7 +157,7 @@ read_object_header(struct got_object **obj, struct got_repository *repo,
i = 0;
totlen = 0;
do {
- err = got_inflate_read(&zb, f, NULL, &outlen);
+ err = got_inflate_read(&zb, f, &outlen);
if (err)
goto done;
if (strchr(zb.outbuf, '\0') == NULL) {
@@ -510,7 +510,7 @@ read_commit_object(struct got_commit_object **commit,
if (err)
return err;
- err = got_inflate_read(&zb, f, NULL, &len);
+ err = got_inflate_read(&zb, f, &len);
if (err)
return err;
@@ -577,7 +577,7 @@ read_tree_object(struct got_tree_object **tree,
if (err)
return err;
- err = got_inflate_read(&zb, f, NULL, &len);
+ err = got_inflate_read(&zb, f, &len);
if (err)
return err;
@@ -673,5 +673,5 @@ got_object_blob_close(struct got_blob_object *blob)
const struct got_error *
got_object_blob_read_block(struct got_blob_object *blob, size_t *outlenp)
{
- return got_inflate_read(&blob->zb, blob->f, NULL, outlenp);
+ return got_inflate_read(&blob->zb, blob->f, outlenp);
}
diff --git a/lib/zb.c b/lib/zb.c
index 6a15f3d..b5e809e 100644
--- a/lib/zb.c
+++ b/lib/zb.c
@@ -63,8 +63,7 @@ done:
}
const struct got_error *
-got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *inlenp,
- size_t *outlenp)
+got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *outlenp)
{
size_t last_total_out = zb->z.total_out;
z_stream *z = &zb->z;
@@ -74,8 +73,6 @@ got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *inlenp,
z->avail_out = zb->outlen;
*outlenp = 0;
- if (inlenp)
- *inlenp = 0;
do {
if (z->avail_in == 0) {
size_t n = fread(zb->inbuf, 1, zb->inlen, f);
@@ -86,8 +83,6 @@ got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *inlenp,
}
z->next_in = zb->inbuf;
z->avail_in = n;
- if (inlenp)
- *inlenp += n;
}
ret = inflate(z, Z_SYNC_FLUSH);
} while (ret == Z_OK && z->avail_out > 0);
@@ -128,7 +123,7 @@ got_inflate_to_mem(uint8_t **outbuf, size_t *outlen, FILE *f)
*outlen = 0;
do {
- err = got_inflate_read(&zb, f, NULL, &avail);
+ err = got_inflate_read(&zb, f, &avail);
if (err)
return err;
if (avail > 0) {
@@ -166,7 +161,7 @@ got_inflate_to_file(size_t *outlen, FILE *infile, FILE *outfile)
*outlen = 0;
do {
- err = got_inflate_read(&zb, infile, NULL, &avail);
+ err = got_inflate_read(&zb, infile, &avail);
if (err)
return err;
if (avail > 0) {
diff --git a/lib/zb.h b/lib/zb.h
index e529401..0796cc6 100644
--- a/lib/zb.h
+++ b/lib/zb.h
@@ -16,7 +16,7 @@
const struct got_error *got_inflate_init(struct got_zstream_buf *, size_t);
const struct got_error *got_inflate_read(struct got_zstream_buf *, FILE *,
- size_t *, size_t *);
+ size_t *);
void got_inflate_end(struct got_zstream_buf *);
const struct got_error *got_inflate_to_mem(uint8_t **, size_t *, FILE *);
const struct got_error *got_inflate_to_file(size_t *, FILE *, FILE *);