Cleans up POSIX/C bits in H5private.h (#804)

test/ros3.c and test/s3comms.c each had a 'FUNC' that needed to be
'__func__', missed in a previous merge.

* Cleans up POSIX/C bits in H5private.h

* Assume difftime exists (C89)
* Reorg AC_CHECK_HEADERS so headers are in alphabetical order
* Split off networking-related AC_CHECK_HEADERS
* Remove unused UNAME_CYGWIN from configure.ac
* Remove checks for unused sys/timeb.h
* Tidying pass over H5private.h HD prefix macros
* Tidy H5win32defs.h
* Add HD prefix to various scanf calls

* Committing clang-format changes

* Fixes to the alarm(2) code used in the tests to make Windows happy

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Dana Robinson
2021-06-28 21:59:25 -07:00
committed by Larry Knox
parent 443187860a
commit 641e6f7b4e
17 changed files with 602 additions and 620 deletions

View File

@@ -117,8 +117,6 @@ endif ()
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME)
# Find the library containing clock_gettime()
if (MINGW OR NOT WINDOWS)
CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)

View File

@@ -117,9 +117,6 @@
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
/* Define to 1 if you have the `difftime' function. */
#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@
/* Define if the direct I/O virtual file driver (VFD) should be compiled */
#cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@

View File

@@ -1212,11 +1212,9 @@ AC_CHECK_LIB([dl], [dlopen])
##
## Unix
AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h])
AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h])
AC_CHECK_HEADERS([features.h])
AC_CHECK_HEADERS([dirent.h])
AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h])
AC_CHECK_HEADERS([dirent.h features.h unistd.h])
AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/resource.h])
AC_CHECK_HEADERS([sys/stat.h sys/time.h sys/types.h])
## Darwin
AC_SUBST([H5_IS_DARWIN])
@@ -1229,20 +1227,17 @@ case $host_os in
esac
## Windows
## The winsock header is needed for gethostname
AC_CHECK_HEADERS([winsock2.h])
case "`uname`" in
CYGWIN*)
AC_CHECK_HEADERS([sys/timeb.h])
UNAME_CYGWIN="yes"
;;
MINGW*)
AC_CHECK_HEADERS([winsock2.h sys/timeb.h])
AC_HAVE_LIBRARY([ws2_32])
;;
*)
AC_CHECK_HEADERS([winsock2.h sys/timeb.h])
;;
esac
# Mirror VFD networking
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h])
## ----------------------------------------------------------------------
## Some platforms require that all symbols are resolved when a library
## is linked. We can use the -no-undefined flag to tell libtool that
@@ -1995,13 +1990,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
## NOTE: clock_gettime may require linking to the rt or posix4 library
## so we'll search for it before calling AC_CHECK_FUNCS.
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork])
AC_CHECK_FUNCS([alarm asprintf clock_gettime fcntl flock fork])
AC_CHECK_FUNCS([gethostname getrusage gettimeofday])
AC_CHECK_FUNCS([lstat rand_r random setsysinfo])
AC_CHECK_FUNCS([siglongjmp sigsetjmp sigprocmask])
AC_CHECK_FUNCS([srandom strdup symlink])
AC_CHECK_FUNCS([tmpfile asprintf vasprintf waitpid])
AC_CHECK_FUNCS([roundf lroundf llroundf round lround llround])
AC_CHECK_FUNCS([tmpfile vasprintf waitpid])
## ----------------------------------------------------------------------
## Check compiler characteristics

View File

