Add buffer_write64be()
Add a function to write 64 bits in big-endian from a uint64_t.
This commit is contained in:
parent
ffdbf5990b
commit
b2d815bfc7
@ -18,6 +18,12 @@ buffer_write32be(uint8_t *buf, uint32_t value) {
|
||||
buf[3] = value;
|
||||
}
|
||||
|
||||
static inline void
|
||||
buffer_write64be(uint8_t *buf, uint64_t value) {
|
||||
buffer_write32be(buf, value >> 32);
|
||||
buffer_write32be(&buf[4], (uint32_t) value);
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
buffer_read16be(const uint8_t *buf) {
|
||||
return (buf[0] << 8) | buf[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user