Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/HDFGroup/hdf5 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lrknox committed Mar 23, 2021
2 parents 38575c5 + 69f3cde commit 9c02416
Show file tree
Hide file tree
Showing 28 changed files with 372 additions and 388 deletions.
3 changes: 1 addition & 2 deletions c++/src/H5DaccProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ DSetAccPropList::getConstant()
void
DSetAccPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5DataSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ DataSpace::getConstant()
void
DataSpace::deleteConstants()
{
if (ALL_ != 0)
delete ALL_;
delete ALL_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5DcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ DSetCreatPropList::getConstant()
void
DSetCreatPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5DxferProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ DSetMemXferPropList::getConstant()
void
DSetMemXferPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5FaccProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ FileAccPropList::getConstant()
void
FileAccPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5FcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ FileCreatPropList::getConstant()
void
FileCreatPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5LaccProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ LinkAccPropList::getConstant()
void
LinkAccPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5LcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ LinkCreatPropList::getConstant()
void
LinkCreatPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5OcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ ObjCreatPropList::getConstant()
void
ObjCreatPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/src/H5PropList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ PropList::getConstant()
void
PropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
delete DEFAULT_;
}

//--------------------------------------------------------------------------
Expand Down
36 changes: 12 additions & 24 deletions c++/test/dsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,15 @@ test_create(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;

// clean up and return with failure
if (dataset != NULL)
delete dataset;
delete dataset;
return -1;
}
// catch all other exceptions
catch (Exception &E) {
issue_fail_msg("test_create", __LINE__, __FILE__);

// clean up and return with failure
if (dataset != NULL)
delete dataset;
delete dataset;
return -1;
}
} // test_create
Expand Down Expand Up @@ -249,8 +247,7 @@ test_simple_io(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;

// clean up and return with failure
if (tconv_buf)
delete[] tconv_buf;
delete[] tconv_buf;
return -1;
}
} // test_simple_io
Expand Down Expand Up @@ -692,10 +689,8 @@ test_compression(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;

// clean up and return with failure
if (dataset != NULL)
delete dataset;
if (tconv_buf)
delete[] tconv_buf;
delete dataset;
delete[] tconv_buf;
return -1;
}
} // test_compression
Expand Down Expand Up @@ -885,8 +880,7 @@ test_multiopen(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;

// clean up and return with failure
if (space != NULL)
delete space;
delete space;
return -1;
}
} // test_multiopen
Expand Down Expand Up @@ -964,8 +958,7 @@ test_types(H5File &file)
cerr << " <<< "
<< "bitfield_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
if (dset != NULL)
delete dset;
delete dset;
return -1;
}

Expand Down Expand Up @@ -996,8 +989,7 @@ test_types(H5File &file)
cerr << " <<< "
<< "bitfield_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
if (dset != NULL)
delete dset;
delete dset;
throw E; // propagate the exception
}

Expand Down Expand Up @@ -1031,10 +1023,8 @@ test_types(H5File &file)
cerr << " <<< "
<< "opaque_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
if (dset != NULL)
delete dset;
if (optype != NULL)
delete optype;
delete dset;
delete optype;
throw E; // propagate the exception
}

Expand Down Expand Up @@ -1067,10 +1057,8 @@ test_types(H5File &file)
cerr << " <<< "
<< "opaque_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
if (dset != NULL)
delete dset;
if (optype != NULL)
delete optype;
delete dset;
delete optype;
throw E; // propagate the exception
}

Expand Down
12 changes: 4 additions & 8 deletions c++/test/tcompound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ test_compound_2()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}

if (array_dt)
delete array_dt;
delete array_dt;
} // test_compound_2()

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -287,8 +286,7 @@ test_compound_3()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}

if (array_dt)
delete array_dt;
delete array_dt;
} // test_compound_3()

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -407,8 +405,7 @@ test_compound_4()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}

if (array_dt)
delete array_dt;
delete array_dt;
} // test_compound_4()

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -504,8 +501,7 @@ test_compound_5()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}

if (array_dt)
delete array_dt;
delete array_dt;
} // test_compound_5()

/*-------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions c++/test/tfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ test_file_create()
catch (InvalidActionException &E) {
cerr << " *FAILED*" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
if (file1 != NULL) // clean up
delete file1;
// clean up
delete file1;
}
// catch all other exceptions
catch (Exception &E) {
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
if (file1 != NULL) // clean up
delete file1;
// clean up
delete file1;
}

// Setting this to NULL for cleaning up in failure situations
Expand Down Expand Up @@ -260,8 +260,8 @@ test_file_create()
// catch all exceptions
catch (Exception &E) {
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
if (tmpl1 != NULL) // clean up
delete tmpl1;
// clean up
delete tmpl1;
}
} // test_file_create()

Expand Down
9 changes: 3 additions & 6 deletions c++/test/trefer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ test_reference_params()
issue_fail_msg("test_reference_param()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}

if (file1)
delete file1;
delete file1;
} /* test_reference_param() */

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -374,8 +373,7 @@ test_reference_obj()
issue_fail_msg("test_reference_obj()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}

if (file1)
delete file1;
delete file1;
} // test_reference_obj()

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -518,8 +516,7 @@ test_reference_group()
issue_fail_msg("test_reference_group()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}

if (file1)
delete file1;
delete file1;
} /* test_reference_group() */

/*-------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions c++/test/ttypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,7 @@ test_named()
issue_fail_msg("test_named", __LINE__, __FILE__, E.getCDetailMsg());
}

if (ds_type)
delete ds_type;
delete ds_type;
} // test_named

/*-------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions c++/test/tvlstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ test_vlstring_array_dataset()
issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
}

if (file1)
delete file1;
delete file1;
} // end test_vlstring_array_dataset()

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -527,8 +526,7 @@ test_vlstring_type()
issue_fail_msg("test_vlstring_type()", __LINE__, __FILE__, E.getCDetailMsg());
}

if (file1)
delete file1;
delete file1;
} // end test_vlstring_type()

/*-------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 9c02416

Please sign in to comment.