summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2022-04-05 13:20:19 (GMT)
committerGitHub <noreply@github.com>2022-04-05 13:20:19 (GMT)
commitbddd148fd29deb18439767c416199914845431b8 (patch)
tree9afaa591016c2ae1fe1978d4573c80303420d922 /c++
parent99ba670f6add3bf83c0361537230e686f3976d1e (diff)
downloadhdf5-bddd148fd29deb18439767c416199914845431b8.zip
hdf5-bddd148fd29deb18439767c416199914845431b8.tar.gz
hdf5-bddd148fd29deb18439767c416199914845431b8.tar.bz2
Misc fixes from develop nov21 - feb22 (#1580)
* Make default to build high-level tools the same as default for (#1234) high-level library. * Updated README.txt to README.md (#1375) * H5Lexists docs: Removed reference to 1.8.16 since the change is the 1.8.x releases, HDFFV-11289 * H5Oget_info_by_name, name can be any object, not just a group * Converted README.txt to README.md and updated files referring to README.txt to README.md. * removed references to README.txt * updated MANIFEST * Snprintf2 (#1399) * Replaced many uses of sprintf with safer snprintf Many very straightforward, but in a few cases added a length parameter to some private functions, because buffer length was otherwise unknowable. * Removed unnecessary use of static on small buffers This improves thread safety. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Replaced several uses of sprintf with safer snprintf (#1383) * Replaced several uses of sprintf with safer snprintf * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Used clang-tidy to change all floating point f suffixes to F (#1359) * Added another missing override keyword on a dtor (#1384) * Creating FUNDING.yml (#1427) * Creating FUNDING.yml Will add sponsor this project widget to the repo's page. * Correct file name Add sponsor widget; filename typo fixed. * Update MANIFEST * Fixed AbstractDs::getVarLenType documentation (#1441) * Committing clang-format changes * Open bsd fixes (#1195) * Fix end of line alignment. Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: loricooperhdf <lori.cooper@hdfgroup.org> Co-authored-by: myd7349 <myd7349@gmail.com>
Diffstat (limited to 'c++')
-rw-r--r--c++/src/H5AbstractDs.cpp2
-rw-r--r--c++/src/H5Location.h2
-rw-r--r--c++/test/tattr.cpp8
-rw-r--r--c++/test/th5s.cpp2
-rw-r--r--c++/test/titerate.cpp2
-rw-r--r--c++/test/tvlstr.cpp10
6 files changed, 13 insertions, 13 deletions
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index eeb0155..70d8531 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -302,7 +302,7 @@ AbstractDs::getStrType() const
//--------------------------------------------------------------------------
// Function: AbstractDs::getVarLenType
-///\brief Returns the floating-point datatype of this abstract dataset,
+///\brief Returns the variable length datatype of this abstract dataset,
/// which can be a dataset or an attribute.
///\return VarLenType instance
///\exception H5::DataTypeIException
diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h
index 740d0ce..27ddd54 100644
--- a/c++/src/H5Location.h
+++ b/c++/src/H5Location.h
@@ -334,7 +334,7 @@ class H5_DLLCPP H5Location : public IdComponent {
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Noop destructor.
- virtual ~H5Location();
+ virtual ~H5Location() override;
}; // end of H5Location
} // namespace H5
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index adaa237..bd6a8c0 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -93,7 +93,7 @@ struct attr4_struct {
const H5std_string ATTR5_NAME("Attr5");
const int ATTR5_RANK = 0;
-float attr_data5 = (float)-5.123; // Test data for 5th attribute
+float attr_data5 = -5.123F; // Test data for 5th attribute
/* Info for another attribute */
const H5std_string ATTR1A_NAME("Attr1_a");
@@ -1741,7 +1741,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl)
unsigned attr_num;
for (attr_num = 0; attr_num < max_compact; attr_num++) {
// Create attribute
- sprintf(attr_name, "attr %02u", attr_num);
+ snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num);
Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space);
// Write data to the attribute
@@ -1753,7 +1753,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl)
{ // Add one more attribute, to push into "dense" storage
// Create another attribute
- sprintf(attr_name, "attr %02u", attr_num);
+ snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num);
Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space);
// Write data to the attribute
@@ -1763,7 +1763,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl)
// Attempt to add attribute again, which should fail
try {
// Create another attribute
- sprintf(attr_name, "attr %02u", attr_num);
+ snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num);
Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space);
// continuation here, that means no exception has been thrown
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index 9952e68..9dd92fa 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -73,7 +73,7 @@ struct space4_struct {
unsigned u;
float f;
char c2;
-} space4_data = {'v', 987123, (float)-3.14, 'g'}; /* Test data for 4th dataspace */
+} space4_data = {'v', 987123, -3.14F, 'g'}; /* Test data for 4th dataspace */
/* Null dataspace */
int space5_data = 7;
diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp
index 7fb64c4..5b8039f 100644
--- a/c++/test/titerate.cpp
+++ b/c++/test/titerate.cpp
@@ -161,7 +161,7 @@ test_iter_group(FileAccPropList &fapl)
DataSpace filespace;
for (i = 0; i < NDATASETS; i++) {
- sprintf(name, "Dataset %d", i);
+ snprintf(name, sizeof(name), "Dataset %d", i);
// Create a dataset in the file
DataSet dataset = file.createDataSet(name, datatype, filespace);
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index b371518..7a7b854 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -911,32 +911,32 @@ test_vl_rewrite()
int i;
char name[256]; // Buffer for names & data
for (i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ snprintf(name, sizeof(name), "/set_%d", i);
write_scalar_dset(file1, type, space, name, name);
}
// Effectively copy data from file 1 to 2.
for (i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ snprintf(name, sizeof(name), "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
}
// Read back from file 2.
for (i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ snprintf(name, sizeof(name), "/set_%d", i);
read_scalar_dset(file2, type, space, name, name);
}
// Remove from file 2.
for (i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ snprintf(name, sizeof(name), "/set_%d", i);
file2.unlink(name);
}
// Effectively copy from file 1 to file 2.
for (i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ snprintf(name, sizeof(name), "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
}