changeset 1877:e1ea3f6f3301

Fix miget_attr_type() so it can return MI_TYPE_FLOAT or MI_TYPE_INT
author bert <bert>
date Wed, 01 Sep 2004 19:20:28 +0000
parents 32bb54fe1f4c
children 42c2994a82fe
files libsrc2/grpattr.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libsrc2/grpattr.c
+++ b/libsrc2/grpattr.c
@@ -540,11 +540,19 @@
     hdf_type = H5Aget_type(hdf_attr);
     switch (H5Tget_class(hdf_type)) {
     case H5T_FLOAT:
-	*data_type = MI_TYPE_DOUBLE;
+        if (H5Tget_size(hdf_type) == sizeof(float)) {
+            *data_type = MI_TYPE_FLOAT;
+        }
+        else {
+            *data_type = MI_TYPE_DOUBLE;
+        }
         break;
     case H5T_STRING:
 	*data_type = MI_TYPE_STRING;
         break;
+    case H5T_INTEGER:
+        *data_type = MI_TYPE_INT;
+        break;
     default:
 	return (MI_ERROR);
     }