Make wuffs_base__load_etc arg const

This commit is contained in:
Nigel Tao committed 2020-05-26 13:57:17 +10:00
1 parent bc546b7383
commit 3afdd91acb
3 files changed
+34 -34

No files matched your search

+15 -15
View File
@@ -528,74 +528,74 @@ wuffs_base__count_leading_zeroes_u64(uint64_t u) {
wuffs_base__load_u8__no_bounds_check
static inline uint8_t //
wuffs_base__load_u8__no_bounds_check(uint8_t* p) {
wuffs_base__load_u8__no_bounds_check(const uint8_t* p) {
return p[0];
}
static inline uint16_t //
wuffs_base__load_u16be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u16be__no_bounds_check(const uint8_t* p) {
return (uint16_t)(((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0));
}
static inline uint16_t //
wuffs_base__load_u16le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u16le__no_bounds_check(const uint8_t* p) {
return (uint16_t)(((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8));
}
static inline uint32_t //
wuffs_base__load_u24be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u24be__no_bounds_check(const uint8_t* p) {
return ((uint32_t)(p[0]) << 16) | ((uint32_t)(p[1]) << 8) |
((uint32_t)(p[2]) << 0);
}
static inline uint32_t //
wuffs_base__load_u24le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u24le__no_bounds_check(const uint8_t* p) {
return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |
((uint32_t)(p[2]) << 16);
}
static inline uint32_t //
wuffs_base__load_u32be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u32be__no_bounds_check(const uint8_t* p) {
return ((uint32_t)(p[0]) << 24) | ((uint32_t)(p[1]) << 16) |
((uint32_t)(p[2]) << 8) | ((uint32_t)(p[3]) << 0);
}
static inline uint32_t //
wuffs_base__load_u32le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u32le__no_bounds_check(const uint8_t* p) {
return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |
((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);
}
static inline uint64_t //
wuffs_base__load_u40be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u40be__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 32) | ((uint64_t)(p[1]) << 24) |
((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 8) |
((uint64_t)(p[4]) << 0);
}
static inline uint64_t //
wuffs_base__load_u40le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u40le__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |
((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |
((uint64_t)(p[4]) << 32);
}
static inline uint64_t //
wuffs_base__load_u48be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u48be__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 40) | ((uint64_t)(p[1]) << 32) |
((uint64_t)(p[2]) << 24) | ((uint64_t)(p[3]) << 16) |
((uint64_t)(p[4]) << 8) | ((uint64_t)(p[5]) << 0);
}
static inline uint64_t //
wuffs_base__load_u48le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u48le__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |
((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |
((uint64_t)(p[4]) << 32) | ((uint64_t)(p[5]) << 40);
}
static inline uint64_t //
wuffs_base__load_u56be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u56be__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 48) | ((uint64_t)(p[1]) << 40) |
((uint64_t)(p[2]) << 32) | ((uint64_t)(p[3]) << 24) |
((uint64_t)(p[4]) << 16) | ((uint64_t)(p[5]) << 8) |
@@ -603,7 +603,7 @@ wuffs_base__load_u56be__no_bounds_check(uint8_t* p) {
}
static inline uint64_t //
wuffs_base__load_u56le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u56le__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |
((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |
((uint64_t)(p[4]) << 32) | ((uint64_t)(p[5]) << 40) |
@@ -611,7 +611,7 @@ wuffs_base__load_u56le__no_bounds_check(uint8_t* p) {
}
static inline uint64_t //
wuffs_base__load_u64be__no_bounds_check(uint8_t* p) {
wuffs_base__load_u64be__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 56) | ((uint64_t)(p[1]) << 48) |
((uint64_t)(p[2]) << 40) | ((uint64_t)(p[3]) << 32) |
((uint64_t)(p[4]) << 24) | ((uint64_t)(p[5]) << 16) |
@@ -619,7 +619,7 @@ wuffs_base__load_u64be__no_bounds_check(uint8_t* p) {
}
static inline uint64_t //
wuffs_base__load_u64le__no_bounds_check(uint8_t* p) {
wuffs_base__load_u64le__no_bounds_check(const uint8_t* p) {
return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |
((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |
((uint64_t)(p[4]) << 32) | ((uint64_t)(p[5]) << 40) |