Skip to content

Commit 15de86e

Browse files
author
Chuck Atkins
committed
Reinstate the use of reinterpret_cast
1 parent a4ad2d7 commit 15de86e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Checks: -*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-google-runtime-int
1+
Checks: -*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-type-reinterpret-cast,-google-runtime-int
22

33
CheckOptions:
44
- key: google-runtime-int.TypeSuffix

source/format/BP1Writer.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void BP1Writer::WriteProcessGroupIndex(
7272

7373
// offset to pg in data in metadata which is the current absolute position
7474
CopyToBuffer(metadataBuffer,
75-
static_cast<uint64_t *>(&heap.m_DataAbsolutePosition));
75+
reinterpret_cast<uint64_t *>(&heap.m_DataAbsolutePosition));
7676

7777
// Back to writing metadata pg index length (length of group)
7878
const std::uint16_t metadataPGIndexLength =
@@ -206,7 +206,7 @@ void BP1Writer::WriteDimensionsRecord(
206206
auto lf_WriteFlaggedDim = [](std::vector<char> &buffer, const char no,
207207
const std::size_t dimension) {
208208
CopyToBuffer(buffer, &no);
209-
CopyToBuffer(buffer, static_cast<const uint64_t *>(&dimension));
209+
CopyToBuffer(buffer, reinterpret_cast<const uint64_t *>(&dimension));
210210
};
211211

212212
// BODY Starts here
@@ -227,8 +227,8 @@ void BP1Writer::WriteDimensionsRecord(
227227
{
228228
for (const auto &localDimension : localDimensions)
229229
{
230-
CopyToBuffer(buffer,
231-
static_cast<const uint64_t *>(&localDimension));
230+
CopyToBuffer(buffer, reinterpret_cast<const uint64_t *>(
231+
&localDimension));
232232
buffer.insert(buffer.end(), skip, 0);
233233
}
234234
}
@@ -250,12 +250,12 @@ void BP1Writer::WriteDimensionsRecord(
250250
{
251251
for (unsigned int d = 0; d < localDimensions.size(); ++d)
252252
{
253-
CopyToBuffer(
254-
buffer, static_cast<const uint64_t *>(&localDimensions[d]));
255-
CopyToBuffer(buffer, static_cast<const uint64_t *>(
253+
CopyToBuffer(buffer, reinterpret_cast<const uint64_t *>(
254+
&localDimensions[d]));
255+
CopyToBuffer(buffer, reinterpret_cast<const uint64_t *>(
256256
&globalDimensions[d]));
257-
CopyToBuffer(buffer,
258-
static_cast<const uint64_t *>(&globalOffsets[d]));
257+
CopyToBuffer(buffer, reinterpret_cast<const uint64_t *>(
258+
&globalOffsets[d]));
259259
}
260260
}
261261
}

0 commit comments

Comments
 (0)