From ab19d0636a2d490c34a3b40a39f14286b9557127 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 9 Mar 2015 06:27:46 -0500 Subject: [svn-r26398] Merges r26333 from trunk 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. - Additionally, some 1.8-specific float suffixes were added. Fixes: HDFFV-9148 Tested on: h5committest --- configure | 2 +- hl/src/H5LTparse.c | 144 ++++++++++++++++++------------------- hl/src/H5LTparse.h | 4 +- hl/test/test_dset_opt.c | 2 +- hl/test/test_packet.c | 16 ++--- hl/test/test_table.c | 38 +++++----- src/H5ACprivate.h | 30 ++++---- src/H5MFaggr.c | 2 +- src/H5Pdxpl.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 | 39 +++++----- 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 | 64 ++++++++--------- 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 +-- 47 files changed, 535 insertions(+), 480 deletions(-) diff --git a/configure b/configure index ed461c9..ef35f67 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Id: configure.ac 26393 2015-03-09 02:11:17Z derobins . +# From configure.ac Id: configure.ac 26395 2015-03-09 04:24:02Z derobins . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for HDF5 1.8.15-snap12. # diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 6ca95c54..36591d3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 621dacd..1461830 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 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 9d3074d..a53b96d 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 4eb5819..4aac9de 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -227,7 +227,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]; @@ -255,18 +255,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 }; @@ -399,14 +399,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/H5ACprivate.h b/src/H5ACprivate.h index aeae56d..8fa6396 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -219,22 +219,22 @@ extern hid_t H5AC_ind_dxpl_id; /* size_t min_size = */ (1 * 1024 * 1024), \ /* long int epoch_length = */ 50000, \ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \ - /* double lower_hr_threshold = */ 0.9, \ - /* double increment = */ 2.0, \ + /* double lower_hr_threshold = */ 0.9F, \ + /* double increment = */ 2.0F, \ /* 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__add_space, \ - /* double flash_multiple = */ 1.0, \ - /* double flash_threshold = */ 0.25, \ + /* double flash_multiple = */ 1.0F, \ + /* double flash_threshold = */ 0.25F, \ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, \ - /* double upper_hr_threshold = */ 0.999, \ - /* double decrement = */ 0.9, \ + /* double upper_hr_threshold = */ H5_DOUBLE(0.999), \ + /* double decrement = */ 0.9F, \ /* 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.1, \ + /* double empty_reserve = */ 0.1F, \ /* int dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ @@ -250,27 +250,27 @@ extern hid_t H5AC_ind_dxpl_id; /* hbool_t evictions_enabled = */ TRUE, \ /* hbool_t set_initial_size = */ TRUE, \ /* size_t initial_size = */ ( 2 * 1024 * 1024), \ - /* double min_clean_fraction = */ 0.01, \ + /* double min_clean_fraction = */ 0.01F, \ /* size_t max_size = */ (32 * 1024 * 1024), \ /* size_t min_size = */ ( 1 * 1024 * 1024), \ /* long int epoch_length = */ 50000, \ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \ - /* double lower_hr_threshold = */ 0.9, \ - /* double increment = */ 2.0, \ + /* double lower_hr_threshold = */ 0.9F, \ + /* double increment = */ 2.0F, \ /* 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__add_space, \ - /* double flash_multiple = */ 1.4, \ - /* double flash_threshold = */ 0.25, \ + /* double flash_multiple = */ 1.4F, \ + /* double flash_threshold = */ 0.25F, \ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\ - /* double upper_hr_threshold = */ 0.999, \ - /* double decrement = */ 0.9, \ + /* double upper_hr_threshold = */ H5_DOUBLE(0.999), \ + /* double decrement = */ 0.9F, \ /* 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.1, \ + /* double empty_reserve = */ 0.1F, \ /* int dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 6a799da..c971355 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/H5Pdxpl.c b/src/H5Pdxpl.c index 7688ecf..4372417 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -62,7 +62,7 @@ * group's B-trees as well as chunked dataset's B-trees - QAK) */ #define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3]) -#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9} +#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1F, 0.5F, 0.9F} /* Definitions for vlen allocation function property */ #define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t) #define H5D_XFER_VLEN_ALLOC_DEF H5D_VLEN_ALLOC diff --git a/src/H5detect.c b/src/H5detect.c index bec261b..fc0570c 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); \ @@ -1382,8 +1382,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 2808860..2a3c79e 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -475,6 +475,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 5e90ff6..2ee6367 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 27c61e7..26ef80f 100644 --- a/test/cache.c +++ b/test/cache.c @@ -20324,7 +20324,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; @@ -28337,7 +28340,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 f41e6af..4077d29 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -4609,7 +4609,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); @@ -4619,7 +4619,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); @@ -4552,7 +4564,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, @@ -4580,7 +4592,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) @@ -4613,7 +4625,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); @@ -4691,7 +4703,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) @@ -4724,7 +4736,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); @@ -4794,7 +4806,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, @@ -4822,7 +4834,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) @@ -4855,7 +4867,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); @@ -5622,11 +5634,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 */ @@ -5820,7 +5832,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(H5Dclose(dset) < 0) goto error; + for(j = 0; j < (size_t)ds_size[1]; j++) { + /* + * The extra cast in the following statement is a bug workaround + * for the Win32 version 5.0 compiler. + * 1998-11-06 ptl + */ + error = fabs(the_data[i][j] - (double)(hssize_t)i / ((hssize_t)j + 1)); + 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; + } /* end if */ + } /* end for */ + if(H5Dclose(dset) < 0) + goto error; return 0; 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 d45a233..f40ead0 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 8b1bf3e..f6296fc 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 af0a835..d95a05e 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 */ @@ -2366,7 +2366,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 8e18fad..6668421 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 */ /**************************************************************** ** @@ -1652,7 +1652,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"); @@ -1688,7 +1688,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 fcb5eac..e4322a2 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2447,17 +2447,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 */ @@ -4993,7 +4993,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 a0f3eec..11fb8ab 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 856c2cb..2804fe6 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