diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-01-09 21:22:30 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-01-09 21:22:30 (GMT) |
commit | 35bc545296209684a5c46db0cde11beb9403a4dc (patch) | |
tree | 98b5a037ed928085b98abc1fee71fc62f81073c1 /test/h5test.c | |
parent | 1290c4808d3e9890c765b1445f66b823c9026734 (diff) | |
download | hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.zip hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.gz hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.bz2 |
[svn-r3252] Purpose:
Code cleanup.
Description:
Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the
extra warnings. Including a few show-stoppers for compression on IRIX
machines.
Solution:
Changed lots of variables' types to more sensible and consistent types,
more range-checking, more variable typecasts, etc.
Platforms tested:
FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
Diffstat (limited to 'test/h5test.c')
-rw-r--r-- | test/h5test.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/test/h5test.c b/test/h5test.c index f8de21a..db4d59d 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -272,7 +272,38 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if (!base_name || !fullname || size<1) return NULL; -#ifndef H5_WANT_H5_V1_2_COMPAT +#ifdef H5_WANT_H5_V1_2_COMPAT + /* figure out the suffix */ + if (H5P_DEFAULT!=fapl){ + if ((driver=H5Pget_driver(fapl))<0) + return NULL; + if (H5F_LOW_FAMILY==driver) { + suffix = "%05d.h5"; + } else if (H5F_LOW_CORE==driver) { + suffix = NULL; + } + } + + /* Use different ones depending on parallel or serial driver used. */ + if (H5P_DEFAULT!=fapl && H5F_LOW_MPIO==driver){ + /* For parallel: + * First use command line option, then the environment variable, + * then try the constant + */ + prefix = (paraprefix ? paraprefix : getenv("HDF5_PARAPREFIX")); +#ifdef HDF5_PARAPREFIX + if (!prefix) prefix = HDF5_PARAPREFIX; +#endif + }else{ + /* For serial: + * First use the environment variable, then try the constant + */ + prefix = getenv("HDF5_PREFIX"); +#ifdef HDF5_PREFIX + if (!prefix) prefix = HDF5_PREFIX; +#endif + } +#else /* H5_WANT_H5_V1_2_COMPAT */ /* figure out the suffix */ if (H5P_DEFAULT!=fapl){ if ((driver=H5Pget_driver(fapl))<0) return NULL; @@ -307,7 +338,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* Prepend the prefix value to the base name */ if (prefix && *prefix) { - if (HDsnprintf(fullname, (long)size, "%s/%s", prefix, base_name)==(int)size) { + if (HDsnprintf(fullname, size, "%s/%s", prefix, base_name)==(int)size) { return NULL; /*buffer is too small*/ } } else if (strlen(base_name)>=size) { |