17
17
#include " src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
18
18
#include " src/__support/macros/properties/architectures.h"
19
19
20
+ #include < cstddef>
20
21
#include < stddef.h> // size_t
21
22
#include < stdint.h> // intptr_t / uintptr_t / INT32_MAX / INT32_MIN
22
23
@@ -293,11 +294,11 @@ LIBC_INLINE void store64_aligned(uint64_t value, Ptr dst, size_t offset) {
293
294
// Advances the pointers p1 and p2 by offset bytes and decrease count by the
294
295
// same amount.
295
296
template <typename T1, typename T2>
296
- LIBC_INLINE void adjust (uintptr_t offset, T1 *__restrict &p1,
297
+ LIBC_INLINE void adjust (ptrdiff_t offset, T1 *__restrict &p1,
297
298
T2 *__restrict &p2, size_t &count) {
298
299
p1 += offset;
299
300
p2 += offset;
300
- count -= offset;
301
+ count -= static_cast < size_t >( offset) ;
301
302
}
302
303
303
304
// Advances p1 and p2 so p1 gets aligned to the next SIZE bytes boundary
@@ -306,7 +307,7 @@ LIBC_INLINE void adjust(uintptr_t offset, T1 *__restrict &p1,
306
307
template <size_t SIZE, typename T1, typename T2>
307
308
void align_p1_to_next_boundary (T1 *__restrict &p1, T2 *__restrict &p2,
308
309
size_t &count) {
309
- adjust (distance_to_next_aligned<SIZE>(p1), p1, p2, count);
310
+ adjust (static_cast < ptrdiff_t >( distance_to_next_aligned<SIZE>(p1) ), p1, p2, count);
310
311
p1 = assume_aligned<SIZE>(p1);
311
312
}
312
313
0 commit comments