X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fkernel%2Fao_fec.h;h=40e5b15a082124dc7b4271fe8031b5d671d735b7;hp=618756c1ce7ea3984959334a7852213c1b6db462;hb=HEAD;hpb=24167015705ae831692b95735968b04a876f935e diff --git a/src/kernel/ao_fec.h b/src/kernel/ao_fec.h index 618756c1..40e5b15a 100644 --- a/src/kernel/ao_fec.h +++ b/src/kernel/ao_fec.h @@ -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 @@ -38,10 +39,10 @@ ao_fec_crc_byte(uint8_t byte, uint16_t crc) for (bit = 0; bit < 8; bit++) { if (((crc & 0x8000) >> 8) ^ (byte & 0x80)) - crc = (crc << 1) ^ 0x8005; + crc = (uint16_t) ((crc << 1) ^ 0x8005); else crc = (crc << 1); - byte <<= 1; + byte = (uint8_t) (byte << 1); } return crc; }