summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorHannes Ellinger <hannes.ellinger@posteo.de>2016-01-14 12:13:24 +0100
committerHannes Ellinger <hannes.ellinger@posteo.de>2016-01-14 12:13:24 +0100
commitf519a568fa196a63afd9057af76a7414ecaea643 (patch)
tree5af9ba4f4d8715f73c0ae60aa670af4174eff591 /host
parent0ccd3af5c7b614c171090b23a692e5f3d1a70656 (diff)
remove declaration in for loop to support old C standard
Diffstat (limited to 'host')
-rw-r--r--host/libubertooth/src/ubertooth.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/host/libubertooth/src/ubertooth.c b/host/libubertooth/src/ubertooth.c
index c4c9611..2d2cf89 100644
--- a/host/libubertooth/src/ubertooth.c
+++ b/host/libubertooth/src/ubertooth.c
@@ -567,6 +567,7 @@ void cb_afh_monitor(ubertooth_t* ut, void* args)
btbb_piconet* pn = (btbb_piconet*)args;
btbb_packet* pkt = NULL;
uint8_t channel;
+ int i;
static unsigned long last_seen[79] = {0};
static unsigned long counter = 0;
@@ -586,7 +587,7 @@ void cb_afh_monitor(ubertooth_t* ut, void* args)
// printf("channel %d is already used\n", channel);
}
- for(int i=0; i<79; i++) {
+ for(i=0; i<79; i++) {
if((counter - last_seen[i] >= counter_max)) {
if(btbb_piconet_clear_channel_seen(pn, i)) {
printf("- channel %2d is not used any more\n", i);
@@ -606,6 +607,7 @@ void cb_afh_r(ubertooth_t* ut, void* args)
btbb_piconet* pn = (btbb_piconet*)args;
btbb_packet* pkt = NULL;
uint8_t channel;
+ int i;
static unsigned long last_seen[79] = {0};
static unsigned long counter = 0;
@@ -620,7 +622,7 @@ void cb_afh_r(ubertooth_t* ut, void* args)
btbb_piconet_set_channel_seen(pn, channel);
- for(int i=0; i<79; i++) {
+ for(i=0; i<79; i++) {
if((counter - last_seen[i] >= counter_max)) {
btbb_piconet_clear_channel_seen(pn, i);
}
@@ -697,6 +699,7 @@ void rx_afh_r(ubertooth_t* ut, btbb_piconet* pn, int timeout __attribute__((unus
static uint32_t lasttime;
int r = btbb_init(max_ac_errors);
+ int i, j;
if (r < 0)
return;
@@ -725,8 +728,8 @@ void rx_afh_r(ubertooth_t* ut, btbb_piconet* pn, int timeout __attribute__((unus
// btbb_print_afh_map(pn);
uint8_t* afh_map = btbb_piconet_get_afh_map(pn);
- for (int i=0; i<10; i++)
- for (int j=0; j<8; j++)
+ for (i=0; i<10; i++)
+ for (j=0; j<8; j++)
if (afh_map[i] & (1<<j))
printf("1");
else