util/OffsetPointer: use std::ptrdiff_t

This commit is contained in:
Max Kellermann 2020-09-28 12:16:07 +02:00 committed by Max Kellermann
parent 36a187da39
commit 643bf95366

View File

@ -35,7 +35,7 @@
* Offset the given pointer by the specified number of bytes. * Offset the given pointer by the specified number of bytes.
*/ */
constexpr void * constexpr void *
OffsetPointer(void *p, ptrdiff_t offset) noexcept OffsetPointer(void *p, std::ptrdiff_t offset) noexcept
{ {
return (char *)p + offset; return (char *)p + offset;
} }
@ -44,7 +44,7 @@ OffsetPointer(void *p, ptrdiff_t offset) noexcept
* Offset the given pointer by the specified number of bytes. * Offset the given pointer by the specified number of bytes.
*/ */
constexpr const void * constexpr const void *
OffsetPointer(const void *p, ptrdiff_t offset) noexcept OffsetPointer(const void *p, std::ptrdiff_t offset) noexcept
{ {
return (const char *)p + offset; return (const char *)p + offset;
} }