summaryrefslogtreecommitdiffstats
path: root/tools/test/perform/zip_perf.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-05-07 16:45:05 (GMT)
committerGitHub <noreply@github.com>2021-05-07 16:45:05 (GMT)
commit9023e98940d959aa974e655cc383fab0b0ed663c (patch)
tree8cad5bb35e1385c7a267319f4baf688d0efade63 /tools/test/perform/zip_perf.c
parent1e572b18e3c271f9de045a6b61e3c855779e7c58 (diff)
downloadhdf5-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>
Diffstat (limited to 'tools/test/perform/zip_perf.c')
-rw-r--r--tools/test/perform/zip_perf.c11
1 files changed, 5 insertions, 6 deletions
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);