Skip to content

Commit

Permalink
Hdf5 merge issue 458 v110 (#465)
Browse files Browse the repository at this point in the history
* close #195. (#196)

* Update HDF5PluginMacros.cmake

* Update HDF5PluginMacros.cmake

* Modify temporary rpath for testing in java example scripts. (#230)

* Fix undefined left shifting of negative numbers (#338)

Undefined Bahavior Sanitizer errored here about left shifting negative numbers.

* Update license url (#332)

* Modify temporary rpath for testing in java example scripts.

* Update URL in source file Copyright headers for web copy of COPYING
file - src and test directories.

* Applied clang-tidy readability-non-const-parameter warning fixes auto… (#429)

* Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes

Removes useless const declarations.

* Fixed most readability-non-const-parameter warnings

These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature.

* Reformat source with clang v10.0.1.

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>

* Added C++11 override keyword where appropriate (#433)

Added H5_OVERRIDE macro for compatibility with both C++11 and older.

* Various clang tidy warning fixes (#448)

* Fixed clang-tidy bugprone-reserved-identifier warnings

* Fixed clang-tidy bugprone-assert-side-effect warnings

* Fixed clang-tidy bugprone-copy-constructor-init warning

* Fixed clang-tidy readability-redundant-preprocessor warning

For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block.

Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing.  Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS.

* Fixed clang-tidy readability-redundant-string-init warnings

* Fixed some clang-tidy performance-type-promotion-in-math-fn warnings

* Fixed clang-tidy performance-unnecessary-value-param warnings

* Reformat source with clang v10.0.1.

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>

* Removed checks/workarounds for pre-C++89 compatibility (#449)

After 30+ years, just assume that the following exist:
- extension-less includes
- namespaces
- std::
- static_cast
- bool

* Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451)

* Fixed all clang-tidy bugprone-suspicious-string-compare warnings

This change was generated entirely by clang-tidy itself.

* Reformat code with clang v10.0.1.

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>

* Fix clang-tidy suspicious string compare in H5A.c missed in merge.

Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Co-authored-by: Sean McBride <sean@rogue-research.com>
  • Loading branch information
3 people authored Mar 12, 2021
1 parent bf4399b commit b42635a
Show file tree
Hide file tree
Showing 143 changed files with 720 additions and 930 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake)
include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake)

if (CMAKE_NO_STD_NAMESPACE)
set (H5_NO_STD 1)
endif ()
add_subdirectory (c++)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
Expand Down
4 changes: 0 additions & 4 deletions c++/examples/chunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
* We will read from the file created by extend.cpp
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
using std::cout;
using std::endl;

Expand Down
4 changes: 0 additions & 4 deletions c++/examples/compound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
* and read back fields' subsets.
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
using std::cout;
using std::endl;

Expand Down
4 changes: 0 additions & 4 deletions c++/examples/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
* This example writes a dataset to a new HDF5 file.
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif

#include <string>
#include "H5Cpp.h"
Expand Down
4 changes: 0 additions & 4 deletions c++/examples/extend_ds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
*
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>

using std::cout;
Expand Down
4 changes: 0 additions & 4 deletions c++/examples/h5group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
* the C version is used in this example.
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
using std::cout;
using std::endl;

Expand Down
4 changes: 0 additions & 4 deletions c++/examples/readdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
// information about the dataset in the SDS.h5 file is obtained.
//

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
using std::cout;
using std::endl;

Expand Down
36 changes: 6 additions & 30 deletions c++/examples/testh5c++.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ temp_FILES="a.out $applib"
cat > $appmain <<EOF
#include <string>
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include "H5Cpp.h"
Expand All @@ -95,19 +91,11 @@ EOF

# generate prog1
cat > $prog1 <<EOF
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <iostream>
#include <string>
#ifndef H5_NO_NAMESPACE
#ifndef H5_NO_STD
using std::cout;
using std::endl;
#endif // H5_NO_STD
#endif
using std::cout;
using std::endl;
int sub1(void)
{
cout << "in sub1" << endl;
Expand All @@ -117,19 +105,11 @@ EOF

# generate prog2
cat > $prog2 <<EOF
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <iostream>
#include <string>
#ifndef H5_NO_NAMESPACE
#ifndef H5_NO_STD
using std::cout;
using std::endl;
#endif // H5_NO_STD
#endif
using std::cout;
using std::endl;
int sub2(void)
{
cout << "in sub2" << endl;
Expand All @@ -142,11 +122,7 @@ EOF
cat > $hdf5main <<EOF
#include <string>
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include "H5Cpp.h"
Expand Down
4 changes: 0 additions & 4 deletions c++/examples/writedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
* file is closed. Program reopens the file and reads and displays the result.
*/

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
using std::cout;
using std::endl;

Expand Down
6 changes: 1 addition & 5 deletions c++/src/H5Attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>

#include "H5private.h" // for HDfree
Expand Down Expand Up @@ -312,7 +308,7 @@ Attribute::getName(char *attr_name, size_t buf_size) const
H5std_string
Attribute::getName() const
{
H5std_string attr_name(""); // attribute name to return
H5std_string attr_name; // attribute name to return

// Preliminary call to get the size of the attribute name
ssize_t name_size = H5Aget_name(id, static_cast<size_t>(0), NULL);
Expand Down
4 changes: 0 additions & 4 deletions c++/src/H5DataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>

#include "H5private.h" // for HDfree
Expand Down
4 changes: 0 additions & 4 deletions c++/src/H5DataSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>

#include "H5Include.h"
Expand Down
8 changes: 4 additions & 4 deletions c++/src/H5DataSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
DataSpace &operator=(const DataSpace &rhs);

// Closes this dataspace.
virtual void close();
virtual void close() H5_OVERRIDE;

// Makes copy of an existing dataspace.
void copy(const DataSpace &like_space);
Expand Down Expand Up @@ -115,13 +115,13 @@ class H5_DLLCPP DataSpace : public IdComponent {

///\brief Returns this class name.
virtual H5std_string
fromClass() const
fromClass() const H5_OVERRIDE
{
return ("DataSpace");
}

// Gets the dataspace id.
virtual hid_t getId() const;
virtual hid_t getId() const H5_OVERRIDE;

// Deletes the global constant
static void deleteConstants();
Expand All @@ -133,7 +133,7 @@ class H5_DLLCPP DataSpace : public IdComponent {

protected:
// Sets the dataspace id.
virtual void p_setId(const hid_t new_id);
virtual void p_setId(const hid_t new_id) H5_OVERRIDE;

#endif // DOXYGEN_SHOULD_SKIP_THIS

Expand Down
4 changes: 0 additions & 4 deletions c++/src/H5DataType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>

#include "H5Include.h"
Expand Down
4 changes: 2 additions & 2 deletions c++/src/H5DcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const char *src_fname, co
// Programmer Binh-Minh Ribler - Mar, 2017
//--------------------------------------------------------------------------
void
DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fname,
const H5std_string src_dsname, const DataSpace &sspace) const
DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string &src_fname,
const H5std_string &src_dsname, const DataSpace &sspace) const
{
setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace);
}
Expand Down
2 changes: 1 addition & 1 deletion c++/src/H5DcreatProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
// Maps elements of a virtual dataset to elements of the source dataset.
void setVirtual(const DataSpace &vspace, const char *src_fname, const char *src_dsname,
const DataSpace &sspace) const;
void setVirtual(const DataSpace &vspace, const H5std_string src_fname, const H5std_string src_dsname,
void setVirtual(const DataSpace &vspace, const H5std_string &src_fname, const H5std_string &src_dsname,
const DataSpace &sspace) const;

///\brief Returns this class name.
Expand Down
2 changes: 1 addition & 1 deletion c++/src/H5DxferProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ DSetMemXferPropList::getDataTransform() const
{
// Initialize string to "", so that if there is no expression, the returned
// string will be empty
H5std_string expression("");
H5std_string expression;

// Preliminary call to get the expression's length
ssize_t exp_len = H5Pget_data_transform(id, NULL, (size_t)0);
Expand Down
2 changes: 1 addition & 1 deletion c++/src/H5Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const char Exception::DEFAULT_MSG[] = "No detailed information provided";
///\brief Default constructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Exception::Exception() : detail_message(""), func_name("") {}
Exception::Exception() {}

//--------------------------------------------------------------------------
// Function: Exception overloaded constructor
Expand Down
Loading

0 comments on commit b42635a

Please sign in to comment.