firmware-utils: fix few random warnings
authorRafał Miłecki <rafal@milecki.pl>
Fri, 9 Apr 2021 06:52:03 +0000 (08:52 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Fri, 9 Apr 2021 08:46:15 +0000 (10:46 +0200)
1. -Wunused-label
2. -Wparentheses
3. -Wmisleading-indentation
4. -Wformat-overflow

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
tools/firmware-utils/src/dgn3500sum.c
tools/firmware-utils/src/mkdniimg.c
tools/firmware-utils/src/mkmylofw.c
tools/firmware-utils/src/mkplanexfw.c
tools/firmware-utils/src/mktitanimg.c
tools/firmware-utils/src/osbridge-crc.c
tools/firmware-utils/src/pc1crypt.c

index eb80e6c01b0329b955e339beb58f60bd16c720ba..e86621bc1fde34bec311233cddc8f13f95b0ce7c 100644 (file)
@@ -104,7 +104,7 @@ int main(int argc, char** argv)
   char *endptr, *buffer, *p;
   int count;  // size of file in bytes
   unsigned short sum = 0, sum1 = 0;
-  char sumbuf[9];
+  char sumbuf[8 + 8 + 1];
 
   if(argc < 3) {
     printf("ERROR: Argument missing!\n\nUsage %s filename starting offset in hex [PID code]\n\n", argv[0]);
index 9111d3434b320983c82516968e05e11974f1fb74..92315f98497846fd740c33bde0e1e986742a67d3 100644 (file)
@@ -187,7 +187,6 @@ int main(int argc, char *argv[])
 
        res = EXIT_SUCCESS;
 
- out_flush:
        fflush(outfile);
 
  err_close_out:
index 3ad743420f831abf770cb9f0f0c1ef9fc5c9aee1..c049ce436e2ec36f1e3e5144dc1992d26cbd1ac9 100644 (file)
@@ -98,7 +98,7 @@ struct cpx_board {
 #define CPX_BOARD_AR23XX(_did, _flash, _mod, _name, _desc) \
        CPX_BOARD(_did, _flash, _mod, _name, _desc, 0x10000, 0x10000)
 
-#define ALIGN(x,y)     ((x)+((y)-1)) & ~((y)-1)
+#define ALIGN(x,y)     (((x)+((y)-1)) & ~((y)-1))
 
 char   *progname;
 char   *ofname = NULL;
index 52145e63d6252747f6c798ce04ffc5710ecf258e..0230fe22528e1763c248bb432ed7d46984392337 100644 (file)
@@ -247,7 +247,6 @@ int main(int argc, char *argv[])
 
        res = EXIT_SUCCESS;
 
- out_flush:
        fflush(outfile);
 
  err_close_out:
index 6f2b27a1f6c2af5bd5e0924ff35f4c072d46c932..acc21bd64d1d38959a82ace0f06017eee35cd405 100644 (file)
@@ -284,7 +284,7 @@ int main(int argc, char* argv[], char* env[])
                        else
                                padding = align - ((section->raw_size+ section->offset) % align);
 
-                               section->total_size=section->raw_size + padding;
+                       section->total_size=section->raw_size + padding;
                }
                else{
                        #define EXTRA_BLOCK 0x10000
index 519dd5f698233d1f4176040bf51213f234feb6f2..46ea855ec11ebe0b2606eff61a7d8ddda0ece289 100644 (file)
@@ -163,7 +163,6 @@ int main(int argc, char *argv[])
 
        res = EXIT_SUCCESS;
 
- out_flush:
        fflush(outfile);
 
  err_close_out:
index 87f125a2323bb99b80154dddc00061e268d74508..5eb6e01d4a51b4ab3fae56b3049a6efaadb3bcc2 100644 (file)
@@ -339,7 +339,6 @@ int main(int argc, char *argv[])
 
        res = EXIT_SUCCESS;
 
- out_flush:
        fflush(outfile);
 
  err_close_out: