diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-04-07 14:23:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 14:23:35 (GMT) |
commit | 13d852d89ede307314adbfaa036fe670dfa75554 (patch) | |
tree | f3e66489a150de1fd493365cf5cf535963679e5d /hl | |
parent | 541bc15452f71f3eae7471fdecbe7994a7f138e2 (diff) | |
download | hdf5-13d852d89ede307314adbfaa036fe670dfa75554.zip hdf5-13d852d89ede307314adbfaa036fe670dfa75554.tar.gz hdf5-13d852d89ede307314adbfaa036fe670dfa75554.tar.bz2 |
1.12: Brings C++ wrappers in line with develop, minus C++11 bits (#1604)
Diffstat (limited to 'hl')
-rw-r--r-- | hl/c++/src/H5PacketTable.cpp | 15 | ||||
-rw-r--r-- | hl/c++/src/H5PacketTable.h | 5 | ||||
-rw-r--r-- | hl/c++/test/ptableTest.cpp | 10 |
3 files changed, 16 insertions, 14 deletions
diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index 0f47b0d..07b82c5 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -28,6 +28,14 @@ /* PacketTable superclass */ /********************************/ +/* Null constructor + * Sets table_id to "invalid" + */ +PacketTable::PacketTable() +{ + table_id = H5I_INVALID_HID; +} + /* "Open" Constructor * Opens an existing packet table, which can contain either fixed-length or * variable-length packets. @@ -59,10 +67,7 @@ PacketTable::~PacketTable() bool PacketTable::IsValid() { - if (H5PTis_valid(table_id) == 0) - return true; - else - return false; + return H5PTis_valid(table_id) == 0; } /* IsVariableLength @@ -271,7 +276,7 @@ FL_PacketTable::GetPackets(hsize_t startIndex, hsize_t endIndex, void *data) if (startIndex > endIndex) return -1; - return H5PTread_packets(table_id, startIndex, (size_t)(endIndex - startIndex + 1), data); + return H5PTread_packets(table_id, startIndex, static_cast<size_t>(endIndex - startIndex + 1), data); } /* GetNextPacket (single packet) diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index 95e53e3..eae66f1 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -33,10 +33,7 @@ class H5_HLCPPDLL PacketTable { /* Null constructor * Sets table_id to H5I_INVALID_HID */ - PacketTable() - { - table_id = H5I_INVALID_HID; - } + PacketTable(); /* "Open" Constructor * Opens an existing packet table, which can contain either fixed-length or diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9616c1b..33199f1 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -223,7 +223,7 @@ TestGetNext() for (record = 1; record < 6; record++) wrapper.AppendPacket(&record); - /* Ensure that we can interate through the records and get the right ones */ + /* Ensure that we can iterate through the records and get the right ones */ for (i = 1; i < 6; i++) { wrapper.GetNextPacket(&record); if (record != i) @@ -237,7 +237,7 @@ TestGetNext() if (error < 0) goto error; - /* Ensure that we can interate through the records and get the right ones */ + /* Ensure that we can iterate through the records and get the right ones */ for (i = 1; i < 6; i++) { error = wrapper.GetNextPacket(&record); if (record != i || error < 0) @@ -307,7 +307,7 @@ TestCompress() if (HDstrncmp(filter_name, "deflate", 7) != 0) H5_FAILED() } - catch (Exception e) { + catch (Exception const &) { H5_FAILED(); return 1; } @@ -605,8 +605,8 @@ const int STRING_LENGTH = 19; // including terminating NULL int TestHDFFV_9758() { - hid_t strtype; - hid_t compound_type; + hid_t strtype = H5I_INVALID_HID; + hid_t compound_type = H5I_INVALID_HID; herr_t err; struct s1_t { int a; |