fix warning about cast realignment, WIP

This commit is contained in:
Philippe Teuwen
2020-05-03 15:15:02 +02:00
parent 82ad1b683a
commit c94eae0046
8 changed files with 30 additions and 24 deletions

View File

@@ -23,8 +23,10 @@ void crc32_ex(const uint8_t *data, const size_t len, uint8_t *crc) {
for (size_t i = 0; i < len; i++) {
crc32_byte(&desfire_crc, data[i]);
}
*((uint32_t *)(crc)) = htole32(desfire_crc);
uint32_t crctmp = htole32(desfire_crc);
for (size_t i=0; i < sizeof(uint32_t); i++) {
crc[i] = ((uint8_t *) &crctmp)[i];
}
}
void crc32_append(uint8_t *data, const size_t len) {

View File

@@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I. -I..
MYCFLAGS =
MYCFLAGS = -Wno-cast-align
MYDEFS =
MYSRCS = \
aes.c \