@@ -4959,12 +4959,12 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
}
for (i = 0, nelms = 1; i < ndims; i++) {
if (fscanf(f, "%s %u", str, &j) && HDferror(f)) {
if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;
} /* end if */
if (fscanf(f, "%d", &n) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;
@@ -4982,7 +4982,7 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
}
for (j = 0; j < nelms; j++) {
if (fscanf(f, "%f", &val) < 0 && HDferror(f)) {
if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;

View File

@@ -580,11 +580,11 @@ test_generate(void)
!
*/
if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -615,7 +615,7 @@ test_generate(void)
goto out;
for (i = 0; i < n_elements; i++) {
if (fscanf(f, "%f ", &value) < 0 && HDferror(f)) {
if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -779,32 +779,32 @@ read_data(const char *fname, /*IN*/
goto out;
}
if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%d", &h) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
if (fscanf(f, "%d", &w) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -838,7 +838,7 @@ read_data(const char *fname, /*IN*/
/* Read data elements */
for (i = 0; i < n_elements; i++) {
if (fscanf(f, "%d", &n) < 0 && HDferror(f)) {
if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -936,7 +936,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
return -1;
}
if (sscanf(buffer, "%u", &nentries) != 1) {
if (HDsscanf(buffer, "%u", &nentries) != 1) {
HDfclose(file);
return -1;
}
@@ -950,7 +950,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
/* read the palette entries */
for (u = 0; u < nentries; u++) {
/* extract the red, green and blue color components. */
if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
HDfclose(file);
return -1;
}

View File

@@ -224,7 +224,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(float): {
float tmp_float = 0.0f;
sscanf(token, "%f", &tmp_float);
HDsscanf(token, "%f", &tmp_float);
HDmemcpy(cptr, &tmp_float, sizeof(float));
break;
}
@@ -232,7 +232,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(double): {
double tmp_double = 0.0;
sscanf(token, "%lf", &tmp_double);
HDsscanf(token, "%lf", &tmp_double);
HDmemcpy(cptr, &tmp_double, sizeof(double));
break;
}
@@ -240,7 +240,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(long double): {
long double tmp_ldouble = 0.0;
sscanf(token, "%Lg", &tmp_ldouble);
HDsscanf(token, "%Lg", &tmp_ldouble);
HDmemcpy(cptr, &tmp_ldouble, sizeof(long double));
break;
}
@@ -288,11 +288,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
signed char tmp_char = 0;
if (H5T_SGN_NONE == nsign) {
sscanf(token, "%hhu", &tmp_uchar);
HDsscanf(token, "%hhu", &tmp_uchar);
HDmemcpy(cptr, &tmp_uchar, sizeof(unsigned char));
}
else {
sscanf(token, "%hhd", &tmp_char);
HDsscanf(token, "%hhd", &tmp_char);
HDmemcpy(cptr, &tmp_char, sizeof(char));
}
@@ -304,11 +304,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
short tmp_short = 0;
if (H5T_SGN_NONE == nsign) {
sscanf(token, "%hu", &tmp_ushort);
HDsscanf(token, "%hu", &tmp_ushort);
HDmemcpy(&tmp_ushort, cptr, sizeof(unsigned short));
}
else {
sscanf(token, "%hd", &tmp_short);
HDsscanf(token, "%hd", &tmp_short);
HDmemcpy(&tmp_short, cptr, sizeof(short));
}
@@ -320,11 +320,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
int tmp_int = 0;
if (H5T_SGN_NONE == nsign) {
sscanf(token, "%u", &tmp_uint);
HDsscanf(token, "%u", &tmp_uint);
HDmemcpy(cptr, &tmp_uint, sizeof(unsigned int));
}
else {
sscanf(token, "%d", &tmp_int);
HDsscanf(token, "%d", &tmp_int);
HDmemcpy(cptr, &tmp_int, sizeof(int));
}
@@ -337,11 +337,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
long tmp_long = 0;
if (H5T_SGN_NONE == nsign) {
sscanf(token, "%lu", &tmp_ulong);
HDsscanf(token, "%lu", &tmp_ulong);
HDmemcpy(cptr, &tmp_ulong, sizeof(unsigned long));
}
else {
sscanf(token, "%ld", &tmp_long);
HDsscanf(token, "%ld", &tmp_long);
HDmemcpy(cptr, &tmp_long, sizeof(long));
}
@@ -354,11 +354,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
long long tmp_llong = 0;
if (H5T_SGN_NONE == nsign) {
sscanf(token, fmt_ullong, &tmp_ullong);
HDsscanf(token, fmt_ullong, &tmp_ullong);
HDmemcpy(cptr, &tmp_ullong, sizeof(unsigned long long));
}
else {
sscanf(token, fmt_llong, &tmp_llong);
HDsscanf(token, fmt_llong, &tmp_llong);
HDmemcpy(cptr, &tmp_llong, sizeof(long long));
}

File diff suppressed because it is too large Load Diff

View File

@@ -29,23 +29,35 @@
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
#define HDaccess(F, M) _access(F, M)
#define HDchdir(S) _chdir(S)
#define HDclose(F) _close(F)
#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M)
#define HDdup(F) _dup(F)
#define HDfdopen(N, S) _fdopen(N, S)
#define HDfileno(F) _fileno(F)
#define HDfstat(F, B) _fstati64(F, B)
#define HDisatty(F) _isatty(F)
#ifdef H5_HAVE_VISUAL_STUDIO
#define HDgetcwd(S, Z) _getcwd(S, Z)
#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z)
#define HDgetdrive() _getdrive()
#define HDlseek(F, O, W) _lseeki64(F, O, W)
#define HDlstat(S, B) _lstati64(S, B)
#define HDmkdir(S, M) _mkdir(S)
#define HDoff_t __int64
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* H5_HAVE_VISUAL_STUDIO */
#define HDaccess(F, M) _access(F, M)
#define HDchdir(S) _chdir(S)
#define HDclose(F) _close(F)
#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M)
#define HDdup(F) _dup(F)
#define HDfdopen(N, S) _fdopen(N, S)
#define HDfileno(F) _fileno(F)
#define HDflock(F, L) Wflock(F, L)
#define HDfstat(F, B) _fstati64(F, B)
#define HDgetcwd(S, Z) _getcwd(S, Z)
#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z)
#define HDgetdrive() _getdrive()
#define HDgetlogin() Wgetlogin()
#define HDgettimeofday(V, Z) Wgettimeofday(V, Z)
#define HDisatty(F) _isatty(F)
#define HDlseek(F, O, W) _lseeki64(F, O, W)
#define HDlstat(S, B) _lstati64(S, B)
#define HDmemset(X, C, Z) memset((void *)(X), C, Z) /* Cast avoids MSVC warning */
#define HDmkdir(S, M) _mkdir(S)
#define HDoff_t __int64
/* Note that the variadic HDopen macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
@@ -55,9 +67,11 @@ typedef __int64 h5_stat_size_t;
#else
#define HDopen(S, F, ...) Wopen_utf8(S, F, ##__VA_ARGS__)
#endif
#define HDread(F, M, Z) _read(F, M, Z)
#define HDremove(S) Wremove_utf8(S)
#define HDrmdir(S) _rmdir(S)
#define HDsetenv(N, V, O) Wsetenv(N, V, O)
#define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, (Z > 1 ? Z : 2))
#define HDsleep(S) Sleep(S * 1000)
#define HDstat(S, B) _stati64(S, B)
@@ -66,21 +80,13 @@ typedef __int64 h5_stat_size_t;
#define HDstrtok_r(X, Y, Z) strtok_s(X, Y, Z)
#define HDtzset() _tzset()
#define HDunlink(S) _unlink(S)
#define HDunsetenv(N, V, O) Wsetenv(N, "", 1)
#define HDwrite(F, M, Z) _write(F, M, Z)
#ifdef H5_HAVE_VISUAL_STUDIO
/*
* The (void*) cast just avoids a compiler warning in MSVC
*/
#define HDmemset(X, C, Z) memset((void *)(X), C, Z)
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* H5_HAVE_VISUAL_STUDIO */
#ifndef H5_HAVE_MINGW
#define HDftruncate(F, L) _chsize_s(F, L)
#define HDfseek(F, O, W) _fseeki64(F, O, W)
#endif /* H5_HAVE_MINGW */
#ifdef __cplusplus
extern "C" {
@@ -98,16 +104,4 @@ H5_DLL int H5_get_win32_times(H5_timevals_t *tvs);
}
#endif /* __cplusplus */
#define HDgettimeofday(V, Z) Wgettimeofday(V, Z)
#define HDsetenv(N, V, O) Wsetenv(N, V, O)
#define HDflock(F, L) Wflock(F, L)
#define HDgetlogin() Wgetlogin()
/* Non-POSIX functions */
#ifndef H5_HAVE_MINGW
#define HDftruncate(F, L) _chsize_s(F, L)
#define HDfseek(F, O, W) _fseeki64(F, O, W)
#endif /* H5_HAVE_MINGW */
#endif /* H5_HAVE_WIN32_API */

View File

@@ -162,12 +162,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
goto error; \
}
/*
* Alarm definitions to wait up (terminate) a test that runs too long.
*/
/* Number of seconds to wait before killing a test (requires alarm(2)) */
#define H5_ALARM_SEC 1200 /* default is 20 minutes */
#define ALARM_ON TestAlarmOn()
#define ALARM_OFF HDalarm(0)
/* Flags for h5_fileaccess_flags() */
#define H5_FILEACCESS_VFD 0x01

View File

@@ -106,7 +106,7 @@
*/
#define JSFAILED_AT() \
{ \
HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------

View File

@@ -96,7 +96,7 @@
*/
#define JSFAILED_AT() \
{ \
HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------

View File

@@ -320,9 +320,9 @@ PerformTests(void)
MESSAGE(5, ("===============================================\n"));
Test[Loop].NumErrors = num_errs;
Test_parameters = Test[Loop].Parameters;
ALARM_ON;
TestAlarmOn();
Test[Loop].Call();
ALARM_OFF;
TestAlarmOff();
Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors;
MESSAGE(5, ("===============================================\n"));
MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors));
@@ -620,12 +620,15 @@ SetTest(const char *testname, int action)
}
}
/*
* Enable alarm on test execution, configurable by environment variable
/* Enable a test timer that will kill long-running tests, the time is configurable
* via an environment variable.
*
* Only useful on POSIX systems where alarm(2) is present.
*/
void
TestAlarmOn(void)
{
#ifdef H5_HAVE_ALARM
char * env_val = HDgetenv("HDF5_ALARM_SECONDS"); /* Alarm environment */
unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */
@@ -635,4 +638,15 @@ TestAlarmOn(void)
/* Set the number of seconds before alarm goes off */
HDalarm((unsigned)alarm_sec);
#endif
}
/* Disable the test timer */
void
TestAlarmOff(void)
{
#ifdef H5_HAVE_ALARM
/* Set the number of seconds to zero */
HDalarm(0);
#endif
}

View File

@@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
if (fscanf(strm, "%hd", &temp16) != 1) {
if (HDfscanf(strm, "%hd", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in16++) {
if (fscanf(strm, "%hd", in16) != 1) {
if (HDfscanf(strm, "%hd", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in32++) {
if (fscanf(strm, "%d", in32) != 1) {
if (HDfscanf(strm, "%d", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -595,7 +595,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in64++) {
if (fscanf(strm, "%s", buffer) < 1) {
if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -664,7 +664,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
if (fscanf(strm, "%hu", &temp16) != 1) {
if (HDfscanf(strm, "%hu", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -693,7 +693,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in16++) {
if (fscanf(strm, "%hu", in16) != 1) {
if (HDfscanf(strm, "%hu", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -729,7 +729,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in32++) {
if (fscanf(strm, "%u", in32) != 1) {
if (HDfscanf(strm, "%u", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -766,7 +766,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in64++) {
if (fscanf(strm, "%s", buffer) < 1) {
if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -832,7 +832,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp32++) {
if (fscanf(strm, "%f", fp32) != 1) {
if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -845,7 +845,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp32++) {
if (fscanf(strm, "%f", fp32) != 1) {
if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -884,7 +884,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp64++) {
if (fscanf(strm, "%lf", fp64) != 1) {
if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -897,7 +897,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp64++) {
if (fscanf(strm, "%lf", fp64) != 1) {
if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1469,16 +1469,16 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
scanret = fscanf(strm, "%254s", key);
scanret = HDfscanf(strm, "%254s", key);
if ((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
scanret = fscanf(strm, "%254s", temp); /* filename */
scanret = fscanf(strm, "%254s", temp); /* start bracket */
scanret = fscanf(strm, "%254s", key); /* DATASET */
scanret = HDfscanf(strm, "%254s", temp); /* filename */
scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
scanret = HDfscanf(strm, "%254s", key); /* DATASET */
while (scanret == 1) {
if (!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
@@ -1488,7 +1488,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1500,7 +1500,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
in->configOptionVector[PATH] = 1;
scanret = fscanf(strm, "%254s", temp); /* start bracket */
scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASET %s found\n", temp);
#endif
@@ -1514,7 +1514,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1550,20 +1550,20 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING found\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* string properties */
if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
while (get_next_prop) {
if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1582,8 +1582,8 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
}
else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1591,8 +1591,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
else if (!HDstrcmp("CSET", key)) { /* CSET */
if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */
else if (!HDstrcmp("CSET", key)) { /* CSET */
if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1600,8 +1600,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1609,7 +1609,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1628,7 +1628,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE key\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1644,14 +1644,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1662,7 +1662,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1672,7 +1672,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1716,7 +1716,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1728,7 +1728,7 @@ processConfigurationFile(char *infile, struct Input *in)
(hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) {
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1742,7 +1742,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1762,7 +1762,7 @@ processConfigurationFile(char *infile, struct Input *in)
char *more = temp;
in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10);
}
if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1793,7 +1793,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
scanret = fscanf(strm, "%254s", temp); /* end bracket */
scanret = HDfscanf(strm, "%254s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
@@ -1808,14 +1808,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1827,7 +1827,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n");
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1838,7 +1838,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int icount = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1848,7 +1848,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10);
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1880,7 +1880,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */
if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1888,7 +1888,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if (!HDstrcmp("SIZE", temp)) { /* SIZE */
if (fscanf(strm, "%d", (&ival)) != 1) {
if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1897,7 +1897,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
while (HDstrcmp("}", temp) != 0) {
if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1912,14 +1912,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS key\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1930,28 +1930,28 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */
if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%d", (&ival)) != 1) {
if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1959,7 +1959,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1981,7 +1981,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->configOptionVector[COMPRESS] = 0;
}
if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1995,14 +1995,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET key\n");
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2012,7 +2012,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_prop) {
if (!HDstrcmp("COUNT", temp)) { /* COUNT */
int icount = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2023,7 +2023,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2033,7 +2033,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2068,7 +2068,7 @@ processConfigurationFile(char *infile, struct Input *in)
} /* if(!HDstrcmp("COUNT", temp)) COUNT */
if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */
int icount = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2079,7 +2079,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2089,7 +2089,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2122,7 +2122,7 @@ processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("BLOCK", temp)) BLOCK */
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2141,7 +2141,7 @@ processConfigurationFile(char *infile, struct Input *in)
scanret = 0;
break;
}
scanret = fscanf(strm, "%254s", key);
scanret = HDfscanf(strm, "%254s", key);
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump path");
@@ -2182,7 +2182,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2199,7 +2199,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2226,7 +2226,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5a, infile);
goto error;
}
if (fscanf(strm, "%254d", (&ival)) != 1) {
if (HDfscanf(strm, "%254d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -2423,7 +2423,7 @@ processConfigurationFile(char *infile, struct Input *in)
default:
break;
}
scanret = fscanf(strm, "%254s", key);
scanret = HDfscanf(strm, "%254s", key);
}
/*
@@ -2602,7 +2602,7 @@ getOutputClass(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output class.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for output size.\n";
if (fscanf(strm, "%d", (&ival)) != 1) {
if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3502,7 +3502,7 @@ getInputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for input byte-order.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3524,7 +3524,7 @@ getRank(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for rank.\n";
if (fscanf(strm, "%d", (&ival)) != 1) {
if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3553,7 +3553,7 @@ getDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
while (fscanf(strm, "%llu", (&ullval)) == 1)
while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfDimension[i++] = ullval;
if (in->rank != i) {
@@ -3579,7 +3579,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
while (fscanf(strm, "%llu", (&ullval)) == 1)
while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfChunk[i++] = ullval;
if (in->rank != i) {
@@ -3612,7 +3612,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
while (fscanf(strm, "%lld", (&llval)) == 1) {
while (HDfscanf(strm, "%lld", (&llval)) == 1) {
if (llval == -1)
in->maxsizeOfDimension[i++] = H5S_UNLIMITED;
else
@@ -3642,7 +3642,7 @@ getOutputArchitecture(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output architecture.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3675,7 +3675,7 @@ getOutputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output byte-order.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3708,7 +3708,7 @@ getCompressionType(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for compression.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3750,7 +3750,7 @@ getCompressionParameter(struct Input *in, FILE *strm)
switch (in->compressionType) {
case 0: /* GZIP */
if (fscanf(strm, "%d", (&ival)) != 1) {
if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3774,7 +3774,7 @@ getExternalFilename(struct Input *in, FILE *strm)
char temp[255];
const char *err1 = "Unable to get 'string' value.\n";
if (fscanf(strm, "%254s", temp) != 1) {
if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}

View File

@@ -337,7 +337,7 @@ read_info(const char *filename, pack_opt_t *options)
/* cycle until end of file reached */
while (1) {
if (EOF == fscanf(fp, "%9s", stype))
if (EOF == HDfscanf(fp, "%9s", stype))
break;
/* Info indicator must be for layout or filter */
@@ -352,7 +352,7 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -364,7 +364,7 @@ read_info(const char *filename, pack_opt_t *options)
c = '0';
/* go until end */
while (c != ' ') {
if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;

View File

@@ -109,7 +109,7 @@ main(int argc, const char *argv[])
filename = HDstrdup(argv[H5_optind]);
size = 0;
if (EOF == (res = sscanf(nbytes, "%u", &size))) {
if (EOF == (res = HDsscanf(nbytes, "%u", &size))) {
/* fail */
error_msg("missing file name\n");
usage(h5tools_getprogname());

View File

@@ -90,27 +90,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
#ifdef H5_HAVE_DIFFTIME
#define HDdifftime(X, Y) difftime(X, Y)
#else
#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
#endif
#define HDdiv(X, Y) div(X, Y)
#define HDdup(F) dup(F)
#define HDdup2(F, I) dup2(F, I)
/* execl() variable arguments */
/* execle() variable arguments */
/* execlp() variable arguments */
#define HDexecv(S, AV) execv(S, AV)
#define HDexecve(S, AV, E) execve(S, AV, E)
#define HDexecvp(S, AV) execvp(S, AV)
#define HDexit(N) exit(N)
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
#define HDdifftime(X, Y) difftime(X, Y)
#define HDdiv(X, Y) div(X, Y)
#define HDdup(F) dup(F)
#define HDdup2(F, I) dup2(F, I)
#define HDexecv(S, AV) execv(S, AV)
#define HDexecve(S, AV, E) execve(S, AV, E)
#define HDexecvp(S, AV) execvp(S, AV)
#define HDexit(N) exit(N)
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)

View File

@@ -105,27 +105,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
#ifdef H5_HAVE_DIFFTIME
#define HDdifftime(X, Y) difftime(X, Y)
#else
#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
#endif
#define HDdiv(X, Y) div(X, Y)
#define HDdup(F) dup(F)
#define HDdup2(F, I) dup2(F, I)
/* execl() variable arguments */
/* execle() variable arguments */
/* execlp() variable arguments */
#define HDexecv(S, AV) execv(S, AV)
#define HDexecve(S, AV, E) execve(S, AV, E)
#define HDexecvp(S, AV) execvp(S, AV)
#define HDexit(N) exit(N)
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
#define HDdifftime(X, Y) difftime(X, Y)
#define HDdiv(X, Y) div(X, Y)
#define HDdup(F) dup(F)
#define HDdup2(F, I) dup2(F, I)
#define HDexecv(S, AV) execv(S, AV)
#define HDexecve(S, AV, E) execve(S, AV, E)
#define HDexecvp(S, AV) execvp(S, AV)
#define HDexit(N) exit(N)
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)