summaryrefslogtreecommitdiffstats
path: root/src/target/firmware
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-11-21 17:03:19 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-11-21 17:04:10 +0700
commit7c60c5d6d95a059a50c85b68a5128c5cfd55f04c (patch)
tree11857885d792f78443b86aa7a8aeba8d47fa37f7 /src/target/firmware
parentc56247071cc6faf8bcbbb511795d1e39aa87a0de (diff)
firmware/layer1: avoid 'for' loop initial declarations
As was reported by roox, osmocom-bb currently fails to build on OBS: https://build.opensuse.org/build/home:mnhauke:osmocom:nightly/openSUSE_Tumbleweed/x86_64/osmocom-bb/_log [ 24s] layer1/prim_tch.c: In function 'l1s_tch_meas_avg': [ 24s] layer1/prim_tch.c:183:2: error: 'for' loop initial declarations are only allowed in C99 mode [ 24s] layer1/prim_tch.c:183:2: note: use option -std=c99 or -std=gnu99 to compile your code We don't specify the C standard explicitly, so let's move the variable declaration out of the for-loop in l1s_tch_meas_avg(). Change-Id: I6c65fbead4e612c81728e9c6601d5f2107616ee6 Fixes: 7286560a3 "firmware/layer1: fill-in DL info for L1CTL TRAFFIC.ind"
Diffstat (limited to 'src/target/firmware')
-rw-r--r--src/target/firmware/layer1/prim_tch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c
index a33cb58d..1bc842b2 100644
--- a/src/target/firmware/layer1/prim_tch.c
+++ b/src/target/firmware/layer1/prim_tch.c
@@ -179,8 +179,9 @@ static inline void l1s_tch_meas_avg(struct l1ctl_info_dl *dl,
{
uint32_t avg_snr = 0;
int32_t avg_dbm8 = 0;
+ unsigned int i;
- for (unsigned int i = 0; i < meas_num; i++) {
+ for (i = 0; i < meas_num; i++) {
int j = (rx_tch.meas_id + FACCH_MEAS_HIST - i) % FACCH_MEAS_HIST;
avg_snr += rx_tch.meas[j].snr;
avg_dbm8 += rx_tch.meas[j].pm_dbm8;