Remove warnings
Remove warnings called by duplicate definition of ALIGN macro.
Note that bionic/libc/include/sys/param.h defines ALIGN as
#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) &~ ALIGNBYTES)
which is not good - clashes with every other definition of ALIGN.
Change-Id: I2d716c41ededd2fa072f944e21d94a0c93ca9c46
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c
index 80e5692..4aa287f 100644
--- a/ext4_utils/contents.c
+++ b/ext4_utils/contents.c
@@ -45,7 +45,7 @@
unsigned int dentry_len;
for (i = 0; i < entries; i++) {
- dentry_len = 8 + ALIGN(strlen(dentries[i].filename), 4);
+ dentry_len = 8 + EXT4_ALIGN(strlen(dentries[i].filename), 4);
if (len % info.block_size + dentry_len > info.block_size)
len += info.block_size - (len % info.block_size);
len += dentry_len;
@@ -59,7 +59,7 @@
u8 file_type)
{
u8 name_len = strlen(name);
- u16 rec_len = 8 + ALIGN(name_len, 4);
+ u16 rec_len = 8 + EXT4_ALIGN(name_len, 4);
struct ext4_dir_entry_2 *dentry;
u32 start_block = *offset / info.block_size;
diff --git a/ext4_utils/ext4.h b/ext4_utils/ext4.h
index 68b5233..ac6f97e 100644
--- a/ext4_utils/ext4.h
+++ b/ext4_utils/ext4.h
@@ -98,7 +98,7 @@
#define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
#define EXT4_INODE_SIZE(s) (((s)->s_rev_level == EXT4_GOOD_OLD_REV) ? EXT4_GOOD_OLD_INODE_SIZE : (s)->s_inode_size)
#define EXT4_FIRST_INO(s) (((s)->s_rev_level == EXT4_GOOD_OLD_REV) ? EXT4_GOOD_OLD_FIRST_INO : (s)->s_first_ino)
-#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
+#define EXT4_BLOCK_ALIGN(size, blkbits) EXT4_ALIGN((size), (1 << (blkbits)))
struct ext4_group_desc
{
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index f87a0de..5ddc839 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -62,7 +62,7 @@
#endif
#define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y))
-#define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y)))
+#define EXT4_ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y)))
/* XXX */
#define cpu_to_le32(x) (x)
diff --git a/ext4_utils/ext4fixup.c b/ext4_utils/ext4fixup.c
index 0e51765..184cd0d 100644
--- a/ext4_utils/ext4fixup.c
+++ b/ext4_utils/ext4fixup.c
@@ -739,7 +739,7 @@
#endif
/* Compute what the new value of inodes_per_blockgroup will be when we're done */
- new_inodes_per_group=ALIGN(info.inodes_per_group,(info.block_size/info.inode_size));
+ new_inodes_per_group=EXT4_ALIGN(info.inodes_per_group,(info.block_size/info.inode_size));
read_inode(fd, EXT4_ROOT_INO, &root_inode);
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 1c25457..d8d2e11 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -334,7 +334,7 @@
u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);
u32 inodes = DIV_ROUND_UP(info.inodes, block_groups);
- inodes = ALIGN(inodes, (info.block_size / info.inode_size));
+ inodes = EXT4_ALIGN(inodes, (info.block_size / info.inode_size));
/* After properly rounding up the number of inodes/group,
* make sure to update the total inodes field in the info struct.