summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkbootimg/Android.mk1
-rw-r--r--mkbootimg/mkbootimg.c12
2 files changed, 7 insertions, 6 deletions
diff --git a/mkbootimg/Android.mk b/mkbootimg/Android.mk
index 2a97c26e1..0c9b0c657 100644
--- a/mkbootimg/Android.mk
+++ b/mkbootimg/Android.mk
@@ -4,6 +4,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := mkbootimg.c
LOCAL_STATIC_LIBRARIES := libmincrypt
+LOCAL_CFLAGS := -Werror
LOCAL_MODULE := mkbootimg
diff --git a/mkbootimg/mkbootimg.c b/mkbootimg/mkbootimg.c
index a7daccc21..fc92b4dc3 100644
--- a/mkbootimg/mkbootimg.c
+++ b/mkbootimg/mkbootimg.c
@@ -77,7 +77,7 @@ static unsigned char padding[16384] = { 0, };
int write_padding(int fd, unsigned pagesize, unsigned itemsize)
{
unsigned pagemask = pagesize - 1;
- unsigned count;
+ ssize_t count;
if((itemsize & pagemask) == 0) {
return 0;
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
unsigned pagesize = 2048;
int fd;
SHA_CTX ctx;
- uint8_t* sha;
+ const uint8_t* sha;
unsigned base = 0x10000000;
unsigned kernel_offset = 0x00008000;
unsigned ramdisk_offset = 0x01000000;
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
return usage();
}
- strcpy(hdr.name, board);
+ strcpy((char *) hdr.name, board);
memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE);
@@ -255,14 +255,14 @@ int main(int argc, char **argv)
if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail;
if(write_padding(fd, pagesize, sizeof(hdr))) goto fail;
- if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail;
+ if(write(fd, kernel_data, hdr.kernel_size) != (ssize_t) hdr.kernel_size) goto fail;
if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail;
- if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail;
+ if(write(fd, ramdisk_data, hdr.ramdisk_size) != (ssize_t) hdr.ramdisk_size) goto fail;
if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
if(second_data) {
- if(write(fd, second_data, hdr.second_size) != hdr.second_size) goto fail;
+ if(write(fd, second_data, hdr.second_size) != (ssize_t) hdr.second_size) goto fail;
if(write_padding(fd, pagesize, hdr.second_size)) goto fail;
}