diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-05-07 16:45:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 16:45:05 (GMT) |
commit | 9023e98940d959aa974e655cc383fab0b0ed663c (patch) | |
tree | 8cad5bb35e1385c7a267319f4baf688d0efade63 | |
parent | 1e572b18e3c271f9de045a6b61e3c855779e7c58 (diff) | |
download | hdf5-9023e98940d959aa974e655cc383fab0b0ed663c.zip hdf5-9023e98940d959aa974e655cc383fab0b0ed663c.tar.gz hdf5-9023e98940d959aa974e655cc383fab0b0ed663c.tar.bz2 |
Removes gratuitous (double)x.yF casts (#632)
* Committing clang-format changes
* Removes gratuitous (double)x.yF casts
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
43 files changed, 291 insertions, 300 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 356112e..0363bba 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -1157,7 +1157,7 @@ test_chunk_cache(const FileAccPropList &fapl) // Verify that chunk cache parameters are the same int mdc_nelmts = 0; size_t nslots_1 = 0, nslots_4 = 0, nbytes_1 = 0, nbytes_4 = 0; - double w0_1 = 0.0F, w0_4 = 0.0F; + double w0_1 = 0.0, w0_4 = 0.0; fapl_def.getCache(mdc_nelmts, nslots_1, nbytes_1, w0_1); dapl.getChunkCache(nslots_4, nbytes_4, w0_4); verify_val(nslots_1, nslots_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__); @@ -1175,7 +1175,7 @@ test_chunk_cache(const FileAccPropList &fapl) // Set new rdcc settings on fapl local size_t nslots_2 = nslots_1 * 2; size_t nbytes_2 = nbytes_1 * 2; - double w0_2 = w0_1 / (double)2.0F; + double w0_2 = w0_1 / 2.0; fapl_local.getCache(mdc_nelmts, nslots_2, nbytes_2, w0_2); // Create a new file using default fcpl and the passed-in fapl diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index fbd2be0..fb507e7 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -822,7 +822,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) char file_name[64]; /* Filename buffer */ size_t alloc_incr; /* Buffer allocation increment */ size_t min_incr = 65536; /* Minimum buffer increment */ - double buf_prcnt = 0.1f; /* Percentage of buffer size to set + double buf_prcnt = 0.1; /* Percentage of buffer size to set as increment */ static long file_name_counter; H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, &image_realloc, &image_free, @@ -445,17 +445,17 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; - (cache_ptr->resize_ctl).flash_multiple = (double)1.0f; - (cache_ptr->resize_ctl).flash_threshold = (double)0.25f; + (cache_ptr->resize_ctl).flash_multiple = 1.0; + (cache_ptr->resize_ctl).flash_threshold = 0.25; (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; - (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD; - (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT; + (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; + (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; (cache_ptr->resize_ctl).apply_max_decrement = TRUE; (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; (cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; (cache_ptr->resize_ctl).apply_empty_reserve = TRUE; - (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE; + (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; cache_ptr->epoch_markers_active = 0; @@ -2705,7 +2705,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p break; case H5C_incr__threshold: - if ((config_ptr->lower_hr_threshold <= (double)0.0f) || (config_ptr->increment <= (double)1.0f) || + if ((config_ptr->lower_hr_threshold <= 0.0) || (config_ptr->increment <= 1.0) || ((config_ptr->apply_max_increment) && (config_ptr->max_increment <= 0))) cache_ptr->size_increase_possible = FALSE; break; @@ -2725,21 +2725,21 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p break; case H5C_decr__threshold: - if ((config_ptr->upper_hr_threshold >= (double)1.0f) || (config_ptr->decrement >= (double)1.0f) || + if ((config_ptr->upper_hr_threshold >= 1.0) || (config_ptr->decrement >= 1.0) || ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0))) cache_ptr->size_decrease_possible = FALSE; break; case H5C_decr__age_out: - if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) || + if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) || ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0))) cache_ptr->size_decrease_possible = FALSE; break; case H5C_decr__age_out_with_threshold: - if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) || + if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) || ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)) || - (config_ptr->upper_hr_threshold >= (double)1.0f)) + (config_ptr->upper_hr_threshold >= 1.0)) cache_ptr->size_decrease_possible = FALSE; break; @@ -3720,8 +3720,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "initial_size must be in the interval [min_size, max_size]") - if ((config_ptr->min_clean_fraction < (double)0.0f) || - (config_ptr->min_clean_fraction > (double)1.0f)) + if ((config_ptr->min_clean_fraction < 0.0) || (config_ptr->min_clean_fraction > 1.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]") if (config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH) @@ -3736,12 +3735,11 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode") if (config_ptr->incr_mode == H5C_incr__threshold) { - if ((config_ptr->lower_hr_threshold < (double)0.0f) || - (config_ptr->lower_hr_threshold > (double)1.0f)) + if ((config_ptr->lower_hr_threshold < 0.0) || (config_ptr->lower_hr_threshold > 1.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "lower_hr_threshold must be in the range [0.0, 1.0]") - if (config_ptr->increment < (double)1.0f) + if (config_ptr->increment < 1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "increment must be greater than or equal to 1.0") /* no need to check max_increment, as it is a size_t, @@ -3755,12 +3753,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) break; case H5C_flash_incr__add_space: - if ((config_ptr->flash_multiple < (double)0.1f) || - (config_ptr->flash_multiple > (double)10.0f)) + if ((config_ptr->flash_multiple < 0.1) || (config_ptr->flash_multiple > 10.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_multiple must be in the range [0.1, 10.0]") - if ((config_ptr->flash_threshold < (double)0.1f) || - (config_ptr->flash_threshold > (double)1.0f)) + if ((config_ptr->flash_threshold < 0.1) || (config_ptr->flash_threshold > 1.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_threshold must be in the range [0.1, 1.0]") break; @@ -3781,10 +3777,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) } if (config_ptr->decr_mode == H5C_decr__threshold) { - if (config_ptr->upper_hr_threshold > (double)1.0f) + if (config_ptr->upper_hr_threshold > 1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0") - if ((config_ptr->decrement > (double)1.0f) || (config_ptr->decrement < (double)0.0f)) + if ((config_ptr->decrement > 1.0) || (config_ptr->decrement < 0.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]") /* no need to check max_decrement as it is a size_t @@ -3801,7 +3797,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big") if ((config_ptr->apply_empty_reserve) && - ((config_ptr->empty_reserve > (double)1.0f) || (config_ptr->empty_reserve < (double)0.0f))) + ((config_ptr->empty_reserve > 1.0) || (config_ptr->empty_reserve < 0.0))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty_reserve must be in the interval [0.0, 1.0]") /* no need to check max_decrement as it is a size_t @@ -3810,8 +3806,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) } /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */ if (config_ptr->decr_mode == H5C_decr__age_out_with_threshold) { - if ((config_ptr->upper_hr_threshold > (double)1.0f) || - (config_ptr->upper_hr_threshold < (double)0.0f)) + if ((config_ptr->upper_hr_threshold > 1.0) || (config_ptr->upper_hr_threshold < 0.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be in the interval [0.0, 1.0]") } /* H5C_decr__age_out_with_threshold */ @@ -4279,8 +4274,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length); - HDassert((double)0.0f <= (cache_ptr->resize_ctl).min_clean_fraction); - HDassert((cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f); + HDassert(0.0 <= (cache_ptr->resize_ctl).min_clean_fraction); + HDassert((cache_ptr->resize_ctl).min_clean_fraction <= 100.0); /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this * is a re-entrant call via a client callback called in the resize @@ -4303,7 +4298,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") - HDassert(((double)0.0f <= hit_rate) && (hit_rate <= (double)1.0f)); + HDassert((0.0 <= hit_rate) && (hit_rate <= 1.0)); switch ((cache_ptr->resize_ctl).incr_mode) { case H5C_incr__off: diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index e59012c..104f1af 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -429,11 +429,11 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, int32_t aggregate_max_pins = 0; double hit_rate; double prefetch_use_rate; - double average_successful_search_depth = 0.0f; - double average_failed_search_depth = 0.0f; - double average_entries_skipped_per_calls_to_msic = 0.0f; - double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0f; - double average_entries_scanned_per_calls_to_msic = 0.0f; + double average_successful_search_depth = 0.0; + double average_failed_search_depth = 0.0; + double average_entries_skipped_per_calls_to_msic = 0.0; + double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0; + double average_entries_scanned_per_calls_to_msic = 0.0; #endif /* H5C_COLLECT_CACHE_STATS */ herr_t ret_value = SUCCEED; /* Return value */ @@ -492,9 +492,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, } /* end for */ if ((total_hits > 0) || (total_misses > 0)) - hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses)); + hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses)); else - hit_rate = 0.0f; + hit_rate = 0.0; if (cache_ptr->successful_ht_searches > 0) average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) / @@ -630,10 +630,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); if (cache_ptr->prefetches > 0) - prefetch_use_rate = - (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); + prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); else - prefetch_use_rate = 0.0f; + prefetch_use_rate = 0.0; HDfprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate); @@ -658,10 +657,10 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, ((cache_ptr->class_table_ptr))[i]->name); if ((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0)) - hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) / + hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) / ((double)(cache_ptr->hits[i] + cache_ptr->misses[i])); else - hit_rate = 0.0f; + hit_rate = 0.0; HDfprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix, (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 20d3b4d..f17ff48 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -933,15 +933,14 @@ H5C_image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header) } /* end for */ if ((total_hits > 0) || (total_misses > 0)) - hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses)); + hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses)); else - hit_rate = 0.0f; + hit_rate = 0.0; if (cache_ptr->prefetches > 0) - prefetch_use_rate = - (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); + prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); else - prefetch_use_rate = 0.0f; + prefetch_use_rate = 0.0; if (print_header) { HDfprintf(stdout, "\nhit prefetches prefetch image pf hit\n"); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index fb5c3ea..27a24c4 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -115,20 +115,20 @@ #define H5C__CURR_CACHE_IMAGE_CTL_VER 1 /* Default configuration settings */ -#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f -#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f +#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999 +#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9 #define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024)) #define H5C__DEF_AR_INIT_SIZE ((size_t)(1 * 1024 * 1024)) #define H5C__DEF_AR_MIN_SIZE ((size_t)(1 * 1024 * 1024)) -#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f -#define H5C__DEF_AR_INCREMENT 2.0f +#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5 +#define H5C__DEF_AR_INCREMENT 2.0 #define H5C__DEF_AR_MAX_INCREMENT ((size_t)(2 * 1024 * 1024)) -#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f -#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f -#define H5C__DEF_AR_DECREMENT 0.9f +#define H5C__DEF_AR_FLASH_MULTIPLE 1.0 +#define H5C__DEV_AR_FLASH_THRESHOLD 0.25 +#define H5C__DEF_AR_DECREMENT 0.9 #define H5C__DEF_AR_MAX_DECREMENT ((size_t)(1 * 1024 * 1024)) #define H5C__DEF_AR_EPCHS_B4_EVICT 3 -#define H5C__DEF_AR_EMPTY_RESERVE 0.05f +#define H5C__DEF_AR_EMPTY_RESERVE 0.05 #define H5C__MIN_AR_EPOCH_LENGTH 100 #define H5C__DEF_AR_EPOCH_LENGTH 50000 #define H5C__MAX_AR_EPOCH_LENGTH 1000000 diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index cc61aa1..a244035 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -543,7 +543,7 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, amount_free = 0; HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:", - ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) / + (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); /* diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index d0cfa96..76e4ec0 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -102,7 +102,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, if (h->dblk_size) HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:", - ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); + (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); /* Print the data in a VMS-style octal dump */ H5_buffer_dump(stream, indent, h->dblk_image, marker, (size_t)0, h->dblk_size); diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index c8a97c2..2ebdbe3 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -768,7 +768,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double /* Check arguments. Note that we allow negative values - they are * considered to "unset" the property. */ - if (rdcc_w0 > (double)1.0f) + if (rdcc_w0 > 1.0) HGOTO_ERROR( H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive, or H5D_CHUNK_CACHE_W0_DEFAULT"); diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 70fc982..de67dfd 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -1486,9 +1486,8 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right) H5TRACE4("e", "iddd", plist_id, left, middle, right); /* Check arguments */ - if (left < (double)0.0f || left > (double)1.0f || middle < (double)0.0f || middle > (double)1.0f || - right < (double)0.0f || right > (double)1.0f) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0") + if (left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 || right < 0.0 || right > 1.0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0 <= X <= 1.0") /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index fb7b195..49cc27e 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1686,7 +1686,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots, H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Check arguments */ - if (rdcc_w0 < (double)0.0f || rdcc_w0 > (double)1.0f) + if (rdcc_w0 < 0.0 || rdcc_w0 > 1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive") @@ -562,8 +562,8 @@ size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; /* (+/- Inf for all floating-point types) */ float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f; float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f; -double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f; -double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f; +double H5T_NATIVE_DOUBLE_POS_INF_g = 0.0; +double H5T_NATIVE_DOUBLE_NEG_INF_g = 0.0; /* Declare the free list for H5T_t's and H5T_shared_t's */ H5FL_DEFINE(H5T_t); diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index d8fed41..d29d8e5 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -48,7 +48,7 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ H5Z__filter_deflate, /* The actual filter function */ }}; -#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12) +#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * 1.001) + 12) /*------------------------------------------------------------------------- * Function: H5Z__filter_deflate diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 5310f7d..2e1a474 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -1116,7 +1116,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu unsigned filavail; /* flag indicating if fill value is defined or not */ H5Z_SO_scale_type_t scale_type = H5Z_SO_FLOAT_DSCALE; /* scale type */ int scale_factor = 0; /* scale factor */ - double D_val = 0.0f; /* decimal scale factor */ + double D_val = 0.0; /* decimal scale factor */ uint32_t minbits = 0; /* minimum number of bits to store values */ unsigned long long minval = 0; /* minimum value of input buffer */ enum H5Z_scaleoffset_t type; /* memory type corresponding to dataset datatype */ diff --git a/src/H5timer.c b/src/H5timer.c index 54a3365..b2cc5f0 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -42,9 +42,9 @@ #define H5TIMER_TIME_STRING_LEN 1536 /* Conversion factors */ -#define H5_SEC_PER_DAY (double)(24.0F * 60.0F * 60.0F) -#define H5_SEC_PER_HOUR (double)(60.0F * 60.0F) -#define H5_SEC_PER_MIN (double)(60.0F) +#define H5_SEC_PER_DAY (24.0 * 60.0 * 60.0) +#define H5_SEC_PER_HOUR (60.0 * 60.0) +#define H5_SEC_PER_MIN (60.0) /******************/ /* Local Typedefs */ @@ -100,13 +100,13 @@ H5_bandwidth(char *buf /*out*/, double nbytes, double nseconds) { double bw; - if (nseconds <= (double)0.0F) + if (nseconds <= 0.0) HDstrcpy(buf, " NaN"); else { bw = nbytes / nseconds; - if (H5_DBL_ABS_EQUAL(bw, (double)0.0F)) + if (H5_DBL_ABS_EQUAL(bw, 0.0)) HDstrcpy(buf, "0.000 B/s"); - else if (bw < (double)1.0F) + else if (bw < 1.0) HDsprintf(buf, "%10.4e", bw); else if (bw < (double)H5_KB) { HDsprintf(buf, "%05.4f", bw); @@ -224,7 +224,7 @@ H5_now_usec(void) double H5_get_time(void) { - double ret_value = (double)0.0f; + double ret_value = 0.0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -233,14 +233,14 @@ H5_get_time(void) struct timespec ts; HDclock_gettime(CLOCK_MONOTONIC, &ts); - ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1000000000.0f); + ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0); } #elif defined(H5_HAVE_GETTIMEOFDAY) { struct timeval now_tv; HDgettimeofday(&now_tv, NULL); - ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / (double)1000000.0f); + ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / 1000000.0); } #else ret_value = (double)HDtime(NULL); @@ -289,8 +289,8 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/) if (HDgetrusage(RUSAGE_SELF, &res) < 0) return -1; - times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / (double)1.0E6F); - times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / (double)1.0E6F); + times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / 1.0E6); + times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / 1.0E6); } #else /* No suitable way to get system/user times */ @@ -589,7 +589,7 @@ H5_timer_get_time_string(double seconds) double remainder_sec = 0.0; /* Extract larger time units from count of seconds */ - if (seconds > (double)60.0F) { + if (seconds > 60.0) { /* Set initial # of seconds */ remainder_sec = seconds; @@ -617,19 +617,19 @@ H5_timer_get_time_string(double seconds) * time unit. Perhaps this could be passed as an integer. * (name? round_up_size? ?) */ - if (seconds < (double)0.0F) + if (seconds < 0.0) HDsprintf(s, "N/A"); - else if (H5_DBL_ABS_EQUAL((double)0.0F, seconds)) + else if (H5_DBL_ABS_EQUAL(0.0, seconds)) HDsprintf(s, "0.0 s"); - else if (seconds < (double)1.0E-6F) + else if (seconds < 1.0E-6) /* t < 1 us, Print time in ns */ - HDsprintf(s, "%.f ns", seconds * (double)1.0E9F); - else if (seconds < (double)1.0E-3F) + HDsprintf(s, "%.f ns", seconds * 1.0E9); + else if (seconds < 1.0E-3) /* t < 1 ms, Print time in us */ - HDsprintf(s, "%.1f us", seconds * (double)1.0E6F); - else if (seconds < (double)1.0F) + HDsprintf(s, "%.1f us", seconds * 1.0E6); + else if (seconds < 1.0) /* t < 1 s, Print time in ms */ - HDsprintf(s, "%.1f ms", seconds * (double)1.0E3F); + HDsprintf(s, "%.1f ms", seconds * 1.0E3); else if (seconds < H5_SEC_PER_MIN) /* t < 1 m, Print time in s */ HDsprintf(s, "%.2f s", seconds); diff --git a/src/H5trace.c b/src/H5trace.c index d587853..ecb2705 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -3903,14 +3903,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if (returning) { if (current_depth > 1) { --current_depth; - return (double)0.0F; + return 0.0; } } else { if (current_depth > 0) { /* Do not update last_call_depth */ current_depth++; - return (double)0.0F; + return 0.0; } } } @@ -3997,5 +3997,5 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if (H5_debug_g.ttimes) return function_times.elapsed; else - return (double)0.0F; + return 0.0; } /* end H5_trace() */ diff --git a/test/cache.c b/test/cache.c index 3f2a404..0081830 100644 --- a/test/cache.c +++ b/test/cache.c @@ -26482,7 +26482,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; } - else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) { /* i.e. hit_rate != 0.0 */ + else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 1.\n"; @@ -26513,7 +26513,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; } - else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) { /* i.e. hit_rate != 0.0 */ + else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 2.\n"; @@ -26554,7 +26554,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; } - else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.5f)) { /* i.e. hit_rate != 0.5 */ + else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.5)) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 3.\n"; @@ -26627,7 +26627,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; } - else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.5F)) { /* i.e. hit_rate != 0.5 */ + else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.5)) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 4.\n"; diff --git a/test/cache_api.c b/test/cache_api.c index 75e1b9d..5d0f395 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -81,27 +81,27 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024 + 1), - /* double min_clean_fraction = */ 0.2f, + /* double min_clean_fraction = */ 0.2, /* size_t max_size = */ (16 * 1024 * 1024 + 1), /* size_t min_size = */ (1 * 1024 * 1024 + 1), /* long int epoch_length = */ 50001, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.91f, - /* double increment = */ 2.1f, + /* double lower_hr_threshold = */ 0.91, + /* double increment = */ 2.1, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024 + 1), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out, - /* double upper_hr_threshold = */ 0.998f, - /* double decrement = */ 0.91f, + /* double upper_hr_threshold = */ 0.998, + /* double decrement = */ 0.91, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024 - 1), /* int epochs_before_eviction = */ 4, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -526,22 +526,22 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024 + 1), - /* double min_clean_fraction = */ 0.2f, + /* double min_clean_fraction = */ 0.2, /* size_t max_size = */ (16 * 1024 * 1024 + 1), /* size_t min_size = */ (1 * 1024 * 1024 + 1), /* long int epoch_length = */ 50001, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.91f, - /* double increment = */ 2.1f, + /* double lower_hr_threshold = */ 0.91, + /* double increment = */ 2.1, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024 + 1), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out, - /* double upper_hr_threshold = */ 0.998f, - /* double decrement = */ 0.91f, + /* double upper_hr_threshold = */ 0.998, + /* double decrement = */ 0.91, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024 - 1), /* int epochs_before_eviction = */ 4, @@ -559,27 +559,27 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (512 * 1024), - /* double min_clean_fraction = */ 0.1f, + /* double min_clean_fraction = */ 0.1, /* size_t max_size = */ (8 * 1024 * 1024), /* size_t min_size = */ (512 * 1024), /* long int epoch_length = */ 25000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.9, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (2 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 1.5f, - /* double flash_threshold = */ 0.4f, + /* double flash_multiple = */ 1.5, + /* double flash_threshold = */ 0.4, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.9995f, - /* double decrement = */ 0.95f, + /* double upper_hr_threshold = */ 0.9995, + /* double decrement = */ 0.95, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (512 * 1024), /* int epochs_before_eviction = */ 4, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -592,27 +592,27 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.2f, + /* double min_clean_fraction = */ 0.2, /* size_t max_size = */ (16 * 1024 * 1024), /* size_t min_size = */ (1 * 1024 * 1024), /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off, - /* double lower_hr_threshold = */ 0.90f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.90, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.1f, - /* double flash_threshold = */ 0.6f, + /* double flash_multiple = */ 2.1, + /* double flash_threshold = */ 0.6, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, + /* double upper_hr_threshold = */ 0.999, + /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ FALSE, /* size_t max_decrement = */ (1 * 1024 * 1024 - 1), /* int epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ FALSE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -625,28 +625,28 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.15f, + /* double min_clean_fraction = */ 0.15, /* size_t max_size = */ (20 * 1024 * 1024), /* size_t min_size = */ (1 * 1024 * 1024), /* long int epoch_length = */ 75000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.9, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (2 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 1.1f, - /* double flash_threshold = */ 0.3f, + /* double flash_multiple = */ 1.1, + /* double flash_threshold = */ 0.3, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, + /* double upper_hr_threshold = */ 0.999, + /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), /* int epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, + /* double empty_reserve = */ 0.1, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -755,7 +755,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() failed 1.\n"; } - else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) { + else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) { pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() returned unexpected hit rate.\n"; @@ -857,7 +857,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) hbool_t valid_chunk; hbool_t dump_hit_rate = FALSE; int64_t min_accesses = 1000; - double min_hit_rate = 0.90f; + double min_hit_rate = 0.90; hbool_t dump_cache_size = FALSE; hid_t file_id = -1; hid_t dataspace_id = -1; @@ -883,27 +883,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ 500000, - /* double min_clean_fraction = */ 0.1f, + /* double min_clean_fraction = */ 0.1, /* size_t max_size = */ 16000000, /* size_t min_size = */ 250000, /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off, - /* double lower_hr_threshold = */ 0.95f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.95, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ FALSE, /* size_t max_increment = */ 4000000, /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, + /* double upper_hr_threshold = */ 0.999, + /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ FALSE, /* size_t max_decrement = */ 1000000, /* int epochs_before_eviction = */ 2, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -916,27 +916,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ 12000000, - /* double min_clean_fraction = */ 0.1f, + /* double min_clean_fraction = */ 0.1, /* size_t max_size = */ 16000000, /* size_t min_size = */ 250000, /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off, - /* double lower_hr_threshold = */ 0.95f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.95, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ FALSE, /* size_t max_increment = */ 4000000, /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, + /* double upper_hr_threshold = */ 0.999, + /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ FALSE, /* size_t max_decrement = */ 1000000, /* int epochs_before_eviction = */ 2, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -949,27 +949,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* hbool_t evictions_enabled = */ TRUE, /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ 2000000, - /* double min_clean_fraction = */ 0.1f, + /* double min_clean_fraction = */ 0.1, /* size_t max_size = */ 16000000, /* size_t min_size = */ 250000, /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off, - /* double lower_hr_threshold = */ 0.95f, - /* double increment = */ 2.0f, + /* double lower_hr_threshold = */ 0.95, + /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ FALSE, /* size_t max_increment = */ 4000000, /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, + /* double upper_hr_threshold = */ 0.999, + /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ FALSE, /* size_t max_decrement = */ 1000000, /* int epochs_before_eviction = */ 2, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; @@ -1517,26 +1517,26 @@ init_invalid_configs(void) configs[i].evictions_enabled = TRUE; configs[i].set_initial_size = TRUE; configs[i].initial_size = (1 * 1024 * 1024); - configs[i].min_clean_fraction = 0.25F; + configs[i].min_clean_fraction = 0.25; configs[i].max_size = (16 * 1024 * 1024); configs[i].min_size = (1 * 1024 * 1024); configs[i].epoch_length = 50000; configs[i].incr_mode = H5C_incr__threshold; - configs[i].lower_hr_threshold = 0.9F; - configs[i].increment = 2.0F; + configs[i].lower_hr_threshold = 0.9; + configs[i].increment = 2.0; configs[i].apply_max_increment = TRUE; configs[i].max_increment = (4 * 1024 * 1024); configs[i].flash_incr_mode = H5C_flash_incr__off; - configs[i].flash_multiple = 2.0F; - configs[i].flash_threshold = 0.5F; + configs[i].flash_multiple = 2.0; + configs[i].flash_threshold = 0.5; configs[i].decr_mode = H5C_decr__age_out_with_threshold; - configs[i].upper_hr_threshold = 0.999F; - configs[i].decrement = 0.9F; + configs[i].upper_hr_threshold = 0.999; + configs[i].decrement = 0.9; configs[i].apply_max_decrement = TRUE; configs[i].max_decrement = (1 * 1024 * 1024); configs[i].epochs_before_eviction = 3; configs[i].apply_empty_reserve = TRUE; - configs[i].empty_reserve = 0.1F; + configs[i].empty_reserve = 0.1; configs[i].dirty_bytes_threshold = (256 * 1024); configs[i].metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; } @@ -1567,10 +1567,10 @@ init_invalid_configs(void) configs[6].initial_size = (1 * 1024 * 1024 - 1); /* 7 -- min_clean_fraction too big */ - configs[7].min_clean_fraction = 1.000001f; + configs[7].min_clean_fraction = 1.000001; /* 8 -- min_clean_fraction too small */ - configs[8].min_clean_fraction = -0.00000001f; + configs[8].min_clean_fraction = -0.00000001; /* 9 -- epoch_length too small */ configs[9].epoch_length = H5C__MIN_AR_EPOCH_LENGTH - 1; @@ -1582,10 +1582,10 @@ init_invalid_configs(void) configs[11].incr_mode = (enum H5C_cache_incr_mode) - 1; /* 12 -- lower_hr_threshold too small */ - configs[12].lower_hr_threshold = -0.000001f; + configs[12].lower_hr_threshold = -0.000001; /* 13 -- lower_hr_threshold too big */ - configs[13].lower_hr_threshold = 1.00000001f; + configs[13].lower_hr_threshold = 1.00000001; /* 14 -- increment too small */ configs[14].increment = 0.999999999999; @@ -1595,29 +1595,29 @@ init_invalid_configs(void) /* 16 -- flash_multiple too small */ configs[16].flash_incr_mode = H5C_flash_incr__add_space; - configs[16].flash_multiple = 0.09f; + configs[16].flash_multiple = 0.09; /* 17 -- flash_multiple too big */ configs[17].flash_incr_mode = H5C_flash_incr__add_space; - configs[17].flash_multiple = 10.001f; + configs[17].flash_multiple = 10.001; /* 18 -- flash_threshold too small */ configs[18].flash_incr_mode = H5C_flash_incr__add_space; - configs[18].flash_threshold = 0.099f; + configs[18].flash_threshold = 0.099; /* 19 -- flash_threshold too big */ configs[19].flash_incr_mode = H5C_flash_incr__add_space; - configs[19].flash_threshold = 1.001f; + configs[19].flash_threshold = 1.001; /* 20 -- bad decr_mode */ configs[20].decr_mode = (enum H5C_cache_decr_mode) - 1; /* 21 -- upper_hr_threshold too big */ - configs[21].upper_hr_threshold = 1.00001f; + configs[21].upper_hr_threshold = 1.00001; /* 22 -- decrement too small */ configs[22].decr_mode = H5C_decr__threshold; - configs[22].decrement = -0.0000000001f; + configs[22].decrement = -0.0000000001; /* 23 -- decrement too big */ configs[23].decr_mode = H5C_decr__threshold; @@ -1630,20 +1630,20 @@ init_invalid_configs(void) configs[25].epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* 26 -- empty_reserve too small */ - configs[26].empty_reserve = -0.0000000001f; + configs[26].empty_reserve = -0.0000000001; /* 27 -- empty_reserve too big */ configs[27].empty_reserve = 1.00000000001; /* 28 -- upper_hr_threshold too small */ - configs[28].upper_hr_threshold = -0.000000001f; + configs[28].upper_hr_threshold = -0.000000001; /* 29 -- upper_hr_threshold too big */ configs[29].upper_hr_threshold = 1.00000001; /* 30 -- upper_hr_threshold <= lower_hr_threshold */ - configs[30].lower_hr_threshold = 0.9f; - configs[30].upper_hr_threshold = 0.9f; + configs[30].lower_hr_threshold = 0.9; + configs[30].upper_hr_threshold = 0.9; /* 31 -- dirty_bytes_threshold too small */ configs[31].dirty_bytes_threshold = (H5C__MIN_MAX_CACHE_SIZE / 2) - 1; diff --git a/test/cross_read.c b/test/cross_read.c index 386c0da..eef814f 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -159,9 +159,9 @@ check_data_f(const char *dsetname, hid_t fid) /* Input (last row is different) */ for (i = 0; i < NX; i++) for (j = 0; j < NY; j++) - data_in[i][j] = ((double)(i + j + 1)) / (double)3.0F; + data_in[i][j] = ((double)(i + j + 1)) / 3.0; for (i = 0; i < NY; i++) - data_in[NX][i] = -2.2F; + data_in[NX][i] = -2.2; /* Output */ HDmemset(data_out, 0, (NX + 1) * NY * sizeof(double)); @@ -174,7 +174,7 @@ check_data_f(const char *dsetname, hid_t fid) /* Check results */ for (i = 0; i < (NX + 1); i++) for (j = 0; j < NY; j++) - if (!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], (double)0.001F)) + if (!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], 0.001)) if (!nerrors++) { H5_FAILED(); HDprintf("element [%d][%d] is %g but should have been %g\n", (int)i, (int)j, diff --git a/test/dsets.c b/test/dsets.c index e38f253..88dcb35 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -6520,7 +6520,7 @@ test_set_local(hid_t fapl) for (i = 0; i < DSET_DIM1; i++) for (j = 0; j < DSET_DIM2; j++) { points[i][j] = (int)n++; - points_dbl[i][j] = (double)1.5F * n++; + points_dbl[i][j] = 1.5 * n++; } /* Open file */ @@ -6716,7 +6716,7 @@ test_set_local(hid_t fapl) for (j = 0; j < dims[1]; j++) { /* If the difference between two values is greater than 0.001%, they're * considered not equal. */ - if (!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], (double)0.00001F)) { + if (!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], 0.00001)) { H5_FAILED(); HDprintf(" Line %d: Read different values than written.\n", __LINE__); HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); @@ -8803,7 +8803,7 @@ test_chunk_cache(hid_t fapl) /* Set new rdcc settings on fapl */ nslots_2 = nslots_1 * 2; nbytes_2 = nbytes_1 * 2; - w0_2 = w0_1 / (double)2.0F; + w0_2 = w0_1 / 2.0; if (H5Pset_cache(fapl_local, 0, nslots_2, nbytes_2, w0_2) < 0) FAIL_STACK_ERROR diff --git a/test/dt_arith.c b/test/dt_arith.c index ddc8814..7b79102 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -3232,7 +3232,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) int expo_diff = check_expo[0] - check_expo[1]; int valid_bits = (int)((dst_ebias + dst_msize) + (size_t)MIN(check_expo[0], check_expo[1])) - 1; - double epsilon = 1.0F; + double epsilon = 1.0; /* Re-scale the mantissas based on any exponent difference */ if (expo_diff != 0) diff --git a/test/dtypes.c b/test/dtypes.c index 626c58c..52eb0ea 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -2284,9 +2284,9 @@ test_compound_11(void) /* Initialize buffer */ for (u = 0; u < NTESTELEM; u++) { - ((big_t *)buf)[u].d1 = (double)u * (double)1.5f; - ((big_t *)buf)[u].d2 = (double)u * (double)2.5f; - ((big_t *)buf)[u].d3 = (double)u * (double)3.5f; + ((big_t *)buf)[u].d1 = (double)u * 1.5; + ((big_t *)buf)[u].d2 = (double)u * 2.5; + ((big_t *)buf)[u].d3 = (double)u * 3.5; ((big_t *)buf)[u].i1 = (int)(u * 3); ((big_t *)buf)[u].i2 = (int)(u * 5); ((big_t *)buf)[u].s1 = (char *)HDmalloc((size_t)32); diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 83298c8..9b4879e 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -141,11 +141,11 @@ main(void) hid_t vspace = -1; /* Virtual dset dataspaces */ hsize_t dims[1] = {3}; /* Data space current size */ hsize_t chunk_size[2] = {16384, 4}; /* chunk size */ - double fill = 2.7f; /* Fill value */ + double fill = 2.7; /* Fill value */ hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; size_t nbytes = 1048576 * 10; - double w0 = 0.5f; + double w0 = 0.5; unsigned max_compact; unsigned min_dense; const char * c_to_f = "x+32"; @@ -159,26 +159,26 @@ main(void) TRUE, FALSE, (2 * 2048 * 1024), - 0.3f, + 0.3, (64 * 1024 * 1024), (4 * 1024 * 1024), 60000, H5C_incr__threshold, - 0.8f, - 3.0f, + 0.8, + 3.0, TRUE, (8 * 1024 * 1024), H5C_flash_incr__add_space, - 2.0f, - 0.25f, + 2.0, + 0.25, H5C_decr__age_out_with_threshold, - 0.997f, - 0.8f, + 0.997, + 0.8, TRUE, (3 * 1024 * 1024), 3, FALSE, - 0.2f, + 0.2, (256 * 2048), H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; diff --git a/test/gen_cross.c b/test/gen_cross.c index 3eac79a..2746bb6 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -295,7 +295,7 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) hid_t dataset = -1; /* dataset handles */ hid_t dcpl = -1; double data[NX][NY]; /* data to write */ - double fillvalue = -2.2f; + double fillvalue = -2.2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; int i, j; diff --git a/test/gen_plist.c b/test/gen_plist.c index 7a67c56..10c6423 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -42,7 +42,7 @@ main(void) hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; size_t nbytes = 1048576 * 10; - double w0 = 0.5f; + double w0 = 0.5; unsigned max_compact; unsigned min_dense; const char * c_to_f = "x+32"; @@ -56,26 +56,26 @@ main(void) 1 /*TRUE*/, 0 /*FALSE*/, (2 * 2048 * 1024), - 0.3f, + 0.3, (64 * 1024 * 1024), (4 * 1024 * 1024), 60000, H5C_incr__threshold, - 0.8f, - 3.0f, + 0.8, + 3.0, 1 /*TRUE*/, (8 * 1024 * 1024), H5C_flash_incr__add_space, - 2.0f, - 0.25f, + 2.0, + 0.25, H5C_decr__age_out_with_threshold, - 0.997f, - 0.8f, + 0.997, + 0.8, 1 /*TRUE*/, (3 * 1024 * 1024), 3, 0 /*FALSE*/, - 0.2f, + 0.2, (256 * 2048), H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY}; H5AC_cache_image_config_t my_cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE, diff --git a/test/links.c b/test/links.c index 2ac2e28..b2d0d9a 100644 --- a/test/links.c +++ b/test/links.c @@ -140,7 +140,7 @@ const char *FILENAME[] = {"links0", #define H5L_DIM1 100 #define H5L_DIM2 100 -#define FILTER_FILESIZE_MAX_FRACTION (double)0.9F +#define FILTER_FILESIZE_MAX_FRACTION 0.9 /* Creation order macros */ #define CORDER_GROUP_NAME "corder_group" diff --git a/test/mtime.c b/test/mtime.c index 78f9065..43dc502 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -120,7 +120,7 @@ main(void) HDputs(" cannot be queried on this system. See H5O_mtime_decode()."); return 0; } - else if (HDfabs(HDdifftime(now, oi1.ctime)) > (double)60.0F) { + else if (HDfabs(HDdifftime(now, oi1.ctime)) > 60.0) { H5_FAILED(); tm = HDlocaltime(&(oi1.ctime)); HDstrftime((char *)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); diff --git a/test/objcopy.c b/test/objcopy.c index 681b8a5..43a5756 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2936,7 +2936,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t HDmemset(buf, 0, sizeof(buf)); for (i = 0; i < DIM_SIZE_1; i++) { buf[i].a = i; - buf[i].d = (double)1.0F / (double)(i + 1); + buf[i].d = 1.0 / (double)(i + 1); } /* end for */ /* Initialize the filenames */ diff --git a/test/tattr.c b/test/tattr.c index 3f0c102..b602222 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -519,13 +519,13 @@ test_attr_basic_read(hid_t fapl) static void test_attr_flush(hid_t fapl) { - hid_t fil, /* File ID */ - att, /* Attribute ID */ - spc, /* Dataspace ID */ - set; /* Dataset ID */ - double wdata = 3.14159F; /* Data to write */ - double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + hid_t fil, /* File ID */ + att, /* Attribute ID */ + spc, /* Dataspace ID */ + set; /* Dataset ID */ + double wdata = 3.14159; /* Data to write */ + double rdata; /* Data read in */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -545,8 +545,8 @@ test_attr_flush(hid_t fapl) ret = H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if (!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) - TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, (double)0.0F); + if (!H5_DBL_ABS_EQUAL(rdata, 0.0)) + TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, 0.0); ret = H5Fflush(fil, H5F_SCOPE_GLOBAL); CHECK(ret, FAIL, "H5Fflush"); @@ -554,8 +554,8 @@ test_attr_flush(hid_t fapl) ret = H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if (!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) - TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, (double)0.0F); + if (!H5_DBL_ABS_EQUAL(rdata, 0.0)) + TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, 0.0); ret = H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata); CHECK(ret, FAIL, "H5Awrite"); diff --git a/test/tgenprop.c b/test/tgenprop.c index 7e805e2..55e5a9b 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -55,7 +55,7 @@ char prop3_def[10] = "Ten chars"; /* Property 3 default value */ #define PROP3_DEF_VALUE (&prop3_def) #define PROP4_NAME "Property 4" -double prop4_def = 1.41F; /* Property 4 default value */ +double prop4_def = 1.41; /* Property 4 default value */ #define PROP4_SIZE sizeof(prop4_def) #define PROP4_DEF_VALUE (&prop4_def) diff --git a/test/th5s.c b/test/th5s.c index 30c3396..51216dc 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2575,7 +2575,7 @@ test_h5s_chunk(void) for (i = 0; i < CHUNK_DATA_NX; i++) { for (j = 0; j < CHUNK_DATA_NY; j++) { /* Check if the two values are within 0.001% range. */ - if (!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], (double)chunk_data_flt[i][j], (double)0.00001F)) + if (!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], (double)chunk_data_flt[i][j], 0.00001)) TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, (double)chunk_data_flt[i][j]); diff --git a/test/timer.c b/test/timer.c index 24f3245..bb474ca 100644 --- a/test/timer.c +++ b/test/timer.c @@ -144,7 +144,7 @@ test_timer_system_user(void) /* The system and user times may not be present on some systems. They * will be -1.0 if they are not. */ - if (timer.initial.system < (double)0.0f || timer.initial.user < (double)0.0f) { + if (timer.initial.system < 0.0 || timer.initial.user < 0.0) { SKIPPED(); HDprintf("NOTE: No suitable way to get system/user times on this platform.\n"); return 0; @@ -165,7 +165,7 @@ test_timer_system_user(void) TEST_ERROR; /* System and user times should be non-negative. */ - if (times.system < (double)0.0f || times.user < (double)0.0f) + if (times.system < 0.0 || times.user < 0.0) TEST_ERROR; PASSED(); @@ -224,7 +224,7 @@ test_timer_elapsed(void) TEST_ERROR; /* Elapsed time should be non-negative. */ - if (times.elapsed < (double)0.0f) + if (times.elapsed < 0.0) TEST_ERROR; PASSED(); @@ -260,11 +260,11 @@ test_timer_functionality(void) /* Times should be initialized to zero */ err = H5_timer_get_times(timer, ×); - if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) + if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) + if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) TEST_ERROR; /******************** @@ -289,11 +289,11 @@ test_timer_functionality(void) /* Times should be positive and non-negative */ err = H5_timer_get_times(timer, ×); - if (err < 0 || times.elapsed < (double)0.0f) + if (err < 0 || times.elapsed < 0.0) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if (err < 0 || times.elapsed < (double)0.0f) + if (err < 0 || times.elapsed < 0.0) TEST_ERROR; /********************** @@ -306,11 +306,11 @@ test_timer_functionality(void) TEST_ERROR; err = H5_timer_get_times(timer, ×); - if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) + if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) + if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) TEST_ERROR; /* Timer state should flip */ @@ -326,12 +326,12 @@ test_timer_functionality(void) /* Times should be non-negative */ err = H5_timer_get_times(timer, ×); - if (err < 0 || times.elapsed < (double)0.0f) + if (err < 0 || times.elapsed < 0.0) TEST_ERROR; prev_etime = times.elapsed; err = H5_timer_get_total_times(timer, ×); - if (err < 0 || times.elapsed < (double)0.0f) + if (err < 0 || times.elapsed < 0.0) TEST_ERROR; prev_total_etime = times.elapsed; diff --git a/test/tmisc.c b/test/tmisc.c index 51e203a..302da0d 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2521,17 +2521,17 @@ test_misc13(void) static void test_misc14(void) { - hid_t file_id; /* File ID */ - hid_t fapl; /* File access property list ID */ - hid_t DataSpace; /* Dataspace ID */ - hid_t Dataset1; /* Dataset ID #1 */ - hid_t Dataset2; /* Dataset ID #2 */ - hid_t Dataset3; /* Dataset ID #3 */ - double data1 = 5.0F; /* Data to write for dataset #1 */ - double data2 = 10.0F; /* Data to write for dataset #2 */ - double data3 = 15.0F; /* Data to write for dataset #3 */ - double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + hid_t file_id; /* File ID */ + hid_t fapl; /* File access property list ID */ + hid_t DataSpace; /* Dataspace ID */ + hid_t Dataset1; /* Dataset ID #1 */ + hid_t Dataset2; /* Dataset ID #2 */ + hid_t Dataset3; /* Dataset ID #3 */ + double data1 = 5.0; /* Data to write for dataset #1 */ + double data2 = 10.0; /* Data to write for dataset #2 */ + double data3 = 15.0; /* Data to write for dataset #3 */ + double rdata; /* Data read in */ + herr_t ret; /* Generic return value */ /* Test creating two datasets and deleting the second */ diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 92c8bc0..a3f1859 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -98,10 +98,10 @@ test_plist_ed(void) int mpi_size, mpi_rank, recv_proc; hsize_t chunk_size = 16384; /* chunk size */ - double fill = 2.7f; /* Fill value */ + double fill = 2.7; /* Fill value */ size_t nslots = 521 * 2; size_t nbytes = 1048576 * 10; - double w0 = 0.5f; + double w0 = 0.5; unsigned max_compact; unsigned min_dense; hsize_t max_size[1]; /*data space maximum size */ @@ -114,26 +114,26 @@ test_plist_ed(void) TRUE, FALSE, (2 * 2048 * 1024), - 0.3f, + 0.3, (64 * 1024 * 1024), (4 * 1024 * 1024), 60000, H5C_incr__threshold, - 0.8f, - 3.0f, + 0.8, + 3.0, TRUE, (8 * 1024 * 1024), H5C_flash_incr__add_space, - 2.0f, - 0.25f, + 2.0, + 0.25, H5C_decr__age_out_with_threshold, - 0.997f, - 0.8f, + 0.997, + 0.8, TRUE, (3 * 1024 * 1024), 3, FALSE, - 0.2f, + 0.2, (256 * 2048), H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 603b1f3..1b81824 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -375,7 +375,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char opts->percent = HDatof(opt_arg); /* -p 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) + if (H5_DBL_ABS_EQUAL(opts->percent, 0.0)) opts->percent_bool = 0; break; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index a0b9441..4392d85 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1983,7 +1983,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) HSIZE_T_FORMAT " logical byte%s, " HSIZE_T_FORMAT " allocated byte%s", total, 1 == total ? "" : "s", used, 1 == used ? "" : "s"); if (used > 0) { - utilization = ((double)total * (double)100.0f) / (double)used; + utilization = ((double)total * 100.0) / (double)used; h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization); } } diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 3e7a8c1..e091a8a 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -1609,7 +1609,7 @@ print_storage_summary(const iter_t *iter) { hsize_t total_meta = 0; hsize_t unaccount = 0; - double percent = 0.0f; + double percent = 0.0; HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); HDfprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size); @@ -1624,7 +1624,7 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta); HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size); - percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f; + percent = ((double)iter->free_space / (double)iter->filesize) * 100.0; HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n", iter->free_space, percent); diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 340e31b..e49125b 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -64,8 +64,8 @@ main(void) double b64r3[5][3][4]; double row8[3], col8[4], pln8[5]; - double rowo8 = 11.0F, colo8 = 21.0F, plno8 = 51.0F; - double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F; + double rowo8 = 11.0, colo8 = 21.0, plno8 = 51.0; + double rowi8 = 1.0, coli8 = 2.0, plni8 = 5.0; /* Initialize machine endian */ volatile uint32_t ibyte = 0x01234567; diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index ada2ed3..1b6793a 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -55,20 +55,20 @@ #define RM_CACHE_STRT 25 #define RM_CACHE_END 25 #define RM_CACHE_DELT 5 -#define RM_START (double)0.50F -#define RM_END (double)5.00F -#define RM_DELTA (double)0.50F -#define RM_W0 0.0F +#define RM_START 0.50 +#define RM_END 5.00 +#define RM_DELTA 0.50 +#define RM_W0 0.0 #define RM_NRDCC 521 /* Diagonal test */ #define DIAG_CACHE_STRT 25 #define DIAG_CACHE_END 25 #define DIAG_CACHE_DELT 5 -#define DIAG_START (double)0.50F -#define DIAG_END (double)5.00F -#define DIAG_DELTA (double)0.50F -/* #define DIAG_W0 0.65F */ +#define DIAG_START 0.50 +#define DIAG_END 5.00 +#define DIAG_DELTA 0.50 +/* #define DIAG_W0 0.65 */ /* #define DIAG_NRDCC 521 */ static size_t nio_g; diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index fcaa337..25fa34c 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -262,13 +262,14 @@ check_partial_chunks_perf(hid_t file) end_t = H5_get_time(); - if ((end_t - start_t) > (double)0.0f) - printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", - (end_t - start_t), nbytes_global); + if ((end_t - start_t) > 0.0) + HDprintf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", + (end_t - start_t), nbytes_global); else - printf("1. Partial chunks: no total read time because timer is not available; number of bytes being " - "read from file is %zu\n", - nbytes_global); + HDprintf( + "1. Partial chunks: no total read time because timer is not available; number of bytes being " + "read from file is %zu\n", + nbytes_global); H5Dclose(dataset); H5Sclose(filespace); @@ -340,13 +341,14 @@ check_hash_value_perf(hid_t file) end_t = H5_get_time(); - if ((end_t - start_t) > (double)0.0f) - printf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", - (end_t - start_t), nbytes_global); + if ((end_t - start_t) > 0.0) + HDprintf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", + (end_t - start_t), nbytes_global); else - printf("2. Hash value: no total read time because timer is not available; number of bytes being read " - "from file is %zu\n", - nbytes_global); + HDprintf( + "2. Hash value: no total read time because timer is not available; number of bytes being read " + "from file is %zu\n", + nbytes_global); H5Dclose(dataset); H5Sclose(filespace); @@ -375,7 +377,7 @@ error: int main(void) { - hid_t file; /* handles */ + hid_t file = H5I_INVALID_HID; /* file ID */ int nerrors = 0; /* Create a new file. If file exists its contents will be overwritten. */ @@ -404,6 +406,6 @@ main(void) return 0; error: - fprintf(stderr, "*** ERRORS DETECTED ***\n"); + HDfprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index 68eaa3a..d0db06a 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -64,11 +64,11 @@ print_stats(const char *prefix, #ifdef H5_HAVE_GETRUSAGE double u_time, s_time; - u_time = ((double)(r_stop->ru_utime.tv_sec) + (double)(r_stop->ru_utime.tv_usec) / (double)1000000.0F) - - ((double)(r_start->ru_utime.tv_sec) + (double)(r_start->ru_utime.tv_usec) / (double)1000000.0F); + u_time = ((double)(r_stop->ru_utime.tv_sec) + (double)(r_stop->ru_utime.tv_usec) / 1000000.0) - + ((double)(r_start->ru_utime.tv_sec) + (double)(r_start->ru_utime.tv_usec) / 1000000.0); - s_time = ((double)(r_stop->ru_stime.tv_sec) + (double)(r_stop->ru_stime.tv_usec) / (double)1000000.0F) - - ((double)(r_start->ru_stime.tv_sec) + (double)(r_start->ru_stime.tv_usec) / (double)1000000.0F); + s_time = ((double)(r_stop->ru_stime.tv_sec) + (double)(r_stop->ru_stime.tv_usec) / 1000000.0) - + ((double)(r_start->ru_stime.tv_sec) + (double)(r_start->ru_stime.tv_usec) / 1000000.0); #endif e_time = t_stop - t_start; H5_bandwidth(bw, (double)nbytes, e_time); @@ -149,8 +149,7 @@ main(void) * Win32 version 5.0 compiler. * 1998-11-06 ptl */ - HDprintf("I/O request size is %1.1fMB\n", - (double)(hssize_t)(size[0] * size[1]) / (double)1024.0F * (double)1024); + HDprintf("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0] * size[1]) / 1024.0 * 1024.0); /* Open the files */ file = H5Fcreate(HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index 5b3a9e8..fe4e7e7 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -65,8 +65,7 @@ #define SIO_HDF5 0x4 /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes, t) \ - (H5_DBL_ABS_EQUAL(t, (double)0.0F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t))) +#define MB_PER_SEC(bytes, t) (H5_DBL_ABS_EQUAL(t, 0.0) ? 0.0 : ((((double)bytes) / (double)ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 6a1e1aa..517866b 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -32,11 +32,10 @@ #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) -#define MICROSECOND 1000000.0F +#define MICROSECOND 1000000.0 /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes, t) \ - ((fabs(t) < (double)0.0000000001F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t))) +#define MB_PER_SEC(bytes, t) ((fabs(t) < 0.0000000001) ? 0.0 : ((((double)bytes) / (double)ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -169,7 +168,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ - destLen = (uLongf)((double)sourceLen + ((double)sourceLen * (double)0.1F)) + 12; + destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12; dest = (Bytef *)HDmalloc(destLen); if (!dest) @@ -179,8 +178,8 @@ write_file(Bytef *source, uLongf sourceLen) compress_buffer(dest, &destLen, source, sourceLen); HDgettimeofday(&timer_stop, NULL); - compression_time += ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - - ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / (double)MICROSECOND); + compression_time += ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / MICROSECOND) - + ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / MICROSECOND); if (report_once_flag) { HDfprintf(stdout, "\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen); |