diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2003-04-29 00:00:22 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2003-04-29 00:00:22 (GMT) |
commit | e42dba5336d382d401d753609d415155243f7086 (patch) | |
tree | f8a45de293b7f0b5876c6a2a6bf50f173493e5e4 /fortran/src | |
parent | c37bcc12fcb51330a640adc82de5caaf388e9f92 (diff) | |
download | hdf5-e42dba5336d382d401d753609d415155243f7086.zip hdf5-e42dba5336d382d401d753609d415155243f7086.tar.gz hdf5-e42dba5336d382d401d753609d415155243f7086.tar.bz2 |
[svn-r6772]
Purpose: Windows maintenance and code cleanup
Description: There were a lot of places in the source code where varibale
was declared but never used.
Solution: Cleaned the source code to avoid warnings on Windows adn Unix
platforms.
Platforms tested: arabica, modi4, Windows
Probably my environment is wrong on Linux, cannot
compile at all when fortran is enabled
If daily tests fails tomorrow, this will be my fault
but I want to go home now :-)
Misc. update:
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Df.c | 34 | ||||
-rw-r--r-- | fortran/src/H5Ff.c | 20 | ||||
-rw-r--r-- | fortran/src/H5Gf.c | 2 | ||||
-rw-r--r-- | fortran/src/H5Git.c | 3 | ||||
-rw-r--r-- | fortran/src/H5Pff.f90 | 2 |
5 files changed, 20 insertions, 41 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index dc6ac43..21dbed9 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1082,8 +1082,9 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id hid_t c_type_id; hid_t c_space_id; hvl_t *c_buf; - int i,j; + int i; hssize_t num_elem; + herr_t status; c_dset_id = (hid_t)*dset_id; c_type_id = (hid_t)*type_id; @@ -1094,16 +1095,17 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id c_buf = (hvl_t *)malloc(sizeof(hvl_t)*num_elem); if (c_buf == NULL) return ret_value; - if(H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf)) goto DONE; + status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf); + if(status < 0) goto DONE; c_len = 0; for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len); *len = (size_t_f)c_len; + H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf); ret_value = 0; DONE: - H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf); free(c_buf); return ret_value; } @@ -1140,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, j; + int i; hsize_t num_elem; max_len = (size_t)dims[0]; @@ -1223,15 +1225,14 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s * Call H5Dread function. */ status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); - if ( status >=0 ) { + if ( status < 0 ) goto DONE; for (i=0; i < num_elem; i++) { len[i] = (size_t_f)c_buf[i].len; memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(int)); } - } - ret_value = num_elem; -DONE: H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + ret_value = 0; +DONE: free(c_buf); return ret_value; } @@ -1266,10 +1267,9 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp herr_t status; char *tmp, *tmp_p; size_t max_len; - size_t buf_len; char **c_buf; - int i, j; + int i; hsize_t num_elem; max_len = (size_t)dims[0]; @@ -1346,10 +1346,9 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa herr_t status; char *tmp, *tmp_p; size_t max_len; - size_t buf_len; char **c_buf; - int i, j; + int i; hsize_t num_elem; max_len = (size_t)dims[0]; @@ -1386,7 +1385,6 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa } HD5packFstring(tmp, _fcdtocp(buf), max_len*num_elem); ret_value = 0; -DONE: H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); free(c_buf); free(tmp); @@ -1430,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, j; + int i; hsize_t num_elem; max_len = (size_t)dims[0]; @@ -1517,7 +1515,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac * Call H5Dread function. */ status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); - if ( status >=0 ) { + if ( status <0 ) goto DONE; for (i=0; i < num_elem; i++) { len[i] = (size_t_f)c_buf[i].len; #if defined (_UNICOS) @@ -1526,10 +1524,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(float)); #endif } - } - ret_value = num_elem; -DONE: + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + ret_value = 0; +DONE: free(c_buf); return ret_value; } diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 74ad7a5..2d8e5ef 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -96,31 +96,11 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) { int ret_value = -1; hid_t c_file_id; - int CASE; H5F_scope_t c_scope; htri_t status; c_scope = (H5F_scope_t)*scope; /* - * Define scope flags - */ -/* - CASE = (int)*scope; - switch (CASE) { - - case H5F_SCOPE_LOCAL_F: - c_scope = H5F_SCOPE_LOCAL; - break; - - case H5F_SCOPE_GLOBAL_F: - c_scope = H5F_SCOPE_GLOBAL; - break; - - default: - return ret_value; - } -*/ - /* * Call H5Fflush function. */ diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index e3b2177..2441973 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -50,7 +50,7 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, */ c_loc_id = *loc_id; if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F ) - c_grp_id = H5Gcreate(c_loc_id, c_name, NULL); + c_grp_id = H5Gcreate(c_loc_id, c_name, 0); else { c_size_hint = (size_t)*size_hint; c_grp_id = H5Gcreate(c_loc_id, c_name, c_size_hint); diff --git a/fortran/src/H5Git.c b/fortran/src/H5Git.c index 804f78c..9e7cf5a 100644 --- a/fortran/src/H5Git.c +++ b/fortran/src/H5Git.c @@ -15,6 +15,7 @@ /* This files contains C stubs for H5G Fortran APIs */ #include "hdf5.h" +#include "H5private.h" #include "H5Git.h" #define FALSE 0 @@ -126,7 +127,7 @@ H5Gget_obj_info_idx( hid_t loc_id, char *group_name, int idx, char **objname, si (*objname)[max_objname_len]='\0'; /* Free the name we strdup'ed in obj_info() */ - free(retVal.name); + HDfree(retVal.name); } /* end if */ else *(*objname)='\0'; diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 63de1dd..47396fc 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -6167,7 +6167,7 @@ INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm INTEGER :: maxlen INTEGER :: c_maxlen_out - INTEGER, INTENT(IN) :: flag + INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_fapl_multi_c END INTERFACE maxlen = LEN(memb_name(0)) |