diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-07-10 20:18:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-07-10 20:18:52 (GMT) |
commit | 0c1c23245d103927c5d59c67b84526974e6217af (patch) | |
tree | eeaa0829d0ba6a98a91f5c1e224f91a049b54d99 /tools/h5toh4 | |
parent | d7bb1d0c0752461dc0e4316c85c72867490b8532 (diff) | |
download | hdf5-0c1c23245d103927c5d59c67b84526974e6217af.zip hdf5-0c1c23245d103927c5d59c67b84526974e6217af.tar.gz hdf5-0c1c23245d103927c5d59c67b84526974e6217af.tar.bz2 |
[svn-r4180] Purpose:
Documentation
Description:
Accommodate v1.2.x behavior when --enable-hdf5v1_2 is enabled.
Platforms tested:
FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'tools/h5toh4')
-rw-r--r-- | tools/h5toh4/h5toh4.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/tools/h5toh4/h5toh4.c b/tools/h5toh4/h5toh4.c index f5b2e93..09138b0 100644 --- a/tools/h5toh4/h5toh4.c +++ b/tools/h5toh4/h5toh4.c @@ -315,7 +315,7 @@ int h5toh4(char *h5_filename, char *h4_filename) hid_t (*func)(void*); - find_objs_t *info = HDmalloc(sizeof(find_objs_t)); + find_objs_t *info = malloc(sizeof(find_objs_t)); @@ -788,6 +788,28 @@ int32 order_array[512]; DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_dataset", __FILE__, __LINE__); break; } +#ifdef H5_WANT_H5_V1_2_COMPAT + /* v1.2 returns the base type of an array field, work around this */ + { + hid_t new_fieldtype; /* datatype for array, if necessary */ + int arrndims; /* Array rank for reading */ + size_t dims[H5S_MAX_RANK]; /* Array dimensions for reading */ + hsize_t arrdims[H5S_MAX_RANK]; /* Array dimensions for reading */ + int k; /* Local index variable */ + + /* Get the array dimensions */ + arrndims=H5Tget_member_dims(type,idx,dims,NULL); + + /* Patch up array information */ + if(arrndims>0) { + for(k=0; k<arrndims; k++) + arrdims[k]=dims[k]; + new_fieldtype=H5Tarray_create(fieldtype,arrndims,arrdims,NULL); + H5Tclose(fieldtype); + fieldtype=new_fieldtype; + } /* end if */ + } +#endif /* WANT_H5_V1_2_COMPAT */ /* Special case for array fields */ if(H5Tget_class(fieldtype)==H5T_ARRAY) { hid_t arr_base_type; @@ -910,6 +932,28 @@ int32 order_array[512]; DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_dataset", __FILE__, __LINE__); break; } +#ifdef H5_WANT_H5_V1_2_COMPAT + /* v1.2 returns the base type of an array field, work around this */ + { + hid_t new_arr_type; /* datatype for array, if necessary */ + int arrndims; /* Array rank for reading */ + size_t dims[H5S_MAX_RANK]; /* Array dimensions for reading */ + hsize_t arrdims[H5S_MAX_RANK]; /* Array dimensions for reading */ + int k; /* Local index variable */ + + /* Get the array dimensions */ + arrndims=H5Tget_member_dims(type,idx,dims,NULL); + + /* Patch up array information */ + if(arrndims>0) { + for(k=0; k<arrndims; k++) + arrdims[k]=dims[k]; + new_arr_type=H5Tarray_create(arr_type,arrndims,arrdims,NULL); + H5Tclose(arr_type); + arr_type=new_arr_type; + } /* end if */ + } +#endif /* WANT_H5_V1_2_COMPAT */ /* Get the number of dimensions */ if ((ndimf = H5Tget_array_ndims(arr_type)) < 0 || ndimf > H5S_MAX_RANK ) { fprintf(stderr, "Error: rank of members of compound type should not be %d\n",ndimf); |