summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5vdata.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-11-09 23:01:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-11-09 23:01:29 (GMT)
commitab5bf9f979fed3a665f302b4e8b93ca1628b5d23 (patch)
treec500e7b7df4979a5933af31336c1583256e325ce /tools/h4toh5vdata.c
parent66c44914cc582da845571768161302b1b18b26bd (diff)
downloadhdf5-ab5bf9f979fed3a665f302b4e8b93ca1628b5d23.zip
hdf5-ab5bf9f979fed3a665f302b4e8b93ca1628b5d23.tar.gz
hdf5-ab5bf9f979fed3a665f302b4e8b93ca1628b5d23.tar.bz2
[svn-r2851] Purpose:
Updated for new array datatypes. Description: I missed these tools earlier when I wasn't compiling with HDF4... Solution: Updated them (correctly, I hope) to use the new array datatype instead of compound datatype array fields. Platforms tested: FreeBSD 4.1.1 (hawkwind)
Diffstat (limited to 'tools/h4toh5vdata.c')
-rw-r--r--tools/h4toh5vdata.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/tools/h4toh5vdata.c b/tools/h4toh5vdata.c
index b078791..25624a5 100644
--- a/tools/h4toh5vdata.c
+++ b/tools/h4toh5vdata.c
@@ -675,7 +675,7 @@ int gen_h5comptype(int32 vdata_id,int32 nfields,
size_t fil_offset;
size_t mem_offset;
size_t fieldsizef;
- size_t fielddim[1];
+ hsize_t fielddim[1];
hid_t h5str_type;
int check_ifstr;/* flag to check if the h5 type is string.*/
int i;
@@ -754,19 +754,42 @@ int gen_h5comptype(int32 vdata_id,int32 nfields,
}
else {
+ hid_t arr_type; /* Array datatype for inserting fields */
- if(H5Tinsert_array(h5_ctype,fieldname,fil_offset,1,fielddim,
- NULL,sh5type[i])<0) {
+ /* Create array datatype */
+ if((arr_type=H5Tarray_create(sh5type[i],1,fielddim,NULL))<0) {
+ printf("error creating array datatype.\n");
+ return FAIL;
+ }
+
+ if(H5Tinsert(h5_ctype,fieldname,fil_offset,arr_type)<0) {
printf("error inserting array into hdf5 compound datatype. \n");
return FAIL;
}
- if(H5Tinsert_array(h5_cmemtype,fieldname,mem_offset,1,fielddim,
- NULL,sh5memtype[i])<0) {
+ /* Close array datatype */
+ if(H5Tclose(arr_type)<0) {
+ printf("error closing array datatype.\n");
+ return FAIL;
+ }
+
+ /* Create array datatype */
+ if((arr_type=H5Tarray_create(sh5memtype[i],1,fielddim,NULL))<0) {
+ printf("error creating array datatype.\n");
+ return FAIL;
+ }
+
+ if(H5Tinsert(h5_cmemtype,fieldname,fil_offset,arr_type)<0) {
printf("error inserting array into hdf5 compound datatype for memory. \n");
return FAIL;
}
+ /* Close array datatype */
+ if(H5Tclose(arr_type)<0) {
+ printf("error closing array datatype.\n");
+ return FAIL;
+ }
+
}