Skip to content
Snippets Groups Projects
Unverified Commit 3137622e authored by Alexander Couzens's avatar Alexander Couzens
Browse files

firmware-utils: tplink-safeloader: compile as gnu99


Also fix minor coding style issue and one redeclaration.

Signed-off-by: default avatarAlexander Couzens <lynxis@fe80.eu>
parent 677d8df9
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ define Host/Compile ...@@ -42,7 +42,7 @@ define Host/Compile
$(call cc,mkplanexfw sha1) $(call cc,mkplanexfw sha1)
$(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline) $(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline)
$(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline) $(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline)
$(call cc,tplink-safeloader md5, -Wall) $(call cc,tplink-safeloader md5, -Wall --std=gnu99)
$(call cc,pc1crypt) $(call cc,pc1crypt)
$(call cc,osbridge-crc) $(call cc,osbridge-crc)
$(call cc,wrt400n cyg_crc32) $(call cc,wrt400n cyg_crc32)
......
...@@ -1417,8 +1417,9 @@ static int add_flash_partition( ...@@ -1417,8 +1417,9 @@ static int add_flash_partition(
unsigned long base, unsigned long base,
unsigned long size) unsigned long size)
{ {
int ptr;
/* check if the list has a free entry */ /* check if the list has a free entry */
for (int ptr=0; ptr<max_entries; ptr++, part_list++) { for (ptr = 0; ptr < max_entries; ptr++, part_list++) {
if (part_list->name == NULL && if (part_list->name == NULL &&
part_list->base == 0 && part_list->base == 0 &&
part_list->size == 0) part_list->size == 0)
...@@ -1494,7 +1495,7 @@ static int read_partition_table( ...@@ -1494,7 +1495,7 @@ static int read_partition_table(
break; break;
} }
for (int i=0; i<=4; i++) { for (int i = 0; i <= 4; i++) {
if (end_part <= ptr) if (end_part <= ptr)
break; break;
...@@ -1620,7 +1621,7 @@ static int extract_firmware(const char *input, const char *output_directory) ...@@ -1620,7 +1621,7 @@ static int extract_firmware(const char *input, const char *output_directory)
error(1, 0, "Error can not read the partition table (fwup-ptn)"); error(1, 0, "Error can not read the partition table (fwup-ptn)");
} }
for (int i=0; i<max_entries; i++) { for (int i = 0; i < max_entries; i++) {
if (entries[i].name == NULL && if (entries[i].name == NULL &&
entries[i].base == 0 && entries[i].base == 0 &&
entries[i].size == 0) entries[i].size == 0)
...@@ -1636,7 +1637,7 @@ static struct flash_partition_entry *find_partition( ...@@ -1636,7 +1637,7 @@ static struct flash_partition_entry *find_partition(
struct flash_partition_entry *entries, size_t max_entries, struct flash_partition_entry *entries, size_t max_entries,
const char *name, const char *error_msg) const char *name, const char *error_msg)
{ {
for (int i=0; i<max_entries; i++, entries++) { for (int i = 0; i < max_entries; i++, entries++) {
if (strcmp(entries->name, name) == 0) if (strcmp(entries->name, name) == 0)
return entries; return entries;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment