cppchecker fixes

This commit is contained in:
iceman1001 2022-07-06 12:42:25 +02:00
parent 88b583417e
commit 805b8e1e44

View file

@ -117,7 +117,7 @@ static bool TexkomCorrelate(uint32_t indx, uint32_t threshold) {
); );
} }
static bool TexkomCalculateMaxMin(uint32_t *data, uint32_t len, uint32_t *dmax, uint32_t *dmin) { static bool TexkomCalculateMaxMin(const uint32_t *data, uint32_t len, uint32_t *dmax, uint32_t *dmin) {
*dmax = 0; *dmax = 0;
*dmin = 0xffffffff; *dmin = 0xffffffff;
for (size_t i = 0; i < len; i++) { for (size_t i = 0; i < len; i++) {
@ -175,7 +175,7 @@ static inline bool TexcomCalculateBit(uint32_t data, uint32_t bitlen, uint32_t t
} }
// code from https://github.com/li0ard/crclib/blob/main/index.js // code from https://github.com/li0ard/crclib/blob/main/index.js
static uint8_t TexcomTK13CRC(uint8_t *data) { static uint8_t TexcomTK13CRC(const uint8_t *data) {
uint8_t crc = 0; uint8_t crc = 0;
uint8_t indx = 0; uint8_t indx = 0;
while (indx < 4) { while (indx < 4) {
@ -348,10 +348,12 @@ static bool TexcomGeneralDecode(uint32_t *implengths, uint32_t implengthslen, ch
else { else {
if (verbose) { if (verbose) {
PrintAndLogEx(INFO, "ERROR string [%zu]: %s, bit: %d, blen: %d", strlen(bitstring), bitstring, i, implengths[i]); PrintAndLogEx(INFO, "ERROR string [%zu]: %s, bit: %d, blen: %d", strlen(bitstring), bitstring, i, implengths[i]);
printf("Length array: \r\n");
for (uint32_t j = 0; j < implengthslen; j++) PrintAndLogEx(INFO, "Length array:");
printf("%d,", implengths[j]); for (uint32_t j = 0; j < implengthslen; j++) {
printf("\r\n"); PrintAndLogEx(NORMAL, "%u, " NOLF, implengths[j]);
}
PrintAndLogEx(NORMAL, "");
} }
biterror = true; biterror = true;