From d8e3d8e9082f0926e80e7e7010c00bda05a215b3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 1 Mar 2015 13:48:54 -0500 Subject: [svn-r26333] Eliminates gcc warnings due to -Wunsuffixed-float-constants. - Adds 'F' suffixes for most float constants. - A few constants MUST be of type double. These now receive the long double L suffix and are then cast to double. I do this via a new H5_DOUBLE() macro which was added to H5private.h. Fixes: HDFFV-9148 Tested on: h5committest --- hl/test/test_dset_opt.c | 2 +- hl/test/test_packet.c | 16 ++--- hl/test/test_table.c | 38 +++++----- src/H5MFaggr.c | 2 +- src/H5detect.c | 24 +++---- src/H5private.h | 42 +++++++++++ src/H5timer.c | 89 +++++++++++------------ src/H5trace.c | 14 ++-- test/cache.c | 7 +- test/cache_api.c | 8 +-- test/cache_common.c | 4 +- test/cross_read.c | 8 +-- test/dsets.c | 86 +++++++++++++---------- test/dt_arith.c | 4 +- test/dtransform.c | 2 +- test/fheap.c | 8 +-- test/fillval.c | 8 +-- test/flush2.c | 14 ++-- test/hyperslab.c | 6 +- test/links.c | 2 +- test/mtime.c | 2 +- test/objcopy.c | 20 +++--- test/set_extent.c | 4 +- test/tarray.c | 10 +-- test/tattr.c | 20 +++--- test/tfile.c | 4 +- test/tgenprop.c | 4 +- test/th5s.c | 6 +- test/tmisc.c | 24 +++---- test/tsohm.c | 4 +- test/tunicode.c | 4 +- test/tvltypes.c | 16 ++--- tools/h5diff/h5diffgentest.c | 160 ++++++++++++++++++++++-------------------- tools/h5dump/h5dumpgentest.c | 74 +++++++++---------- tools/h5import/h5importtest.c | 12 ++-- tools/h5jam/h5jamgentest.c | 4 +- tools/lib/io_timer.c | 2 +- tools/perform/chunk.c | 16 ++--- tools/perform/iopipe.c | 18 ++--- tools/perform/overhead.c | 2 +- tools/perform/sio_perf.c | 20 +++--- tools/perform/zip_perf.c | 8 +-- 42 files changed, 436 insertions(+), 382 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index bddd162..b0800a0 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -41,7 +41,7 @@ #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001F)+12) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index c7a1c27..62e9ae3 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -54,14 +54,14 @@ typedef struct particle_t *------------------------------------------------------------------------- */ static particle_t testPart[NRECORDS] = { - {"zero", 0,0, 0.0f, 0.0}, - {"one", 10,10, 1.0f, 10.0}, - {"two", 20,20, 2.0f, 20.0}, - {"three",30,30, 3.0f, 30.0}, - {"four", 40,40, 4.0f, 40.0}, - {"five", 50,50, 5.0f, 50.0}, - {"six", 60,60, 6.0f, 60.0}, - {"seven",70,70, 7.0f, 70.0} + {"zero", 0,0, 0.0f, 0.0f}, + {"one", 10,10, 1.0f, 10.0f}, + {"two", 20,20, 2.0f, 20.0f}, + {"three",30,30, 3.0f, 30.0f}, + {"four", 40,40, 4.0f, 40.0f}, + {"five", 50,50, 5.0f, 50.0f}, + {"six", 60,60, 6.0f, 60.0f}, + {"seven",70,70, 7.0f, 70.0f} }; /*------------------------------------------------------------------------- diff --git a/hl/test/test_table.c b/hl/test/test_table.c index c312296..8af6d28 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -218,7 +218,7 @@ static int test_table(hid_t fid, int do_write) hsize_t chunk_size=10; int compress=0; int *fill=NULL; - particle_t fill1[1] = { {"no data",-1, -99.0f, -99.0, -1} }; + particle_t fill1[1] = { {"no data",-1, -99.0f, -99.0f, -1} }; int fill1_new[1] = { -100 }; hsize_t position; char tname[20]; @@ -246,18 +246,18 @@ static int test_table(hid_t fid, int do_write) particle2_t rbuf2[NRECORDS]; particle3_t rbuf3[NRECORDS]; particle_t rbufc[NRECORDS*2]; - particle_t abuf[2]={{"eight",80,8.0f,80.0,80},{"nine",90,9.0f,90.0,90}}; - particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0, 0},{"zero", 0, 0.0f, 0.0, 0}}; + particle_t abuf[2]={{"eight",80,8.0f,80.0f,80},{"nine",90,9.0f,90.0f,90}}; + particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0f, 0},{"zero", 0, 0.0f, 0.0f, 0}}; particle_t wbufd[NRECORDS]; particle_t wbuf[NRECORDS] = { - {"zero", 0, 0.0f, 0.0, 0,}, - {"one", 10, 1.0f, 10.0, 10}, - {"two", 20, 2.0f, 20.0, 20}, - {"three",30, 3.0f, 30.0, 30}, - {"four", 40, 4.0f, 40.0, 40}, - {"five", 50, 5.0f, 50.0, 50}, - {"six", 60, 6.0f, 60.0, 60}, - {"seven",70, 7.0f, 70.0, 70} + {"zero", 0, 0.0f, 0.0f, 0,}, + {"one", 10, 1.0f, 10.0f, 10}, + {"two", 20, 2.0f, 20.0f, 20}, + {"three",30, 3.0f, 30.0f, 30}, + {"four", 40, 4.0f, 40.0f, 40}, + {"five", 50, 5.0f, 50.0f, 50}, + {"six", 60, 6.0f, 60.0f, 60}, + {"seven",70, 7.0f, 70.0f, 70} }; /* buffers for the field "Pressure" and "New_field" */ float pressure_in [NRECORDS] = { 0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f }; @@ -390,14 +390,14 @@ static int test_table(hid_t fid, int do_write) /* Define an array of Particles */ particle4_t p_data[NRECORDS] = { - {12112, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12113, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12114, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12115, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12116, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12117, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12118, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12119, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}} + {12112, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12113, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12114, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12115, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12116, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12117, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12118, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12119, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}} }; /*------------------------------------------------------------------------- diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index f015b19..29d21fd 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -46,7 +46,7 @@ /******************/ /* Local Typedefs */ /******************/ -#define EXTEND_THRESHOLD .10 +#define EXTEND_THRESHOLD 0.10F /********************/ diff --git a/src/H5detect.c b/src/H5detect.c index aed7514..b902af4 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -323,7 +323,7 @@ precision (detected_t *d) * steps). This is necessary because padding bits can change arbitrarily \ * and interfere with detection of the various properties below unless we \ * know to ignore them. */ \ - _v1 = 4.0; \ + _v1 = (TYPE)4.0L; \ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ for(_i = 0; _i < (int)sizeof(TYPE); _i++) \ for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask <<= 1) { \ @@ -335,10 +335,10 @@ precision (detected_t *d) } /* end for */ \ \ /* Byte Order */ \ - for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ + for(_i = 0, _v1 = (TYPE)0.0L, _v2 = (TYPE)1.0L; _i < (int)sizeof(TYPE); _i++) { \ _v3 = _v1; \ _v1 += _v2; \ - _v2 /= 256.0; \ + _v2 /= (TYPE)256.0L; \ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ _j = byte_cmp(sizeof(TYPE), _buf3, _buf1, _pad_mask); \ @@ -353,20 +353,20 @@ precision (detected_t *d) INFO.is_vax = TRUE; \ \ /* Implicit mantissa bit */ \ - _v1 = 0.5; \ - _v2 = 1.0; \ + _v1 = (TYPE)0.5L; \ + _v2 = (TYPE)1.0L; \ INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ \ /* Sign bit */ \ - _v1 = 1.0; \ - _v2 = -1.0; \ + _v1 = (TYPE)1.0L; \ + _v2 = (TYPE)-1.0L; \ INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ \ /* Mantissa */ \ INFO.mpos = 0; \ \ - _v1 = 1.0; \ - _v2 = 1.5; \ + _v1 = (TYPE)1.0L; \ + _v2 = (TYPE)1.5L; \ INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \ \ @@ -375,7 +375,7 @@ precision (detected_t *d) \ INFO.esize = INFO.sign - INFO.epos; \ \ - _v1 = 1.0; \ + _v1 = (TYPE)1.0L; \ INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ precision (&(INFO)); \ ALIGNMENT(TYPE, INFO); \ @@ -1381,8 +1381,8 @@ detect_C89_integers(void) static void detect_C89_floats(void) { - DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; - DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; + DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } diff --git a/src/H5private.h b/src/H5private.h index a532c79..1164a2d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -480,6 +480,48 @@ # define H5_DEC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)-1)) #endif +/* Double constant wrapper + * + * Quiets gcc warnings from -Wunsuffixed-float-constants. + * + * This is a really annoying warning since the standard specifies that + * constants of type double do NOT get a suffix so there's no way + * to specify a constant of type double. To quiet gcc, we specify floating + * point constants as type long double and cast to double. + * + * Note that this macro only needs to be used where using a double + * is important. For most code, suffixing constants with F will quiet the + * compiler and not produce erroneous code. + */ +#define H5_DOUBLE(S) ((double) S ## L) + +/* + * Methods to compare the equality of floating-point values: + * + * 1. H5_XXX_ABS_EQUAL - check if the difference is smaller than the + * Epsilon value. The Epsilon values, FLT_EPSILON, DBL_EPSILON, + * and LDBL_EPSILON, are defined by compiler in float.h. + * + * 2. H5_XXX_REL_EQUAL - check if the relative difference is smaller than a + * predefined value M. See if two values are relatively equal. + * It's the developer's responsibility not to pass in the value 0, which + * may cause the equation to fail. + */ +#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf(X-Y) < FLT_EPSILON) +#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs (X-Y) < DBL_EPSILON) +#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl(X-Y) < LDBL_EPSILON) + +#define H5_FLT_REL_EQUAL(X,Y,M) (HDfabsf((Y-X) / X) < M) +#define H5_DBL_REL_EQUAL(X,Y,M) (HDfabs ((Y-X) / X) < M) +#define H5_LDBL_REL_EQUAL(X,Y,M) (HDfabsl((Y-X) / X) < M) + +/* KiB, MiB, GiB, TiB, EiB - Used in profiling and timing code */ +#define H5_KB (1024.0F) +#define H5_MB (1024.0F * 1024.0F) +#define H5_GB (1024.0F * 1024.0F * 1024.0F) +#define H5_TB (1024.0F * 1024.0F * 1024.0F * 1024.0F) +#define H5_EB (1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F) + /* * Data types and functions for timing certain parts of the library. */ diff --git a/src/H5timer.c b/src/H5timer.c index 301d98b..94f2883 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -90,8 +90,6 @@ * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -112,8 +110,6 @@ H5_timer_reset (H5_timer_t *timer) * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -131,18 +127,18 @@ H5_timer_begin (H5_timer_t *timer) #ifdef H5_HAVE_GETRUSAGE HDgetrusage (RUSAGE_SELF, &rusage); timer->utime = (double)rusage.ru_utime.tv_sec + - ((double)rusage.ru_utime.tv_usec / 1e6); + ((double)rusage.ru_utime.tv_usec / 1e6F); timer->stime = (double)rusage.ru_stime.tv_sec + - ((double)rusage.ru_stime.tv_usec / 1e6); + ((double)rusage.ru_stime.tv_usec / 1e6F); #else - timer->utime = 0.0; - timer->stime = 0.0; + timer->utime = 0.0F; + timer->stime = 0.0F; #endif #ifdef H5_HAVE_GETTIMEOFDAY HDgettimeofday (&etime, NULL); - timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec / 1e6); + timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec / 1e6F); #else - timer->etime = 0.0; + timer->etime = 0.0F; #endif } /* end H5_timer_begin() */ @@ -160,8 +156,6 @@ H5_timer_begin (H5_timer_t *timer) * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -170,16 +164,16 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) H5_timer_t now; HDassert(timer); - H5_timer_begin (&now); + H5_timer_begin(&now); - timer->utime = MAX(0.0, now.utime - timer->utime); - timer->stime = MAX(0.0, now.stime - timer->stime); - timer->etime = MAX(0.0, now.etime - timer->etime); + timer->utime = MAX(0.0F, now.utime - timer->utime); + timer->stime = MAX(0.0F, now.stime - timer->stime); + timer->etime = MAX(0.0F, now.etime - timer->etime); if (sum) { - sum->utime += timer->utime; - sum->stime += timer->stime; - sum->etime += timer->etime; + sum->utime += timer->utime; + sum->stime += timer->stime; + sum->etime += timer->etime; } } /* end H5_timer_end() */ @@ -207,8 +201,6 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) * Programmer: Robb Matzke * Wednesday, August 5, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -216,35 +208,34 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) { double bw; - if(nseconds <= 0.0) - HDstrcpy(buf, " NaN"); + if(nseconds <= 0.0F) + HDstrcpy(buf, " NaN"); else { - bw = nbytes/nseconds; - if(HDfabs(bw) < 0.0000000001) - /* That is == 0.0, but direct comparison between floats is bad */ - HDstrcpy(buf, "0.000 B/s"); - else if(bw < 1.0) - sprintf(buf, "%10.4e", bw); - else if(bw < 1024.0) { - sprintf(buf, "%05.4f", bw); - HDstrcpy(buf+5, " B/s"); - } else if(bw < (1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / 1024.0); - HDstrcpy(buf+5, " kB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0)); - HDstrcpy(buf+5, " MB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0 * 1024.0)); - HDstrcpy(buf+5, " GB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0 * 1024.0 * 1024.0)); - HDstrcpy(buf+5, " TB/s"); - } else { - sprintf(buf, "%10.4e", bw); - if(HDstrlen(buf) > 10) - sprintf(buf, "%10.3e", bw); - } + bw = nbytes/nseconds; + if(H5_DBL_ABS_EQUAL(bw, 0.0F)) + HDstrcpy(buf, "0.000 B/s"); + else if(bw < 1.0F) + sprintf(buf, "%10.4e", bw); + else if(bw < H5_KB) { + sprintf(buf, "%05.4f", bw); + HDstrcpy(buf+5, " B/s"); + } else if(bw < H5_MB) { + sprintf(buf, "%05.4f", bw / H5_KB); + HDstrcpy(buf+5, " kB/s"); + } else if(bw < H5_GB) { + sprintf(buf, "%05.4f", bw / H5_MB); + HDstrcpy(buf+5, " MB/s"); + } else if(bw < H5_TB) { + sprintf(buf, "%05.4f", bw / H5_GB); + HDstrcpy(buf+5, " GB/s"); + } else if(bw < H5_EB) { + sprintf(buf, "%05.4f", bw / H5_TB); + HDstrcpy(buf+5, " TB/s"); + } else { + sprintf(buf, "%10.4e", bw); + if(HDstrlen(buf) > 10) + sprintf(buf, "%10.3e", bw); + } } } /* end H5_bandwidth() */ diff --git a/src/H5trace.c b/src/H5trace.c index 3a84489..6634a2a 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -110,7 +110,7 @@ * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. * - * Return: void + * Return: Execution time for an API call * * Programmer: Robb Matzke * Tuesday, June 16, 1998 @@ -129,34 +129,34 @@ H5_trace(const double *returning, const char *func, const char *type, ...) void *vp = NULL; FILE *out = H5_debug_g.trace; H5_timer_t event_time; - static H5_timer_t first_time = {0.0, 0.0, 0.0}; + static H5_timer_t first_time = {0.0F, 0.0F, 0.0F}; static int current_depth = 0; static int last_call_depth = 0; /* FUNC_ENTER() should not be called */ if(!out) - return 0.0; /*tracing is off*/ + return 0.0F; /*tracing is off*/ va_start(ap, type); if(H5_debug_g.ttop) { if(returning) { if(current_depth > 1) { --current_depth; - return 0.0; + return 0.0F; } /* end if */ } /* end if */ else { if(current_depth > 0) { /*do not update last_call_depth*/ current_depth++; - return 0.0; + return 0.0F; } /* end if */ } /* end else */ } /* end if */ - /* Get tim for event */ - if(HDfabs(first_time.etime) < 0.0000000001) + /* Get time for event */ + if(HDfabs(first_time.etime) < 0.0000000001F) /* That is == 0.0, but direct comparison between floats is bad */ H5_timer_begin(&first_time); if(H5_debug_g.ttimes) diff --git a/test/cache.c b/test/cache.c index 5ad1314..8725b31 100644 --- a/test/cache.c +++ b/test/cache.c @@ -20340,7 +20340,10 @@ check_auto_cache_resize(void) auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + /* NOTE: upper_hr_threshold MUST be type double (not float) + * or the cache test will fail on 64-bit systems. + */ + auto_size_ctl.upper_hr_threshold = H5_DOUBLE(0.999); /* for ease of testing */ auto_size_ctl.decrement = 0.5f; @@ -28353,7 +28356,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5F, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = diff --git a/test/cache_api.c b/test/cache_api.c index b1ccef1..8f556be 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -2173,7 +2173,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 0.999999999999, + /* double increment = */ H5_DOUBLE(0.999999999999), /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ @@ -2532,7 +2532,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 1.0000000001, + /* double decrement = */ H5_DOUBLE(1.0000000001), /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), /* int epochs_before_eviction = */ 3, @@ -2712,7 +2712,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* size_t max_decrement = */ (1 * 1024 * 1024), /* int epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 1.00000000001, + /* double empty_reserve = */ H5_DOUBLE(1.00000000001), /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY @@ -2776,7 +2776,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* double flash_multiple = */ 2.0f, /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 1.00000001, + /* double upper_hr_threshold = */ H5_DOUBLE(1.00000001), /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), diff --git a/test/cache_common.c b/test/cache_common.c index 7b26714..0231a11 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -5161,7 +5161,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, } else { - expected_hit_rate = 0.0; + expected_hit_rate = 0.0F; } result = H5Fget_mdc_hit_rate(file_id, &hit_rate); @@ -5171,7 +5171,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() failed."; - } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001) ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001F) ) { pass = FALSE; failure_mssg = "unexpected hit rate."; diff --git a/test/cross_read.c b/test/cross_read.c index 2d95d15..35dd2ce 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -100,15 +100,15 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) { data_in[j][i] = ((double)(i + j + 1))/3; - data_out[j][i] = 0; + data_out[j][i] = 0.0F; int_data_in[j][i] = i + j; int_data_out[j][i] = 0; } } for (i = 0; i < NY; i++) { - data_in[NX][i] = -2.2; - data_out[NX][i] = 0; + data_in[NX][i] = -2.2F; + data_out[NX][i] = 0.0F; int_data_in[NX][i] = -2; int_data_out[NX][i] = 0; @@ -126,7 +126,7 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) /* Check results */ for (j=0; j<(NX+1); j++) { for (i=0; i HDpow(10.0, -3.0)) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4539,7 +4551,7 @@ test_scaleoffset_float_2(hid_t file) if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ - fillval = 10000.0; + fillval = 10000.0F; if(H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, @@ -4567,7 +4579,7 @@ test_scaleoffset_float_2(hid_t file) /* Initialize data of hyperslab */ for(j = 0; j < (size_t)size[1]; j++) { - orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0); + orig_data[0][j] = (float)((HDrandom() % 100000) / 1000.0F); /* even-numbered values are negtive */ if((j+1)%2 == 0) @@ -4600,7 +4612,7 @@ test_scaleoffset_float_2(hid_t file) /* Check that the values read are the same as the values written */ for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -4678,7 +4690,7 @@ test_scaleoffset_double(hid_t file) /* Initialize data */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) { - orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0; + orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0F; /* even-numbered values are negtive */ if((i*size[1]+j+1)%2 == 0) @@ -4711,7 +4723,7 @@ test_scaleoffset_double(hid_t file) /* Check that the values read are the same as the values written */ for(i=0; i<(size_t)size[0]; i++) { for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4781,7 +4793,7 @@ test_scaleoffset_double_2(hid_t file) if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ - fillval = 10000.0; + fillval = 10000.0F; if(H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, @@ -4809,7 +4821,7 @@ test_scaleoffset_double_2(hid_t file) /* Initialize data of hyperslab */ for(j = 0; j < (size_t)size[1]; j++) { - orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0; + orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0F; /* even-numbered values are negtive */ if((j+1)%2 == 0) @@ -4842,7 +4854,7 @@ test_scaleoffset_double_2(hid_t file) /* Check that the values read are the same as the values written */ for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -5609,11 +5621,11 @@ test_set_local(hid_t fapl) h5_fixname(FILENAME[5], fapl, filename, sizeof filename); /* Initialize the integer & floating-point dataset */ - n=1.0; + n=1.0F; 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.5*n++; + points_dbl[i][j] = (double)1.5F*n++; } /* Open file */ @@ -5807,7 +5819,7 @@ test_set_local(hid_t fapl) for(j=0; j 0.0001) { - H5_FAILED(); - printf(" dset[%lu][%lu] = %g\n", - (unsigned long)i, (unsigned long)j, the_data[i][j]); - printf(" should be %g\n", - (double)(hssize_t)i/(hssize_t)(j+1)); - goto error; + if(error > 0.0001F) { + H5_FAILED(); + printf(" dset[%lu][%lu] = %g\n", + (unsigned long)i, (unsigned long)j, the_data[i][j]); + printf(" should be %g\n", + (double)(hssize_t)i/(hssize_t)(j+1)); + goto error; } } if(H5Dclose(dset) < 0) goto error; diff --git a/test/hyperslab.c b/test/hyperslab.c index 5e2c109..9bc085c 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -609,10 +609,10 @@ test_multifill(size_t nx) for(i = 0; i < nx; i++) { src[i].left = 1111111; - src[i].mid = 12345.6789; + src[i].mid = 12345.6789F; src[i].right = 2222222; dst[i].left = 3333333; - dst[i].mid = 98765.4321; + dst[i].mid = 98765.4321F; dst[i].right = 4444444; } /* end for */ @@ -621,7 +621,7 @@ test_multifill(size_t nx) * over and over again. */ fill.left = 55555555; - fill.mid = 3.1415927; + fill.mid = 3.1415927F; fill.right = 66666666; src_stride = 0; diff --git a/test/links.c b/test/links.c index 6119bb3..891b5e4 100644 --- a/test/links.c +++ b/test/links.c @@ -141,7 +141,7 @@ const char *FILENAME[] = { #define H5L_DIM1 100 #define H5L_DIM2 100 -#define FILTER_FILESIZE_MAX_FRACTION .9 +#define FILTER_FILESIZE_MAX_FRACTION 0.9F /* Creation order macros */ #define CORDER_GROUP_NAME "corder_group" diff --git a/test/mtime.c b/test/mtime.c index 6e00fe0..0c0c923 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -114,7 +114,7 @@ main(void) puts(" Modification times will be mantained in the file but"); puts(" cannot be queried on this system. See H5O_mtime_decode()."); return 0; - } else if(HDfabs(HDdifftime(now, oi1.ctime)) > 60.0) { + } else if(HDfabs(HDdifftime(now, oi1.ctime)) > 60.0F) { 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 0a1d7a0..71a7236 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2315,7 +2315,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t #endif /* H5_CLEAR_MEMORY */ for(i = 0; i < DIM_SIZE_1; i++) { buf[i].a = i; - buf[i].d = 1. / (i + 1); + buf[i].d = 1.0F / (i + 1); } /* end for */ /* Initialize the filenames */ @@ -2447,9 +2447,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* set initial data values */ for(i = 0; i < DIM_SIZE_1; i++) { - buf1d[i] = (float)(i / 2.0); + buf1d[i] = (float)(i / 2.0F); for(j = 0; j < DIM_SIZE_2; j++) - buf2d[i][j] = (float)(i + (j / 100.0)); + buf2d[i][j] = (float)(i + (j / 100.0F)); } /* end for */ /* Initialize the filenames */ @@ -2790,9 +2790,9 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* set initial data values */ for(i = 0; i < DIM_SIZE_1; i++) { - buf1d[i] = (float)(i / 10.0); + buf1d[i] = (float)(i / 10.0F); for(j = 0; j < DIM_SIZE_2; j++) - buf2d[i][j] = (float)(i + (j / 100.0)); + buf2d[i][j] = (float)(i + (j / 100.0F)); } /* end for */ /* Initialize the filenames */ @@ -2985,7 +2985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* set initial data values */ for (i=0; i 0.0) { + if(diff > 0.0F) { /* Output message about test being performed */ MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time (We know OpenVMS behaves in this way).\n")); } /* end if */ @@ -2395,7 +2395,7 @@ test_rw_noupdate(void) /* Ensure That Timestamps Are Equal */ diff = HDdifftime(sb2.st_mtime, sb1.st_mtime); - ret = (diff > 0.0); + ret = (diff > 0.0F); VERIFY(ret, 0, "Timestamp"); } /* end else */ } /* end test_rw_noupdate() */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 004e346..d147099 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -47,7 +47,7 @@ int prop1_def=10; /* Property 1 default value */ #define PROP1_DEF_VALUE (&prop1_def) #define PROP2_NAME "Property 2" -float prop2_def=(float)3.14; /* Property 2 default value */ +float prop2_def=3.14F; /* Property 2 default value */ #define PROP2_SIZE sizeof(prop2_def) #define PROP2_DEF_VALUE (&prop2_def) @@ -57,7 +57,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.41; /* Property 4 default value */ +double prop4_def=1.41F; /* 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 d3a651c..94268a7 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -79,7 +79,7 @@ struct space4_struct { unsigned u; float f; char c2; - } space4_data={'v',987123,(float)-3.14,'g'}; /* Test data for 4th dataspace */ + } space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */ /**************************************************************** ** @@ -1647,7 +1647,7 @@ test_h5s_chunk(void) /* Initialize float array */ for(i = 0; i < 50000; i++) for(j = 0; j < 3; j++) - chunk_data_flt[i][j] = (float)((i + 1) * 2.5 - j * 100.3); + chunk_data_flt[i][j] = (float)((i + 1) * 2.5F - j * 100.3F); status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt); CHECK(status, FAIL, "H5Dwrite"); @@ -1683,7 +1683,7 @@ test_h5s_chunk(void) for(i=0; i<50000; i++) { for(j=0; j<3; j++) { /* Check if the two values are within 0.001% range. */ - if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001)) + if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F)) 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, chunk_data_flt[i][j]); } /* end for */ } /* end for */ diff --git a/test/tmisc.c b/test/tmisc.c index cac6b04..cffb3df 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2427,17 +2427,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.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 */ + 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 */ /* Test creating two datasets and deleting the second */ @@ -4949,7 +4949,7 @@ test_misc28(void) * bytes). */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75); + ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75F); CHECK(ret, FAIL, "H5Pset_cache"); /* Create the dcpl and set the chunk size */ diff --git a/test/tsohm.c b/test/tsohm.c index 8ebfd52..9da655e 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -57,7 +57,7 @@ const unsigned test_minsizes[H5O_SHMESG_MAX_NINDEXES] = {0, 2, 40, 100, 3, 1000} #define NAME_BUF_SIZE 512 /* How much overhead counts as "not much" when converting B-trees, etc. */ -#define OVERHEAD_ALLOWED 1.15 +#define OVERHEAD_ALLOWED 1.15F #define NUM_DATASETS 10 #define NUM_ATTRIBUTES 100 @@ -600,7 +600,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos wdata.i6 = 66; wdata.i7 = 77; wdata.i8 = 88; - wdata.f1 = 0.0; + wdata.f1 = 0.0F; /* Intialize rdata */ HDmemset(&rdata, 0, sizeof(rdata)); diff --git a/test/tunicode.c b/test/tunicode.c index 7dc3391..82dc429 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -39,8 +39,8 @@ #define RANK 1 #define COMP_INT_VAL 7 -#define COMP_FLOAT_VAL -42.0 -#define COMP_DOUBLE_VAL 42.0 +#define COMP_FLOAT_VAL -42.0F +#define COMP_DOUBLE_VAL 42.0F /* Test function prototypes */ void test_fl_string(hid_t fid, const char *string); diff --git a/test/tvltypes.c b/test/tvltypes.c index 516974e..2928e57 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -731,7 +731,7 @@ test_vltypes_vlen_compound(void) wdata[i].len=i+1; for(j=0; j<(i+1); j++) { ((s1 *)wdata[i].p)[j].i=i*10+j; - ((s1 *)wdata[i].p)[j].f=(float)((i*20+j)/3.0); + ((s1 *)wdata[i].p)[j].f=(float)((i*20+j)/3.0F); } /* end for */ } /* end for */ @@ -877,7 +877,7 @@ rewrite_vltypes_vlen_compound(void) wdata[i].len = i + increment; for(j = 0; j < (i + increment); j++) { ((s1 *)wdata[i].p)[j].i = i * 40 + j; - ((s1 *)wdata[i].p)[j].f = (float)((i * 60 + j) / 3.0); + ((s1 *)wdata[i].p)[j].f = (float)((i * 60 + j) / 3.0F); } /* end for */ } /* end for */ @@ -1018,7 +1018,7 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ for(i=0; iru_utime.tv_sec)+ - (double)(r_stop->ru_utime.tv_usec)/1000000.0) - + (double)(r_stop->ru_utime.tv_usec)/1000000.0F) - ((double)(r_start->ru_utime.tv_sec)+ - (double)(r_start->ru_utime.tv_usec)/1000000.0); + (double)(r_start->ru_utime.tv_usec)/1000000.0F); s_time = ((double)(r_stop->ru_stime.tv_sec)+ - (double)(r_stop->ru_stime.tv_usec)/1000000.0) - + (double)(r_stop->ru_stime.tv_usec)/1000000.0F) - ((double)(r_start->ru_stime.tv_sec)+ - (double)(r_start->ru_stime.tv_usec)/1000000.0); + (double)(r_start->ru_stime.tv_usec)/1000000.0F); #endif #ifndef H5_HAVE_SYS_TIMEB e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000000.0) - + (double)(t_stop->tv_usec)/1000000.0F) - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000000.0); + (double)(t_start->tv_usec)/1000000.0F); #else e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000.0) - + (double)(t_stop->tv_usec)/1000.0F) - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000.0); + (double)(t_start->tv_usec)/1000.0F); #endif bw = (double)nbytes / e_time; @@ -191,7 +191,7 @@ main (void) * 1998-11-06 ptl */ printf ("I/O request size is %1.1fMB\n", - (double)(hssize_t)(size[0]*size[1])/1024.0*1024); + (double)(hssize_t)(size[0]*size[1])/1024.0F*1024); /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index 9341e64..046668f 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -209,7 +209,7 @@ test(fill_t fill_style, const double splits[], if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; if(!use_rdcc) { if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error; - if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error; + if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0F) < 0) goto error; } if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c index 1828d6f..7d75a2d 100644 --- a/tools/perform/sio_perf.c +++ b/tools/perform/sio_perf.c @@ -68,7 +68,7 @@ #define SIO_HDF5 0x4 /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) (((t)==0.0F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -451,14 +451,14 @@ run_test(iotype iot, parameters parms, struct options *opts) minmax *read_mm_table=NULL; minmax *read_gross_mm_table=NULL; minmax *read_raw_mm_table=NULL; - minmax write_sys_mm = {0.0, 0.0, 0.0, 0}; - minmax write_mm = {0.0, 0.0, 0.0, 0}; - minmax write_gross_mm = {0.0, 0.0, 0.0, 0}; - minmax write_raw_mm = {0.0, 0.0, 0.0, 0}; - minmax read_sys_mm = {0.0, 0.0, 0.0, 0}; - minmax read_mm = {0.0, 0.0, 0.0, 0}; - minmax read_gross_mm = {0.0, 0.0, 0.0, 0}; - minmax read_raw_mm = {0.0, 0.0, 0.0, 0}; + minmax write_sys_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_gross_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_raw_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_sys_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_gross_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_raw_mm = {0.0F, 0.0F, 0.0F, 0}; raw_size = (off_t)parms.num_bytes; parms.io_type = iot; @@ -717,7 +717,7 @@ accumulate_minmax_stuff(minmax *mm, int count) int i; minmax total_mm; - total_mm.sum = 0.0; + total_mm.sum = 0.0F; total_mm.max = -DBL_MAX; total_mm.min = DBL_MAX; total_mm.num = count; diff --git a/tools/perform/zip_perf.c b/tools/perform/zip_perf.c index edd5b0f..f73ba40 100644 --- a/tools/perform/zip_perf.c +++ b/tools/perform/zip_perf.c @@ -43,10 +43,10 @@ #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) -#define MICROSECOND 1000000.0 +#define MICROSECOND 1000000.0F /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -182,7 +182,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 * 0.1)) + 12; + destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1F)) + 12; dest = (Bytef *)HDmalloc(destLen); if (!dest) @@ -464,7 +464,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, error("out of memory"); } - compression_time = 0.0; + compression_time = 0.0F; if (random_test) fill_with_random_data(src, src_len); -- cgit v0.12