acc.c: Don't use C99 constructs, this breaks builds on Debian 8

[  160s] acc.c: In function 'get_highest_allowed_acc':
[  160s] acc.c:117:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 9; i >= 0; i--) {
[  160s]   ^
[  160s] acc.c:117:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
[  160s] acc.c: In function 'get_lowest_allowed_acc':
[  160s] acc.c:127:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 0; i < 10; i++) {
[  160s]   ^
[  160s] Makefile:617: recipe for target 'acc.o' failed

Change-Id: I03722854634b2d6d6f1abac7c7553762b5fc6890
This commit is contained in:
Harald Welte 2020-07-30 10:40:24 +02:00
parent 981a7cc6a9
commit c4b25704f5
1 changed files with 6 additions and 2 deletions

View File

@ -114,7 +114,9 @@ static void acc_mgr_gen_subset(struct acc_mgr *acc_mgr, bool update_si)
static uint8_t get_highest_allowed_acc(uint16_t mask)
{
for (int i = 9; i >= 0; i--) {
int i;
for (i = 9; i >= 0; i--) {
if (mask & (1 << i))
return i;
}
@ -124,7 +126,9 @@ static uint8_t get_highest_allowed_acc(uint16_t mask)
static uint8_t get_lowest_allowed_acc(uint16_t mask)
{
for (int i = 0; i < 10; i++) {
int i;
for (i = 0; i < 10; i++) {
if (mask & (1 << i))
return i;
}