diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-09-05 21:52:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 21:52:30 (GMT) |
commit | 8253ab9ebf6a082dc07eb931f27b169d6a45d577 (patch) | |
tree | 47630856491e54f5d28e1608ffa5e2f976dc9c95 /src/H5FDcore.c | |
parent | 920869796031ed4ee9c1fbea8aaccda3592a88b3 (diff) | |
download | hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.zip hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.tar.gz hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.tar.bz2 |
Convert hbool_t --> bool in src (#3496)
* hbool_t --> bool in src
* Does not remove TRUE/FALSE
* Public header files are unchanged
* Public API calls are unchanged
* TRUE/FALSE --> true/false in src
* Add deprecation notice for hbool_t
Diffstat (limited to 'src/H5FDcore.c')
-rw-r--r-- | src/H5FDcore.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a48a314..b54b1f1 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -52,10 +52,10 @@ typedef struct H5FD_core_t { haddr_t eoa; /* end of allocated region */ haddr_t eof; /* current allocated size */ size_t increment; /* multiples for mem allocation */ - hbool_t backing_store; /* write to file name on flush */ - hbool_t write_tracking; /* Whether to track writes */ + bool backing_store; /* write to file name on flush */ + bool write_tracking; /* Whether to track writes */ size_t bstore_page_size; /* backing store page size */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; int fd; /* backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ #ifndef H5_HAVE_WIN32_API @@ -85,22 +85,22 @@ typedef struct H5FD_core_t { HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ - hbool_t dirty; /* changes not saved? */ + bool dirty; /* changes not saved? */ H5FD_file_image_callbacks_t fi_callbacks; /* file image callbacks */ H5SL_t *dirty_list; /* dirty parts of the file */ } H5FD_core_t; /* Driver-specific file access properties */ typedef struct H5FD_core_fapl_t { - size_t increment; /* how much to grow memory */ - hbool_t backing_store; /* write to file name on flush */ - hbool_t write_tracking; /* Whether to track writes */ - size_t page_size; /* Page size for tracked writes */ + size_t increment; /* how much to grow memory */ + bool backing_store; /* write to file name on flush */ + bool write_tracking; /* Whether to track writes */ + size_t page_size; /* Page size for tracked writes */ } H5FD_core_fapl_t; /* Allocate memory in multiples of this size by default */ #define H5FD_CORE_INCREMENT 8192 -#define H5FD_CORE_WRITE_TRACKING_FLAG FALSE +#define H5FD_CORE_WRITE_TRACKING_FLAG false #define H5FD_CORE_WRITE_TRACKING_PAGE_SIZE 524288 /* These macros check for overflow of various quantities. These macros @@ -140,9 +140,9 @@ static herr_t H5FD__core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha void *buf); static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__core_lock(H5FD_t *_file, bool rw); static herr_t H5FD__core_unlock(H5FD_t *_file); static herr_t H5FD__core_delete(const char *filename, hid_t fapl_id); static inline const H5FD_core_fapl_t *H5FD__core_get_default_config(void); @@ -192,8 +192,8 @@ static const H5FD_class_t H5FD_core_g = { /* Default configurations, if none provided */ static const H5FD_core_fapl_t H5FD_core_default_config_g = { - (size_t)H5_MB, TRUE, H5FD_CORE_WRITE_TRACKING_FLAG, H5FD_CORE_WRITE_TRACKING_PAGE_SIZE}; -static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {(size_t)H5_MB, TRUE, TRUE, (size_t)4096}; + (size_t)H5_MB, true, H5FD_CORE_WRITE_TRACKING_FLAG, H5FD_CORE_WRITE_TRACKING_PAGE_SIZE}; +static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {(size_t)H5_MB, true, true, (size_t)4096}; /* Define a free list to manage the region type */ H5FL_DEFINE(H5FD_core_region_t); @@ -216,7 +216,7 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) H5FD_core_region_t *item = NULL; haddr_t b_addr = 0; haddr_t a_addr = 0; - hbool_t create_new_node = TRUE; + bool create_new_node = true; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -257,7 +257,7 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) /* We won't need to insert a new node since we can * just update an existing one instead. */ - create_new_node = FALSE; + create_new_node = false; } /* end if */ /* Remove any old nodes that are no longer needed */ @@ -464,14 +464,14 @@ H5FD_core_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) - ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) - ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + ignore_disabled_file_locks_s = false; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ if (H5I_VFL != H5I_get_type(H5FD_CORE_g)) - H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), FALSE); + H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_CORE_g; @@ -683,7 +683,7 @@ H5FD__core_fapl_get(H5FD_t *_file) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); fa->increment = file->increment; - fa->backing_store = (hbool_t)(file->fd >= 0); + fa->backing_store = (bool)(file->fd >= 0); fa->write_tracking = file->write_tracking; fa->page_size = file->bstore_page_size; @@ -927,14 +927,14 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Set up write tracking if the backing store is on */ file->dirty_list = NULL; if (fa->backing_store) { - hbool_t use_write_tracking = FALSE; /* what we're actually doing */ + bool use_write_tracking = false; /* what we're actually doing */ /* default is to have write tracking OFF for create (hence the check to see * if the user explicitly set a page size) and ON with the default page size * on open (when not read-only). */ /* Only use write tracking if the file is open for writing */ - use_write_tracking = (TRUE == fa->write_tracking) /* user asked for write tracking */ + use_write_tracking = (true == fa->write_tracking) /* user asked for write tracking */ && !(o_flags & O_RDONLY) /* file is open for writing (i.e. not read-only) */ && (file->bstore_page_size != 0); /* page size is not zero */ @@ -977,7 +977,7 @@ H5FD__core_close(H5FD_t *_file) FUNC_ENTER_PACKAGE /* Flush any changed buffers */ - if (H5FD__core_flush(_file, (hid_t)-1, TRUE) < 0) + if (H5FD__core_flush(_file, (hid_t)-1, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush core vfd backing store"); /* Destroy the dirty region list */ @@ -1238,7 +1238,7 @@ H5FD__core_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle) * library) QAK - 2009/12/04 */ if (H5P_exist_plist(plist, H5F_ACS_WANT_POSIX_FD_NAME) > 0) { - hbool_t want_posix_fd; /* Setting for retrieving file descriptor from core VFD */ + bool want_posix_fd; /* Setting for retrieving file descriptor from core VFD */ /* Get property */ if (H5P_get(plist, H5F_ACS_WANT_POSIX_FD_NAME, &want_posix_fd) < 0) @@ -1396,7 +1396,7 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN H5MM_memcpy(file->mem + addr, buf, size); /* Mark memory buffer as modified */ - file->dirty = TRUE; + file->dirty = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1413,7 +1413,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_core_t *file = (H5FD_core_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1453,7 +1453,7 @@ H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UN HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store"); } /* end else */ - file->dirty = FALSE; + file->dirty = false; } done: @@ -1493,7 +1493,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_core_t *file = (H5FD_core_t *)_file; size_t new_eof; /* New size of memory buffer */ @@ -1584,15 +1584,15 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD__core_lock(H5FD_t *_file, hbool_t rw) +H5FD__core_lock(H5FD_t *_file, bool rw) { H5FD_core_t *file = (H5FD_core_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ |