mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-13 16:47:58 +08:00
[svn-r946] Changes since 19981121
---------------------- ./src/H5Tconv.c With my poor eyesight I missed the definitions of SCHAR_MIN and SCHAR_MAX in <limits.h> and used CHAR_MIN and CHAR_MAX incorrectly. I changed all occurrences of the latter to the former and the new hardware integer type conversions now work on Irix. ./configure.in ./configure [REGENERATED] ./src/H5config.h.in [REGENERATED] ./src/H5private.h ./src/H5.c ./test/h5test.c Added a wrapper for HDsnprintf() that just calls sprintf() if snprintf() isn't available. ./MANIFEST Added Paul's new h5toh4 files.
This commit is contained in:
parent
9db8ce23f6
commit
0dfd13d13b
11
MANIFEST
11
MANIFEST
@ -357,43 +357,54 @@
|
||||
./tools/h5dump.c
|
||||
./tools/h5dump.h
|
||||
./tools/h5dumputil.c
|
||||
./tools/h5findshd.c
|
||||
./tools/h5import.c
|
||||
./tools/h5ls.c
|
||||
./tools/h5repart.c
|
||||
./tools/h5toh4.c
|
||||
./tools/h5toh4.h
|
||||
./tools/h5tools.c
|
||||
./tools/h5tools.h
|
||||
./tools/testh5dump.sh
|
||||
./tools/testh5toh4
|
||||
|
||||
./tools/testfiles/h5dumptst.c
|
||||
./tools/testfiles/tall-1.ddl
|
||||
./tools/testfiles/tall-2.ddl
|
||||
./tools/testfiles/tall-3.ddl
|
||||
./tools/testfiles/tall.dmp
|
||||
./tools/testfiles/tall.h5
|
||||
./tools/testfiles/tattr-1.ddl
|
||||
./tools/testfiles/tattr-2.ddl
|
||||
./tools/testfiles/tattr-3.ddl
|
||||
./tools/testfiles/tattr-4.ddl
|
||||
./tools/testfiles/tattr.dmp
|
||||
./tools/testfiles/tattr.h5
|
||||
./tools/testfiles/tcomp-1.ddl
|
||||
./tools/testfiles/tcomp-2.ddl
|
||||
./tools/testfiles/tcomp-3.ddl
|
||||
./tools/testfiles/tcomp-4.ddl
|
||||
./tools/testfiles/tcompound.dmp
|
||||
./tools/testfiles/tcompound.h5
|
||||
./tools/testfiles/tdset-1.ddl
|
||||
./tools/testfiles/tdset-2.ddl
|
||||
./tools/testfiles/tdset-3.ddl
|
||||
./tools/testfiles/tdset-4.ddl
|
||||
./tools/testfiles/tdset.dmp
|
||||
./tools/testfiles/tdset.h5
|
||||
./tools/testfiles/tgroup-1.ddl
|
||||
./tools/testfiles/tgroup-2.ddl
|
||||
./tools/testfiles/tgroup-3.ddl
|
||||
./tools/testfiles/tgroup.dmp
|
||||
./tools/testfiles/tgroup.h5
|
||||
./tools/testfiles/thlink-1.ddl
|
||||
./tools/testfiles/thlink-2.ddl
|
||||
./tools/testfiles/thlink-3.ddl
|
||||
./tools/testfiles/thlink-4.ddl
|
||||
./tools/testfiles/thlink-5.ddl
|
||||
./tools/testfiles/thlink.dmp
|
||||
./tools/testfiles/thlink.h5
|
||||
./tools/testfiles/tslink-1.ddl
|
||||
./tools/testfiles/tslink-2.ddl
|
||||
./tools/testfiles/tslink.dmp
|
||||
./tools/testfiles/tslink.h5
|
||||
|
2
README
2
README
@ -1,4 +1,4 @@
|
||||
This is hdf5-1.1.29 released on Sat Nov 21 04:26:08 CST 1998
|
||||
This is hdf5-1.1.32 released on Tue Nov 24 10:39:49 CST 1998
|
||||
Please refer to the INSTALL file for installation instructions.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
2
configure
vendored
2
configure
vendored
@ -3582,7 +3582,7 @@ else
|
||||
fi
|
||||
done
|
||||
|
||||
for ac_func in gettimeofday BSDgettimeofday difftime sigaction
|
||||
for ac_func in gettimeofday BSDgettimeofday difftime sigaction snprintf
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:3589: checking for $ac_func" >&5
|
||||
|
@ -358,7 +358,7 @@ dnl ----------------------------------------------------------------------
|
||||
dnl Check for functions.
|
||||
dnl
|
||||
AC_CHECK_FUNCS(getpwuid gethostname system getrusage fork waitpid)
|
||||
AC_CHECK_FUNCS(gettimeofday BSDgettimeofday difftime sigaction)
|
||||
AC_CHECK_FUNCS(gettimeofday BSDgettimeofday difftime sigaction snprintf)
|
||||
|
||||
AC_TRY_COMPILE([#include<sys/types.h>],
|
||||
[off64_t n = 0;],
|
||||
|
41
src/H5.c
41
src/H5.c
@ -436,6 +436,47 @@ H5close (void)
|
||||
return SUCCEED;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: HDsnprintf
|
||||
*
|
||||
* Purpose: Writes output to the string BUF under control of the format
|
||||
* FMT that specifies how subsequent arguments are converted for
|
||||
* output. It is similar to sprintf except that SIZE specifies
|
||||
* the maximum number of characters to produce. The trailing
|
||||
* null character is counted towards this limit, so you should
|
||||
* allocated at least SIZE characters for the string BUF.
|
||||
*
|
||||
* Note: This function is for compatibility on systems that don't have
|
||||
* snprintf(3). It doesn't actually check for overflow like the
|
||||
* real snprintf() would.
|
||||
*
|
||||
* Return: Success: Number of characters stored, not including
|
||||
* the terminating null. If this value equals
|
||||
* SIZE then there was not enough space in BUF
|
||||
* for all the output.
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, November 24, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
HDsnprintf(char *buf, size_t __unused__ size, const char *fmt, ...)
|
||||
{
|
||||
int n;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
n = vsprintf(buf, fmt, ap);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: HDfprintf
|
||||
|
@ -2023,7 +2023,7 @@ H5T_conv_uchar_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_char_short, FAIL);
|
||||
H5T_CONV_us(cdata, src_id, dst_id, buf, nelmts,
|
||||
unsigned char, signed char, CHAR_MAX);
|
||||
unsigned char, signed char, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -2481,7 +2481,7 @@ H5T_conv_short_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_short_char, FAIL);
|
||||
H5T_CONV_Ss(cdata, src_id, dst_id, buf, nelmts,
|
||||
short, signed char, CHAR_MIN, CHAR_MAX);
|
||||
short, signed char, SCHAR_MIN, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -2535,7 +2535,7 @@ H5T_conv_ushort_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_ushort_char, FAIL);
|
||||
H5T_CONV_Us(cdata, src_id, dst_id, buf, nelmts,
|
||||
unsigned short, signed char, CHAR_MAX);
|
||||
unsigned short, signed char, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -2965,7 +2965,7 @@ H5T_conv_int_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_int_char, FAIL);
|
||||
H5T_CONV_Ss(cdata, src_id, dst_id, buf, nelmts,
|
||||
int, signed char, CHAR_MIN, CHAR_MAX);
|
||||
int, signed char, SCHAR_MIN, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -3019,7 +3019,7 @@ H5T_conv_uint_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_uint_char, FAIL);
|
||||
H5T_CONV_Us(cdata, src_id, dst_id, buf, nelmts,
|
||||
unsigned, signed char, CHAR_MAX);
|
||||
unsigned, signed char, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -3450,7 +3450,7 @@ H5T_conv_long_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_long_char, FAIL);
|
||||
H5T_CONV_Ss(cdata, src_id, dst_id, buf, nelmts,
|
||||
long, signed char, CHAR_MIN, CHAR_MAX);
|
||||
long, signed char, SCHAR_MIN, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -3504,7 +3504,7 @@ H5T_conv_ulong_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_ulong_char, FAIL);
|
||||
H5T_CONV_Us(cdata, src_id, dst_id, buf, nelmts,
|
||||
unsigned long, signed char, CHAR_MAX);
|
||||
unsigned long, signed char, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -3936,7 +3936,7 @@ H5T_conv_llong_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_llong_char, FAIL);
|
||||
H5T_CONV_Ss(cdata, src_id, dst_id, buf, nelmts,
|
||||
long_long, signed char, CHAR_MIN, CHAR_MAX);
|
||||
long_long, signed char, SCHAR_MIN, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -3990,7 +3990,7 @@ H5T_conv_ullong_char(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
{
|
||||
FUNC_ENTER(H5T_conv_ullong_char, FAIL);
|
||||
H5T_CONV_Us(cdata, src_id, dst_id, buf, nelmts,
|
||||
unsigned long_long, signed char, CHAR_MAX);
|
||||
unsigned long_long, signed char, SCHAR_MAX);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
@ -173,6 +173,9 @@
|
||||
/* Define if you have the sigaction function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the system function. */
|
||||
#undef HAVE_SYSTEM
|
||||
|
||||
|
@ -595,6 +595,9 @@ int HDfprintf (FILE *stream, const char *fmt, ...);
|
||||
#define HDsin(X) sin(X)
|
||||
#define HDsinh(X) sinh(X)
|
||||
#define HDsleep(N) sleep(N)
|
||||
#ifdef HAVE_SNPRINTF
|
||||
# define HDsnprintf snprintf /*varargs*/
|
||||
#endif
|
||||
/* sprintf() variable arguments */
|
||||
#define HDsqrt(X) sqrt(X)
|
||||
#define HDsrand(N) srand(N)
|
||||
@ -662,9 +665,13 @@ int64_t HDstrtoll (const char *s, const char **rest, int base);
|
||||
/*
|
||||
* And now for a couple non-Posix functions...
|
||||
*/
|
||||
extern char *strdup(const char *s);
|
||||
char *strdup(const char *s);
|
||||
#define HDstrdup(S) strdup(S)
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
int HDsnprintf(char *buf, size_t size, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These macros check whether debugging has been requested for a certain
|
||||
* package at run-time. Code for debugging is conditionally compiled by
|
||||
|
@ -94,15 +94,15 @@ h5_cleanup(hid_t fapl)
|
||||
break; /*nothing to remove*/
|
||||
|
||||
case H5F_LOW_SPLIT:
|
||||
snprintf(temp, sizeof temp, "%s.raw", filename);
|
||||
HDsnprintf(temp, sizeof temp, "%s.raw", filename);
|
||||
remove(temp);
|
||||
snprintf(temp, sizeof temp, "%s.meta", filename);
|
||||
HDsnprintf(temp, sizeof temp, "%s.meta", filename);
|
||||
remove(temp);
|
||||
break;
|
||||
|
||||
case H5F_LOW_FAMILY:
|
||||
for (j=0; /*void*/; j++) {
|
||||
snprintf(temp, sizeof temp, filename, j);
|
||||
HDsnprintf(temp, sizeof temp, filename, j);
|
||||
if (access(temp, F_OK)<0) break;
|
||||
remove(temp);
|
||||
}
|
||||
@ -180,7 +180,7 @@ h5_fixname(const char *basename, hid_t fapl, char *fullname, size_t size)
|
||||
|
||||
/* Prepend the prefix value to the base name */
|
||||
if (prefix && *prefix) {
|
||||
if (snprintf(fullname, size, "%s/%s", prefix, basename)==(int)size) {
|
||||
if (HDsnprintf(fullname, size, "%s/%s", prefix, basename)==(int)size) {
|
||||
return NULL; /*buffer is too small*/
|
||||
}
|
||||
} else if (strlen(basename)>=size) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user