diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 1999-11-17 22:00:15 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 1999-11-17 22:00:15 (GMT) |
commit | 9648d22f5f387640de8140acd7d2193bcd6770ad (patch) | |
tree | 20905fda3ba2ecf9259c0cc9c4ef0658a79ad903 /tools | |
parent | 9e014467b62df66322de63e21be565ed59a079b3 (diff) | |
download | hdf5-9648d22f5f387640de8140acd7d2193bcd6770ad.zip hdf5-9648d22f5f387640de8140acd7d2193bcd6770ad.tar.gz hdf5-9648d22f5f387640de8140acd7d2193bcd6770ad.tar.bz2 |
[svn-r1837] Cleaned up a few warnings from the SGI compiler.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump.c | 8 | ||||
-rw-r--r-- | tools/h5dumptst.c | 80 | ||||
-rw-r--r-- | tools/h5tools.c | 17 |
3 files changed, 49 insertions, 56 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c index 94052b0..7248b3e 100644 --- a/tools/h5dump.c +++ b/tools/h5dump.c @@ -177,7 +177,7 @@ H5G_stat_t statbuf; cset = H5Tget_cset(type); indentation (indent+COL); - printf("%s %s %d;\n", BEGIN, STRSIZE, size); + printf("%s %s %d;\n", BEGIN, STRSIZE, (int)size); indentation (indent+COL); printf(" %s ", STRPAD); @@ -301,7 +301,7 @@ H5G_stat_t statbuf; if (ndims != 1 || dims[0] != 1) { for (j = 0; j < ndims; j++) - printf("[%d]",dims[j]); + printf("[%d]",(int)dims[j]); } printf (";\n"); @@ -522,7 +522,7 @@ char *obj_name, *attr_name; hid_t oid, attr_id, type, space; H5G_stat_t statbuf; - j = strlen(name)-1; + j = (int)strlen(name)-1; obj_name = malloc ((j+2)* sizeof(char)); /* find the last / */ @@ -798,7 +798,7 @@ size_t dims[H5DUMP_MAX_RANK]; if (ndims != 1 || dims[0] != 1) { for (j = 0; j < ndims; j++) - printf("[%d]",dims[j]); + printf("[%d]",(int)dims[j]); } printf (";\n"); diff --git a/tools/h5dumptst.c b/tools/h5dumptst.c index bededf5..e2c9bf7 100644 --- a/tools/h5dumptst.c +++ b/tools/h5dumptst.c @@ -248,15 +248,14 @@ int point = 100; static void test_softlink(void) { hid_t fid, root; -herr_t status; fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen (fid, "/"); - status = H5Glink (root, H5G_LINK_SOFT, "somevalue", "slink1"); + H5Glink (root, H5G_LINK_SOFT, "somevalue", "slink1"); - status = H5Glink (root, H5G_LINK_SOFT, "linkvalue", "slink2"); + H5Glink (root, H5G_LINK_SOFT, "linkvalue", "slink2"); H5Gclose(root); @@ -1018,7 +1017,7 @@ const int perm[4] = {0,1,2,3}; /* the 0'th and the 3'rd indices are permuted */ H5Fclose(fid); } -static hid_t mkstr(int size, int pad) { +static hid_t mkstr(int size, H5T_str_t pad) { hid_t type; if ((type=H5Tcopy(H5T_C_S1))<0) return -1; @@ -1363,8 +1362,6 @@ void test_objref(void){ uint32_t *tu32; /* Temporary pointer to uint32 data */ intn i; /* counting variables */ const char *write_comment="Foo!"; /* Comments for group */ - herr_t ret; /* Generic return value */ - /* Allocate write & read buffers */ wbuf=malloc(sizeof(hobj_ref_t)*SPACE1_DIM1); @@ -1381,7 +1378,7 @@ void test_objref(void){ group=H5Gcreate(fid1,"Group1",-1); /* Set group's comment */ - ret=H5Gset_comment(group,".",write_comment); + H5Gset_comment(group,".",write_comment); /* Create a dataset (inside Group1) */ dataset=H5Dcreate(group,"Dataset1",H5T_STD_U32BE,sid1,H5P_DEFAULT); @@ -1390,72 +1387,72 @@ void test_objref(void){ *tu32++=i*3; /* Write selection to disk */ - ret=H5Dwrite(dataset,H5T_NATIVE_UINT,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); + H5Dwrite(dataset,H5T_NATIVE_UINT,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); /* Close Dataset */ - ret = H5Dclose(dataset); + H5Dclose(dataset); /* Create another dataset (inside Group1) */ dataset=H5Dcreate(group,"Dataset2",H5T_STD_U8BE,sid1,H5P_DEFAULT); /* Close Dataset */ - ret = H5Dclose(dataset); + H5Dclose(dataset); /* Create a datatype to refer to */ tid1 = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)); /* Insert fields */ - ret=H5Tinsert (tid1, "a", HOFFSET(s1_t,a), H5T_STD_I32BE); + H5Tinsert (tid1, "a", HOFFSET(s1_t,a), H5T_STD_I32BE); - ret=H5Tinsert (tid1, "b", HOFFSET(s1_t,b), H5T_IEEE_F32BE); + H5Tinsert (tid1, "b", HOFFSET(s1_t,b), H5T_IEEE_F32BE); - ret=H5Tinsert (tid1, "c", HOFFSET(s1_t,c), H5T_IEEE_F32BE); + H5Tinsert (tid1, "c", HOFFSET(s1_t,c), H5T_IEEE_F32BE); /* Save datatype for later */ - ret=H5Tcommit (group, "Datatype1", tid1); + H5Tcommit (group, "Datatype1", tid1); /* Close datatype */ - ret = H5Tclose(tid1); + H5Tclose(tid1); /* Close group */ - ret = H5Gclose(group); + H5Gclose(group); /* Create a dataset */ dataset=H5Dcreate(fid1,"Dataset3",H5T_STD_REF_OBJ,sid1,H5P_DEFAULT); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[0],fid1,"/Group1/Dataset1",H5R_OBJECT,-1); - ret = H5Rget_object_type(dataset,&wbuf[0]); + H5Rcreate(&wbuf[0],fid1,"/Group1/Dataset1",H5R_OBJECT,-1); + H5Rget_object_type(dataset,&wbuf[0]); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[1],fid1,"/Group1/Dataset2",H5R_OBJECT,-1); + H5Rcreate(&wbuf[1],fid1,"/Group1/Dataset2",H5R_OBJECT,-1); - ret = H5Rget_object_type(dataset,&wbuf[1]); + H5Rget_object_type(dataset,&wbuf[1]); /* Create reference to group */ - ret = H5Rcreate(&wbuf[2],fid1,"/Group1",H5R_OBJECT,-1); + H5Rcreate(&wbuf[2],fid1,"/Group1",H5R_OBJECT,-1); - ret = H5Rget_object_type(dataset,&wbuf[2]); + H5Rget_object_type(dataset,&wbuf[2]); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf[3],fid1,"/Group1/Datatype1",H5R_OBJECT,-1); + H5Rcreate(&wbuf[3],fid1,"/Group1/Datatype1",H5R_OBJECT,-1); - ret = H5Rget_object_type(dataset,&wbuf[3]); + H5Rget_object_type(dataset,&wbuf[3]); /* Write selection to disk */ - ret=H5Dwrite(dataset,H5T_STD_REF_OBJ,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); + H5Dwrite(dataset,H5T_STD_REF_OBJ,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); /* Close disk dataspace */ - ret = H5Sclose(sid1); + H5Sclose(sid1); /* Close Dataset */ - ret = H5Dclose(dataset); + H5Dclose(dataset); /* Close file */ - ret = H5Fclose(fid1); + H5Fclose(fid1); /* Free memory buffers */ free(wbuf); @@ -1487,7 +1484,6 @@ void test_datareg(void){ *drbuf; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ intn i; /* counting variables */ - herr_t ret; /* Generic return value */ /* Allocate write & read buffers */ wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); @@ -1508,10 +1504,10 @@ void test_datareg(void){ *tu8++=i*3; /* Write selection to disk */ - ret=H5Dwrite(dset2,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf); + H5Dwrite(dset2,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf); /* Close Dataset */ - ret = H5Dclose(dset2); + H5Dclose(dset2); /* Create dataspace for the reference dataset */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); @@ -1526,12 +1522,12 @@ void test_datareg(void){ stride[0]=1; stride[1]=1; count[0]=6; count[1]=6; block[0]=1; block[1]=1; - ret = H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block); + H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block); - ret = H5Sget_select_npoints(sid2); + H5Sget_select_npoints(sid2); /* Store first dataset region */ - ret = H5Rcreate(&wbuf[0],fid1,"/Dataset2",H5R_DATASET_REGION,sid2); + H5Rcreate(&wbuf[0],fid1,"/Dataset2",H5R_DATASET_REGION,sid2); /* Select sequence of ten points for second reference */ coord1[0][0]=6; coord1[0][1]=9; @@ -1544,27 +1540,27 @@ void test_datareg(void){ coord1[7][0]=9; coord1[7][1]=0; coord1[8][0]=7; coord1[8][1]=1; coord1[9][0]=3; coord1[9][1]=3; - ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1); + H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1); - ret = H5Sget_select_npoints(sid2); + H5Sget_select_npoints(sid2); /* Store second dataset region */ - ret = H5Rcreate(&wbuf[1],fid1,"/Dataset2",H5R_DATASET_REGION,sid2); + H5Rcreate(&wbuf[1],fid1,"/Dataset2",H5R_DATASET_REGION,sid2); /* Write selection to disk */ - ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); + H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); /* Close disk dataspace */ - ret = H5Sclose(sid1); + H5Sclose(sid1); /* Close Dataset */ - ret = H5Dclose(dset1); + H5Dclose(dset1); /* Close uint8 dataset dataspace */ - ret = H5Sclose(sid2); + H5Sclose(sid2); /* Close file */ - ret = H5Fclose(fid1); + H5Fclose(fid1); /* Free memory buffers */ free(wbuf); diff --git a/tools/h5tools.c b/tools/h5tools.c index 7e10c92..78aec60 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -1312,8 +1312,8 @@ h5dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, } /* Print the data */ - flags = ((0==elmtno?START_OF_DATA:0) | - (elmtno+hs_nelmts>=p_nelmts?END_OF_DATA:0)); + flags = ((0==elmtno ? START_OF_DATA : 0) | + (elmtno+hs_nelmts>=p_nelmts ? END_OF_DATA : 0)); if (programtype == UNKNOWN){ return FAIL; } else if (programtype == H5LS){ @@ -1848,7 +1848,7 @@ int temp; if ((int)(strlen(out_buf)+tempstr.len+1) > (nCols-indent-COL)) { if (isref){ /* i added this */ - temp = strlen(out_buf); + temp = (int)strlen(out_buf); if ((strlen(out_buf) + 7) < (totalspace)){ /* 7 for the word dataset */ memcpy(out_buf+strlen(out_buf), tempstr.s, totalspace - strlen(out_buf)); out_buf[totalspace] = '\0'; @@ -1959,7 +1959,7 @@ static void display_string (hsize_t hs_nelmts, hid_t p_type, unsigned char *sm_buf, size_t p_type_nbytes, hsize_t p_nelmts, hsize_t dim_n_size, hsize_t elmtno) { hsize_t i, row_size=0; - int j, m, x, y, z, first_row=1; + int j, m, x, y, first_row=1; int free_space, long_string = 0; char* out_buf = malloc(sizeof(char) * nCols); struct h5dump_str_t tempstr; @@ -1998,7 +1998,7 @@ static void display_string tempstr.s[tempstr.len - 2] = '\0'; tempstr.len = tempstr.len - 2; - free_space = nCols - indent - COL - strlen(out_buf); + free_space = (int)(nCols - indent - COL - strlen(out_buf)); if ((elmtno+i+1) == p_nelmts) { /* last element */ /* 2 for double quotes */ @@ -2033,7 +2033,7 @@ static void display_string indentation(indent+COL); printf("%s\"", out_buf); memset(out_buf, '\0', nCols); - temp = copy_atomic_char(out_buf,tempstr.s,tempstr.len,x); + temp = copy_atomic_char(out_buf,tempstr.s,(int)tempstr.len,x); out_buf[x] = '\0'; printf("%s\" %s\n",out_buf,CONCATENATOR); x = temp; @@ -2042,10 +2042,7 @@ static void display_string y = nCols - indent -COL - 5; - m = (tempstr.len - x)/y; - - z = (tempstr.len - x) % y; - + m = (int)((tempstr.len - x)/y); for (j = 0; j < m - 1 ; j++) { indentation(indent+COL); |