summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-06-10 21:04:58 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-06-10 21:04:58 (GMT)
commit67449f5c65efa0b1b2d17288a2387259ccd651d2 (patch)
tree3a92ecb1e88510650275f8d47e5c2283b75a4ca3 /src/H5Tconv.c
parentb6f348df6ea4bd829f8f2bf249d8fad5a6691bf0 (diff)
downloadhdf5-67449f5c65efa0b1b2d17288a2387259ccd651d2.zip
hdf5-67449f5c65efa0b1b2d17288a2387259ccd651d2.tar.gz
hdf5-67449f5c65efa0b1b2d17288a2387259ccd651d2.tar.bz2
[svn-r7021] Purpose: bug fix
Description: H5Tget_native_type fails for multiple kinds of datatype on Cray; it fails fix-length string type, too. Platforms tested: Cray, h5committest
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r--src/H5Tconv.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 13a6737..92f6fa3 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1885,12 +1885,12 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
H5MM_xfree(priv->src2dst);
priv->src2dst = map;
HGOTO_DONE(SUCCEED);
- } else {
- /* Sort source type by value and adjust src2dst[] appropriately */
- H5T_sort_value(src, priv->src2dst);
}
}
+ /* Sort source type by value and adjust src2dst[] appropriately */
+ H5T_sort_value(src, priv->src2dst);
+
done:
if (ret_value<0 && priv) {
H5MM_xfree(priv->src2dst);
@@ -1976,15 +1976,12 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
assert (H5T_ENUM==src->type);
assert (H5T_ENUM==dst->type);
- if (priv->length) {
- /* Use O(1) lookup */
- H5T_sort_name(src, NULL);
- H5T_sort_name(dst, NULL);
- } else {
- /* Use O(log N) lookup */
- H5T_sort_value(src, NULL); /*yes, by value*/
- H5T_sort_name(dst, NULL); /*yes, by name*/
- }
+ /* priv->src2dst map was computed for certain sort keys. Make sure those same
+ * sort keys are used here during conversion. See H5T_conv_enum_init(). But
+ * we actually don't care about the source type's order when doing the O(1)
+ * conversion algorithm, which is turned on by non-zero priv->length */
+ H5T_sort_name(dst, NULL);
+ if (!priv->length) H5T_sort_value(src, NULL);
/*
* Direction of conversion.