minor: Fix use of xor token ()

Might clash with C alternative spellings of iso646.h
This commit is contained in:
MDW 2023-10-22 18:49:12 +02:00 committed by GitHub
parent a68f177adc
commit 7d62be5ccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions
src/devices

View file

@ -74,12 +74,12 @@ static uint8_t calc_checksum(uint8_t const *bitrow, unsigned len)
const uint8_t full_bytes = len / 8; const uint8_t full_bytes = len / 8;
const uint8_t bits_left = len % 8; const uint8_t bits_left = len % 8;
uint8_t xor = xor_bytes(bitrow, full_bytes); uint8_t xor_byte = xor_bytes(bitrow, full_bytes);
if (bits_left) { if (bits_left) {
xor ^= bitrow[full_bytes] & ~BIT_MASK(8 - bits_left); xor_byte ^= bitrow[full_bytes] & ~BIT_MASK(8 - bits_left);
} }
const uint8_t xor_nibble = ((xor&0xF0) >> 4) ^ (xor&0x0F); const uint8_t xor_nibble = ((xor_byte&0xF0) >> 4) ^ (xor_byte&0x0F);
uint8_t result = 0; uint8_t result = 0;
if (xor_nibble & 0x8) { if (xor_nibble & 0x8) {
@ -96,7 +96,7 @@ static uint8_t calc_checksum(uint8_t const *bitrow, unsigned len)
} }
result = result & 0xF; result = result & 0xF;
result |= (parity8(xor) << 4); result |= (parity8(xor_byte) << 4);
return result; return result;
} }

View file

@ -141,10 +141,10 @@ static int norgo_decode(r_device *decoder, bitbuffer_t *bitbuffer)
return DECODE_ABORT_EARLY; return DECODE_ABORT_EARLY;
} }
int xor = xor_bytes(b + 1, (bitbuffer->bits_per_row[0] - 15) / 8); int xor_byte = xor_bytes(b + 1, (bitbuffer->bits_per_row[0] - 15) / 8);
if (xor != 0xff) { // before invert 0 is ff if (xor_byte != 0xff) { // before invert 0 is ff
decoder_logf_bitrow(decoder, 1, __func__, b, bitbuffer->bits_per_row[0], "XOR fail (%02x)", decoder_logf_bitrow(decoder, 1, __func__, b, bitbuffer->bits_per_row[0], "XOR fail (%02x)",
xor); xor_byte);
return DECODE_FAIL_MIC; return DECODE_FAIL_MIC;
} }