diff options
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 474 |
1 files changed, 232 insertions, 242 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 46386a0..1cdf6cf 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -448,7 +448,7 @@ gent_dataset(void) for(i = 0; i < 30; i++) for(j = 0; j < 20; j++) - dset2[i][j] = 0.0001F * j + i; + dset2[i][j] = 0.0001F * (float)j + (float)i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -543,7 +543,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT); - for(i = 0; i < 10; i++) d[i] = 0.1F * i; + for(i = 0; i < 10; i++) d[i] = 0.1F * (float)i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space); @@ -971,16 +971,16 @@ static void gent_compound_dt(void) { /* test compound data type */ for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); - dset1[i].c = (float)(1.0F/(i+1)); + dset1[i].c = (float)(1.0F/(float)(i+1)); dset2[i].a = i; - dset2[i].b = (float)(i+ i*0.1F); + dset2[i].b = (float)((float)i+ (float)i*0.1F); dset4[i].a = i; dset4[i].b = (float)(i+3); dset5[i].a = i; - dset5[i].b = (float)(i*0.1F); + dset5[i].b = (float)((float)i*0.1F); } @@ -1156,16 +1156,16 @@ static void gent_compound_dt2(void) { /* test compound data type */ for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); - dset1[i].c = (float)(1.0F/(i+1)); + dset1[i].c = (float)(1.0F / (float)(i+ 1)); dset2[i].a = i; - dset2[i].b = (float)(i+ i*0.1F); + dset2[i].b = (float)((float)i + (float)i * 0.1F); dset4[i].a = i; - dset4[i].b = (float)(i*1.0F); + dset4[i].b = (float)((float)i * 1.0F); dset5[i].a = i; - dset5[i].b = (float)(i*1.0F); + dset5[i].b = (float)((float)i * 1.0F); } fid = H5Fcreate(FILE9, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1405,7 +1405,7 @@ static void gent_all(void) space = H5Screate_simple(1, dims, NULL); dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - dset2_1[i] = (float)(i * 0.1F + 1); + dset2_1[i] = (float)((float)i * 0.1F + 1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); @@ -1416,7 +1416,7 @@ static void gent_all(void) dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 3; i++) for(j = 0; j < 5; j++) - dset2_2[i][j] = (float)((i + 1) * j * 0.1F); + dset2_2[i][j] = (float)((float)(i + 1) * (float)j * 0.1F); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); H5Sclose(space); H5Dclose(dataset); @@ -1584,7 +1584,7 @@ gent_many(void) space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - d[i] = 0.1F * i; + d[i] = 0.1F * (float)i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space2); H5Aclose(attr); @@ -1594,9 +1594,9 @@ gent_many(void) for(i2 = 0; i2 < 2; i2++) { for(i1 = 0; i1 < 2; i1++) { for(i0 = 0; i0 < 2; i0++) { - dset1[j].a[i3][i2][i1][i0] = i0+j; - dset1[j].b[i3][i2][i1][i0] = (double)(i0+j); - dset1[j].c[i3][i2][i1][i0] = (double)(i0+j+sdim); + dset1[j].a[i3][i2][i1][i0] = i0 + j; + dset1[j].b[i3][i2][i1][i0] = (double)(i0 + j); + dset1[j].c[i3][i2][i1][i0] = (double)((hsize_t)i0 + (hsize_t)j + sdim); } } } @@ -1899,7 +1899,7 @@ static void gent_str2(void) block[0]=1; for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1912,7 +1912,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1932,7 +1932,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0;(hsize_t) i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1946,7 +1946,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1965,7 +1965,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1979,7 +1979,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -2065,7 +2065,7 @@ static void gent_objref(void) dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu32 = (uint32_t *)((void*)wbuf), i = 0; i < SPACE1_DIM1; i++) - *tu32++ = i * 3; + *tu32++ = (uint32_t)(i * 3); /* Write selection to disk */ H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); @@ -2170,7 +2170,7 @@ static void gent_datareg(void) dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) - *tu8++=i*3; + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -2279,7 +2279,7 @@ static void gent_attrreg(void) dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) - *tu8++=i*3; + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -2397,8 +2397,8 @@ static void gent_nestcomp(void) for(i = 0; i< 10; i++) { s1[i].a = i; s1[i].b = (float)(i*i); - s1[i].c = 1.0F/(i+1); - s1[i].d.a = 65 + i; + s1[i].c = 1.0F/(float)(i + 1); + s1[i].d.a = (char)(65 + i); s1[i].d.b[0] = -100.0F; s1[i].d.b[1] = 100.0F; } @@ -2469,8 +2469,8 @@ static void gent_opaque(void) hsize_t dim = 2; for(x = 0; x < 100; x++){ - test[x][0] = x; - test[x][1] = 99 - x; + test[x][0] = (char)x; + test[x][1] = (char)(99 - x); } /* @@ -2570,8 +2570,8 @@ static void gent_vldatatypes(void) for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((i + 1) * sizeof(int)); - wdata[i].len = i + 1; + wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + wdata[i].len = (size_t)(i + 1); for(j = 0; j < i + 1; j++) ((int *)wdata[i].p)[j] = i * 10 + j; @@ -2597,12 +2597,12 @@ static void gent_vldatatypes(void) for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((i + 1) * sizeof(float)); - wdata[i].len = i + 1; + wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(float)); + wdata[i].len = (size_t)(i + 1); for(j = 0; j < i + 1; j++) - ((float *)wdata[i].p)[j] = (float)(i * 10 + ((float)j) / 10.0F); - } + ((float *)wdata[i].p)[j] = (float)((float)(i * 10) + ((float)j) / 10.0F); + } /* end for */ /* write out the floats in little-endian format */ space = H5Screate_simple(SPACE1_RANK, dims, NULL); @@ -2719,9 +2719,9 @@ gent_vldatatypes2(void) static void gent_vldatatypes3(void) { typedef struct { /* Struct that the VL sequences are composed of */ - int i; - float f; - hvl_t v; + int i; + float f; + hvl_t v; } s1; s1 wdata[SPACE1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -2734,12 +2734,12 @@ static void gent_vldatatypes3(void) /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { - wdata[i].i=i*10; - wdata[i].f=(float)((i*20)/3.0F); - wdata[i].v.p=HDmalloc((i+1)*sizeof(unsigned int)); - wdata[i].v.len=i+1; - for(j=0; j<(i+1); j++) - ((unsigned int *)wdata[i].v.p)[j]=i*10+j; + wdata[i].i = (int)(i * 10); + wdata[i].f = (float)((float)(i * 20)/3.0F); + wdata[i].v.p = HDmalloc((size_t)(i + 1) * sizeof(unsigned int)); + wdata[i].v.len = (size_t)(i + 1); + for(j = 0; j < (i + 1); j++) + ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; } /* end for */ /* Create file */ @@ -2789,8 +2789,8 @@ static void gent_vldatatypes3(void) static void gent_vldatatypes4(void) { typedef struct { /* Struct that the VL sequences are composed of */ - int i; - float f; + int i; + float f; } s1; hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -2803,11 +2803,11 @@ static void gent_vldatatypes4(void) /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { - wdata[i].p=HDmalloc((i+1)*sizeof(s1)); - 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.0F); + wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].len = i + 1; + for(j = 0; j < (i + 1); j++) { + ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); + ((s1 *)wdata[i].p)[j].f = (float)((float)(i * 20 + j) / 3.0F); } /* end for */ } /* end for */ @@ -2872,10 +2872,10 @@ static void gent_vldatatypes5(void) wdata[i].p=NULL; } /* end if */ else { - wdata[i].len=i+5; - wdata[i].p=HDmalloc(sizeof(unsigned)*(i+5)); - for(j=0; j<i+5; j++) - ((unsigned *)wdata[i].p)[j]=j*2; + wdata[i].len = (size_t)(i + 5); + wdata[i].p = HDmalloc(sizeof(unsigned) * (size_t)(i + 5)); + for(j = 0; j < i + 5; j++) + ((unsigned *)wdata[i].p)[j] = (unsigned)(j * 2); } /* end else */ } /* end for */ @@ -3177,8 +3177,8 @@ static void gent_array4(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].i=i*10+j; - wdata[i][j].f=(float)(i*2.5F+j); + wdata[i][j].i = i * 10 + j; + wdata[i][j].f = (float)((float)i * 2.5F + (float)j); } /* end for */ /* Create file */ @@ -3244,9 +3244,9 @@ static void gent_array5(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].i=i*10+j; + wdata[i][j].i = i * 10 + j; for(k=0; k<ARRAY1_DIM1; k++) - wdata[i][j].f[k]=(float)(i*10+j*2.5F+k); + wdata[i][j].f[k] = (float)((float)i * 10 + (float)j * 2.5F + (float)k); } /* end for */ /* Create file */ @@ -3314,10 +3314,10 @@ static void gent_array6(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].p=HDmalloc((i+j+1)*sizeof(unsigned int)); - wdata[i][j].len=i+j+1; - for(k=0; k<(i+j+1); k++) - ((unsigned int *)wdata[i][j].p)[k]=i*100+j*10+k; + wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].len = (size_t)(i + j + 1); + for(k = 0; k < (i + j + 1); k++) + ((unsigned int *)wdata[i][j].p)[k] = (unsigned)(i * 100 + j * 10 + k); } /* end for */ /* Create file */ @@ -3375,11 +3375,11 @@ static void gent_array7(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].p=HDmalloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1)); - wdata[i][j].len=i+j+1; - for(k=0; k<(i+j+1); k++) - for(l=0; l<ARRAY1_DIM1; l++) - ((unsigned int *)wdata[i][j].p)[k*ARRAY1_DIM1+l]=i*1000+j*100+k*10+l; + wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); + wdata[i][j].len = (size_t)(i + j + 1); + for(k = 0; k < (i + j + 1); k++) + for(l = 0; l<ARRAY1_DIM1; l++) + ((unsigned int *)wdata[i][j].p)[k * ARRAY1_DIM1 + l] = (unsigned)(i * 1000+j * 100+k * 10 + l); } /* end for */ /* Create file */ @@ -3437,15 +3437,15 @@ static void gent_array8(void) herr_t status = -1; hsize_t sdims[] = {F64_DIM0}; hsize_t tdims[] = {F64_DIM1}; - int wdata[(F64_DIM1) * sizeof(int)]; /* Write buffer */ + int wdata[F64_DIM1]; /* Write buffer */ unsigned int i; /* * Initialize data. i is the element in the dataspace, j and k the * elements within the array datatype. */ - for (i=0; i<F64_DIM1; i++) - wdata[i] = i; + for (i = 0; i < F64_DIM1; i++) + wdata[i] = (int)i; /* * Create a new file using the default properties. @@ -3719,7 +3719,7 @@ void gent_multi(void) sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ - memb_addr[mt] = MAX(mt - 1,0) * (HADDR_MAX / 10); + memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER; @@ -4106,8 +4106,8 @@ static void write_attr_in(hid_t loc_id, for(j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; } @@ -4163,7 +4163,7 @@ static void write_attr_in(hid_t loc_id, for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { for(k = 0; k < 2; k++) { - buf23[i][j][k]=n++; + buf23[i][j][k] = (char)n++; } } } @@ -4189,7 +4189,7 @@ static void write_attr_in(hid_t loc_id, for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { for(k = 0; k < 2; k++) { - buf33[i][j][k].a=n++; + buf33[i][j][k].a = (char)n++; buf33[i][j][k].b=n++; } } @@ -4238,8 +4238,8 @@ static void write_attr_in(hid_t loc_id, for(k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; } @@ -4548,8 +4548,8 @@ static void write_dset_in(hid_t loc_id, for(j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; } @@ -4614,13 +4614,10 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf23[i][j][k]=n++; - } - } - } + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) + buf23[i][j][k] = (char)n++; tid = H5Tcopy(H5T_STD_B8LE); write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); status = H5Tclose(tid); @@ -4640,14 +4637,12 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) for(k = 0; k < 2; k++) { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; + buf33[i][j][k].a = (char)n++; + buf33[i][j][k].b = n++; } - } - } tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); @@ -4692,8 +4687,8 @@ static void write_dset_in(hid_t loc_id, for(k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].p = HDmalloc(((size_t)i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; } @@ -4938,25 +4933,20 @@ static void gent_compound_complex(void) for(m = 0; m< F41_LENGTH; m++) { Array1[m].a = m; - for(n = 0; n < F41_DIMb; n++) { + for(n = 0; n < F41_DIMb; n++) Array1[m].b[n] = quote[n]; - } - for(n = 0; n < F41_ARRAY_DIMc; n++) { + for(n = 0; n < F41_ARRAY_DIMc; n++) Array1[m].c[n] = chararray[n]; - } - for(n = 0; n < F41_ARRAY_DIMd1; n++) { - for(o = 0; o < F41_ARRAY_DIMd2; o++){ - Array1[m].d[n][o] = m + n + o; - } - } + for(n = 0; n < F41_ARRAY_DIMd1; n++) + for(o = 0; o < F41_ARRAY_DIMd2; o++) + Array1[m].d[n][o] = (short)(m + n + o); - Array1[m].e = (float)( m * 0.96F ); + Array1[m].e = (float)((float)m * 0.96F ); - for(n = 0; n < F41_ARRAY_DIMf; n++) { - Array1[m].f[n] = ( m * 1024.9637F ); - } + for(n = 0; n < F41_ARRAY_DIMf; n++) + Array1[m].f[n] = ((float)m * 1024.9637F ); Array1[m].g = 'm'; } @@ -7154,8 +7144,8 @@ gent_packedbits(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) - dsetu8[i][j] = dsetu8[i][j-1] << 1; - valu8bits <<= 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1); + valu8bits = (uint8_t)(valu8bits << 1); } H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -7171,8 +7161,8 @@ gent_packedbits(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) - dsetu16[i][j] = dsetu16[i][j-1] << 1; - valu16bits <<= 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); + valu16bits = (uint16_t)(valu16bits << 1); } H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -7222,8 +7212,8 @@ gent_packedbits(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) - dset8[i][j] = dset8[i][j-1] << 1; - val8bits <<= 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); + val8bits = (int8_t)(val8bits << 1); } H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -7239,8 +7229,8 @@ gent_packedbits(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) - dset16[i][j] = dset16[i][j-1] << 1; - val16bits <<= 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); + val16bits = (int16_t)(val16bits << 1); } H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -7288,7 +7278,7 @@ gent_packedbits(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); @@ -7336,9 +7326,9 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } H5Awrite(attr, H5T_NATIVE_UINT8, dsetu8); @@ -7354,9 +7344,9 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } H5Awrite(attr, H5T_NATIVE_UINT16, dsetu16); @@ -7408,9 +7398,9 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } H5Awrite(attr, H5T_NATIVE_INT8, dset8); @@ -7426,9 +7416,9 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } H5Awrite(attr, H5T_NATIVE_INT16, dset16); @@ -7478,7 +7468,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl); @@ -7589,33 +7579,33 @@ static void gent_compound_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; valu8bits = (uint8_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu8[n][0] = valu8bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dsetu8[n][o] = Array1[m].dsetu8[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dsetu8[n][o] = (uint8_t)(Array1[m].dsetu8[n][o-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } /* Array of 16 bits unsigned int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM16; valu16bits = (uint16_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu16[n][0] = valu16bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dsetu16[n][o] = Array1[m].dsetu16[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dsetu16[n][o] = (uint16_t)(Array1[m].dsetu16[n][o-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } /* Array of 32 bits unsigned int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM32; valu32bits = (uint32_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu32[n][0] = valu32bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dsetu32[n][o] = Array1[m].dsetu32[n][o-1] << 1; } valu32bits <<= 1; @@ -7625,9 +7615,9 @@ static void gent_compound_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM64; valu64bits = (uint64_t) ~0Lu; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu64[n][0] = valu64bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dsetu64[n][o] = Array1[m].dsetu64[n][o-1] << 1; } valu64bits <<= 1; @@ -7637,33 +7627,33 @@ static void gent_compound_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; val8bits = (int8_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset8[n][0] = val8bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dset8[n][o] = Array1[m].dset8[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dset8[n][o] = (int8_t)(Array1[m].dset8[n][o-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } /* Array of 16 bits signed int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM16; val16bits = (int16_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset16[n][0] = val16bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dset16[n][o] = Array1[m].dset16[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dset16[n][o] = (int16_t)(Array1[m].dset16[n][o-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } /* Array of 32 bits signed int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM32; val32bits = (int32_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset32[n][0] = val32bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dset32[n][o] = Array1[m].dset32[n][o-1] << 1; } val32bits <<= 1; @@ -7673,9 +7663,9 @@ static void gent_compound_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM64; val64bits = (int64_t) ~0L; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset64[n][0] = val64bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dset64[n][o] = Array1[m].dset64[n][o-1] << 1; } val64bits <<= 1; @@ -7684,9 +7674,9 @@ static void gent_compound_intsizes(void) { /* Double Dummy set for failure tests */ dims[0] = F70_XDIM; dims[1] = F70_YDIM8; - for(n = 0; n < dims[0]; n++) - for(o = 0; o < dims[1]; o++) - Array1[m].dsetdbl[n][o] = 0.0001F * o + n; + for(n = 0; n < (int)dims[0]; n++) + for(o = 0; o < (int)dims[1]; o++) + Array1[m].dsetdbl[n][o] = 0.0001F * (float)o + (float)n; } /* Create the array data type for the 8 bits signed int array */ @@ -7864,33 +7854,33 @@ static void gent_compound_attr_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; valu8bits = (uint8_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu8[n][0] = valu8bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dsetu8[n][o] = Array1[m].dsetu8[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dsetu8[n][o] = (uint8_t)(Array1[m].dsetu8[n][o-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } /* Array of 16 bits unsigned int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM16; valu16bits = (uint16_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu16[n][0] = valu16bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dsetu16[n][o] = Array1[m].dsetu16[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dsetu16[n][o] = (uint16_t)(Array1[m].dsetu16[n][o-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } /* Array of 32 bits unsigned int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM32; valu32bits = (uint32_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu32[n][0] = valu32bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dsetu32[n][o] = Array1[m].dsetu32[n][o-1] << 1; } valu32bits <<= 1; @@ -7900,9 +7890,9 @@ static void gent_compound_attr_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM64; valu64bits = (uint64_t) ~0Lu; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dsetu64[n][0] = valu64bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dsetu64[n][o] = Array1[m].dsetu64[n][o-1] << 1; } valu64bits <<= 1; @@ -7912,33 +7902,33 @@ static void gent_compound_attr_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; val8bits = (int8_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset8[n][0] = val8bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dset8[n][o] = Array1[m].dset8[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dset8[n][o] = (int8_t)(Array1[m].dset8[n][o-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } /* Array of 16 bits signed int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM16; val16bits = (int16_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset16[n][0] = val16bits; - for(o = 1; o < dims[1]; o++) { - Array1[m].dset16[n][o] = Array1[m].dset16[n][o-1] << 1; + for(o = 1; o < (int)dims[1]; o++) { + Array1[m].dset16[n][o] = (int16_t)(Array1[m].dset16[n][o-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } /* Array of 32 bits signed int */ dims[0] = F70_XDIM; dims[1] = F70_YDIM32; val32bits = (int32_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset32[n][0] = val32bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dset32[n][o] = Array1[m].dset32[n][o-1] << 1; } val32bits <<= 1; @@ -7948,9 +7938,9 @@ static void gent_compound_attr_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM64; val64bits = (int64_t) ~0L; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Array1[m].dset64[n][0] = val64bits; - for(o = 1; o < dims[1]; o++) { + for(o = 1; o < (int)dims[1]; o++) { Array1[m].dset64[n][o] = Array1[m].dset64[n][o-1] << 1; } val64bits <<= 1; @@ -7959,9 +7949,9 @@ static void gent_compound_attr_intsizes(void) { /* Double Dummy set for failure tests */ dims[0] = F70_XDIM; dims[1] = F70_YDIM8; - for(n = 0; n < dims[0]; n++) - for(o = 0; o < dims[1]; o++) - Array1[m].dsetdbl[n][o] = 0.0001F * o + n; + for(n = 0; n < (int)dims[0]; n++) + for(o = 0; o < (int)dims[1]; o++) + Array1[m].dsetdbl[n][o] = 0.0001F * (float)o + (float)n; } /* Create the array data type for the 8 bits signed int array */ @@ -8129,17 +8119,17 @@ static void gent_nested_compound_dt(void) { /* test nested data type */ dset1[i].b = (float)(i*i); dset2[i].a = i; - dset2[i].b = (float)(i+i*0.1F); + dset2[i].b = (float)((float)i + (float)i * 0.1F); dset2[i].c = GREEN; for(j = 0; j < 5; j++) { - dset3[i].a[j] = i*j; + dset3[i].a[j] = i * j; for(k = 0; k < 6; k++) { - dset3[i].b[j][k] = (float)(i*j*k*1.0F); + dset3[i].b[j][k] = (float)((float)i * (float)j * (float)k * 1.0F); } } dset3[i].c.a = i; - dset3[i].c.b = (float)(i*1.0F); + dset3[i].c.b = (float)((float)i * 1.0F); } fid = H5Fcreate(FILE72, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -8277,9 +8267,9 @@ gent_intscalars(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -8296,9 +8286,9 @@ gent_intscalars(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -8353,9 +8343,9 @@ gent_intscalars(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -8372,9 +8362,9 @@ gent_intscalars(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -8427,7 +8417,7 @@ gent_intscalars(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); @@ -8476,9 +8466,9 @@ gent_attr_intscalars(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } H5Awrite(attr, tid, dsetu8); @@ -8495,9 +8485,9 @@ gent_attr_intscalars(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } H5Awrite(attr, tid, dsetu16); @@ -8552,9 +8542,9 @@ gent_attr_intscalars(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } H5Awrite(attr, tid, dset8); @@ -8571,9 +8561,9 @@ gent_attr_intscalars(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } H5Awrite(attr, tid, dset16); @@ -8626,7 +8616,7 @@ gent_attr_intscalars(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; H5Awrite(attr, tid, dsetdbl); @@ -8665,9 +8655,9 @@ gent_string_scalars(void) memset(string, ' ', F73_XDIM * F73_YDIM8); for(i = 0; i < dims[0]; i++) { - string[i][0] = 'A' + i; + string[i][0] = (char)('A' + i); for(j = 1; j < dims[1]; j++) { - string[i][j] = string[i][j-1] + 1; + string[i][j] = (char)(string[i][j-1] + 1); } } string[dims[0]-1][dims[1]-1] = 0; @@ -8740,25 +8730,25 @@ static void gent_compound_int_array(void) { dims[0] = F76_DIM8; valu8bits = (uint8_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dsetu8[n] = valu8bits; - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } /* Array of 16 bits unsigned int */ dims[0] = F76_DIM16; valu16bits = (uint16_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dsetu16[n] = valu16bits; - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } /* Array of 32 bits unsigned int */ dims[0] = F76_DIM32; valu32bits = (uint32_t) ~0u; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dsetu32[n] = valu32bits; valu32bits <<= 1; } @@ -8767,7 +8757,7 @@ static void gent_compound_int_array(void) { dims[0] = F76_DIM64; valu64bits = (uint64_t) ~0Lu; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dsetu64[n] = valu64bits; valu64bits <<= 1; } @@ -8776,25 +8766,25 @@ static void gent_compound_int_array(void) { dims[0] = F76_DIM8; val8bits = (int8_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dset8[n] = val8bits; - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } /* Array of 16 bits signed int */ dims[0] = F76_DIM16; val16bits = (int16_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dset16[n] = val16bits; - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } /* Array of 32 bits signed int */ dims[0] = F76_DIM32; val32bits = (int32_t) ~0; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dset32[n] = val32bits; val32bits <<= 1; } @@ -8803,7 +8793,7 @@ static void gent_compound_int_array(void) { dims[0] = F76_DIM64; val64bits = (int64_t) ~0L; /* all 1s */ - for(n = 0; n < dims[0]; n++){ + for(n = 0; n < (int)dims[0]; n++){ Cmpd1[m].dset64[n] = val64bits; val64bits <<= 1; } @@ -8811,8 +8801,8 @@ static void gent_compound_int_array(void) { /* Double Dummy set for failure tests */ dims[0] = F76_DIM8; - for(n = 0; n < dims[0]; n++) - Cmpd1[m].dsetdbl[n] = 0.0001F + n; + for(n = 0; n < (int)dims[0]; n++) + Cmpd1[m].dsetdbl[n] = 0.0001F + (float)n; } /* Create the array data type for the 8 bits signed int array */ @@ -8991,14 +8981,14 @@ static void gent_compound_ints(void) { valu8bits = (uint8_t) ~0u; /* all 1s */ Cmpd1[m].dsetu8 = valu8bits; Cmpd2[m].dsetu8 = valu8bits; - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); /* Array of 16 bits unsigned int */ if((m % F76_DIM16) == 0) valu16bits = (uint16_t) ~0u; /* all 1s */ Cmpd1[m].dsetu16 = valu16bits; Cmpd2[m].dsetu16 = valu16bits; - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); /* Array of 32 bits unsigned int */ if((m % F76_DIM32) == 0) @@ -9019,14 +9009,14 @@ static void gent_compound_ints(void) { val8bits = (int8_t) ~0; /* all 1s */ Cmpd1[m].dset8 = val8bits; Cmpd2[m].dset8 = val8bits; - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); /* Array of 16 bits signed int */ if((m % F76_DIM16) == 0) val16bits = (int16_t) ~0; /* all 1s */ Cmpd1[m].dset16 = val16bits; Cmpd2[m].dset16 = val16bits; - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); /* Array of 32 bits signed int */ if((m % F76_DIM32) == 0) @@ -9043,8 +9033,8 @@ static void gent_compound_ints(void) { val64bits <<= 1; /* Double Dummy set for failure tests */ - Cmpd1[m].dsetdbl = 0.0001F + m; - Cmpd2[m].dsetdbl = 0.0001F + m; + Cmpd1[m].dsetdbl = 0.0001F + (float)m; + Cmpd2[m].dsetdbl = 0.0001F + (float)m; } /* Create the dataspace */ @@ -9199,9 +9189,9 @@ gent_intattrscalars(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j-1] << 1); } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -9222,9 +9212,9 @@ gent_intattrscalars(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -9291,9 +9281,9 @@ gent_intattrscalars(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -9314,9 +9304,9 @@ gent_intattrscalars(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -9381,7 +9371,7 @@ gent_intattrscalars(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); /* Attribute of double */ @@ -9433,10 +9423,10 @@ gent_intsattrs(void) dsetu8[i][0] = valu8bits; asetu8[i*dims[1]] = dsetu8[i][0]; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = (uint8_t)(dsetu8[i][j-1] << 1); asetu8[i*dims[1]+j] = dsetu8[i][j]; } - valu8bits <<= 1; + valu8bits = (uint8_t)(valu8bits << 1); } H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -9460,10 +9450,10 @@ gent_intsattrs(void) dsetu16[i][0] = valu16bits; asetu16[i*dims[1]] = dsetu16[i][0]; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = (uint16_t)(dsetu16[i][j-1] << 1); asetu16[i*dims[1]+j] = dsetu16[i][j]; } - valu16bits <<= 1; + valu16bits = (uint16_t)(valu16bits << 1); } H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -9541,10 +9531,10 @@ gent_intsattrs(void) dset8[i][0] = val8bits; aset8[i*dims[1]] = dset8[i][0]; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = (int8_t)(dset8[i][j-1] << 1); aset8[i*dims[1]+j] = dset8[i][j]; } - val8bits <<= 1; + val8bits = (int8_t)(val8bits << 1); } H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -9568,10 +9558,10 @@ gent_intsattrs(void) dset16[i][0] = val16bits; aset16[i*dims[1]] = dset16[i][0]; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = (int16_t)(dset16[i][j-1] << 1); aset16[i*dims[1]+j] = dset16[i][j]; } - val16bits <<= 1; + val16bits = (int16_t)(val16bits << 1); } H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -9646,7 +9636,7 @@ gent_intsattrs(void) for(i = 0; i < dims[0]; i++) for(j = 0; j < dims[1]; j++) { - dsetdbl[i][j] = 0.0001F * j + i; + dsetdbl[i][j] = 0.0001F * (float)j + (float)i; asetdbl[i*dims[1]+j] = dsetdbl[i][j]; } @@ -9823,7 +9813,7 @@ static void gent_bitnopaquefields(void) static void gent_intsfourdims(void) { - hid_t fid, dataset, space, tid; + hid_t fid, dataset, space; hsize_t dims[F81_RANK]; uint32_t dset1[F81_ZDIM][F81_YDIM][F81_XDIM][F81_WDIM]; unsigned int i, j, k, l; |