resolve compile errors
authorJan Altensen <info@stricted.net>
Mon, 21 Jun 2021 22:03:21 +0000 (00:03 +0200)
committerJan Altensen <info@stricted.net>
Mon, 21 Jun 2021 22:03:21 +0000 (00:03 +0200)
Change-Id: If4db9a27ea4da98ca95f07d90ce54ec415d63dcb

amlImage.cpp
sha1.c
sparse_format.cpp

index 7a1b13bb7f1d97012012ea70e1b8b82e648d0f2f..eb8acf3246bc65863812887567e43f40593f3708 100644 (file)
@@ -316,7 +316,7 @@ static int image_get_item_count(HIMAGE hImage,const char* mainType)
 static int image_get_next_item(HIMAGE hImage,unsigned int iItem, char* maintype, char* subtype)
 {
        FILE* fp = (FILE*)hImage;
-       unsigned int nItem = 0;
+
        if(ImageDecoder->AmlFirmwareImg->crc==0){
                memset(ImageDecoder->AmlFirmwareImg,0,sizeof(AmlFirmwareImg_t));
                fseeko(fp,0,SEEK_SET);
@@ -358,7 +358,7 @@ static int image_get_next_item(HIMAGE hImage,unsigned int iItem, char* maintype,
 #define MTYPE_TAG       "main_type="
 #define STYPE_TAG       "sub_type="
 
-static int  image_cfg_parse(char *data,int length)
+static int  image_cfg_parse(char *data,int length __attribute__((__unused__)))
 {
        int ret = 0;
 
@@ -510,9 +510,6 @@ static int image_check_files(const char* src_dir)
 static const ItemInfo* previous_duplicated_item_id(const FileList* headFileList, const FileList* const curFileList, 
         const ItemInfo* headItemInfo, const ItemInfo* curItemInfo)
 {
-    int itemId = -1;
-    int i = 0;
-
     for(;headFileList != curFileList && headFileList->next; headFileList = headFileList->next)
     {
         int rc = strcmp(curFileList->name, headFileList->name);
@@ -794,7 +791,6 @@ int image_unpack(const char* imagefile,const char *outpath)
        char sub_type[32] = {0};
        char outfile[512] = {0};
        char cfgfile[128] = {0};
-       char buff[256] = {0};
        
        #ifdef BUILD_DLL
        if(ImageDecoder->AmlFirmwareImg == NULL){
@@ -988,10 +984,7 @@ static const char * const usage = "%s usage:\n\
 int main(int argc, char * const* argv)
 {
        int ret = 0;
-       int c = 0;
-       const char* optstring = "d:r:c:";
 
-       
        if(argc < 3||argc > 5) {
                printf("invalid arguments argc==%d\n", argc);
                fprintf(stderr,usage,argv[0],argv[0],argv[0],argv[0]);
diff --git a/sha1.c b/sha1.c
index c148be268238cd78e1ea0d98fedab0b3a5dc7572..b6dee1aeefad508360f38ed2957ec8f75544feaf 100644 (file)
--- a/sha1.c
+++ b/sha1.c
@@ -312,7 +312,7 @@ void sha1_csum (unsigned char *input, int ilen, unsigned char output[20])
  * bytes of input processed.
  */
 void sha1_csum_wd (unsigned char *input, int ilen, unsigned char output[20],
-                       unsigned int chunk_sz)
+                       unsigned int chunk_sz __attribute__((__unused__)))
 {
        sha1_context ctx;
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
index b2fa09830f495da91126409d69f5e0eee4799cee..c3e32e7ef4465de36a8b3d4637bab8e71b648ecc 100644 (file)
@@ -15,7 +15,7 @@ int optimus_simg_probe(const char* source, const __u32 length)
        sparse_header_t *header = (sparse_header_t*) source;
 
     if(length < sizeof(sparse_header_t)) {
-       fprintf(stderr,"length %d < sparse_header_t len %d\n", length, FILE_HEAD_SIZE);
+       fprintf(stderr,"length %d < sparse_header_t len %lu\n", length, FILE_HEAD_SIZE);
         return 0;
     }
        if (header->magic != SPARSE_HEADER_MAGIC) {
@@ -27,7 +27,7 @@ int optimus_simg_probe(const char* source, const __u32 length)
                 && FILE_HEAD_SIZE == header->file_hdr_sz
                 && CHUNK_HEAD_SIZE == header->chunk_hdr_sz))
     {
-        fprintf(stderr,"want 0x [%x, %x, %x], but [%x, %x, %x]\n",
+        fprintf(stderr,"want 0x [%x, %lx, %lx], but [%x, %x, %x]\n",
                 SPARSE_HEADER_MAJOR_VER,    FILE_HEAD_SIZE,             CHUNK_HEAD_SIZE,
                 header->major_version,      header->file_hdr_sz,        header->chunk_hdr_sz);
         return 0;