X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_fec_rx.c;h=ecbb21ac6847c32ad2f4820df4822f05fc0e1160;hb=b140da92536d7c48ba37868f1c2afce7bb86dfdb;hp=c4f5559a11f8ea79b07d069e99ee60a2208fe58f;hpb=24167015705ae831692b95735968b04a876f935e;p=fw%2Faltos diff --git a/src/kernel/ao_fec_rx.c b/src/kernel/ao_fec_rx.c index c4f5559a..ecbb21ac 100644 --- a/src/kernel/ao_fec_rx.c +++ b/src/kernel/ao_fec_rx.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -58,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 @@ -261,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; @@ -292,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);