From 8fe3cece3c671453e4c49f22fde9d7635c08f031 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Aug 2020 17:46:40 -0500 Subject: Switch H5VM inline routines back to single underscope and put a comment in their header about this naming --- src/H5B2hdr.c | 4 +- src/H5B2int.c | 2 +- src/H5Dbtree.c | 2 +- src/H5Dbtree2.c | 6 +-- src/H5Dchunk.c | 10 ++--- src/H5Dearray.c | 4 +- src/H5Dfarray.c | 4 +- src/H5Dint.c | 6 +-- src/H5EA.c | 4 +- src/H5EAdblock.c | 2 +- src/H5EAhdr.c | 6 +-- src/H5EApkg.h | 2 +- src/H5FA.c | 6 +-- src/H5FAdbg.c | 2 +- src/H5FScache.c | 4 +- src/H5FSsection.c | 14 +++--- src/H5Faccum.c | 10 ++--- src/H5Fprivate.h | 2 +- src/H5HFdbg.c | 6 +-- src/H5HFdblock.c | 4 +- src/H5HFdtable.c | 12 +++--- src/H5HFhdr.c | 6 +-- src/H5HFiblock.c | 10 ++--- src/H5HFiter.c | 2 +- src/H5HFpkg.h | 2 +- src/H5MF.c | 2 +- src/H5Odtype.c | 6 +-- src/H5Pdapl.c | 8 ++-- src/H5Pdcpl.c | 20 ++++----- src/H5Pdxpl.c | 4 +- src/H5Pencdec.c | 4 +- src/H5Pfapl.c | 22 +++++----- src/H5Plapl.c | 6 +-- src/H5Pocpl.c | 8 ++-- src/H5VM.c | 10 ++--- src/H5VMprivate.h | 126 +++++++++++++++++++++++++++++++++++++----------------- src/hdf5.lnt | 6 +-- test/dsets.c | 4 +- test/earray.c | 16 +++---- test/fheap.c | 6 +-- 40 files changed, 214 insertions(+), 166 deletions(-) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index fc5e7f8..7b8b564 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) diff --git a/src/H5B2int.c b/src/H5B2int.c index 3f9ae74..816d8f8 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -367,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index c80f90a..5b5ff4a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -338,7 +338,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); + ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index b9cf6cd..d233ce5 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) HDassert(rec2); /* Compare the offsets but ignore the other fields */ - *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); + *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__bt2_compare() */ @@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4d351dd..8962348 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -833,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset) unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */ /* Get encoded size of dim, in bytes */ - enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; + enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; /* Check if this is the largest value so far */ if(enc_bytes_per_dim > max_enc_bytes_per_dim) @@ -997,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) / dset->shared->layout.u.chunk.dim[u]; - if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Inital 'power2up' values for scaled dimensions */ rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ - rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]); + rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); } /* end for */ } /* end if */ @@ -6887,12 +6887,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); + allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); if(allow_chunk_size_len > 8) allow_chunk_size_len = 8; /* Compute encoded size of chunk */ - new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; + new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; if(new_chunk_size_len > 8) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?") diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 56be6a7..a53489e 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index a79471a..a9202c2 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dint.c b/src/H5Dint.c index d662cec..079fef7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -672,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) for(u = 0; u < dset->shared->ndims; u++) { hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ - if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; } @@ -3088,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; - if(!(scaled_power2up = H5VM__power2up(scaled))) + if(!(scaled_power2up = H5VM_power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Check if the number of bits required to encode the scaled size value changed */ if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up; - dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up); + dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ update_chunks = TRUE; diff --git a/src/H5EA.c b/src/H5EA.c index a027792..bf50452 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -553,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, (page_idx * sblock->dblk_page_size); /* Check if page has been initialized yet */ - if(!H5VM__bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ @@ -561,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5VM__bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index c72dc7c..d540a3c 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -266,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)) /* Determine the superblock information for the index */ H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t); - sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); /* Set return value */ ret_value = sblk_idx; diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 07330c1..8b4d5f7 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -199,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); @@ -261,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Check for needing to increase size of array of factories */ if(idx >= hdr->elmt_fac.nalloc) { @@ -327,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ HDassert(idx < hdr->elmt_fac.nalloc); diff --git a/src/H5EApkg.h b/src/H5EApkg.h index ad1fdfc..b70231d 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -146,7 +146,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5FA.c b/src/H5FA.c index 871793e..ee99bb2 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -395,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -482,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 431e6fa..b578cf2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FScache.c b/src/H5FScache.c index ed468b4..4c75fb1 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -1027,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1294,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, /* Set up user data for iterator */ udata.sinfo = sinfo; udata.image = ℑ - udata.sect_cnt_size = H5VM__limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 269f63c..51233a0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -527,7 +527,7 @@ H5FS__sect_serialize_size(H5FS_t *fspace) sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ - sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -777,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -963,7 +963,7 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -1640,7 +1640,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(request); + bin = H5VM_log2_gen(request); HDassert(bin < fspace->sinfo->nbins); alignment = fspace->alignment; if(!((alignment > 1) && (request >= fspace->align_thres))) @@ -2028,7 +2028,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 5ad7634..02f475d 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -153,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -296,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -609,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -653,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t clear_size; /* Size of memory that needs clearing */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -701,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 1cfd103..9deba8c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -117,7 +117,7 @@ typedef struct H5F_t H5F_t; /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM__limit_enc_size(__n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ \ *(p)++ = (uint8_t)_s; \ UINT64ENCODE_VAR(p, __n, _s); \ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index f6c7f0e..e841d78 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -702,10 +702,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 96392c1..1e0813c 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -356,7 +356,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5VM__log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -559,7 +559,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index ad317c9..4fff348 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -102,10 +102,10 @@ H5HF__dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5VM__log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5VM__log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -165,7 +165,7 @@ H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, uns H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { - unsigned high_bit = H5VM__log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ *row = (high_bit - dtable->first_row_bits) + 1; @@ -241,7 +241,7 @@ H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5VM__log2_of2((uint32_t)block_size) - H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) } /* end H5HF__dtable_size_to_row() */ @@ -271,7 +271,7 @@ H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) */ HDassert(dtable); - rows = (H5VM__log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) } /* end H5HF__dtable_size_to_rows() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 4a645cd..043ab87 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5VM__log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and * some offsets/sizes are encoded with a maximum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -221,7 +221,7 @@ H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, - H5VM__limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1070,7 +1070,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 1c40d53..2714ac7 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -371,7 +371,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -689,7 +689,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = (unsigned)1 << (1 + H5VM__log2_gen((uint64_t)max_child_row)); + new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -1722,10 +1722,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5VM__log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 002ff01..43cb76a 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -210,7 +210,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5VM__log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index ca05798..5324bc4 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -134,7 +134,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM__log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ diff --git a/src/H5MF.c b/src/H5MF.c index 7de09cb..42ad3fb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -419,7 +419,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5VM__log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; /* Set up alignment and threshold to use depending on TYPE */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c7d6c1b..cbadfd0 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -264,7 +264,7 @@ H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -905,7 +905,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -1277,7 +1277,7 @@ H5O__dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 7429443..6dae5ed 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -331,7 +331,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(vds_file_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -579,7 +579,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efile_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -899,7 +899,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -1001,7 +1001,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index d8b0218..11ab7b1 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1029,7 +1029,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -1058,7 +1058,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -1414,7 +1414,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1424,7 +1424,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1435,14 +1435,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,13 +1450,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index f416eff..e6db02f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -685,7 +685,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -702,7 +702,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 32824b7..8b10971 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -94,7 +94,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -135,7 +135,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index baad470..7f962ef 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -3475,7 +3475,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3483,13 +3483,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3507,7 +3507,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3529,7 +3529,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3550,15 +3550,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + @@ -4227,7 +4227,7 @@ H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(log_location); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 72c60b4..8a0848c 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -373,7 +373,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -384,7 +384,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) *pp += fapl_size; } - fapl_size += (1 + H5VM__limit_enc_size((uint64_t)fapl_size)); + fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); } /* end if */ *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ @@ -705,7 +705,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b053895..b576aec 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1407,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1437,7 +1437,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,12 +1450,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ diff --git a/src/H5VM.c b/src/H5VM.c index 403cc45..7be8eab 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -75,7 +75,7 @@ H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -119,7 +119,7 @@ H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -642,7 +642,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); H5VM_vector_cpy(n, idx, size); - nelmts = H5VM__vector_reduce_product(n, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i 0) -#define H5VM_vector_le_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) <= 0) -#define H5VM_vector_ge_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) >= 0) -#define H5VM_vector_eq_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) == 0) -#define H5VM_vector_lt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) < 0) -#define H5VM_vector_gt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) > 0) -#define H5VM_vector_le_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) <= 0) -#define H5VM_vector_ge_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) >= 0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) == 0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) < 0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) > 0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) <= 0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) >= 0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) == 0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) < 0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) > 0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) <= 0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) >= 0) /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ @@ -139,13 +139,17 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, /*------------------------------------------------------------------------- - * Function: H5VM__vector_reduce_product + * Function: H5VM_vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of * elements in an array and array dimensions are always of type * size_t. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: Product of elements * * Failure: 1 if N is zero @@ -156,7 +160,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, *------------------------------------------------------------------------- */ static H5_INLINE hsize_t H5_ATTR_UNUSED -H5VM__vector_reduce_product(unsigned n, const hsize_t *v) +H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -171,10 +175,14 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_zerop_u + * Function: H5VM_vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -186,7 +194,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED -H5VM__vector_zerop_u(int n, const hsize_t *v) +H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -208,6 +216,10 @@ done: * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -237,11 +249,15 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_u + * Function: H5VM_vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -254,7 +270,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ @@ -277,11 +293,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -294,7 +314,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ @@ -317,10 +337,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_inc + * Function: H5VM_vector_inc * * Purpose: Increments V1 by V2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: void * * Programmer: Robb Matzke @@ -329,7 +353,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -357,7 +381,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_gen + * Function: H5VM_log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -368,6 +392,10 @@ static const unsigned char LogTable256[] = * The version on the web-site is for 32-bit quantities and this * version has been extended for 64-bit quantities. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -376,7 +404,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__log2_gen(uint64_t n) +H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -394,7 +422,7 @@ H5VM__log2_gen(uint64_t n) r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n]; return(r); -} /* H5VM__log2_gen() */ +} /* H5VM_log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -406,7 +434,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_of2 + * Function: H5VM_log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -416,6 +444,10 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = * This is from the "Bit Twiddling Hacks" at: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -424,20 +456,24 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_PURE unsigned -H5VM__log2_of2(uint32_t n) +H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5VM__log2_of2() */ +} /* H5VM_log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM__power2up + * Function: H5VM_power2up * * Purpose: Round up a number to the next power of 2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Return the number which is a power of 2 * * Programmer: Vailin Choi; Nov 2014 @@ -445,7 +481,7 @@ H5VM__log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_CONST hsize_t -H5VM__power2up(hsize_t n) +H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -457,15 +493,19 @@ H5VM__power2up(hsize_t n) ret_value <<= 1; return(ret_value); -} /* H5VM__power2up */ +} /* H5VM_power2up */ /*------------------------------------------------------------------------- - * Function: H5VM__limit_enc_size + * Function: H5VM_limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Number of bytes needed * * Programmer: Quincey Koziol @@ -474,17 +514,17 @@ H5VM__power2up(hsize_t n) *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__limit_enc_size(uint64_t limit) +H5VM_limit_enc_size(uint64_t limit) { - return (H5VM__log2_gen(limit) / 8) + 1; -} /* end H5VM__limit_enc_size() */ + return (H5VM_log2_gen(limit) / 8) + 1; +} /* end H5VM_limit_enc_size() */ static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5VM__bit_get + * Function: H5VM_bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -495,6 +535,10 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: TRUE/FALSE * * Programmer: Quincey Koziol @@ -503,15 +547,15 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, *------------------------------------------------------------------------- */ static H5_INLINE hbool_t H5_ATTR_UNUSED -H5VM__bit_get(const unsigned char *buf, size_t offset) +H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5VM__bit_get() */ +} /* end H5VM_bit_get() */ /*------------------------------------------------------------------------- - * Function: H5VM__bit_set + * Function: H5VM_bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -522,6 +566,10 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: None * * Programmer: Quincey Koziol @@ -530,14 +578,14 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; -} /* end H5VM__bit_set() */ +} /* end H5VM_bit_set() */ #endif /* H5VMprivate_H */ diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 61c4a61..7b0f384 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM__vector_inc) --esym(528, H5VM__vector_cmp_s) --esym(528, H5VM__vector_zerop_s, H5VM__vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) +-esym(528, H5VM_vector_cmp_s) +-esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) diff --git a/test/dsets.c b/test/dsets.c index 3547554..4ab3efa 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11723,9 +11723,9 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM__power2up(n) function does not result in an + * Purpose: Tests that the H5VM_power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) - * H5VM__power2up() is used to calculate the next power of 2 for + * H5VM_power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. * * Return: Success: 0 diff --git a/test/earray.c b/test/earray.c index a8ae9f0..7d91bdc 100644 --- a/test/earray.c +++ b/test/earray.c @@ -232,7 +232,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM__log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -718,7 +718,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM__log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); + test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; @@ -1373,7 +1373,7 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); @@ -1465,10 +1465,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5VM__log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5VM__log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1586,14 +1586,14 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5VM__log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) @@ -2317,7 +2317,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/fheap.c b/test/fheap.c index 55af7d6..1ce7398 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1592,7 +1592,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1710,7 +1710,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1800,7 +1800,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR -- cgit v0.12