OSDN Git Service

Revert "ext4_utils: -Werror"
authorColin Cross <ccross@android.com>
Fri, 30 Sep 2016 01:01:50 +0000 (01:01 +0000)
committerColin Cross <ccross@android.com>
Fri, 30 Sep 2016 01:01:50 +0000 (01:01 +0000)
This reverts commit f55303f4a4a4319e90e671b50a4dcdd131781f35.

Change-Id: I63b6c158536871534cfee9b3fbe416f121d7b75a

ext4_utils/Android.mk
ext4_utils/allocate.c
ext4_utils/make_ext4fs.c

index ee07b69..a8362b2 100644 (file)
@@ -23,7 +23,7 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := $(libext4_utils_src_files)
 LOCAL_MODULE := libext4_utils_host
 # Various instances of dereferencing a type-punned pointer in extent.c
-LOCAL_CFLAGS += -fno-strict-aliasing -Werror
+LOCAL_CFLAGS += -fno-strict-aliasing
 LOCAL_STATIC_LIBRARIES := \
     libsparse_host \
     libz
@@ -44,7 +44,7 @@ LOCAL_STATIC_LIBRARIES += \
 LOCAL_LDLIBS_windows += -lws2_32
 LOCAL_SHARED_LIBRARIES_darwin += libselinux
 LOCAL_SHARED_LIBRARIES_linux += libselinux
-LOCAL_CFLAGS_darwin := -DHOST -Werror
+LOCAL_CFLAGS_darwin := -DHOST
 LOCAL_CFLAGS_linux := -DHOST
 include $(BUILD_HOST_EXECUTABLE)
 
@@ -52,7 +52,6 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := blk_alloc_to_base_fs.c
 LOCAL_MODULE := blk_alloc_to_base_fs
 LOCAL_SHARED_LIBRARIES += libcutils
-LOCAL_CFLAGS := -Werror
 LOCAL_CFLAGS_darwin := -DHOST
 LOCAL_CFLAGS_linux := -DHOST
 include $(BUILD_HOST_EXECUTABLE)
@@ -72,7 +71,7 @@ LOCAL_SRC_FILES := $(libext4_utils_src_files)
 LOCAL_MODULE := libext4_utils
 LOCAL_C_INCLUDES += system/core/logwrapper/include
 # Various instances of dereferencing a type-punned pointer in extent.c
-LOCAL_CFLAGS += -fno-strict-aliasing -Werror
+LOCAL_CFLAGS += -fno-strict-aliasing
 LOCAL_SHARED_LIBRARIES := \
     libbase \
     libcutils \
@@ -89,7 +88,7 @@ LOCAL_SRC_FILES := $(libext4_utils_src_files) \
     ext4_crypt_init_extensions.cpp
 LOCAL_MODULE := libext4_utils_static
 # Various instances of dereferencing a type-punned pointer in extent.c
-LOCAL_CFLAGS += -fno-strict-aliasing -Werror
+LOCAL_CFLAGS += -fno-strict-aliasing
 LOCAL_STATIC_LIBRARIES := \
     libbase \
     liblogwrap \
@@ -108,7 +107,7 @@ LOCAL_SHARED_LIBRARIES := \
     libext4_utils \
     libselinux \
     libz
-LOCAL_CFLAGS := -DREAL_UUID -Werror
+LOCAL_CFLAGS := -DREAL_UUID
 include $(BUILD_EXECUTABLE)
 
 
@@ -120,7 +119,6 @@ LOCAL_SHARED_LIBRARIES += \
     libselinux \
     libsparse \
     libz
-LOCAL_CFLAGS := -Werror
 include $(BUILD_EXECUTABLE)
 
 
@@ -133,7 +131,6 @@ LOCAL_STATIC_LIBRARIES += \
     libext4_utils_host \
     libsparse_host \
     libz
-LOCAL_CFLAGS := -Werror
 include $(BUILD_HOST_EXECUTABLE)
 
 
@@ -141,7 +138,6 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := setup_fs.c
 LOCAL_MODULE := setup_fs
 LOCAL_SHARED_LIBRARIES += libcutils
-LOCAL_CFLAGS := -Werror
 include $(BUILD_EXECUTABLE)
 
 
@@ -152,7 +148,6 @@ LOCAL_SHARED_LIBRARIES += \
     libext4_utils \
     libsparse \
     libz
-LOCAL_CFLAGS := -Werror
 include $(BUILD_EXECUTABLE)
 
 
@@ -163,7 +158,6 @@ LOCAL_STATIC_LIBRARIES += \
     libext4_utils_host \
     libsparse_host \
     libz
-LOCAL_CFLAGS := -Werror
 include $(BUILD_HOST_EXECUTABLE)
 
 
index 8b7e8f5..497f580 100644 (file)
@@ -351,8 +351,7 @@ u32 allocate_block()
 
 static struct region *ext4_allocate_best_fit_partial(u32 len)
 {
-       unsigned int i;
-       int j;
+       unsigned int i, j;
        unsigned int found_bg = 0, found_prev_chunk = 0, found_block = 0;
        u32 found_allocate_len = 0;
        bool minimize = false;
index bc8ea3a..f45a699 100644 (file)
@@ -79,9 +79,7 @@
 
 #endif
 
-#ifndef MAX_PATH
 #define MAX_PATH 4096
-#endif
 #define MAX_BLK_MAPPING_STR 1000
 
 const int blk_file_major_ver = 1;
@@ -535,7 +533,7 @@ static int compare_chunks(const void* chunk1, const void* chunk2) {
 }
 
 static int get_block_group(u32 block) {
-       unsigned i, group = 0;
+       int i, group = 0;
        for(i = 0; i < aux_info.groups; i++) {
                if (block >= aux_info.bgs[i].first_block)
                        group = i;
@@ -556,8 +554,7 @@ static void extract_base_fs_allocations(const char *directory, const char *mount
        char stored_file_name[MAX_PATH], real_file_name[MAX_PATH], file_map[MAX_BLK_MAPPING_STR];
        struct block_allocation *fs_alloc;
        struct block_group_info *bgs = aux_info.bgs;
-       unsigned i;
-       int major_version = 0, minor_version = 0;
+       int i, major_version = 0, minor_version = 0;
        char *base_file_line = NULL;
        size_t base_file_line_len = 0;
 
@@ -628,8 +625,8 @@ static void extract_base_fs_allocations(const char *directory, const char *mount
                                }
                                block_range = strtok_r(NULL, ",", &end_string);
                                int bg_first_block = bgs[block_group].first_block;
-                               unsigned min_bg_bound = bgs[block_group].chunks[0].block + bgs[block_group].chunks[0].len;
-                               unsigned max_bg_bound = bgs[block_group].chunks[bgs[block_group].chunk_count - 1].block;
+                               int min_bg_bound = bgs[block_group].chunks[0].block + bgs[block_group].chunks[0].len;
+                               int max_bg_bound = bgs[block_group].chunks[bgs[block_group].chunk_count - 1].block;
 
                                if (min_bg_bound >= start_block - bg_first_block ||
                                        max_bg_bound <= end_block - bg_first_block) {