summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Df.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-13 19:21:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-13 19:21:41 (GMT)
commit9bc89569d6990a1ebbe8fa595a23d5df59575c7f (patch)
tree68f37a5fbec8709187c2b4fe9521d0ce8434388b /fortran/src/H5Df.c
parented23cda102d6c9312d863d4a2b5b2b0ec12f7224 (diff)
downloadhdf5-9bc89569d6990a1ebbe8fa595a23d5df59575c7f.zip
hdf5-9bc89569d6990a1ebbe8fa595a23d5df59575c7f.tar.gz
hdf5-9bc89569d6990a1ebbe8fa595a23d5df59575c7f.tar.bz2
[svn-r7611] Purpose:
Code cleanup Description: Cleaned up various compiler warnings Platforms tested: FreeBSD 4.9 (sleipnir) Linux 2.4 (verbena) w/FORTRAN too minor for h5committest
Diffstat (limited to 'fortran/src/H5Df.c')
-rw-r--r--fortran/src/H5Df.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 04b38b2..22ce62c 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -741,23 +741,23 @@ nh5dread_ref_obj_c_b (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space
/*
* Allocate temporary buffer.
*/
- buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(n));
+ buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(size_t)n);
if ( buf_c != NULL ) {
- /*
- * Call H5Dread function.
- */
- c_dset_id = (hid_t)*dset_id;
- c_mem_type_id = (hid_t)*mem_type_id;
- c_mem_space_id = (hid_t)*mem_space_id;
- c_file_space_id = (hid_t)*file_space_id;
- ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
- if (ret >=0) {
- for (i = 0; i < n; i++) {
- HDmemcpy(buf, &buf_c[i], H5R_OBJ_REF_BUF_SIZE);
- buf = buf + REF_OBJ_BUF_LEN_F;
- }
- }
- if ( buf_c != NULL ) HDfree(buf_c);
+ /*
+ * Call H5Dread function.
+ */
+ c_dset_id = (hid_t)*dset_id;
+ c_mem_type_id = (hid_t)*mem_type_id;
+ c_mem_space_id = (hid_t)*mem_space_id;
+ c_file_space_id = (hid_t)*file_space_id;
+ ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
+ if (ret >=0) {
+ for (i = 0; i < n; i++) {
+ HDmemcpy(buf, &buf_c[i], H5R_OBJ_REF_BUF_SIZE);
+ buf = buf + REF_OBJ_BUF_LEN_F;
+ }
+ }
+ if ( buf_c != NULL ) HDfree(buf_c);
}
if (ret < 0) return ret_value;
ret_value = 0;
@@ -859,23 +859,23 @@ nh5dread_ref_reg_c_b (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space
/*
* Allocate temporary buffer.
*/
- buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(n));
+ buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(size_t)n);
if ( buf_c != NULL ) {
- /*
- * Call H5Dread function.
- */
- c_dset_id = (hid_t)*dset_id;
- c_mem_type_id = (hid_t)*mem_type_id;
- c_mem_space_id = (hid_t)*mem_space_id;
- c_file_space_id = (hid_t)*file_space_id;
- ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
- if (ret >=0) {
- for (i = 0; i < n; i++) {
- HDmemcpy(buf, buf_c[i].heapid, H5R_DSET_REG_REF_BUF_SIZE);
- buf = buf + REF_REG_BUF_LEN_F;
- }
- }
- if ( buf_c != NULL ) HDfree(buf_c);
+ /*
+ * Call H5Dread function.
+ */
+ c_dset_id = (hid_t)*dset_id;
+ c_mem_type_id = (hid_t)*mem_type_id;
+ c_mem_space_id = (hid_t)*mem_space_id;
+ c_file_space_id = (hid_t)*file_space_id;
+ ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
+ if (ret >=0) {
+ for (i = 0; i < n; i++) {
+ HDmemcpy(buf, buf_c[i].heapid, H5R_DSET_REG_REF_BUF_SIZE);
+ buf = buf + REF_REG_BUF_LEN_F;
+ }
+ }
+ if ( buf_c != NULL ) HDfree(buf_c);
}
if (ret < 0) return ret_value;
ret_value = 0;
@@ -1093,7 +1093,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id
num_elem = H5Sget_select_npoints(c_space_id);
if( num_elem < 0) return ret_value;
- c_buf = (hvl_t *)malloc(sizeof(hvl_t)*num_elem);
+ c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem);
if (c_buf == NULL) return ret_value;
status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf);
if(status < 0) goto DONE;
@@ -1142,7 +1142,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
size_t max_len;
hvl_t *c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -1154,7 +1154,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
- c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (int *)buf;
for (i=0; i < num_elem; i++) {
@@ -1219,7 +1219,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
@@ -1269,7 +1269,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
size_t max_len;
char **c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -1284,11 +1284,11 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
/*
* Allocate arra of character pointers
*/
- c_buf = (char **)malloc(num_elem * sizeof(char *));
+ c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/* Copy data to long C string */
- tmp = (char *)HD5f2cstring(buf, max_len*num_elem);
+ tmp = (char *)HD5f2cstring(buf, (int)(max_len*num_elem));
if (tmp == NULL) { free(c_buf);
return ret_value;
}
@@ -1297,8 +1297,8 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
*/
tmp_p = tmp;
for (i=0; i < num_elem; i++) {
- c_buf[i] = (char *) malloc(len[i]+1);
- memcpy(c_buf[i], tmp_p, len[i]);
+ c_buf[i] = (char *) malloc((size_t)len[i]+1);
+ memcpy(c_buf[i], tmp_p, (size_t)len[i]);
c_buf[i][len[i]] = '\0';
tmp_p = tmp_p + max_len;
}
@@ -1348,7 +1348,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
size_t max_len;
char **c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -1363,7 +1363,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
/*
* Allocate array of character pointers
*/
- c_buf = (char **)malloc(num_elem * sizeof(char *));
+ c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/*
@@ -1374,7 +1374,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
return ret_value;
}
/* Copy data to long C string */
- tmp = (char *)malloc(max_len*num_elem +1);
+ tmp = (char *)malloc((size_t)(max_len*num_elem) +1);
tmp_p = tmp;
for (i=0; i<max_len*num_elem; i++) tmp[i] = ' ';
tmp[max_len*num_elem] = '\0';
@@ -1383,7 +1383,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
len[i] = (size_t_f)strlen(c_buf[i]);
tmp_p = tmp_p + max_len;
}
- HD5packFstring(tmp, _fcdtocp(buf), max_len*num_elem);
+ HD5packFstring(tmp, _fcdtocp(buf), (int)(max_len*num_elem));
ret_value = 0;
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
free(c_buf);
@@ -1428,7 +1428,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
size_t max_len;
hvl_t *c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -1440,7 +1440,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
- c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
#if defined (_UNICOS)
tmp = (double *)buf;
@@ -1509,7 +1509,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.