diff options
Diffstat (limited to 'hl/c++/src')
-rw-r--r-- | hl/c++/src/H5PacketTable.cpp | 15 | ||||
-rw-r--r-- | hl/c++/src/H5PacketTable.h | 5 |
2 files changed, 11 insertions, 9 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 |