Skip to content

Commit 9e0bb81

Browse files
fphammerleWanzenBug
authored andcommitted
fix clang-tidy warning modernize-use-equals-default
1 parent 755d224 commit 9e0bb81

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ WarningsAsErrors: >-
2020
-cppcoreguidelines-pro-type-vararg,
2121
-cppcoreguidelines-special-member-functions,
2222
-modernize-use-emplace,
23-
-modernize-use-equals-default,
2423
-modernize-use-equals-delete,
2524
-modernize-use-noexcept,
2625
-performance-inefficient-vector-operation,

lib/HdfItem.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ std::string hdf4cpp::HdfItem::HdfDatasetItem::getName() const {
3232
int32 hdf4cpp::HdfItem::HdfDatasetItem::getId() const {
3333
return id;
3434
}
35-
hdf4cpp::HdfItem::HdfDatasetItem::~HdfDatasetItem() {
36-
}
35+
hdf4cpp::HdfItem::HdfDatasetItem::~HdfDatasetItem() = default;
3736
hdf4cpp::HdfItem::HdfGroupItem::HdfGroupItem(int32 id, const HdfDestroyerChain &chain)
3837
: HdfItemBase(id, VGROUP, chain) {
3938
char _name[MAX_NAME_LENGTH];
@@ -53,17 +52,15 @@ std::string hdf4cpp::HdfItem::HdfGroupItem::getName() const {
5352
int32 hdf4cpp::HdfItem::HdfGroupItem::getId() const {
5453
return id;
5554
}
56-
hdf4cpp::HdfItem::HdfGroupItem::~HdfGroupItem() {
57-
}
55+
hdf4cpp::HdfItem::HdfGroupItem::~HdfGroupItem() = default;
5856
hdf4cpp::HdfItem::HdfDataItem::HdfDataItem(int32 id, const HdfDestroyerChain &chain)
5957
: HdfItemBase(id, VDATA, chain) {
6058
this->chain.pushBack(new HdfDestroyer(&VSdetach, id));
6159
char _name[MAX_NAME_LENGTH];
6260
VSinquire(id, &nrRecords, &interlace, nullptr, &recordSize, _name);
6361
name = std::string(_name);
6462
}
65-
hdf4cpp::HdfItem::HdfDataItem::~HdfDataItem() {
66-
}
63+
hdf4cpp::HdfItem::HdfDataItem::~HdfDataItem() = default;
6764
hdf4cpp::HdfAttribute hdf4cpp::HdfItem::HdfDataItem::getAttribute(const std::string &name) const {
6865
return HdfAttribute(new HdfAttribute::HdfDataAttribute(id, name, chain));
6966
}

tests/HdfFileTest.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ using namespace hdf4cpp;
99

1010
class HdfFileTest : public ::testing::Test {
1111
protected:
12-
HdfFileTest()
13-
: file(std::string(TEST_DATA_PATH) + "small_test.hdf") {
14-
}
15-
16-
HdfFile file;
12+
HdfFile file{TEST_DATA_PATH "small_test.hdf"};
1713
};
1814

1915
TEST_F(HdfFileTest, DatasetValidity) {
@@ -236,4 +232,4 @@ TEST_F(HdfFileTest, VdataDestroyer) {
236232
std::vector<int32> vec;
237233
attribute.get(vec);
238234
ASSERT_EQ(vec, std::vector<int32>({1, 2, 3, 3, 2, 1}));
239-
}
235+
}

0 commit comments

Comments
 (0)