diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-06-29 04:59:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 04:59:25 (GMT) |
commit | 4ff544f9977da3bd54eac03cc124961eea7c4daf (patch) | |
tree | d23a3d50fbeb2c1eca882db4d48726173f25097c /hl | |
parent | 734d317da9c759799c92ff47e05e3be7e3e969a9 (diff) | |
download | hdf5-4ff544f9977da3bd54eac03cc124961eea7c4daf.zip hdf5-4ff544f9977da3bd54eac03cc124961eea7c4daf.tar.gz hdf5-4ff544f9977da3bd54eac03cc124961eea7c4daf.tar.bz2 |
Cleans up POSIX/C bits in H5private.h (#804)
* 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>
Diffstat (limited to 'hl')
-rw-r--r-- | hl/test/test_ds.c | 6 | ||||
-rw-r--r-- | hl/test/test_image.c | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 786aba8..8c6ef91 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -4964,12 +4964,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; @@ -4987,7 +4987,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; diff --git a/hl/test/test_image.c b/hl/test/test_image.c index dc1be96..81340c1 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -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; } |