summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-10-13 02:32:25 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-10-13 02:32:25 (GMT)
commitfcfecf9ff20c670eab5cce89700348a37da368a7 (patch)
treea44ff90b4ad0cb3e9ed6d364c082c8f927838757 /tools
parentf53e72cc9f5f8d188926d425e9970b35b523115c (diff)
downloadhdf5-fcfecf9ff20c670eab5cce89700348a37da368a7.zip
hdf5-fcfecf9ff20c670eab5cce89700348a37da368a7.tar.gz
hdf5-fcfecf9ff20c670eab5cce89700348a37da368a7.tar.bz2
[svn-r2680] Purpose:
Bug fix (ID 419) Description: Converted strings class types (in dataset and attributes) to HDF4 type of DFNT_INT8. Should have been DFNT_CHAR type. Solution: h5toh4.c: Changed the HDF4 type from DFNT_INT8 to DFNT_CHAR type. Converted all hdf5 strings (be it NULLTERM, NULLPAD, SPACEPAD) all to fixed width space padded HDF4 DFNT_CHAR. testh5toh4: Added the testing of $HDF_NOCLEANUP before cleaning away the result files. testfiles/Expected/tattr.hdf: testfiles/Expected/tstr.hdf: testfiles/Expected/tstr2.hdf: Updated with the corrected DFNT_CHAR type. Platforms tested: Solaris 2.7, Linux, Irix 6.5.
Diffstat (limited to 'tools')
-rw-r--r--tools/h5toh4.c6
-rw-r--r--tools/testfiles/Expected/tattr.hdfbin783 -> 783 bytes
-rw-r--r--tools/testfiles/Expected/tstr.hdfbin1429 -> 1429 bytes
-rw-r--r--tools/testfiles/Expected/tstr2.hdfbin4103 -> 4103 bytes
-rw-r--r--tools/testh5toh44
5 files changed, 6 insertions, 4 deletions
diff --git a/tools/h5toh4.c b/tools/h5toh4.c
index 228c33c..7182f8a 100644
--- a/tools/h5toh4.c
+++ b/tools/h5toh4.c
@@ -1175,7 +1175,7 @@ H5T_str_t strpad;
case H5T_STRING:
fxdlenstr = type;
- h4_type = DFNT_INT8;
+ h4_type = DFNT_CHAR;
if ((space = H5Aget_space(attr_id)) <= 0) {
fprintf(stderr, "Error: H5Dget_space() didn't return appropriate value.\n");
@@ -1214,7 +1214,7 @@ H5T_str_t strpad;
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_attr", __FILE__, __LINE__);
return strpad;
}
- if ((status = H5Tset_strpad(mem_type, strpad)) != SUCCEED ) {
+ if ((status = H5Tset_strpad(mem_type, H5T_STR_SPACEPAD)) != SUCCEED ) {
fprintf(stderr, "Error: Problem with H5Tset_strpad()\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_attr", __FILE__, __LINE__);
return status;
@@ -1954,7 +1954,7 @@ H5T_str_t strpad;
return status;
}
- h4_type = DFNT_INT8;
+ h4_type = DFNT_CHAR;
if ((mem_type = H5Tcopy(H5T_C_S1)) == FAIL ) {
fprintf(stderr, "Error: Problems translating h4 type to mem type\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_dataset_string", __FILE__, __LINE__);
diff --git a/tools/testfiles/Expected/tattr.hdf b/tools/testfiles/Expected/tattr.hdf
index cf1519a..36b2497 100644
--- a/tools/testfiles/Expected/tattr.hdf
+++ b/tools/testfiles/Expected/tattr.hdf
Binary files differ
diff --git a/tools/testfiles/Expected/tstr.hdf b/tools/testfiles/Expected/tstr.hdf
index 90b5694..5507e24 100644
--- a/tools/testfiles/Expected/tstr.hdf
+++ b/tools/testfiles/Expected/tstr.hdf
Binary files differ
diff --git a/tools/testfiles/Expected/tstr2.hdf b/tools/testfiles/Expected/tstr2.hdf
index 05328a0..dc4df5b 100644
--- a/tools/testfiles/Expected/tstr2.hdf
+++ b/tools/testfiles/Expected/tstr2.hdf
Binary files differ
diff --git a/tools/testh5toh4 b/tools/testh5toh4
index af224ff..7e4e0f2 100644
--- a/tools/testh5toh4
+++ b/tools/testh5toh4
@@ -295,5 +295,7 @@ if test $nerrors -eq 0 ; then
echo "All h5toh4 tests passed."
fi
-$RM -r $OUTDIR
+if test -z "$HDF5_NOCLEANUP"; then
+ $RM -r $OUTDIR
+fi
exit $nerrors