mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Add write_fast_uxx methods
This commit is contained in:
1 parent
57c4196934
commit
732365b80d
14 files changed
+1260
-42
No files matched your search
@@ -1908,6 +1908,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -1990,6 +1994,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
@@ -1909,6 +1909,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -1991,6 +1995,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
@@ -2000,6 +2000,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -2082,6 +2086,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
+122
@@ -2164,6 +2164,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -2246,6 +2250,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
@@ -2207,6 +2207,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -2289,6 +2293,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
+122
@@ -1940,6 +1940,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -2022,6 +2026,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
@@ -2204,6 +2204,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
static inline uint8_t wuffs_base__load_u8be(uint8_t* p) {
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
|
||||
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
|
||||
}
|
||||
@@ -2286,6 +2290,124 @@ static inline uint64_t wuffs_base__load_u64le(uint8_t* p) {
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__store_u8be(uint8_t* p, uint8_t x) {
|
||||
p[0] = x;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16be(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 8;
|
||||
p[1] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u16le(uint8_t* p, uint16_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 16;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u24le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32be(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 24;
|
||||
p[1] = x >> 16;
|
||||
p[2] = x >> 8;
|
||||
p[3] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u32le(uint8_t* p, uint32_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 32;
|
||||
p[1] = x >> 24;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 8;
|
||||
p[4] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u40le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 40;
|
||||
p[1] = x >> 32;
|
||||
p[2] = x >> 24;
|
||||
p[3] = x >> 16;
|
||||
p[4] = x >> 8;
|
||||
p[5] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u48le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 48;
|
||||
p[1] = x >> 40;
|
||||
p[2] = x >> 32;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 16;
|
||||
p[5] = x >> 8;
|
||||
p[6] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u56le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64be(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 56;
|
||||
p[1] = x >> 48;
|
||||
p[2] = x >> 40;
|
||||
p[3] = x >> 32;
|
||||
p[4] = x >> 24;
|
||||
p[5] = x >> 16;
|
||||
p[6] = x >> 8;
|
||||
p[7] = x >> 0;
|
||||
}
|
||||
|
||||
static inline void wuffs_base__store_u64le(uint8_t* p, uint64_t x) {
|
||||
p[0] = x >> 0;
|
||||
p[1] = x >> 8;
|
||||
p[2] = x >> 16;
|
||||
p[3] = x >> 24;
|
||||
p[4] = x >> 32;
|
||||
p[5] = x >> 40;
|
||||
p[6] = x >> 48;
|
||||
p[7] = x >> 56;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline void wuffs_base__u8__sat_add_indirect(uint8_t* x, uint8_t y) {
|
||||
*x = wuffs_base__u8__sat_add(*x, y);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user