summaryrefslogtreecommitdiffstats
path: root/src/H5Tenum.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-13 19:31:33 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-13 19:31:33 (GMT)
commit324cd9d1e28824d4f686809b21e3d41deb1bf515 (patch)
tree26ba64ea19947af4a9933ceb479af5005137686e /src/H5Tenum.c
parent4a4f9cd82d950fb752587125cb2a011d14ec2223 (diff)
downloadhdf5-324cd9d1e28824d4f686809b21e3d41deb1bf515.zip
hdf5-324cd9d1e28824d4f686809b21e3d41deb1bf515.tar.gz
hdf5-324cd9d1e28824d4f686809b21e3d41deb1bf515.tar.bz2
[svn-r7616] Purpose:
Code cleanup Description: Change field member count and indices for compound and enumerated types from 'int' to 'unsigned' to better reflect actual use. Cleaned up a few other minor compiler warnings, etc. Platforms tested: FreeBSD 4.9 (sleipnir) Linux 2.4 (verbena) too minor to require h5committest
Diffstat (limited to 'src/H5Tenum.c')
-rw-r--r--src/H5Tenum.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index 95c514f..56ac80d 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -220,7 +220,7 @@ done:
herr_t
H5T_enum_insert(H5T_t *dt, const char *name, void *value)
{
- int i;
+ unsigned i;
char **names=NULL;
uint8_t *values=NULL;
herr_t ret_value=SUCCEED; /* Return value */
@@ -280,9 +280,17 @@ done:
*
*-------------------------------------------------------------------------
*/
+#ifdef H5_WANT_H5_V1_6_COMPAT
herr_t
-H5Tget_member_value(hid_t type, int membno, void *value/*out*/)
+H5Tget_member_value(hid_t type, int _membno, void *value/*out*/)
+#else /* H5_WANT_H5_V1_6_COMPAT */
+herr_t
+H5Tget_member_value(hid_t type, unsigned membno, void *value/*out*/)
+#endif /* H5_WANT_H5_V1_6_COMPAT */
{
+#ifdef H5_WANT_H5_V1_6_COMPAT
+ unsigned membno = (unsigned)_membno;
+#endif /* H5_WANT_H5_V1_6_COMPAT */
H5T_t *dt=NULL;
herr_t ret_value=SUCCEED; /* Return value */
@@ -293,7 +301,7 @@ H5Tget_member_value(hid_t type, int membno, void *value/*out*/)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
if (H5T_ENUM!=dt->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
- if (membno<0 || membno>=dt->u.enumer.nmembs)
+ if (membno>=dt->u.enumer.nmembs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number");
if (!value)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null value buffer");
@@ -324,7 +332,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_get_member_value(H5T_t *dt, int membno, void *value/*out*/)
+H5T_get_member_value(H5T_t *dt, unsigned membno, void *value/*out*/)
{
herr_t ret_value=SUCCEED; /* Return value */