*
* 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
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;
}