summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-04-30 15:44:10 -0500
committerMark Salyzyn2014-05-05 12:30:04 -0500
commitcc209517e45346ea30d88ce9274dbb6ff1649914 (patch)
treefab1f39d679b4499004da733954d079afdb4237d /mkbootimg
parent1c00d46b2566e91be9268812dbb5d3abfea3c3a2 (diff)
downloadplatform-system-core-cc209517e45346ea30d88ce9274dbb6ff1649914.tar.gz
platform-system-core-cc209517e45346ea30d88ce9274dbb6ff1649914.tar.xz
platform-system-core-cc209517e45346ea30d88ce9274dbb6ff1649914.zip
mkbootimg: turn on -Werror
- Deal with signedness issues Change-Id: I61211165eb4ce0fa9a2edeebb3f97fb0ffc62d34
Diffstat (limited to 'mkbootimg')
-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)
4 4
5LOCAL_SRC_FILES := mkbootimg.c 5LOCAL_SRC_FILES := mkbootimg.c
6LOCAL_STATIC_LIBRARIES := libmincrypt 6LOCAL_STATIC_LIBRARIES := libmincrypt
7LOCAL_CFLAGS := -Werror
7 8
8LOCAL_MODULE := mkbootimg 9LOCAL_MODULE := mkbootimg
9 10
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, };
77int write_padding(int fd, unsigned pagesize, unsigned itemsize) 77int write_padding(int fd, unsigned pagesize, unsigned itemsize)
78{ 78{
79 unsigned pagemask = pagesize - 1; 79 unsigned pagemask = pagesize - 1;
80 unsigned count; 80 ssize_t count;
81 81
82 if((itemsize & pagemask) == 0) { 82 if((itemsize & pagemask) == 0) {
83 return 0; 83 return 0;
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
108 unsigned pagesize = 2048; 108 unsigned pagesize = 2048;
109 int fd; 109 int fd;
110 SHA_CTX ctx; 110 SHA_CTX ctx;
111 uint8_t* sha; 111 const uint8_t* sha;
112 unsigned base = 0x10000000; 112 unsigned base = 0x10000000;
113 unsigned kernel_offset = 0x00008000; 113 unsigned kernel_offset = 0x00008000;
114 unsigned ramdisk_offset = 0x01000000; 114 unsigned ramdisk_offset = 0x01000000;
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
189 return usage(); 189 return usage();
190 } 190 }
191 191
192 strcpy(hdr.name, board); 192 strcpy((char *) hdr.name, board);
193 193
194 memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE); 194 memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE);
195 195
@@ -255,14 +255,14 @@ int main(int argc, char **argv)
255 if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail; 255 if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail;
256 if(write_padding(fd, pagesize, sizeof(hdr))) goto fail; 256 if(write_padding(fd, pagesize, sizeof(hdr))) goto fail;
257 257
258 if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail; 258 if(write(fd, kernel_data, hdr.kernel_size) != (ssize_t) hdr.kernel_size) goto fail;
259 if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail; 259 if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail;
260 260
261 if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail; 261 if(write(fd, ramdisk_data, hdr.ramdisk_size) != (ssize_t) hdr.ramdisk_size) goto fail;
262 if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail; 262 if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
263 263
264 if(second_data) { 264 if(second_data) {
265 if(write(fd, second_data, hdr.second_size) != hdr.second_size) goto fail; 265 if(write(fd, second_data, hdr.second_size) != (ssize_t) hdr.second_size) goto fail;
266 if(write_padding(fd, pagesize, hdr.second_size)) goto fail; 266 if(write_padding(fd, pagesize, hdr.second_size)) goto fail;
267 } 267 }
268 268