C conversion to unsigned types implictly mods
This commit is contained in:
parent
264f6fd44e
commit
cf2b617b39
6
puer.c
6
puer.c
|
@ -56,9 +56,9 @@ uint32_t bytes2word(unsigned char const bytes[4]) {
|
|||
}
|
||||
|
||||
void word2bytes(unsigned char *bytes, uint32_t word) {
|
||||
bytes[0] = word & 0xff;
|
||||
bytes[1] = word>>8 & 0xff;
|
||||
bytes[2] = word>>16 & 0xff;
|
||||
bytes[0] = word;
|
||||
bytes[1] = word>>8;
|
||||
bytes[2] = word>>16;
|
||||
bytes[3] = word>>24;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue