Add the RB64 macro.
Reads an unsigned 64 bit integer from memory.
This commit is contained in:
parent
8eb4299c5b
commit
17b93fd7c0
|
@ -116,6 +116,20 @@ struct zip_stat;
|
||||||
((unsigned)((const uint8_t*)(x))[1] << 8) | \
|
((unsigned)((const uint8_t*)(x))[1] << 8) | \
|
||||||
(unsigned)((const uint8_t*)(x))[0]))
|
(unsigned)((const uint8_t*)(x))[0]))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read a 64 bits big endian unsigned integer out of memory.
|
||||||
|
* @param x a pointer to the input memory
|
||||||
|
* @return the corresponding unsigned integer
|
||||||
|
*/
|
||||||
|
#define RB64(x) (((uint64_t)((const uint8_t*)(x))[0] << 56) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[1] << 48) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[2] << 40) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[3] << 32) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[4] << 24) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[5] << 16) | \
|
||||||
|
((uint64_t)((const uint8_t*)(x))[6] << 8) | \
|
||||||
|
(uint64_t)((const uint8_t*)(x))[7])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a 32 bits big endian float out of memory.
|
* Read a 32 bits big endian float out of memory.
|
||||||
* @param x a pointer to the input memory
|
* @param x a pointer to the input memory
|
||||||
|
|
Loading…
Reference in New Issue