Browse Source

fix "-Werror" build against latest libosmo-abis

libosmo-abisrecently marked the 'out_cb' of the subchan_demux
as 'const', which caused compiler warnings/errors.

Related: libosmo-abis.git Ia082b9fddf03d02afd007825a1588a3ef0dbedae
Change-Id: I0cf430980e50fa8094f0efc7642004fb5923c4c6
changes/35/18735/1
Harald Welte 2 years ago
parent
commit
130eeb39f7
  1. 7
      src/e1cap_dump.c
  2. 7
      src/flip_bits.c
  3. 2
      src/flip_bits.h

7
src/e1cap_dump.c

@ -153,11 +153,12 @@ static void handle_sc_in(struct osmo_e1cap_pkthdr *pkt, const uint8_t *data, uns
}
static void handle_data(struct osmo_e1cap_pkthdr *pkt, uint8_t *data, int len)
static void handle_data(struct osmo_e1cap_pkthdr *pkt, const uint8_t *idata, int len)
{
uint8_t data[len];
struct timeval tv;
flip_buf_bits(data, len);
flip_buf_bits(data, idata, len);
#if 0
/* filter out all-ff/all-fe/all-7f */
if (all_bytes_are(0xff, data, len) ||
@ -193,7 +194,7 @@ static void handle_data(struct osmo_e1cap_pkthdr *pkt, uint8_t *data, int len)
}
}
static int subch_demux_out_cb(struct subch_demux *dmx, int ch, uint8_t *data,
static int subch_demux_out_cb(struct subch_demux *dmx, int ch, const ubit_t *data,
int len, void *c)
{
OSMO_ASSERT(ch == g_filter_subslot);

7
src/flip_bits.c

@ -16,14 +16,13 @@ void init_flip_bits(void)
}
}
uint8_t *flip_buf_bits(uint8_t *buf, int len)
uint8_t *flip_buf_bits(uint8_t *out, const uint8_t *in, int len)
{
int i;
uint8_t *start = buf;
for (i = 0 ; i < len; i++) {
buf[i] = flip_table[(uint8_t)buf[i]];
out[i] = flip_table[(uint8_t)in[i]];
}
return start;
return out;
}

2
src/flip_bits.h

@ -1,4 +1,4 @@
#pragma once
void init_flip_bits(void);
uint8_t *flip_buf_bits(uint8_t * buf , int len);
uint8_t *flip_buf_bits(uint8_t *out, const uint8_t *in, int len);

Loading…
Cancel
Save