@@ -140,23 +140,23 @@ size_t FlatLutData::getEntryOffset(int nch_bin, int rad_bin, int eta_bin, int pt
140140const lutEntry_t* FlatLutData::getEntryRef (int nch_bin, int rad_bin, int eta_bin, int pt_bin) const
141141{
142142 size_t offset = getEntryOffset (nch_bin, rad_bin, eta_bin, pt_bin);
143- return reinterpret_cast <const lutEntry_t*>(mDataRef .data () + offset);
143+ return reinterpret_cast <const lutEntry_t*>(mDataRef .data () + offset); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
144144}
145145
146146lutEntry_t* FlatLutData::getEntry (int nch_bin, int rad_bin, int eta_bin, int pt_bin)
147147{
148148 size_t offset = getEntryOffset (nch_bin, rad_bin, eta_bin, pt_bin);
149- return reinterpret_cast <lutEntry_t*>(mData .data () + offset);
149+ return reinterpret_cast <lutEntry_t*>(mData .data () + offset); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
150150}
151151
152152const lutHeader_t& FlatLutData::getHeaderRef () const
153153{
154- return *static_cast <const lutHeader_t*>(static_cast < const void *>( mDataRef .data ()));
154+ return *reinterpret_cast <const lutHeader_t*>(mDataRef .data ()); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
155155}
156156
157157lutHeader_t& FlatLutData::getHeader ()
158158{
159- return *static_cast <lutHeader_t*>(static_cast < void *>( mData .data ()));
159+ return *reinterpret_cast <lutHeader_t*>(mData .data ()); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
160160}
161161
162162void FlatLutData::updateRef ()
@@ -216,7 +216,7 @@ lutHeader_t FlatLutData::previewHeader(const uint8_t* buffer, size_t size)
216216 if (size < sizeof (lutHeader_t)) {
217217 throw framework::runtime_error_f (" Buffer too small for LUT header: expected at least %zu, got %zu" , sizeof (lutHeader_t), size);
218218 }
219- const auto * header = static_cast <const lutHeader_t*>(static_cast < const void *>( buffer));
219+ const auto * header = reinterpret_cast <const lutHeader_t*>(buffer); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
220220 if (!header->checkVersion ()) {
221221 throw framework::runtime_error_f (" LUT header version mismatch: expected %d, got %d" , LUTCOVM_VERSION , header->version );
222222 }
@@ -246,7 +246,7 @@ FlatLutData FlatLutData::ViewFromBuffer(const uint8_t* buffer, size_t size)
246246
247247FlatLutData FlatLutData::ViewFromBuffer (std::span<std::byte> const & span)
248248{
249- return ViewFromBuffer (reinterpret_cast <const uint8_t *>(span.data ()), span.size_bytes ());
249+ return ViewFromBuffer (reinterpret_cast <const uint8_t *>(span.data ()), span.size_bytes ()); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
250250}
251251
252252bool FlatLutData::isLoaded () const
@@ -257,7 +257,7 @@ bool FlatLutData::isLoaded() const
257257lutHeader_t FlatLutData::previewHeader (std::ifstream& file, const char * filename)
258258{
259259 lutHeader_t tempHeader;
260- file.read (reinterpret_cast <char *>(&tempHeader), sizeof (lutHeader_t));
260+ file.read (reinterpret_cast <char *>(&tempHeader), sizeof (lutHeader_t)); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
261261 if (file.gcount () != static_cast <std::streamsize>(sizeof (lutHeader_t))) {
262262 throw framework::runtime_error_f (" Failed to read LUT header from %s" , filename);
263263 }
@@ -282,7 +282,7 @@ FlatLutData FlatLutData::loadFromFile(std::ifstream& file, const char* filename)
282282 size_t numEntries = static_cast <size_t >(data.mNchBins ) * data.mRadBins * data.mEtaBins * data.mPtBins ;
283283 size_t entriesSize = numEntries * sizeof (lutEntry_t);
284284
285- file.read (reinterpret_cast <char *>(data.data () + headerSize), entriesSize);
285+ file.read (reinterpret_cast <char *>(data.data () + headerSize), entriesSize); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
286286 if (file.gcount () != static_cast <std::streamsize>(entriesSize)) {
287287 throw framework::runtime_error_f (" Failed to read LUT entries from %s: expected %zu bytes, got %zu" , filename, entriesSize, static_cast <size_t >(file.gcount ()));
288288 }
0 commit comments