Ah, integer promotion rules

This commit is contained in:
Juhani Krekelä 2021-04-10 17:20:14 +03:00
parent 8c7117fef1
commit 80e1a7779a
1 changed files with 1 additions and 1 deletions

2
puer.c
View File

@ -66,7 +66,7 @@ void xxtea128(uint32_t const key[4], uint32_t block[4]) {
}
uint32_t bytes2word(unsigned char const bytes[4]) {
return bytes[0] | bytes[1]<<8 | bytes[2]<<16 | bytes[3]<<24;
return (uint32_t)bytes[0] | (uint32_t)bytes[1]<<8 | (uint32_t)bytes[2]<<16 | (uint32_t)bytes[3]<<24;
}
void word2bytes(unsigned char *bytes, uint32_t word) {