Skip to contentSkip to conversation

make get_be64() compile on pu with NO_UNALIGNED_LOADS

PATCH In review Martin Ågren 2 participants 2 messages Jul 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make get_be64() compile on pu with NO_UNALIGNED_LOADS

1. s/unit64_t/uint64_t/

2. add const-qualifier to *p

3. add missing closing ')'

---
Applies to pu and passes the tests. I think this should be squashed in somewhere. Perhaps a mismerge in commit d553324d ("Merge branch 'bp/fsmonitor' into pu", 2017-07-21).

 compat/bswap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
compat/bswap.h +3 -3
index 133da1d2b..f86110a72 100644
@@ -188,11 +188,11 @@ static inline void put_be32(void *ptr, uint32_t value)
 	p[3] = value >>  0;
 }
 
-static inline unit64_t get_be64(const void *ptr)
+static inline uint64_t get_be64(const void *ptr)
 {
-	unsigned char *p = ptr;
+	const unsigned char *p = ptr;
 	return  ((uint64_t)get_be32(p) << 32) |
-		((uint64_t)get_be32(p + 4);
+		((uint64_t)get_be32(p + 4));
 }
 
 #endif
Signature · 1 line
2.14.0.rc0.14.g12cc05b53
#1 lore raw
Quoted 3 lines · Martin Ågren

Applies to pu and passes the tests. I think this should be squashed in somewhere. Perhaps a mismerge in commit d553324d ("Merge branch 'bp/fsmonitor' into pu", 2017-07-21).

Yes, you spotted a mistaken evil-merge. Thanks.

Quoted 23 lines
 compat/bswap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
compat/bswap.h +3 -3
index 133da1d2b..f86110a72 100644
@@ -188,11 +188,11 @@ static inline void put_be32(void *ptr, uint32_t value)
 	p[3] = value >>  0;
 }
 
-static inline unit64_t get_be64(const void *ptr)
+static inline uint64_t get_be64(const void *ptr)
 {
-	unsigned char *p = ptr;
+	const unsigned char *p = ptr;
 	return  ((uint64_t)get_be32(p) << 32) |
-		((uint64_t)get_be32(p + 4);
+		((uint64_t)get_be32(p + 4));
 }
 
 #endif