diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-28 14:31:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 14:31:56 (GMT) |
commit | 7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch) | |
tree | 44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5MF.c | |
parent | 622fcbd13881fbc58bbeaed3062583b759f5e864 (diff) | |
download | hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.zip hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.gz hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.bz2 |
Rename HDassert() to assert() (#3191)
* Change HDassert to assert
* Fix bin/make_err
Diffstat (limited to 'src/H5MF.c')
-rw-r--r-- | src/H5MF.c | 366 |
1 files changed, 183 insertions, 183 deletions
@@ -49,7 +49,7 @@ #define H5MF_CHECK_FSM(FSM, CF) \ do { \ - HDassert(*CF == FALSE); \ + assert(*CF == FALSE); \ if (!H5_addr_defined(FSM->addr) || !H5_addr_defined(FSM->sect_addr)) \ *CF = TRUE; \ } while (0) @@ -146,8 +146,8 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f_sh); - HDassert(f_sh->lf); + assert(f_sh); + assert(f_sh->lf); /* Iterate over all the free space types to determine if sections of that type * can merge with the metadata or small 'raw' data aggregator @@ -253,8 +253,8 @@ H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f_sh); - HDassert(fs_type); + assert(f_sh); + assert(fs_type); if (H5F_SHARED_PAGED_AGGR(f_sh)) { /* paged aggregation */ if (size >= f_sh->fs_page_size) { @@ -311,16 +311,16 @@ H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(H5_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(H5_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set up the alignment and threshold to use depending on the manager type */ if (H5F_PAGED_AGGR(f)) { @@ -389,16 +389,16 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(!H5_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(!H5_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set the free space creation parameters */ fs_create.client = H5FS_CLIENT_FILE_ID; @@ -464,13 +464,13 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ /* Check if the free space manager exists already */ @@ -513,12 +513,12 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(H5_addr_defined(f->shared->fs_addr[type])); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(H5_addr_defined(f->shared->fs_addr[type])); /* Put address into temporary variable and reset it */ /* (Avoids loopback in file space freeing routine) */ @@ -546,11 +546,11 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); + assert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; /* Sanity check that the free space manager for this type wasn't started up again */ - HDassert(!H5_addr_defined(f->shared->fs_addr[type])); + assert(!H5_addr_defined(f->shared->fs_addr[type])); done: /* Reset the ring in the API context */ @@ -583,14 +583,14 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(f->shared); - HDassert(f->shared->fs_man[type]); - HDassert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(f->shared); + assert(f->shared->fs_man[type]); + assert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before closing free space manager\n", __func__); @@ -629,9 +629,9 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); - HDassert(node); + assert(f); + assert(fspace); + assert(node); H5MF__alloc_to_fs_type(f->shared, alloc_type, node->sect_info.size, &fs_type); @@ -689,8 +689,8 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); /* Set the ring type in the API context */ if (H5MF__fsm_is_self_referential(f->shared, fspace)) @@ -710,7 +710,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h /* Check for actually finding section */ if (ret_value) { /* Sanity check */ - HDassert(node); + assert(node); /* Retrieve return value */ if (addr) @@ -780,10 +780,10 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -813,7 +813,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Open the free-space manager */ if (H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); } /* end if */ /* Search for large enough space in the free space manager */ @@ -828,7 +828,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) HDfprintf(stderr, "%s: Check 2.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ if (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) { - HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); if (HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from paged aggregation") @@ -838,7 +838,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") } /* end else */ } /* end if */ - HDassert(H5_addr_defined(ret_value)); + assert(H5_addr_defined(ret_value)); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Check 3.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ @@ -908,7 +908,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Get the EOA for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + size), f->shared->fs_page_size, frag_size); @@ -955,7 +955,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) if (!(f->shared->fs_man[ptype])) if (H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[ptype]); + assert(f->shared->fs_man[ptype]); if (NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size), (f->shared->fs_page_size - size)))) @@ -1038,10 +1038,10 @@ H5MF_alloc_tmp(H5F_t *f, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); /* Retrieve the 'eoa' for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) @@ -1091,10 +1091,10 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); + assert(f); if (!H5_addr_defined(addr) || 0 == size) HGOTO_DONE(SUCCEED) - HDassert(addr != 0); /* Can't deallocate the superblock :-) */ + assert(addr != 0); /* Can't deallocate the superblock :-) */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1192,7 +1192,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) /* If size of the freed section is larger than threshold, add it to the free space manager */ if (size >= f->shared->fs_threshold) { - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", __func__); @@ -1288,8 +1288,8 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi #endif /* H5MF_ALLOC_DEBUG */ /* Sanity check */ - HDassert(f); - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(f); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* Set mapped type, treating global heap as raw data */ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; @@ -1315,7 +1315,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi * page boundary if extended */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + extra_requested), f->shared->fs_page_size, frag_size); } /* end else */ @@ -1345,7 +1345,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi H5MF_free_section_t *node = NULL; /* Free space section pointer */ /* Should be large-sized block */ - HDassert(size >= f->shared->fs_page_size); + assert(size >= f->shared->fs_page_size); /* Start up the free-space manager */ if (!(f->shared->fs_man[fs_type])) @@ -1464,15 +1464,15 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(H5_addr_defined(addr)); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(H5_addr_defined(addr)); + assert(size > 0); /* Set up free-space section class information */ sect_cls = H5MF_SECT_CLS_TYPE(f, size); - HDassert(sect_cls); + assert(sect_cls); /* Get free space type from allocation type */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1499,7 +1499,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) if ((ret_value = (*sect_cls->can_shrink)((const H5FS_section_info_t *)node, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check if section can shrink container") if (ret_value > 0) { - HDassert(sect_cls->shrink); + assert(sect_cls->shrink); if ((*sect_cls->shrink)((H5FS_section_info_t **)&node, &udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink container") @@ -1544,8 +1544,8 @@ H5MF_close(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) { if ((ret_value = H5MF__close_pagefs(f)) < 0) @@ -1588,12 +1588,12 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", @@ -1652,7 +1652,7 @@ H5MF_try_close(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); + assert(f); /* If there have been no file space allocations / deallocation so * far, must call H5MF_tidy_self_referential_fsm_hack() to float @@ -1759,10 +1759,10 @@ H5MF__close_aggrfs(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1789,7 +1789,7 @@ H5MF__close_aggrfs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5_addr_defined(f->shared->sblock->ext_addr)); + assert(H5_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1832,7 +1832,7 @@ H5MF__close_aggrfs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -1845,16 +1845,16 @@ H5MF__close_aggrfs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* verify that the aggregators are still shutdown. */ - HDassert(f->shared->sdata_aggr.tot_size == 0); - HDassert(f->shared->sdata_aggr.addr == 0); - HDassert(f->shared->sdata_aggr.size == 0); + assert(f->shared->sdata_aggr.tot_size == 0); + assert(f->shared->sdata_aggr.addr == 0); + assert(f->shared->sdata_aggr.size == 0); - HDassert(f->shared->meta_aggr.tot_size == 0); - HDassert(f->shared->meta_aggr.addr == 0); - HDassert(f->shared->meta_aggr.size == 0); + assert(f->shared->meta_aggr.tot_size == 0); + assert(f->shared->meta_aggr.addr == 0); + assert(f->shared->meta_aggr.size == 0); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -1869,7 +1869,7 @@ H5MF__close_aggrfs(H5F_t *f) * been no file space allocation or deallocation since file * open. */ - HDassert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); + assert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); } /* end if */ else { /* super_vers can be 0, 1, 2 */ for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) @@ -1925,12 +1925,12 @@ H5MF__close_pagefs(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); - HDassert(f->shared->fs_page_size); - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); + assert(f->shared->fs_page_size); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1961,7 +1961,7 @@ H5MF__close_pagefs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5_addr_defined(f->shared->sblock->ext_addr)); + assert(H5_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1998,7 +1998,7 @@ H5MF__close_pagefs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[ptype]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -2011,7 +2011,7 @@ H5MF__close_pagefs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -2038,9 +2038,9 @@ H5MF__close_pagefs(H5F_t *f) * the file driver layer. However, as this possibility seems remote, * it is ignored in the following assert. */ - HDassert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || - ((H5_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && - (final_eoa == f->shared->eoa_post_mdci_fsalloc))); + assert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || + ((H5_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && + (final_eoa == f->shared->eoa_post_mdci_fsalloc))); } /* end if */ else { /* Iterate over all the free space types that have managers @@ -2101,8 +2101,8 @@ H5MF__close_shrink_eoa(H5F_t *f) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Construct user data for callbacks */ udata.f = f; @@ -2219,9 +2219,9 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -2262,7 +2262,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) if (!f->shared->fs_man[type] && H5_addr_defined(f->shared->fs_addr[type])) { if (H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") - HDassert(f->shared->fs_man[type]); + assert(f->shared->fs_man[type]); fs_started[type] = TRUE; } /* end if */ @@ -2355,9 +2355,9 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* H5MF_tidy_self_referential_fsm_hack() will fail if any self * referential FSM is opened prior to the call to it. Thus call @@ -2415,7 +2415,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t if (!f->shared->fs_man[ty] && H5_addr_defined(f->shared->fs_addr[ty])) { if (H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") - HDassert(f->shared->fs_man[ty]); + assert(f->shared->fs_man[ty]); fs_started = TRUE; } /* end if */ @@ -2498,10 +2498,10 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(sect_udata); - HDassert(nums); - HDassert(fspace); + assert(f); + assert(sect_udata); + assert(nums); + assert(fspace); /* Query how many sections of this type */ if (H5FS_sect_stats(fspace, NULL, &hnums) < 0) @@ -2636,9 +2636,9 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* Initialize structs */ HDmemset(&fsinfo, 0, sizeof(fsinfo)); @@ -2653,15 +2653,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) hbool_t fsm_visited[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ /* Sanity check */ - HDassert(f->shared->sblock); + assert(f->shared->sblock); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* shouldn't be called unless we have a superblock supporting the * superblock extension. */ - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Initialize fsm_opened and fsm_visited */ HDmemset(fsm_opened, 0, sizeof(fsm_opened)); @@ -2733,15 +2733,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); if (!fsm_visited[fsm_type]) { fsm_visited[fsm_type] = TRUE; @@ -2753,7 +2753,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (NULL == f->shared->fs_man[fsm_type]) { if (H5_addr_defined(f->shared->fs_addr[fsm_type])) { /* Sanity check */ - HDassert(fsm_opened[fsm_type] == FALSE); + assert(fsm_opened[fsm_type] == FALSE); if (H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, @@ -2879,15 +2879,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); /* Test to see if we need to switch rings -- do so if required */ if (H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) @@ -2915,7 +2915,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) { /* The current ring should be H5AC_RING_RDFSM */ - HDassert(curr_ring == H5AC_RING_RDFSM); + assert(curr_ring == H5AC_RING_RDFSM); /* Query free space manager info for this type */ if (H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) @@ -2928,7 +2928,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (fs_stat.serial_sect_count > 0) { /* Sanity check */ - HDassert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.addr)); /* Allocate FSM header */ if (H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], @@ -2937,8 +2937,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) "can't allocated free-space header") /* Allocate FSM section info */ - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); if (H5FS_alloc_sect(f, f->shared->fs_man[fsm_type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") @@ -2949,18 +2949,18 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") - HDassert(H5_addr_defined(fs_stat.addr)); - HDassert(H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count > 0); - HDassert(fs_stat.alloc_sect_size > 0); - HDassert(fs_stat.alloc_sect_size == fs_stat.sect_size); + assert(H5_addr_defined(fs_stat.addr)); + assert(H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count > 0); + assert(fs_stat.alloc_sect_size > 0); + assert(fs_stat.alloc_sect_size == fs_stat.sect_size); #endif /* NDEBUG */ } /* end if */ else { - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count == 0); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count == 0); + assert(fs_stat.alloc_sect_size == 0); } /* end else */ } /* end if */ } /* end if */ @@ -2978,7 +2978,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* verify that all opened FSMs were closed */ for (fsm_type = H5F_MEM_PAGE_SUPER; fsm_type < H5F_MEM_PAGE_NTYPES; fsm_type++) - HDassert(!fsm_opened[fsm_type]); + assert(!fsm_opened[fsm_type]); /* Indicate that the FSM was settled successfully */ *fsm_settled = TRUE; @@ -3108,9 +3108,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* * Only need to settle things if we are persisting free space and @@ -3118,22 +3118,22 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (f->shared->fs_persist && !H5F_NULL_FSM_ADDR(f)) { /* Sanity check */ - HDassert(f->shared->lf); + assert(f->shared->lf); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type); - HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(!H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); - HDassert(!H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); /* Note that in most cases, sm_hdr_fspace will equal sm_sinfo_fspace. */ sm_hdr_fspace = f->shared->fs_man[sm_fshdr_fs_type]; @@ -3145,14 +3145,14 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type); - HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(!H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); - HDassert(!H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); /* Note that in most cases, lg_hdr_fspace will equal lg_sinfo_fspace. */ lg_hdr_fspace = f->shared->fs_man[lg_fshdr_fs_type]; @@ -3171,9 +3171,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that sm_sinfo_fspace is floating if it exists and is distinct */ @@ -3182,9 +3182,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ if (H5F_PAGED_AGGR(f)) { @@ -3194,9 +3194,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (3)") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that lg_sinfo_fspace is floating if it @@ -3207,9 +3207,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (4)") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ } @@ -3343,8 +3343,8 @@ H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_s FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(f_sh); - HDassert(continue_alloc_fsm); + assert(f_sh); + assert(continue_alloc_fsm); /* Check sm_hdr_fspace */ if (sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) @@ -3395,9 +3395,9 @@ H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fsm_type >= H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(f_sh); + assert(fsm_type >= H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); @@ -3448,8 +3448,8 @@ H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fspace); + assert(f_sh); + assert(fspace); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); |