diff options
author | Harald Welte <laforge@osmocom.org> | 2020-07-30 10:40:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-07-30 10:40:24 +0200 |
commit | c4b25704f5147cd852403c7ed410023efcb1b152 (patch) | |
tree | f743ce105ef77a57e89efafd33ec2ec31327e119 /src | |
parent | 981a7cc6a955e57c35c545903e77793c0a5c58f8 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/acc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c index b25f2fdc3..72b4591ee 100644 --- a/src/osmo-bsc/acc.c +++ b/src/osmo-bsc/acc.c @@ -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; } |