Changed leb128 related functions to operate on uint32_t

So unsigned instead of signed. The original intention of using int32_t
was to hint that the sign bit should be reserved, but this may just
confuse if our leb128 encoding has a sign representation, which it does
not.
This commit is contained in:
Christopher Haster
2024-02-09 14:20:56 -06:00
parent 9f9653eb79
commit 6f1d110e01
3 changed files with 34 additions and 35 deletions
+2 -2
View File
@@ -344,9 +344,9 @@ static inline uint32_t lfs_fromle32_(const void *buffer) {
// Convert to/from leb128 encoding
// TODO should we really be using ssize_t here and not lfs_ssize_t?
ssize_t lfs_toleb128(int32_t word, void *buffer, size_t size);
ssize_t lfs_toleb128(uint32_t word, void *buffer, size_t size);
ssize_t lfs_fromleb128(int32_t *word, const void *buffer, size_t size);
ssize_t lfs_fromleb128(uint32_t *word, const void *buffer, size_t size);