From a739b62eccb9748d7089d6db527fed7159ebe3b1 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 14 Jul 2009 12:04:04 -0500 Subject: [svn-r17182] In my last round of checkin (r17177), I forgot to clean up some code. I'm checking in the fix now. Another minor fix - The way that H5Tset_size checks whether the datatype is a string wasn't correct. I changed it to use the macro H5T_IS_STRING. Tested on jam, smirom, and linew. --- src/H5Odtype.c | 5 ----- src/H5T.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 47fdd7e..63b2aaf 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -520,15 +520,10 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p dt->shared->force_conv=TRUE; -#ifdef TMP /* Mark location this type as undefined for now. The caller function should * decide the location. */ if(H5T_set_loc(dt, f, H5T_LOC_BADLOC) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") -else - if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") -#endif break; case H5T_ARRAY: /* Array datatypes */ diff --git a/src/H5T.c b/src/H5T.c index a8b4fcd..4dd1984 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2120,7 +2120,7 @@ H5Tset_size(hid_t type_id, size_t size) HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") if(size <= 0 && size != H5T_VARIABLE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") - if(size == H5T_VARIABLE && dt->shared->type != H5T_STRING) + if(size == H5T_VARIABLE && !H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length") if(H5T_ENUM == dt->shared->type && dt->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") -- cgit v0.12