termux-packages/packages/abootimg/0001-fixed-silly-warnings-d...

61 lines
2.0 KiB
Diff

From 4f8acfd12826037a8dbb183336922bdb9a1d6636 Mon Sep 17 00:00:00 2001
From: Gilles Grandou <gilles@grandou.net>
Date: Thu, 21 Jul 2011 01:21:34 +0200
Subject: [PATCH 1/3] fixed silly warnings due to -Wall
---
abootimg.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/abootimg.c b/abootimg.c
index 464522f6a082..a55c5c84b160 100644
--- a/abootimg.c
+++ b/abootimg.c
@@ -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;
@@ -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;
}
@@ -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)) {
@@ -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);
--
2.38.1