diff options
| author | Ray <[email protected]> | 2023-02-12 13:29:39 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-02-12 13:29:39 +0100 |
| commit | 22287a78c5f4b34b0d57d060dd7f68b51e70d363 (patch) | |
| tree | 56aa86fecc03e0453f89ff476653758fef998207 /src | |
| parent | 96a9b4e1f25819bef8198ad0a0412ac84025d179 (diff) | |
| download | raylib-22287a78c5f4b34b0d57d060dd7f68b51e70d363.tar.gz raylib-22287a78c5f4b34b0d57d060dd7f68b51e70d363.zip | |
Update qoa.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/external/qoa.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/external/qoa.h b/src/external/qoa.h index aae57551..65752d1b 100644 --- a/src/external/qoa.h +++ b/src/external/qoa.h @@ -274,24 +274,26 @@ static inline int qoa_clamp(int v, int min, int max) { } static inline qoa_uint64_t qoa_read_u64(const unsigned char *bytes, unsigned int *p) { - qoa_uint64_t v = - (qoa_uint64_t)bytes[(*p)+0] << 56 | (qoa_uint64_t)bytes[(*p)+1] << 48 | - (qoa_uint64_t)bytes[(*p)+2] << 40 | (qoa_uint64_t)bytes[(*p)+3] << 32 | - (qoa_uint64_t)bytes[(*p)+4] << 24 | (qoa_uint64_t)bytes[(*p)+5] << 16 | - (qoa_uint64_t)bytes[(*p)+6] << 8 | (qoa_uint64_t)bytes[(*p)+7]; + bytes += *p; *p += 8; - return v; + return + ((qoa_uint64_t)(bytes[0]) << 56) | ((qoa_uint64_t)(bytes[1]) << 48) | + ((qoa_uint64_t)(bytes[2]) << 40) | ((qoa_uint64_t)(bytes[3]) << 32) | + ((qoa_uint64_t)(bytes[4]) << 24) | ((qoa_uint64_t)(bytes[5]) << 16) | + ((qoa_uint64_t)(bytes[6]) << 8) | ((qoa_uint64_t)(bytes[7]) << 0); } static inline void qoa_write_u64(qoa_uint64_t v, unsigned char *bytes, unsigned int *p) { - bytes[(*p)++] = (v >> 56) & 0xff; - bytes[(*p)++] = (v >> 48) & 0xff; - bytes[(*p)++] = (v >> 40) & 0xff; - bytes[(*p)++] = (v >> 32) & 0xff; - bytes[(*p)++] = (v >> 24) & 0xff; - bytes[(*p)++] = (v >> 16) & 0xff; - bytes[(*p)++] = (v >> 8) & 0xff; - bytes[(*p)++] = (v >> 0) & 0xff; + bytes += *p; + *p += 8; + bytes[0] = (v >> 56) & 0xff; + bytes[1] = (v >> 48) & 0xff; + bytes[2] = (v >> 40) & 0xff; + bytes[3] = (v >> 32) & 0xff; + bytes[4] = (v >> 24) & 0xff; + bytes[5] = (v >> 16) & 0xff; + bytes[6] = (v >> 8) & 0xff; + bytes[7] = (v >> 0) & 0xff; } |
