diff options
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2633,7 +2633,7 @@ H5Tset_size(hid_t type_id, size_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive"); if (size == H5T_VARIABLE && dt->type!=H5T_STRING) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length"); - if ((H5T_ENUM==dt->type && dt->u.enumer.nmembs>0) || (H5T_COMPOUND==dt->type && dt->u.compnd.nmembs>0)) + if ((H5T_ENUM==dt->type && dt->u.enumer.nmembs>0)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined"); if (H5T_REFERENCE==dt->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype"); @@ -3328,7 +3328,7 @@ H5T_create(H5T_class_t type, size_t size) dt->type = type; if (NULL==(dt->parent=H5T_copy(H5I_object(subtype), H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy base data type"); - break; + break; case H5T_VLEN: /* Variable length datatype */ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, NULL, "base type required - use H5Tvlen_create()"); @@ -3953,10 +3953,12 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_TIME: case H5T_BITFIELD: case H5T_OPAQUE: - case H5T_COMPOUND: /* nothing to check */ break; - + case H5T_COMPOUND: + if(size>dt->size) + dt->size = size; + break; case H5T_STRING: /* Convert string to variable-length datatype */ if(size==H5T_VARIABLE) { |