X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fkernel%2Fao_fec_rx.c;fp=src%2Fkernel%2Fao_fec_rx.c;h=ecbb21ac6847c32ad2f4820df4822f05fc0e1160;hp=8e4a852221aac60e869576348acae5bab01dab51;hb=c49bd3cb0c31a51fae79ddc92237cc309be9a242;hpb=d225adc3af9e5726d436cbbdbf8dcc5837e50804 diff --git a/src/kernel/ao_fec_rx.c b/src/kernel/ao_fec_rx.c index 8e4a8522..ecbb21ac 100644 --- a/src/kernel/ao_fec_rx.c +++ b/src/kernel/ao_fec_rx.c @@ -59,7 +59,7 @@ static const uint8_t ao_interleave_order[] = { }; static inline uint16_t ao_interleave_index(uint16_t i) { - return (i & ~0x1e) | ao_interleave_order[(i & 0x1e) >> 1]; + return (uint16_t) ((i & ~0x1e) | ao_interleave_order[(i & 0x1e) >> 1]); } #define NUM_STATE 8 @@ -262,7 +262,7 @@ ao_fec_decode(const uint8_t *in, uint16_t len, uint8_t *out, uint8_t out_len, ui * the end of the input, in which case * it will be seven. */ - int8_t dist = b - (o + 8); /* distance to last ready-for-writing bit */ + int8_t dist = (int8_t) (b - (o + 8)); /* distance to last ready-for-writing bit */ uint32_t min_cost; /* lowest cost */ uint8_t min_state; /* lowest cost state */ uint8_t byte; @@ -293,7 +293,7 @@ ao_fec_decode(const uint8_t *in, uint16_t len, uint8_t *out, uint8_t out_len, ui printf ("\tbit %3d min_cost %5d old bit %3d old_state %x bits %02x whiten %0x\n", i/2, min_cost, o + 8, min_state, (bits[p][min_state] >> dist) & 0xff, *whiten); #endif - byte = (bits[p][min_state] >> dist) ^ *whiten++; + byte = (uint8_t) ((bits[p][min_state] >> dist) ^ *whiten++); *out++ = byte; if (out_len > 2) crc = ao_fec_crc_byte(byte, crc);