From 7659506fa895d00ddaeba68603689e51ca263fb3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 11 Mar 2015 17:51:14 -0500 Subject: [svn-r26438] Fixed some double promotion warnings from gcc 4.9.2. Most were in format strings. Tested on: h5committest --- src/H5system.c | 2 +- test/cmpd_dset.c | 16 ++++++++-------- test/dt_arith.c | 18 +++++++++--------- test/fillval.c | 16 ++++++++-------- test/tarray.c | 18 +++++++++--------- test/tattr.c | 6 +++--- test/tgenprop.c | 6 +++--- test/th5s.c | 4 ++-- test/tvltypes.c | 2 +- tools/h5dump/h5dump_xml.c | 2 +- tools/lib/h5tools_str.c | 2 +- 11 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index 437a004..56db380 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -313,7 +313,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) case 'G': if(!HDstrcmp(modifier, "h")) { float x = (float)va_arg(ap, double); - n = fprintf(stream, format_templ, x); + n = fprintf(stream, format_templ, (double)x); } else if(!*modifier || !HDstrcmp(modifier, "l")) { double x = va_arg(ap, double); n = fprintf(stream, format_templ, x); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index a782fb0..d81b7fc 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -1301,17 +1301,17 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset) printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7], - s_ptr->d, s_ptr->e, s_ptr->f, s_ptr->g,s_ptr->h[0],s_ptr->h[1],s_ptr->h[2], - s_ptr->h[3],s_ptr->h[4],s_ptr->h[5],s_ptr->h[6],s_ptr->h[7],s_ptr->h[8], - s_ptr->h[9],s_ptr->h[10],s_ptr->h[11],s_ptr->h[12],s_ptr->h[13],s_ptr->h[14], - s_ptr->h[15], s_ptr->i,s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n); + s_ptr->d, s_ptr->e, (double)s_ptr->f, (double)s_ptr->g,(double)s_ptr->h[0],(double)s_ptr->h[1],(double)s_ptr->h[2], + (double)s_ptr->h[3],(double)s_ptr->h[4],(double)s_ptr->h[5],(double)s_ptr->h[6],(double)s_ptr->h[7],(double)s_ptr->h[8], + (double)s_ptr->h[9],(double)s_ptr->h[10],(double)s_ptr->h[11],(double)s_ptr->h[12],(double)s_ptr->h[13],(double)s_ptr->h[14], + (double)s_ptr->h[15], (double)s_ptr->i,(double)s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n); printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7], - d_ptr->d, d_ptr->e, d_ptr->f, d_ptr->g,d_ptr->h[0],d_ptr->h[1],d_ptr->h[2], - d_ptr->h[3],d_ptr->h[4],d_ptr->h[5],d_ptr->h[6],d_ptr->h[7],d_ptr->h[8], - d_ptr->h[9],d_ptr->h[10],d_ptr->h[11],d_ptr->h[12],d_ptr->h[13], - d_ptr->h[14], d_ptr->h[15], d_ptr->i,d_ptr->j,d_ptr->k,d_ptr->l, + d_ptr->d, d_ptr->e, (double)d_ptr->f, (double)d_ptr->g,(double)d_ptr->h[0],(double)d_ptr->h[1],(double)d_ptr->h[2], + (double)d_ptr->h[3],(double)d_ptr->h[4],(double)d_ptr->h[5],(double)d_ptr->h[6],(double)d_ptr->h[7],(double)d_ptr->h[8], + (double)d_ptr->h[9],(double)d_ptr->h[10],(double)d_ptr->h[11],(double)d_ptr->h[12],(double)d_ptr->h[13], + (double)d_ptr->h[14],(double)d_ptr->h[15],(double)d_ptr->i,(double)d_ptr->j,d_ptr->k,d_ptr->l, d_ptr->m,d_ptr->n); goto error; } diff --git a/test/dt_arith.c b/test/dt_arith.c index 17f8e55..1e183aa 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -538,7 +538,7 @@ some_dummy_func(float x) { char s[128]; - HDsnprintf(s, sizeof(s), "%g", x); + HDsnprintf(s, sizeof(s), "%g", (double)x); } @@ -832,7 +832,7 @@ static int test_particular_fp_integer(void) printf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); HDmemcpy(&x, saved_buf2, src_size2); - printf(" %29.20e\n", x); + printf(" %29.20e\n", (double)x); printf(" dst = "); for (j=0; jline_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 3160cfa..f4302a9 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -740,7 +740,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai float tempfloat; HDmemcpy(&tempfloat, vp, sizeof(float)); - h5tools_str_append(str, OPT(info->fmt_float, "%g"), tempfloat); + h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat); } else if (sizeof(double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ -- cgit v0.12