am db32e788: am a2b03c4a: Merge "libsparse: turn on -Werror"

* commit 'db32e7889049150c965fe9103400299c9256acf1':
  libsparse: turn on -Werror
This commit is contained in:
Mark Salyzyn 2014-05-08 20:36:34 +00:00 committed by Android Git Automerger
commit d4d0963701
5 changed files with 14 additions and 19 deletions

View file

@ -17,6 +17,7 @@ LOCAL_SRC_FILES := $(libsparse_src_files)
LOCAL_MODULE := libsparse_host
LOCAL_STATIC_LIBRARIES := libz
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include external/zlib
LOCAL_CFLAGS := -Werror
include $(BUILD_HOST_STATIC_LIBRARY)
@ -27,6 +28,7 @@ LOCAL_MODULE := libsparse
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include external/zlib
LOCAL_SHARED_LIBRARIES := \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_SHARED_LIBRARY)
@ -36,6 +38,7 @@ LOCAL_SRC_FILES := $(libsparse_src_files)
LOCAL_MODULE := libsparse_static
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include external/zlib
LOCAL_STATIC_LIBRARIES := libz
LOCAL_CFLAGS := -Werror
include $(BUILD_STATIC_LIBRARY)
@ -48,6 +51,7 @@ LOCAL_MODULE_STEM := simg2img
LOCAL_STATIC_LIBRARIES := \
libsparse_host \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_HOST_EXECUTABLE)
@ -58,6 +62,7 @@ LOCAL_MODULE := simg2img
LOCAL_STATIC_LIBRARIES := \
libsparse_static \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE)
@ -69,6 +74,7 @@ LOCAL_MODULE_STEM := img2simg
LOCAL_STATIC_LIBRARIES := \
libsparse_host \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_HOST_EXECUTABLE)
@ -78,6 +84,7 @@ LOCAL_MODULE := img2simg
LOCAL_STATIC_LIBRARIES := \
libsparse_static \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE)
@ -87,6 +94,7 @@ LOCAL_MODULE := simg2simg
LOCAL_STATIC_LIBRARIES := \
libsparse_host \
libz
LOCAL_CFLAGS := -Werror
include $(BUILD_HOST_EXECUTABLE)
@ -95,5 +103,5 @@ LOCAL_MODULE := simg_dump.py
LOCAL_SRC_FILES := simg_dump.py
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_IS_HOST_MODULE := true
LOCAL_CFLAGS := -Werror
include $(BUILD_PREBUILT)

View file

@ -47,7 +47,6 @@ int main(int argc, char *argv[])
{
int in;
int out;
unsigned int i;
int ret;
struct sparse_file *s;
unsigned int block_size = 4096;

View file

@ -31,8 +31,8 @@
#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>
@ -295,7 +295,6 @@ static int callback_file_pad(struct output_file *out __unused, int64_t len __unu
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);
@ -341,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",
@ -368,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);
@ -536,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);
}

View file

@ -279,7 +279,6 @@ int sparse_file_resparse(struct sparse_file *in_s, unsigned int max_len,
struct sparse_file **out_s, int out_s_count)
{
struct backed_block *bb;
unsigned int overhead;
struct sparse_file *s;
struct sparse_file *tmp;
int c = 0;

View file

@ -180,22 +180,16 @@ static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size,
int fd __unused, unsigned int blocks,
unsigned int block __unused, uint32_t *crc32)
{
int ret;
int chunk;
int64_t len = (int64_t)blocks * s->block_size;
uint32_t fill_val;
uint32_t *fillbuf;
unsigned int i;
if (chunk_size != 0) {
return -EINVAL;
}
if (crc32) {
int64_t len = (int64_t)blocks * s->block_size;
memset(copybuf, 0, COPY_BUF_SIZE);
while (len) {
chunk = min(len, COPY_BUF_SIZE);
int chunk = min(len, COPY_BUF_SIZE);
*crc32 = sparse_crc32(*crc32, copybuf, chunk);
len -= chunk;
}
@ -367,7 +361,6 @@ static int sparse_file_read_normal(struct sparse_file *s, int fd)
int64_t remain = s->len;
int64_t offset = 0;
unsigned int to_read;
char *ptr;
unsigned int i;
bool sparse_block;