Loading libsparse/defs.h 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LIBSPARSE_DEFS_H_ #ifndef __unused #define __unused __attribute__((__unused__)) #endif #endif /* _LIBSPARSE_DEFS_H_ */ libsparse/output_file.c +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <unistd.h> #include <zlib.h> #include "defs.h" #include "output_file.h" #include "sparse_format.h" #include "sparse_crc32.h" Loading Loading @@ -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; } Loading @@ -287,7 +288,7 @@ 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; } Loading Loading @@ -631,8 +632,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; Loading libsparse/sparse.c +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <sparse/sparse.h> #include "defs.h" #include "sparse_file.h" #include "output_file.h" Loading Loading @@ -189,7 +190,7 @@ int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc, return ret; } static int out_counter_write(void *priv, const void *data, int len) static int out_counter_write(void *priv, const void *data __unused, int len) { int64_t *count = priv; *count += len; Loading libsparse/sparse_read.c +4 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ #include <sparse/sparse.h> #include "defs.h" #include "output_file.h" #include "sparse_crc32.h" #include "sparse_file.h" #include "sparse_format.h" Loading Loading @@ -175,7 +177,8 @@ static int process_fill_chunk(struct sparse_file *s, unsigned int chunk_size, } static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size, int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) int fd __unused, unsigned int blocks, unsigned int block __unused, uint32_t *crc32) { int ret; int chunk; Loading Loading
libsparse/defs.h 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LIBSPARSE_DEFS_H_ #ifndef __unused #define __unused __attribute__((__unused__)) #endif #endif /* _LIBSPARSE_DEFS_H_ */
libsparse/output_file.c +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <unistd.h> #include <zlib.h> #include "defs.h" #include "output_file.h" #include "sparse_format.h" #include "sparse_crc32.h" Loading Loading @@ -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; } Loading @@ -287,7 +288,7 @@ 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; } Loading Loading @@ -631,8 +632,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; Loading
libsparse/sparse.c +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <sparse/sparse.h> #include "defs.h" #include "sparse_file.h" #include "output_file.h" Loading Loading @@ -189,7 +190,7 @@ int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc, return ret; } static int out_counter_write(void *priv, const void *data, int len) static int out_counter_write(void *priv, const void *data __unused, int len) { int64_t *count = priv; *count += len; Loading
libsparse/sparse_read.c +4 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ #include <sparse/sparse.h> #include "defs.h" #include "output_file.h" #include "sparse_crc32.h" #include "sparse_file.h" #include "sparse_format.h" Loading Loading @@ -175,7 +177,8 @@ static int process_fill_chunk(struct sparse_file *s, unsigned int chunk_size, } static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size, int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) int fd __unused, unsigned int blocks, unsigned int block __unused, uint32_t *crc32) { int ret; int chunk; Loading