From a85c4ce535c940bd2f48c34ab823fb3a8f5be0cc Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Sun, 4 Aug 2024 22:03:35 -0700 Subject: tree-wide: automated migration to charptr_cast The lint did it :3 Change-Id: I2d9f276b01ebbf14101de4257ea13e44ff6fe0a0 --- src/libutil/compression.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libutil/compression.cc') diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index 6b0fa9d15..5152a2146 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -1,3 +1,4 @@ +#include "charptr-cast.hh" #include "compression.hh" #include "tarfile.hh" #include "signals.hh" @@ -160,7 +161,7 @@ struct BrotliDecompressionSource : Source size_t read(char * data, size_t len) override { - uint8_t * out = reinterpret_cast(data); + uint8_t * out = charptr_cast(data); const auto * begin = out; while (len && !BrotliDecoderIsFinished(state.get())) { @@ -172,7 +173,7 @@ struct BrotliDecompressionSource : Source } catch (EndOfFile &) { break; } - next_in = reinterpret_cast(buf.get()); + next_in = charptr_cast(buf.get()); } if (!BrotliDecoderDecompressStream( @@ -238,7 +239,7 @@ struct BrotliCompressionSink : ChunkedCompressionSink void writeInternal(std::string_view data) override { - auto next_in = reinterpret_cast(data.data()); + auto next_in = charptr_cast(data.data()); size_t avail_in = data.size(); uint8_t * next_out = outbuf; size_t avail_out = sizeof(outbuf); -- cgit v1.2.3