Skip to content

Commit 3b47e2d

Browse files
authored
Remove hbool_t from the public API (#5802)
* Remove hbool_t from the public API This was previously removed from the source code, but the API calls retained hbool_t in the public API calls. This commit removes hbool_t from the public APIs. hbool_t is retained as a typedef for bool in H5public.h so existing code doesn't break.
1 parent 3363183 commit 3b47e2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+254
-241
lines changed

HDF5Examples/C/H5PAR/ph5_filtered_writes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* if one is needed.
2727
*/
2828

29+
#include <stdbool.h>
2930
#include <stdlib.h>
3031

3132
#include "hdf5.h"
@@ -102,7 +103,7 @@ fill_databuf(hsize_t start[], hsize_t count[], hsize_t stride[], C_DATATYPE *dat
102103
static void
103104
cleanup(char *filename)
104105
{
105-
hbool_t do_cleanup = getenv(HDF5_NOCLEANUP) ? 0 : 1;
106+
bool do_cleanup = getenv(HDF5_NOCLEANUP) ? false : true;
106107

107108
if (do_cleanup)
108109
MPI_File_delete(filename, MPI_INFO_NULL);

HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* if one is needed.
2828
*/
2929

30+
#include <stdbool.h>
3031
#include <stdlib.h>
3132

3233
#include "hdf5.h"
@@ -102,7 +103,7 @@ fill_databuf(hsize_t start[], hsize_t count[], hsize_t stride[], C_DATATYPE *dat
102103
static void
103104
cleanup(char *filename)
104105
{
105-
hbool_t do_cleanup = getenv(HDF5_NOCLEANUP) ? 0 : 1;
106+
bool do_cleanup = getenv(HDF5_NOCLEANUP) ? false : true;
106107

107108
if (do_cleanup)
108109
MPI_File_delete(filename, MPI_INFO_NULL);
@@ -125,7 +126,7 @@ write_dataset_some_no_sel(hid_t file_id, hid_t dxpl_id)
125126
hsize_t start[EXAMPLE_DSET_DIMS];
126127
hsize_t stride[EXAMPLE_DSET_DIMS];
127128
hsize_t count[EXAMPLE_DSET_DIMS];
128-
hbool_t no_selection;
129+
bool no_selection;
129130
hid_t dset_id = H5I_INVALID_HID;
130131
hid_t dcpl_id = H5I_INVALID_HID;
131132
hid_t file_dataspace = H5I_INVALID_HID;

HDF5Examples/C/H5PAR/ph5_subfiling.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* is needed.
2828
*/
2929

30+
#include <stdbool.h>
3031
#include <stdlib.h>
3132

3233
#include "hdf5.h"
@@ -51,7 +52,7 @@ typedef int EXAMPLE_DSET_C_DATATYPE;
5152
static void
5253
cleanup(char *filename, hid_t fapl_id)
5354
{
54-
hbool_t do_cleanup = getenv(HDF5_NOCLEANUP) ? 0 : 1;
55+
bool do_cleanup = getenv(HDF5_NOCLEANUP) ? false : true;
5556

5657
if (do_cleanup)
5758
H5Fdelete(filename, fapl_id);

bin/trace

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ $Source = "";
4040
"H5A_info_t" => "Ai",
4141
"H5A_operator1_t" => "Ao",
4242
"H5A_operator2_t" => "AO",
43-
"hbool_t" => "b",
4443
"bool" => "b",
4544
"H5AC_cache_config_t" => "Cc",
4645
"H5AC_cache_image_config_t" => "CC",

c++/src/C2Cppfunction_map.htm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5323,7 +5323,7 @@
53235323
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
53245324
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
53255325
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
5326-
normal'>void FileAccPropList::setCore (size_t increment, hbool_t
5326+
normal'>void FileAccPropList::setCore (size_t increment, bool
53275327
backing_store)</p>
53285328
</td>
53295329
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
@@ -5360,7 +5360,7 @@
53605360
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
53615361
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
53625362
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
5363-
normal'>void FileAccPropList::getCore (size_t&amp; increment, hbool_t&amp;
5363+
normal'>void FileAccPropList::getCore (size_t&amp; increment, bool&amp;
53645364
backing_store)</p>
53655365
</td>
53665366
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
@@ -9226,7 +9226,7 @@
92269226
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
92279227
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
92289228
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
9229-
normal'>void CommonFG::getObjinfo( const char* name, hbool_t follow_link,
9229+
normal'>void CommonFG::getObjinfo( const char* name, bool follow_link,
92309230
H5G_stat_t&amp; statbuf )</p>
92319231
</td>
92329232
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
@@ -9257,7 +9257,7 @@
92579257
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
92589258
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
92599259
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
9260-
normal'>void CommonFG::getObjinfo( const H5std_string&amp; name, hbool_t
9260+
normal'>void CommonFG::getObjinfo( const H5std_string&amp; name, bool
92619261
follow_link, H5G_stat_t&amp; statbuf )</p>
92629262
</td>
92639263
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
@@ -15330,7 +15330,7 @@
1533015330
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
1533115331
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
1533215332
normal'>void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t
15333-
strategy, hbool_t persist, hsize_t threshold)</p>
15333+
strategy, bool persist, hsize_t threshold)</p>
1533415334
</td>
1533515335
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
1533615336
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
@@ -15368,7 +15368,7 @@
1536815368
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
1536915369
normal'>void
1537015370
FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t&amp; strategy,
15371-
hbool_t&amp; persist, hsize_t&amp; threshold)</p>
15371+
bool&amp; persist, hsize_t&amp; threshold)</p>
1537215372
</td>
1537315373
<td width=35 valign=top style='width:26.05pt;border-top:none;border-left:
1537415374
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;

