From 7ad5a5efec73f6cc9f5bce3f707d42a407c0dca1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jun 2022 20:50:04 +0200 Subject: [PATCH] util/OffsetPointer: use std::byte --- src/util/OffsetPointer.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }