summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 15:38:13 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 15:38:13 +1100
commitc9977fd038d10c50abcfa2f92e07bc5401737bec (patch)
tree68acb384cabd0533b0e8628363635df3a7ee56e0
parent4ffa5d6c3a4130982d7bfd4a07cbeca4d6ccf788 (diff)
fix(common): Move inline endian utility functions to common.h
-rw-r--r--include/tinyff/common.h16
-rw-r--r--src/common.c15
2 files changed, 15 insertions, 16 deletions
diff --git a/include/tinyff/common.h b/include/tinyff/common.h
index abed24f..0c04ce9 100644
--- a/include/tinyff/common.h
+++ b/include/tinyff/common.h
@@ -14,7 +14,19 @@ typedef bool ff_flag;
// Functions
-inline uint32_t get_big_endian(const uint8_t *buffer);
-inline uint32_t get_little_endian(const uint8_t *buffer);
+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 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);
+}
#endif \ No newline at end of file
diff --git a/src/common.c b/src/common.c
index e52a98b..2e12c29 100644
--- a/src/common.c
+++ b/src/common.c
@@ -1,16 +1,3 @@
#include "tinyff/common.h"
-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]);
-}
-
-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);
-} \ No newline at end of file
+// Endian functions moved to header because C's acting up again \ No newline at end of file