diff options
Diffstat (limited to 'libsparse/output_file.c')
-rw-r--r-- | libsparse/output_file.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libsparse/output_file.c b/libsparse/output_file.c index e63c4a9..cd30800 100644 --- a/libsparse/output_file.c +++ b/libsparse/output_file.c @@ -29,9 +29,10 @@ #include <unistd.h> #include <zlib.h> +#include "defs.h" #include "output_file.h" -#include "sparse_format.h" #include "sparse_crc32.h" +#include "sparse_format.h" #ifndef USE_MINGW #include <sys/mman.h> @@ -264,7 +265,7 @@ static struct output_file_ops gz_file_ops = { .close = gz_file_close, }; -static int callback_file_open(struct output_file *out, int fd) +static int callback_file_open(struct output_file *out __unused, int fd __unused) { return 0; } @@ -287,14 +288,13 @@ static int callback_file_skip(struct output_file *out, int64_t off) return 0; } -static int callback_file_pad(struct output_file *out, int64_t len) +static int callback_file_pad(struct output_file *out __unused, int64_t len __unused) { return -1; } static int callback_file_write(struct output_file *out, void *data, int len) { - int ret; struct output_file_callback *outc = to_output_file_callback(out); return outc->write(outc->priv, data, len); @@ -340,7 +340,7 @@ int read_all(int fd, void *buf, size_t len) static int write_sparse_skip_chunk(struct output_file *out, int64_t skip_len) { chunk_header_t chunk_header; - int ret, chunk; + int ret; if (skip_len % out->block_size) { error("don't care size %"PRIi64" is not a multiple of the block size %u", @@ -367,9 +367,8 @@ static int write_sparse_fill_chunk(struct output_file *out, unsigned int len, uint32_t fill_val) { chunk_header_t chunk_header; - int rnd_up_len, zero_len, count; + int rnd_up_len, count; int ret; - unsigned int i; /* Round up the fill length to a multiple of the block size */ rnd_up_len = ALIGN(len, out->block_size); @@ -535,8 +534,6 @@ static struct sparse_file_ops normal_file_ops = { void output_file_close(struct output_file *out) { - int ret; - out->sparse_ops->write_end_chunk(out); out->ops->close(out); } @@ -631,8 +628,8 @@ static struct output_file *output_file_new_normal(void) } struct output_file *output_file_open_callback(int (*write)(void *, const void *, int), - void *priv, unsigned int block_size, int64_t len, int gz, int sparse, - int chunks, int crc) + void *priv, unsigned int block_size, int64_t len, + int gz __unused, int sparse, int chunks, int crc) { int ret; struct output_file_callback *outc; |