Skip to content

Commit

Permalink
[Modernize] Use auto when initializing with a cast to avoid duplicati…
Browse files Browse the repository at this point in the history
…ng the type name. NFC.
  • Loading branch information
Arnaud-de-Grandmaison-ARM committed Apr 24, 2024
1 parent 5f0cbcf commit 8f8ebad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/PAF/WAN/FSTWaveFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct FSTHierarchyVisitorBase {
template <class BuilderTy> struct FSTWaveBuilderBase {
static void callback(void *user_callback_data_pointer, uint64_t time,
fstHandle facidx, const unsigned char *value) {
BuilderTy *B = static_cast<BuilderTy *>(user_callback_data_pointer);
auto *B = static_cast<BuilderTy *>(user_callback_data_pointer);
B->process(time, facidx, value);
}
fstHandle getHandle() const {
Expand Down
2 changes: 1 addition & 1 deletion lib/SCA/sca-apps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class NumpyOutput : public OutputBase {

assert(decimate > 0 && "decimate can not be 0");

ofstream *ofs = dynamic_cast<ofstream *>(out);
auto *ofs = dynamic_cast<ofstream *>(out);
if (!ofs)
reporter->errx(EXIT_FAILURE, "Numpy output must be a file");
if (decimate == 1) {
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/NPArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ void testViewAs(size_t rows, size_t cols, const vector<fromTy> &init) {
EXPECT_EQ(T.cols(), cols * sizeof(fromTy) / sizeof(newTy));
EXPECT_EQ(T.elementSize(), sizeof(newTy));

const newTy *init2 = reinterpret_cast<const newTy *>(init.data());
const auto *init2 = reinterpret_cast<const newTy *>(init.data());

for (size_t r = 0; r < T.rows(); r++)
for (size_t c = 0; c < T.cols(); c++)
Expand Down

0 comments on commit 8f8ebad

Please sign in to comment.