aports/testing/s2geometry/fix-uint-handling.patch
2020-11-23 01:40:50 +00:00

88 lines
3.1 KiB
Diff

From 5a1d1e0a08c763fdb2a332d6a56e72377cc76efe Mon Sep 17 00:00:00 2001
From: Rinigus <rinigus.git@gmail.com>
Date: Sun, 15 Nov 2020 20:59:22 +0200
Subject: [PATCH] fix uint handling
---
.../absl/base/internal/unaligned_access.h | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/s2/third_party/absl/base/internal/unaligned_access.h b/src/s2/third_party/absl/base/internal/unaligned_access.h
index 6f7a703..ba2fbdf 100644
--- a/src/s2/third_party/absl/base/internal/unaligned_access.h
+++ b/src/s2/third_party/absl/base/internal/unaligned_access.h
@@ -130,8 +130,8 @@ inline uint32_t UnalignedLoad32(const void *p) {
return t;
}
-inline uint64 UnalignedLoad64(const void *p) {
- uint64 t;
+inline uint64_t UnalignedLoad64(const void *p) {
+ uint64_t t;
memcpy(&t, p, sizeof t);
return t;
}
@@ -140,7 +140,7 @@ inline void UnalignedStore16(void *p, uint16_t v) { memcpy(p, &v, sizeof v); }
inline void UnalignedStore32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); }
-inline void UnalignedStore64(void *p, uint64 v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); }
} // namespace base_internal
} // namespace absl
@@ -172,14 +172,14 @@ inline void UnalignedStore64(void *p, uint64 v) { memcpy(p, &v, sizeof v); }
#define ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \
(*reinterpret_cast<const uint32_t *>(_p))
#define ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \
- (*reinterpret_cast<const uint64 *>(_p))
+ (*reinterpret_cast<const uint64_t *>(_p))
#define ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \
(*reinterpret_cast<uint16_t *>(_p) = (_val))
#define ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \
(*reinterpret_cast<uint32_t *>(_p) = (_val))
#define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \
- (*reinterpret_cast<uint64 *>(_p) = (_val))
+ (*reinterpret_cast<uint64_t *>(_p) = (_val))
#elif defined(__arm__) && \
!defined(__ARM_ARCH_5__) && \
@@ -246,13 +246,13 @@ struct Unaligned32Struct {
namespace absl {
namespace base_internal {
-inline uint64 UnalignedLoad64(const void *p) {
- uint64 t;
+inline uint64_t UnalignedLoad64(const void *p) {
+ uint64_t t;
memcpy(&t, p, sizeof t);
return t;
}
-inline void UnalignedStore64(void *p, uint64 v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); }
} // namespace base_internal
} // namespace absl
@@ -286,8 +286,8 @@ inline uint32_t UnalignedLoad32(const void *p) {
return t;
}
-inline uint64 UnalignedLoad64(const void *p) {
- uint64 t;
+inline uint64_t UnalignedLoad64(const void *p) {
+ uint64_t t;
memcpy(&t, p, sizeof t);
return t;
}
@@ -296,7 +296,7 @@ inline void UnalignedStore16(void *p, uint16_t v) { memcpy(p, &v, sizeof v); }
inline void UnalignedStore32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); }
-inline void UnalignedStore64(void *p, uint64 v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); }
} // namespace base_internal
} // namespace absl