c++/src/H5DxferProp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ DSetMemXferPropList::getBuffer(void **tconv, void **bkg) const
164164
void
165165
DSetMemXferPropList::setPreserve(bool status) const
166166
{
167-
herr_t ret_value = H5Pset_preserve(id, static_cast<hbool_t>(status));
167+
herr_t ret_value = H5Pset_preserve(id, static_cast<bool>(status));
168168
if (ret_value < 0) {
169169
throw PropListIException("DSetMemXferPropList::setPreserve", "H5Pset_preserve failed");
170170
}

c++/src/H5FaccProp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ FileAccPropList::getFamilyOffset() const
207207
/// refer to the H5Pset_fapl_core API in the HDF5 C Reference Manual.
208208
//--------------------------------------------------------------------------
209209
void
210-
FileAccPropList::setCore(size_t increment, hbool_t backing_store) const
210+
FileAccPropList::setCore(size_t increment, bool backing_store) const
211211
{
212212
herr_t ret_value = H5Pset_fapl_core(id, increment, backing_store);
213213
if (ret_value < 0) {
@@ -224,7 +224,7 @@ FileAccPropList::setCore(size_t increment, hbool_t backing_store) const
224224
///\exception H5::PropListIException
225225
//--------------------------------------------------------------------------
226226
void
227-
FileAccPropList::getCore(size_t &increment, hbool_t &backing_store) const
227+
FileAccPropList::getCore(size_t &increment, bool &backing_store) const
228228
{
229229
herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store);
230230
if (ret_value < 0) {
@@ -667,7 +667,7 @@ FileAccPropList::getGcReferences() const
667667
/// the HDF5 C Reference Manual.
668668
//--------------------------------------------------------------------------
669669
void
670-
FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const
670+
FileAccPropList::setFileLocking(bool use_file_locking, bool ignore_when_disabled) const
671671
{
672672
herr_t ret_value = H5Pset_file_locking(id, use_file_locking, ignore_when_disabled);
673673

@@ -689,7 +689,7 @@ FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_di
689689
/// the HDF5 C Reference Manual.
690690
//--------------------------------------------------------------------------
691691
void
692-
FileAccPropList::getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const
692+
FileAccPropList::getFileLocking(bool &use_file_locking, bool &ignore_when_disabled) const
693693
{
694694
herr_t ret_value = H5Pget_file_locking(id, &use_file_locking, &ignore_when_disabled);
695695

c++/src/H5FaccProp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ class H5CPP_DLL FileAccPropList : public PropList {
4949

5050
// Modifies this file access property list to use the H5FD_CORE
5151
// driver.
52-
void setCore(size_t increment, hbool_t backing_store) const;
52+
void setCore(size_t increment, bool backing_store) const;
5353

5454
// Queries H5FD_CORE driver properties.
55-
void getCore(size_t &increment, hbool_t &backing_store) const;
55+
void getCore(size_t &increment, bool &backing_store) const;
5656

5757
// Sets this file access properties list to the family driver.
5858
void setFamily(hsize_t memb_size, const FileAccPropList &memb_plist) const;
@@ -122,10 +122,10 @@ class H5CPP_DLL FileAccPropList : public PropList {
122122
unsigned getGcReferences() const;
123123

124124
// Sets file locking parameters.
125-
void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const;
125+
void setFileLocking(bool use_file_locking, bool ignore_when_disabled) const;
126126

127127
// Gets file locking parameters.
128-
void getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const;
128+
void getFileLocking(bool &use_file_locking, bool &ignore_when_disabled) const;
129129

130130
// Sets bounds on versions of library format to be used when creating
131131
// or writing objects.

c++/src/H5FcreatProp.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@ FileCreatPropList::getIstorek() const
292292
/// API in the HDF5 C Reference Manual.
293293
//--------------------------------------------------------------------------
294294
void
295-
FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist,
296-
hsize_t threshold) const
295+
FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, bool persist, hsize_t threshold) const
297296
{
298297
herr_t ret_value = H5Pset_file_space_strategy(id, strategy, persist, threshold);
299298
if (ret_value < 0) {
@@ -312,7 +311,7 @@ FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t
312311
///\exception H5::PropListIException
313312
//--------------------------------------------------------------------------
314313
void
315-
FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t &strategy, hbool_t &persist,
314+
FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t &strategy, bool &persist,
316315
hsize_t &threshold) const
317316
{
318317
herr_t ret_value = H5Pget_file_space_strategy(id, &strategy, &persist, &threshold);

c++/src/H5FcreatProp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class H5CPP_DLL FileCreatPropList : public PropList {
6363

6464
// Sets the strategy and the threshold value that the library will
6565
// will employ in managing file space.
66-
void setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const;
66+
void setFileSpaceStrategy(H5F_fspace_strategy_t strategy, bool persist, hsize_t threshold) const;
6767

6868
// Returns the strategy that the library uses in managing file space.
69-
void getFileSpaceStrategy(H5F_fspace_strategy_t &strategy, hbool_t &persist, hsize_t &threshold) const;
69+
void getFileSpaceStrategy(H5F_fspace_strategy_t &strategy, bool &persist, hsize_t &threshold) const;
7070

7171
// Sets the file space page size for paged aggregation.
7272
void setFileSpacePagesize(hsize_t fsp_psize) const;

0 commit comments

Comments
 (0)