Skip to content

Commit

Permalink
fixed silly warnings due to -Wall
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrandou committed Jul 20, 2011
1 parent 6a7ce6c commit 4f8acfd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions abootimg.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ enum command parse_args(int argc, char** argv, t_abootimg* img)
return none;

switch(cmd) {
case none:
case help:
break;

case info:
if (argc != 3)
return none;
Expand Down Expand Up @@ -275,7 +279,7 @@ enum command parse_args(int argc, char** argv, t_abootimg* img)

int check_boot_img_header(t_abootimg* img)
{
if (strncmp(img->header.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
if (strncmp((char*)(img->header.magic), BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
fprintf(stderr, "%s: no Android Magic Value\n", img->fname);
return 1;
}
Expand Down Expand Up @@ -421,10 +425,10 @@ void update_header_entry(t_abootimg* img, char* cmd)
if (len >= BOOT_ARGS_SIZE)
abort_printf("cmdline length (%d) is too long (max %d)", len, BOOT_ARGS_SIZE-1);
memset(img->header.cmdline, 0, BOOT_ARGS_SIZE);
strcpy(img->header.cmdline, value);
strcpy((char*)(img->header.cmdline), value);
}
else if (!strncmp(token, "name", 4)) {
strncpy(img->header.name, value, BOOT_NAME_SIZE);
strncpy((char*)(img->header.name), value, BOOT_NAME_SIZE);
img->header.name[BOOT_NAME_SIZE-1] = '\0';
}
else if (!strncmp(token, "bootsize", 8)) {
Expand Down Expand Up @@ -640,9 +644,7 @@ void write_bootimg(t_abootimg* img)

unsigned n = (img->header.kernel_size + psize - 1) / psize;
unsigned m = (img->header.ramdisk_size + psize - 1) / psize;
unsigned o = (img->header.second_size + psize - 1) / psize;
unsigned total_pages = 1+n+m+o;
unsigned bootimg_pages = img->size/psize;
//unsigned o = (img->header.second_size + psize - 1) / psize;

if (fseek(img->stream, 0, SEEK_SET))
abort_perror(img->fname);
Expand Down

0 comments on commit 4f8acfd

Please sign in to comment.