fix some const params
This commit is contained in:
1 parent
7549f53b63
commit
996429fa9e
2 files changed
+6
-6
No files matched your search
+3
-3
@@ -1147,7 +1147,7 @@ void binstr_2_bytes(uint8_t *target, size_t *targetlen, const char *src) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hex_xor(uint8_t *d, uint8_t *x, int n) {
|
void hex_xor(uint8_t *d, const uint8_t *x, int n) {
|
||||||
while (n--) {
|
while (n--) {
|
||||||
d[n] ^= x[n];
|
d[n] ^= x[n];
|
||||||
}
|
}
|
||||||
@@ -1163,7 +1163,7 @@ uint8_t GetParity(const uint8_t *bits, uint8_t type, int length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add HID parity to binary array: EVEN prefix for 1st half of ID, ODD suffix for 2nd half
|
// add HID parity to binary array: EVEN prefix for 1st half of ID, ODD suffix for 2nd half
|
||||||
void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length) {
|
void wiegand_add_parity(uint8_t *target, const uint8_t *source, uint8_t length) {
|
||||||
*(target++) = GetParity(source, EVEN, length / 2);
|
*(target++) = GetParity(source, EVEN, length / 2);
|
||||||
memcpy(target, source, length);
|
memcpy(target, source, length);
|
||||||
target += length;
|
target += length;
|
||||||
@@ -1171,7 +1171,7 @@ void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add HID parity to binary array: ODD prefix for 1st half of ID, EVEN suffix for 2nd half
|
// add HID parity to binary array: ODD prefix for 1st half of ID, EVEN suffix for 2nd half
|
||||||
void wiegand_add_parity_swapped(uint8_t *target, uint8_t *source, uint8_t length) {
|
void wiegand_add_parity_swapped(uint8_t *target, const uint8_t *source, uint8_t length) {
|
||||||
*(target++) = GetParity(source, ODD, length / 2);
|
*(target++) = GetParity(source, ODD, length / 2);
|
||||||
memcpy(target, source, length);
|
memcpy(target, source, length);
|
||||||
target += length;
|
target += length;
|
||||||
|
|||||||
+3
-3
@@ -141,11 +141,11 @@ int binstr_2_binarray(uint8_t *target, char *source, int length);
|
|||||||
void bytes_2_binstr(char *target, const uint8_t *source, size_t sourcelen);
|
void bytes_2_binstr(char *target, const uint8_t *source, size_t sourcelen);
|
||||||
void binstr_2_bytes(uint8_t *target, size_t *targetlen, const char *src);
|
void binstr_2_bytes(uint8_t *target, size_t *targetlen, const char *src);
|
||||||
|
|
||||||
void hex_xor(uint8_t *d, uint8_t *x, int n);
|
void hex_xor(uint8_t *d, const uint8_t *x, int n);
|
||||||
|
|
||||||
uint8_t GetParity(const uint8_t *bits, uint8_t type, int length);
|
uint8_t GetParity(const uint8_t *bits, uint8_t type, int length);
|
||||||
void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length);
|
void wiegand_add_parity(uint8_t *target, const uint8_t *source, uint8_t length);
|
||||||
void wiegand_add_parity_swapped(uint8_t *target, uint8_t *source, uint8_t length);
|
void wiegand_add_parity_swapped(uint8_t *target, const uint8_t *source, uint8_t length);
|
||||||
|
|
||||||
//void xor(unsigned char *dst, unsigned char *src, size_t len);
|
//void xor(unsigned char *dst, unsigned char *src, size_t len);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user