diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-06-29 21:07:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-06-29 21:07:41 +0200 |
commit | 1cfc2614ddffee45f8f76e03d401b3d1dce6d6b2 (patch) | |
tree | 9b845d9d99dec5216604f06926d8757b869fe1d4 /firmware | |
parent | a9bca48914abf4a16fccfbf223810c0918c2a200 (diff) |
apps/dfu/main.c: Avoid variable declaration in for loop initial
This fixes the following compile error:
apps/dfu/main.c:73:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (unsigned int i=0; i<len; i++) {
^
apps/dfu/main.c:73:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
which was recently introduced in b73f0a00bc8d5cbce0ada6dfd8416677de28be4c
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/apps/dfu/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 578f2f2..3d55fdc 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -31,6 +31,7 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset, uint8_t *data, unsigned int len) { uint32_t addr; + unsigned int i; int rc; /* address of the last allocated variable on the stack */ uint32_t stack_addr = (uint32_t)&rc; @@ -70,7 +71,7 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset, /* FIXME: set error codes */ return DFU_RET_STALL; } - for (unsigned int i=0; i<len; i++) { + for (i = 0; i < len; i++) { if (((uint8_t*)addr)[i]!=data[i]) { TRACE_ERROR("DFU download flash data written not correct\n\r"); return DFU_RET_STALL; |