diff --git a/src/util/OffsetPointer.hxx b/src/util/OffsetPointer.hxx index e2621dd12..e9103e81d 100644 --- a/src/util/OffsetPointer.hxx +++ b/src/util/OffsetPointer.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2014 Max Kellermann + * Copyright 2013-2022 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ constexpr void * OffsetPointer(void *p, std::ptrdiff_t offset) noexcept { - return (char *)p + offset; + return static_cast(p) + offset; } /** @@ -46,5 +46,5 @@ OffsetPointer(void *p, std::ptrdiff_t offset) noexcept constexpr const void * OffsetPointer(const void *p, std::ptrdiff_t offset) noexcept { - return (const char *)p + offset; + return static_cast(p) + offset; }