summaryrefslogtreecommitdiff
path: root/include/tinyff/common.h
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-04-03 18:31:41 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-04-03 18:31:41 +1100
commitca214e6cd61a6f035d18ae7e96e6d63064b22859 (patch)
tree1395064b656d8d1d0de8f2ad362e0b829edac6d7 /include/tinyff/common.h
parentc62be285b0891ad0038a2dcddd1a38b78318d2da (diff)
refactor(common): Change endianess function names to ff_le32 and ff_be32
Diffstat (limited to 'include/tinyff/common.h')
-rw-r--r--include/tinyff/common.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/tinyff/common.h b/include/tinyff/common.h
index 838caa3..39265a3 100644
--- a/include/tinyff/common.h
+++ b/include/tinyff/common.h
@@ -16,19 +16,18 @@ typedef bool ff_flag;
// Functions
-static inline uint32_t get_big_endian(const uint8_t *buffer) {
- return (uint32_t)(buffer[0] << 24) |
- (uint32_t)(buffer[1] << 16) |
- (uint32_t)(buffer[2] << 8) |
- (uint32_t)(buffer[3]);
+static inline uint32_t ff_be32(const uint8_t *b) {
+ return ((uint32_t)b[0] << 24) |
+ ((uint32_t)b[1] << 16) |
+ ((uint32_t)b[2] << 8) |
+ ((uint32_t)b[3]);
}
-static inline uint32_t get_little_endian(const uint8_t *buffer)
-{
- return (uint32_t)(buffer[0]) |
- (uint32_t)(buffer[1] << 8) |
- (uint32_t)(buffer[2] << 16) |
- (uint32_t)(buffer[3] << 24);
+static inline uint32_t ff_le32(const uint8_t *b) {
+ return ((uint32_t)b[0]) |
+ ((uint32_t)b[1] << 8) |
+ ((uint32_t)b[2] << 16) |
+ ((uint32_t)b[3] << 24);
}