Rename puffs_u16be to puffs_base_load_u16be.

This commit is contained in:
Nigel Tao committed 2017-09-23 09:29:45 +10:00
1 parent ed8a91ef51
commit f107ec155d
5 files changed
+28 -28

No files matched your search

+10 -10
View File
@@ -333,24 +333,24 @@ extern int printf(const char* __restrict __format, ...);
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
// TODO: for puffs_u16be and similar functions, look for (ifdef) the x86
// architecture and cast the pointer? Only do so if a benchmark justifies the
// additional code path. Modern compilers might already generate good code.
// TODO: for puffs_base_load_u16be etc, look for (ifdef) the x86 architecture
// and cast the pointer? Only do so if a benchmark justifies the additional code
// path. Modern compilers might already generate good code.
static inline uint16_t puffs_u16be(uint8_t* p) {
static inline uint16_t puffs_base_load_u16be(uint8_t* p) {
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
}
static inline uint16_t puffs_u16le(uint8_t* p) {
static inline uint16_t puffs_base_load_u16le(uint8_t* p) {
return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);
}
static inline uint32_t puffs_u32be(uint8_t* p) {
static inline uint32_t puffs_base_load_u32be(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 puffs_u32le(uint8_t* p) {
static inline uint32_t puffs_base_load_u32le(uint8_t* p) {
return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |
((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);
}
@@ -913,7 +913,7 @@ puffs_flate_status puffs_flate_decoder_decode_uncompressed(
PUFFS_COROUTINE_SUSPENSION_POINT(1);
uint32_t t_1;
if (PUFFS_LIKELY(b_rend_src - b_rptr_src >= 4)) {
t_1 = puffs_u32le(b_rptr_src);
t_1 = puffs_base_load_u32le(b_rptr_src);
b_rptr_src += 4;
} else {
self->private_impl.c_decode_uncompressed[0].scratch = 0;
@@ -1978,7 +1978,7 @@ puffs_flate_status puffs_flate_zlib_decoder_decode(
PUFFS_COROUTINE_SUSPENSION_POINT(1);
uint16_t t_1;
if (PUFFS_LIKELY(b_rend_src - b_rptr_src >= 2)) {
t_1 = puffs_u16be(b_rptr_src);
t_1 = puffs_base_load_u16be(b_rptr_src);
b_rptr_src += 2;
} else {
self->private_impl.c_decode[0].scratch = 0;
@@ -2047,7 +2047,7 @@ puffs_flate_status puffs_flate_zlib_decoder_decode(
PUFFS_COROUTINE_SUSPENSION_POINT(4);
uint32_t t_3;
if (PUFFS_LIKELY(b_rend_src - b_rptr_src >= 4)) {
t_3 = puffs_u32be(b_rptr_src);
t_3 = puffs_base_load_u32be(b_rptr_src);
b_rptr_src += 4;
} else {
self->private_impl.c_decode[0].scratch = 0;
+7 -7
View File
@@ -304,24 +304,24 @@ extern int printf(const char* __restrict __format, ...);
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
// TODO: for puffs_u16be and similar functions, look for (ifdef) the x86
// architecture and cast the pointer? Only do so if a benchmark justifies the
// additional code path. Modern compilers might already generate good code.
// TODO: for puffs_base_load_u16be etc, look for (ifdef) the x86 architecture
// and cast the pointer? Only do so if a benchmark justifies the additional code
// path. Modern compilers might already generate good code.
static inline uint16_t puffs_u16be(uint8_t* p) {
static inline uint16_t puffs_base_load_u16be(uint8_t* p) {
return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);
}
static inline uint16_t puffs_u16le(uint8_t* p) {
static inline uint16_t puffs_base_load_u16le(uint8_t* p) {
return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);
}
static inline uint32_t puffs_u32be(uint8_t* p) {
static inline uint32_t puffs_base_load_u32be(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 puffs_u32le(uint8_t* p) {
static inline uint32_t puffs_base_load_u32le(uint8_t* p) {
return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |
((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);
}