[svn-r1837] Cleaned up a few warnings from the SGI compiler.

This commit is contained in:
Quincey Koziol 1999-11-17 17:00:15 -05:00
parent 9e014467b6
commit 9648d22f5f
8 changed files with 65 additions and 75 deletions

View File

@ -734,7 +734,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = 0xff ^ i;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
goto error;
if (H5Sclose(space)<0) goto error;
@ -747,7 +747,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT))<0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = 0xff ^ i;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
goto error;
if (H5Sclose(space)<0) goto error;
@ -761,7 +761,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(grp, "opaque_1", type, space, H5P_DEFAULT))<0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = 0xff ^ i;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
goto error;
if (H5Sclose(space)<0) goto error;
@ -775,7 +775,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(grp, "opaque_2", type, space, H5P_DEFAULT))<0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = 0xff ^ i;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
goto error;
if (H5Sclose(space)<0) goto error;

View File

@ -94,6 +94,3 @@ main(void)
_exit(1);
}

View File

@ -116,7 +116,7 @@ h5_cleanup(hid_t fapl)
} else if (H5FD_MULTI==driver) {
H5FD_mem_t mt;
assert(strlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
HDsnprintf(temp, sizeof temp, "%s-%c.h5",
filename, multi_letters[mt]);
remove(temp); /*don't care if it fails*/
@ -212,7 +212,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
/* Prepend the prefix value to the base name */
if (prefix && *prefix) {
if (HDsnprintf(fullname, size, "%s/%s", prefix, base_name)==(int)size) {
if (HDsnprintf(fullname, (long)size, "%s/%s", prefix, base_name)==(int)size) {
return NULL; /*buffer is too small*/
}
} else if (strlen(base_name)>=size) {
@ -310,7 +310,7 @@ h5_fileaccess(void)
memset(memb_addr, 0, sizeof memb_addr);
assert(strlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];

View File

@ -62,10 +62,10 @@ void *test_vlstr_alloc_custom(size_t size, void *info)
* This weird contortion is required on the DEC Alpha to keep the
* alignment correct - QAK
*/
extra=MAX(sizeof(void *),sizeof(int));
extra=MAX(sizeof(void *),sizeof(size_t));
if((ret_value=HDmalloc(extra+size))!=NULL) {
*(int *)ret_value=size;
*(size_t *)ret_value=size;
*mem_used+=size;
} /* end if */
ret_value=((unsigned char *)ret_value)+extra;
@ -90,11 +90,11 @@ void test_vlstr_free_custom(void *_mem, void *info)
* This weird contortion is required on the DEC Alpha to keep the
* alignment correct - QAK
*/
extra=MAX(sizeof(void *),sizeof(int));
extra=MAX(sizeof(void *),sizeof(size_t));
if(_mem!=NULL) {
mem=((unsigned char *)_mem)-extra;
*mem_used-=*(int *)mem;
*mem_used-=*(size_t *)mem;
HDfree(mem);
} /* end if */
}
@ -182,7 +182,7 @@ test_vlstrings_basic(void)
for(i=0; i<SPACE1_DIM1; i++) {
if(strlen(wdata[i])!=strlen(rdata[i])) {
num_errs++;
printf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,strlen(wdata[i]),(int)i,strlen(rdata[i]));
printf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
if( strcmp(wdata[i],rdata[i]) != 0 ) {

View File

@ -62,10 +62,10 @@ void *test_vltypes_alloc_custom(size_t size, void *info)
* This weird contortion is required on the DEC Alpha to keep the
* alignment correct - QAK
*/
extra=MAX(sizeof(void *),sizeof(int));
extra=MAX(sizeof(void *),sizeof(size_t));
if((ret_value=HDmalloc(extra+size))!=NULL) {
*(int *)ret_value=size;
*(size_t *)ret_value=size;
*mem_used+=size;
} /* end if */
ret_value=((unsigned char *)ret_value)+extra;
@ -90,11 +90,11 @@ void test_vltypes_free_custom(void *_mem, void *info)
* This weird contortion is required on the DEC Alpha to keep the
* alignment correct - QAK
*/
extra=MAX(sizeof(void *),sizeof(int));
extra=MAX(sizeof(void *),sizeof(size_t));
if(_mem!=NULL) {
mem=((unsigned char *)_mem)-extra;
*mem_used-=*(int *)mem;
*mem_used-=*(size_t *)mem;
HDfree(mem);
} /* end if */
}

View File

@ -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");

View File

@ -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);

View File

@ -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);