From fd56a593b7928da636b2494b25cd7478fed78c29 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 29 Jun 2023 08:19:31 -0700 Subject: Remove HD from C std lib file ops (#3206) * HDfclose * HDferror * HDfeof * HDfflush * HDfopen * HDfread * HDfwrite --- hl/c++/test/ptableTest.cpp | 16 +++--- src/H5.c | 4 +- src/H5Clog_json.c | 4 +- src/H5Clog_trace.c | 4 +- src/H5Dmpio.c | 8 +-- src/H5FDhdfs.c | 2 +- src/H5FDlog.c | 4 +- src/H5FDmirror.c | 4 +- src/H5FDros3.c | 2 +- src/H5FDs3comms.c | 42 ++++++++-------- src/H5FDsplitter.c | 10 ++-- src/H5FDsubfiling/H5FDioc.c | 8 +-- src/H5FDsubfiling/H5FDioc_threads.c | 4 +- src/H5FDsubfiling/H5subfiling_common.c | 32 ++++++------ src/H5Rint.c | 2 +- src/H5Tref.c | 2 +- src/H5private.h | 21 -------- src/H5trace.c | 2 +- test/API/testhdf5.h | 12 ++--- test/API/tmisc.c | 26 +++++----- test/big.c | 18 +++---- test/cmpd_dset.c | 2 +- test/direct_chunk.c | 2 +- test/dt_arith.c | 38 +++++++------- test/dtypes.c | 6 +-- test/err_compat.c | 4 +- test/external.c | 4 +- test/flush1.c | 4 +- test/flushrefresh.c | 10 ++-- test/h5test.c | 40 +++++++-------- test/h5test.h | 14 +++--- test/hdfs.c | 18 +++---- test/hyperslab.c | 14 +++--- test/mirror_vfd.c | 2 +- test/objcopy.c | 2 +- test/onion.c | 14 +++--- test/ros3.c | 28 +++++------ test/s3comms.c | 8 +-- test/swmr_reader.c | 2 +- test/swmr_start_write.c | 2 +- test/swmr_writer.c | 2 +- test/testmeta.c | 2 +- test/tmisc.c | 26 +++++----- test/twriteorder.c | 2 +- test/vfd.c | 12 ++--- testpar/API/testphdf5.c | 2 +- testpar/t_cache.c | 8 +-- testpar/t_cache_image.c | 6 +-- testpar/t_filters_parallel.c | 90 ++++++++++++++++----------------- testpar/t_pflush1.c | 14 +++--- testpar/t_subfiling_vfd.c | 92 +++++++++++++++++----------------- testpar/testphdf5.c | 2 +- tools/lib/h5tools.c | 38 +++++++------- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_error.h | 6 +-- tools/libtest/h5tools_test_utils.c | 2 +- tools/src/h5diff/ph5diff_main.c | 4 +- tools/src/h5import/h5import.c | 34 ++++++------- tools/src/h5jam/h5jam.c | 2 +- tools/src/h5jam/h5unjam.c | 12 ++--- tools/src/h5perf/pio_perf.c | 2 +- tools/src/h5perf/sio_perf.c | 4 +- tools/src/h5repack/h5repack_main.c | 12 ++--- tools/src/h5stat/h5stat.c | 2 +- tools/test/h5import/h5importtest.c | 82 +++++++++++++++--------------- tools/test/h5jam/getub.c | 2 +- tools/test/h5jam/tellub.c | 2 +- tools/test/misc/h5repart_gentest.c | 2 +- tools/test/misc/talign.c | 2 +- tools/test/perform/iopipe.c | 14 +++--- tools/test/perform/zip_perf.c | 2 +- utils/mirror_vfd/mirror_remote.c | 6 +-- utils/tools/h5dwalk/h5dwalk.c | 8 +-- 73 files changed, 459 insertions(+), 480 deletions(-) diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 2a77a9e..746fa09 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -81,7 +81,7 @@ BasicTest() int error; printf("Testing %-62s", "basic functionality"); - HDfflush(stdout); + fflush(stdout); FL_PacketTable wrapper(fileID, H5P_DEFAULT, BASICTEST_PT, H5T_NATIVE_INT, 1); if (!wrapper.IsValid()) @@ -139,7 +139,7 @@ TestCompoundDatatype() int error; printf("Testing %-62s", "compound datatypes"); - HDfflush(stdout); + fflush(stdout); /* Create compound datatype */ typedef struct { @@ -210,7 +210,7 @@ TestGetNext() int i; printf("Testing %-62s", "GetNextPacket"); - HDfflush(stdout); + fflush(stdout); /* Create a dataset */ FL_PacketTable wrapper(fileID, H5P_DEFAULT, GETNEXT_PT, H5T_NATIVE_INT, 500); @@ -277,7 +277,7 @@ TestCompress() size_t cd_nelemts = 0; printf("Testing %-62s", "compression"); - HDfflush(stdout); + fflush(stdout); try { /* Prepare property list to set compression, randomly use deflate */ DSetCreatPropList dscreatplist; @@ -326,7 +326,7 @@ TestGetPacket() int theRecs[3]; int i; printf("Testing %-62s", "GetPacket"); - HDfflush(stdout); + fflush(stdout); /* Create a dataset. Does not need to specify property list because there is no compression. */ @@ -365,7 +365,7 @@ int TestErrors() { printf("Testing %-62s", "error conditions"); - HDfflush(stdout); + fflush(stdout); /* Create a dataset */ FL_PacketTable wrapper(fileID, PT_TESTERROR, H5T_NATIVE_INT, 1); @@ -484,7 +484,7 @@ int SystemTest() { printf("Testing %-62s", "multiple datatypes"); - HDfflush(stdout); + fflush(stdout); hid_t dtypeID1, dtypeID2; hsize_t count; @@ -626,7 +626,7 @@ TestHDFFV_9758() } printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)"); - HDfflush(stdout); + fflush(stdout); // Build a compound datatype compound_type = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); diff --git a/src/H5.c b/src/H5.c index caa5636..54e6f17 100644 --- a/src/H5.c +++ b/src/H5.c @@ -488,7 +488,7 @@ H5_term_library(void) H5_debug_open_stream_t *tmp_open_stream; tmp_open_stream = H5_debug_g.open_stream; - (void)HDfclose(H5_debug_g.open_stream->stream); + (void)fclose(H5_debug_g.open_stream->stream); H5_debug_g.open_stream = H5_debug_g.open_stream->next; (void)H5MM_free(tmp_open_stream); } /* end while */ @@ -753,7 +753,7 @@ H5__debug_mask(const char *s) if (NULL == (open_stream = (H5_debug_open_stream_t *)H5MM_malloc(sizeof(H5_debug_open_stream_t)))) { - (void)HDfclose(stream); + (void)fclose(stream); return; } /* end if */ diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index b2542a9..39ba0ed 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -249,7 +249,7 @@ H5C__log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mp HDsnprintf(file_name, n_chars, "RANK_%d.%s", mpi_rank, log_location); /* Open log file and set it to be unbuffered */ - if (NULL == (json_udata->outfile = HDfopen(file_name, "w"))) + if (NULL == (json_udata->outfile = fopen(file_name, "w"))) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "can't create mdc log file") HDsetbuf(json_udata->outfile, NULL); @@ -303,7 +303,7 @@ H5C__json_tear_down_logging(H5C_log_info_t *log_info) H5MM_xfree(json_udata->message); /* Close log file */ - if (EOF == HDfclose(json_udata->outfile)) + if (EOF == fclose(json_udata->outfile)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "problem closing mdc log file") json_udata->outfile = NULL; diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index be07fa4..91ce691 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -244,7 +244,7 @@ H5C__log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int m HDsnprintf(file_name, n_chars, "%s.%d", log_location, mpi_rank); /* Open log file and set it to be unbuffered */ - if (NULL == (trace_udata->outfile = HDfopen(file_name, "w"))) + if (NULL == (trace_udata->outfile = fopen(file_name, "w"))) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "can't create mdc log file") HDsetbuf(trace_udata->outfile, NULL); @@ -301,7 +301,7 @@ H5C__trace_tear_down_logging(H5C_log_info_t *log_info) H5MM_xfree(trace_udata->message); /* Close log file */ - if (EOF == HDfclose(trace_udata->outfile)) + if (EOF == fclose(trace_udata->outfile)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "problem closing mdc log file") trace_udata->outfile = NULL; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index ea4d9a4..dd474cc 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -433,7 +433,7 @@ static FILE *debug_stream = NULL; do { \ if (debug_stream && H5D_MPIO_DEBUG_THIS_RANK(rank)) { \ fprintf(debug_stream, "%*s(Rank %d) " string "\n", debug_indent, "", rank); \ - HDfflush(debug_stream); \ + fflush(debug_stream); \ } \ } while (0) @@ -442,7 +442,7 @@ static FILE *debug_stream = NULL; do { \ if (debug_stream && H5D_MPIO_DEBUG_THIS_RANK(rank)) { \ fprintf(debug_stream, "%*s(Rank %d) " string "\n", debug_indent, "", rank, __VA_ARGS__); \ - HDfflush(debug_stream); \ + fflush(debug_stream); \ } \ } while (0) @@ -1145,7 +1145,7 @@ H5D__piece_io(H5D_io_info_t *io_info) HDsnprintf(debug_log_filename, 1024, "H5Dmpio_debug.rank%d", mpi_rank); - if (NULL == (debug_log_file = HDfopen(debug_log_filename, "a"))) + if (NULL == (debug_log_file = fopen(debug_log_filename, "a"))) HGOTO_ERROR(H5E_IO, H5E_OPENERROR, FAIL, "couldn't open debugging log file") /* Print a short header for this I/O operation */ @@ -1357,7 +1357,7 @@ done: /* Close debugging log file */ if (debug_log_file) { fprintf(debug_log_file, "##############\n\n"); - if (EOF == HDfclose(debug_log_file)) + if (EOF == fclose(debug_log_file)) HDONE_ERROR(H5E_IO, H5E_CLOSEERROR, FAIL, "couldn't close debugging log file") debug_stream = H5DEBUG(D); } diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 00b9b92..ad08e42 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -1158,7 +1158,7 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) br_val, br_suffix, /* raw data bytes */ am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* raw data average */ - HDfflush(stream); + fflush(stream); } done: diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 6dc76cb..cb04903 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -599,7 +599,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Set the log file pointer */ if (fa->logfile) - file->logfp = HDfopen(fa->logfile, "w"); + file->logfp = fopen(fa->logfile, "w"); else file->logfp = stderr; @@ -797,7 +797,7 @@ H5FD__log_close(H5FD_t *_file) if (file->fa.flags & H5FD_LOG_FLAVOR) file->flavor = (unsigned char *)H5MM_xfree(file->flavor); if (file->logfp != stderr) - HDfclose(file->logfp); + fclose(file->logfp); } /* end if */ if (file->fa.logfile) diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index b6997e4..a7baff0 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -122,7 +122,7 @@ typedef struct H5FD_mirror_t { /* end partial line */ \ fprintf(stdout, "\n"); \ fprintf(stdout, "```\n"); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define LOG_XMIT_BYTES(label, buf, len) /* no-op */ @@ -132,7 +132,7 @@ typedef struct H5FD_mirror_t { #define LOG_OP_CALL(name) \ do { \ printf("called %s()\n", (name)); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define LOG_OP_CALL(name) /* no-op */ diff --git a/src/H5FDros3.c b/src/H5FDros3.c index ad9825c..2804ef4 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -1048,7 +1048,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* raw data average */ - HDfflush(stream); + fflush(stream); } done: diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 5d958b5..b3e1620 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -229,7 +229,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) fprintf(stdout, "{%s}\n->", node_ptr->cat); printf("(null)\n"); - HDfflush(stdout); + fflush(stdout); node_ptr = NULL; #endif @@ -302,7 +302,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("CREATE NEW\n"); - HDfflush(stdout); + fflush(stdout); #endif /******************* * CREATE NEW LIST * @@ -333,7 +333,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) if (value == NULL) { #if S3COMMS_DEBUG printf("REMOVE HEAD\n"); - HDfflush(stdout); + fflush(stdout); #endif /*************** * REMOVE HEAD * @@ -343,39 +343,39 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) #if S3COMMS_DEBUG printf("FREEING CAT (node)\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(node_ptr->cat); #if S3COMMS_DEBUG printf("FREEING LOWERNAME (node)\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(node_ptr->lowername); #if S3COMMS_DEBUG printf("FREEING NAME (node)\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(node_ptr->name); #if S3COMMS_DEBUG printf("FREEING VALUE (node)\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(node_ptr->value); #if S3COMMS_DEBUG printf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO"); - HDfflush(stdout); + fflush(stdout); #endif assert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC); node_ptr->magic += 1ul; #if S3COMMS_DEBUG printf("FREEING POINTER\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(node_ptr); #if S3COMMS_DEBUG printf("FREEING WORKING LOWERNAME\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(lowername); lowername = NULL; @@ -383,7 +383,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("MODIFY HEAD\n"); - HDfflush(stdout); + fflush(stdout); #endif /*************** * MODIFY HEAD * @@ -413,7 +413,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("PREPEND NEW HEAD\n"); - HDfflush(stdout); + fflush(stdout); #endif /******************* * INSERT NEW HEAD * @@ -442,7 +442,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("APPEND A NODE\n"); - HDfflush(stdout); + fflush(stdout); #endif /******************* * APPEND NEW NODE * @@ -465,7 +465,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("INSERT A NODE\n"); - HDfflush(stdout); + fflush(stdout); #endif /******************* * INSERT NEW NODE * @@ -494,7 +494,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) #if S3COMMS_DEBUG printf("REMOVE A NODE\n"); - HDfflush(stdout); + fflush(stdout); #endif H5MM_xfree(tmp->cat); H5MM_xfree(tmp->lowername); @@ -511,7 +511,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) else { #if S3COMMS_DEBUG printf("MODIFY A NODE\n"); - HDfflush(stdout); + fflush(stdout); #endif /***************** * MODIFY A NODE * @@ -2077,12 +2077,12 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char * if (ret < 0 || (size_t)ret >= 128) HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path") - credfile = HDfopen(filepath, "r"); + credfile = fopen(filepath, "r"); if (credfile != NULL) { if (H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out, secret_access_key_out, aws_region_out) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials") - if (HDfclose(credfile) == EOF) + if (fclose(credfile) == EOF) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file") credfile = NULL; } /* end if credential file opened */ @@ -2090,14 +2090,14 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char * ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config"); if (ret < 0 || (size_t)ret >= 128) HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path") - credfile = HDfopen(filepath, "r"); + credfile = fopen(filepath, "r"); if (credfile != NULL) { if (H5FD__s3comms_load_aws_creds_from_file( credfile, profile_name, (*key_id_out == 0) ? key_id_out : NULL, (*secret_access_key_out == 0) ? secret_access_key_out : NULL, (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config") - if (HDfclose(credfile) == EOF) + if (fclose(credfile) == EOF) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file") credfile = NULL; } /* end if credential file opened */ @@ -2108,7 +2108,7 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char * done: if (credfile != NULL) - if (HDfclose(credfile) == EOF) + if (fclose(credfile) == EOF) HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 70a3caf..c33f083 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -90,7 +90,7 @@ typedef struct H5FD_splitter_t { #define H5FD_SPLITTER_LOG_CALL(name) \ do { \ printf("called %s()\n", (name)); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -849,7 +849,7 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha */ if (!file_ptr->logfp) { if (file_ptr->fa.log_file_path[0] != '\0') { - file_ptr->logfp = HDfopen(file_ptr->fa.log_file_path, "w"); + file_ptr->logfp = fopen(file_ptr->fa.log_file_path, "w"); if (file_ptr->logfp == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open log file") } /* end if logfile path given */ @@ -880,7 +880,7 @@ done: if (file_ptr->wo_file) H5FD_close(file_ptr->wo_file); if (file_ptr->logfp) - HDfclose(file_ptr->logfp); + fclose(file_ptr->logfp); H5FL_FREE(H5FD_splitter_t, file_ptr); } } /* end if error */ @@ -924,7 +924,7 @@ H5FD__splitter_close(H5FD_t *_file) "unable to close W/O file") if (file->logfp) { - HDfclose(file->logfp); + fclose(file->logfp); file->logfp = NULL; } @@ -1580,7 +1580,7 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const ret_value = FAIL; else if (size < (size_t)HDsnprintf(s, size + 1, "%s: %s\n", atfunc, msg)) ret_value = FAIL; - else if (size != HDfwrite(s, 1, size, file->logfp)) + else if (size != fwrite(s, 1, size, file->logfp)) ret_value = FAIL; H5MM_free(s); } diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 1cc4f87..7baa334 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -92,7 +92,7 @@ typedef struct H5FD_ioc_t { #define H5FD_IOC_LOG_CALL(name) \ do { \ printf("called %s()\n", (name)); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define H5FD_IOC_LOG_CALL(name) /* no-op */ @@ -1498,7 +1498,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) HDsnprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, prefix_env ? prefix_env : file_dirname, base_filename, (uint64_t)st.st_ino); - if (NULL == (config_file = HDfopen(tmp_filename, "r"))) { + if (NULL == (config_file = fopen(tmp_filename, "r"))) { if (ENOENT == errno) { #ifdef H5FD_IOC_DEBUG printf("** WARNING: couldn't delete Subfiling configuration file '%s'\n", tmp_filename); @@ -1518,7 +1518,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) n_subfiles = (int32_t)read_n_subfiles; /* Delete the Subfiling configuration file */ - if (EOF == HDfclose(config_file)) { + if (EOF == fclose(config_file)) { config_file = NULL; H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close subfiling config file"); @@ -1555,7 +1555,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) done: if (config_file) - if (EOF == HDfclose(config_file)) + if (EOF == fclose(config_file)) H5_SUBFILING_DONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close subfiling config file"); /* Set up a barrier (don't want processes to run ahead of the delete) */ diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index fad5cf6..84831e1 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -196,7 +196,7 @@ initialize_ioc_threads(void *_sf_context) #ifdef H5FD_IOC_DEBUG if (sf_context->topology->ioc_idx == 0) { printf("%s: time = %lf seconds\n", __func__, (t_end - t_start)); - HDfflush(stdout); + fflush(stdout); } #endif @@ -1178,7 +1178,7 @@ ioc_file_truncate(sf_work_request_t *msg) #ifdef H5FD_IOC_DEBUG printf("[ioc(%d) %s]: truncated subfile to %lld bytes. ret = %d\n", ioc_idx, __func__, (long long)length, errno); - HDfflush(stdout); + fflush(stdout); #endif done: diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 5c8d366..17cde45 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -673,7 +673,7 @@ H5_open_subfiles(const char *base_filename, uint64_t file_id, H5FD_subfiling_par HDsnprintf(sf_context->sf_logfile_name, PATH_MAX, "%s.log.%d", sf_context->h5_filename, mpi_rank); - if (NULL == (sf_context->sf_logfile = HDfopen(sf_context->sf_logfile_name, "a"))) + if (NULL == (sf_context->sf_logfile = fopen(sf_context->sf_logfile_name, "a"))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't open subfiling debug logfile"); @@ -903,7 +903,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param *context_id_out = context_id; done: - if (config_file && (EOF == HDfclose(config_file))) + if (config_file && (EOF == fclose(config_file))) H5_SUBFILING_DONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "couldn't close subfiling configuration file"); @@ -2305,7 +2305,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c int n_subfiles = sf_context->sf_num_subfiles; int num_digits; - if (NULL == (config_file = HDfopen(config_filename, "w+"))) + if (NULL == (config_file = fopen(config_filename, "w+"))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't create/truncate subfiling configuration file"); @@ -2315,31 +2315,31 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c /* Write the subfiling stripe size to the configuration file */ HDsnprintf(line_buf, PATH_MAX, "stripe_size=%" PRId64 "\n", sf_context->sf_stripe_size); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); /* Write the number of I/O concentrators to the configuration file */ HDsnprintf(line_buf, PATH_MAX, "aggregator_count=%d\n", sf_context->topology->n_io_concentrators); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); /* Write the number of subfiles to the configuration file */ HDsnprintf(line_buf, PATH_MAX, "subfile_count=%d\n", n_subfiles); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); /* Write the base HDF5 filename to the configuration file */ HDsnprintf(line_buf, PATH_MAX, "hdf5_file=%s\n", sf_context->h5_filename); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); /* Write the optional subfile directory prefix to the configuration file */ HDsnprintf(line_buf, PATH_MAX, "subfile_dir=%s\n", subfile_dir); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); @@ -2349,7 +2349,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c HDsnprintf(line_buf, PATH_MAX, H5FD_SUBFILING_FILENAME_TEMPLATE "\n", base_filename, sf_context->h5_file_id, num_digits, k + 1, n_subfiles); - if (HDfwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) + if (fwrite(line_buf, HDstrlen(line_buf), 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "failed to write to subfiling configuration file"); } @@ -2357,7 +2357,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c done: if (config_file) { - if (EOF == HDfclose(config_file)) + if (EOF == fclose(config_file)) H5_SUBFILING_DONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "couldn't close subfiling configuration file"); } @@ -2426,7 +2426,7 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't check existence of subfiling configuration file"); - if (NULL == (config_file = HDfopen(config_filename, mode))) + if (NULL == (config_file = fopen(config_filename, mode))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't open subfiling configuration file"); @@ -2434,7 +2434,7 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil done: if (ret_value < 0) { - if (config_file && (EOF == HDfclose(config_file))) + if (config_file && (EOF == fclose(config_file))) H5_SUBFILING_DONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "couldn't close subfiling configuration file"); } @@ -2482,7 +2482,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for reading from subfiling configuration file"); - if (HDfread(config_buf, (size_t)config_file_len, 1, config_file) != 1) + if (fread(config_buf, (size_t)config_file_len, 1, config_file) != 1) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "couldn't read from subfiling configuration file"); @@ -2797,7 +2797,7 @@ H5_close_subfiles(int64_t subfiling_context_id, MPI_Comm file_comm) H5_subfiling_log(sf_context->sf_context_id, "\n-- LOGGING FINISH - %s", asctime(tm)); - HDfclose(sf_context->sf_logfile); + fclose(sf_context->sf_logfile); sf_context->sf_logfile = NULL; } #endif @@ -3129,12 +3129,12 @@ H5_subfiling_log(int64_t sf_context_id, const char *fmt, ...) if (sf_context->sf_logfile) { HDvfprintf(sf_context->sf_logfile, fmt, log_args); HDfputs("\n", sf_context->sf_logfile); - HDfflush(sf_context->sf_logfile); + fflush(sf_context->sf_logfile); } else { HDvprintf(fmt, log_args); HDputs(""); - HDfflush(stdout); + fflush(stdout); } H5FD_ioc_end_thread_exclusive(); diff --git a/src/H5Rint.c b/src/H5Rint.c index 9b56b10..2d7f893 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -94,7 +94,7 @@ fprintf(stdout, " # %s(): ", __func__); \ fprintf(stdout, __VA_ARGS__); \ fprintf(stdout, "\n"); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) static const char * H5R__print_token(const H5O_token_t token) diff --git a/src/H5Tref.c b/src/H5Tref.c index 37b3604..aac3634 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -49,7 +49,7 @@ fprintf(stdout, " # %s(): ", __func__); \ fprintf(stdout, __VA_ARGS__); \ fprintf(stdout, "\n"); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define H5T_REF_LOG_DEBUG(...) \ diff --git a/src/H5private.h b/src/H5private.h index 0d1671c..a062ae7 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -650,21 +650,9 @@ typedef off_t h5_stat_size_t; #ifndef HDfabsl #define HDfabsl(X) fabsl(X) #endif -#ifndef HDfclose -#define HDfclose(F) fclose(F) -#endif #ifndef HDfdopen #define HDfdopen(N, S) fdopen(N, S) #endif -#ifndef HDfeof -#define HDfeof(F) feof(F) -#endif -#ifndef HDferror -#define HDferror(F) ferror(F) -#endif -#ifndef HDfflush -#define HDfflush(F) fflush(F) -#endif #ifndef HDfgetc #define HDfgetc(F) fgetc(F) #endif @@ -703,18 +691,12 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDfloor #define HDfloor(X) floor(X) #endif -#ifndef HDfopen -#define HDfopen(S, M) fopen(S, M) -#endif #ifndef HDfputc #define HDfputc(C, F) fputc(C, F) #endif #ifndef HDfputs #define HDfputs(S, F) fputs(S, F) #endif -#ifndef HDfread -#define HDfread(M, Z, N, F) fread(M, Z, N, F) -#endif #ifndef HDfrexp #define HDfrexp(X, N) frexp(X, N) #endif @@ -739,9 +721,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDftruncate #define HDftruncate(F, L) ftruncate(F, L) #endif -#ifndef HDfwrite -#define HDfwrite(M, Z, N, F) fwrite(M, Z, N, F) -#endif #ifndef HDgetc #define HDgetc(F) getc(F) #endif diff --git a/src/H5trace.c b/src/H5trace.c index 4f81736..60632de 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -4087,7 +4087,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) H5RS_acat(rs, ")"); } HDfputs(H5RS_get_str(rs), out); - HDfflush(out); + fflush(out); H5RS_decr(rs); if (H5_debug_g.ttimes) diff --git a/test/API/testhdf5.h b/test/API/testhdf5.h index e4aaacd..bfcf320 100644 --- a/test/API/testhdf5.h +++ b/test/API/testhdf5.h @@ -211,32 +211,32 @@ #define TESTING(WHAT) \ { \ printf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define TESTING_2(WHAT) \ { \ printf(" Testing %-60s", WHAT); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define PASSED() \ { \ HDputs(" PASSED"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define H5_FAILED() \ { \ HDputs("*FAILED*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define H5_WARNING() \ { \ HDputs("*WARNING*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define SKIPPED() \ { \ HDputs(" -SKIP-"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define PUTS_ERROR(s) \ { \ diff --git a/test/API/tmisc.c b/test/API/tmisc.c index eb827a2..a7faae7 100644 --- a/test/API/tmisc.c +++ b/test/API/tmisc.c @@ -2397,35 +2397,35 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char HDmemcpy(user_block, str, HDstrlen(str)); /* Open the new file */ - new_fp = HDfopen(new_name, "wb"); - CHECK_PTR(new_fp, "HDfopen"); + new_fp = fopen(new_name, "wb"); + CHECK_PTR(new_fp, "fopen"); /* Write the user block to the new file */ - written = HDfwrite(user_block, (size_t)1, size, new_fp); - VERIFY(written, size, "HDfwrite"); + written = fwrite(user_block, (size_t)1, size, new_fp); + VERIFY(written, size, "fwrite"); /* Open the old file */ - old_fp = HDfopen(old_name, "rb"); - CHECK_PTR(old_fp, "HDfopen"); + old_fp = fopen(old_name, "rb"); + CHECK_PTR(old_fp, "fopen"); /* Allocate space for the copy buffer */ copy_buf = malloc((size_t)MISC13_COPY_BUF_SIZE); CHECK_PTR(copy_buf, "malloc"); /* Copy data from the old file to the new file */ - while ((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { + while ((read_in = fread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { /* Write the data to the new file */ - written = HDfwrite(copy_buf, (size_t)1, read_in, new_fp); - VERIFY(written, read_in, "HDfwrite"); + written = fwrite(copy_buf, (size_t)1, read_in, new_fp); + VERIFY(written, read_in, "fwrite"); } /* Close the old file */ - ret = HDfclose(old_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(old_fp); + VERIFY(ret, 0, "fclose"); /* Close the new file */ - ret = HDfclose(new_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(new_fp); + VERIFY(ret, 0, "fclose"); /* Free the copy buffer */ free(copy_buf); diff --git a/test/big.c b/test/big.c index ef6bd5f..fa556ae 100644 --- a/test/big.c +++ b/test/big.c @@ -324,7 +324,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) hid_t file = -1, space1 = -1, space2 = -1, mem_space = -1, d1 = -1, d2 = -1; int *buf = (int *)malloc(sizeof(int) * WRT_SIZE); int i, j; - FILE *out = HDfopen(DNAME, "w"); + FILE *out = fopen(DNAME, "w"); hid_t dcpl; switch (testsize) { @@ -427,7 +427,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) if (H5Fclose(file) < 0) goto error; free(buf); - HDfclose(out); + fclose(out); PASSED(); return 0; @@ -445,7 +445,7 @@ error: if (buf) free(buf); if (out) - HDfclose(out); + fclose(out); return 1; } @@ -475,7 +475,7 @@ reader(char *filename, hid_t fapl) int i, j, zero, wrong, nerrors = 0; /* Open script file */ - script = HDfopen(DNAME, "r"); + script = fopen(DNAME, "r"); /* Open HDF5 file */ if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) @@ -498,7 +498,7 @@ reader(char *filename, hid_t fapl) i = (int)strtol(ln + 1, &s, 10); hs_offset[0] = strtoull(s, NULL, 0); fprintf(stdout, "#%03d 0x%016" PRIxHSIZE "%47s", i, hs_offset[0], ""); - HDfflush(stdout); + fflush(stdout); if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) FAIL_STACK_ERROR; @@ -535,7 +535,7 @@ reader(char *filename, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR; free(buf); - HDfclose(script); + fclose(script); return nerrors; @@ -551,7 +551,7 @@ error: if (buf) free(buf); if (script) - HDfclose(script); + fclose(script); return 1; } @@ -649,12 +649,12 @@ quit: /* Clean up the test file */ h5_clean_files(FILENAME, fapl); HDremove(DNAME); - HDfflush(stdout); + fflush(stdout); return 0; error: HDputs("*** TEST FAILED ***"); - HDfflush(stdout); + fflush(stdout); return 1; } /* end test_stdio() */ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 0c7f77c..e97bb3b 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -1669,7 +1669,7 @@ error: for (_i = 0; _i < PACK_NMEMBS; _i++) \ printf(" %d", order[_i]); \ printf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \ - HDfflush(stdout); \ + fflush(stdout); \ goto error; \ } diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 6bf1202..bdcd9f6 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -2333,7 +2333,7 @@ main(void) need_comma = TRUE; } /* end if */ printf(":\n"); - HDfflush(stdout); + fflush(stdout); nerrors += test_single_chunk(config); } /* end for */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 9da4118..3a14817 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -758,7 +758,7 @@ test_particular_fp_integer(void) return 0; error: - HDfflush(stdout); + fflush(stdout); H5E_BEGIN_TRY { H5Pclose(dxpl_id); @@ -977,7 +977,7 @@ test_derived_flt(void) HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); H5_FAILED(); } printf(" test %u elmt %u: \n", 1, (unsigned)i); @@ -1146,7 +1146,7 @@ test_derived_flt(void) HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); H5_FAILED(); } printf(" test %u elmt %u: \n", 1, (unsigned)i); @@ -1212,7 +1212,7 @@ error: free(saved_buf); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); H5E_BEGIN_TRY { H5Tclose(tid1); @@ -1462,7 +1462,7 @@ test_derived_integer(void) HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); H5_FAILED(); } printf(" test %u elmt %u: \n", 1, (unsigned)i); @@ -1524,7 +1524,7 @@ error: free(buf); if (saved_buf) free(saved_buf); - HDfflush(stdout); + fflush(stdout); H5E_BEGIN_TRY { H5Tclose(tid1); @@ -1700,7 +1700,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) else { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); fails_this_test = 0; } @@ -2573,7 +2573,7 @@ done: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -2589,7 +2589,7 @@ error: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -2622,7 +2622,7 @@ test_conv_int_2(void) char *buf; printf("%-70s", "Testing overlap calculations"); - HDfflush(stdout); + fflush(stdout); buf = (char *)calloc(TMP_BUF_DIM1, TMP_BUF_DIM2); assert(buf); @@ -2822,8 +2822,8 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) * fork here and let the child run the test and return the number of * failures with the exit status. */ - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); if ((child_pid = fork()) < 0) { HDperror("fork"); return 1; @@ -2931,7 +2931,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) dst_type_name); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); fails_this_test = 0; } @@ -3302,7 +3302,7 @@ done: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) exit(MIN((int)fails_all_tests, 254)); @@ -3331,7 +3331,7 @@ error: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) exit(MIN(MAX((int)fails_all_tests, 1), 254)); @@ -3572,7 +3572,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_LLONG == src_type || INT_ULLONG == src_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); fails_this_test = 0; } else { @@ -3586,7 +3586,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); - HDfflush(stdout); + fflush(stdout); fails_this_test = 0; } @@ -4522,7 +4522,7 @@ done: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -4542,7 +4542,7 @@ error: aligned_free(saved); if (aligned) free(aligned); - HDfflush(stdout); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); diff --git a/test/dtypes.c b/test/dtypes.c index 7d2b4ef..3fd66e1 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -5071,7 +5071,7 @@ test_conv_str_2(void) /* Do the conversions */ HDsnprintf(s, sizeof(s), "Testing random string conversion speed"); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); if (H5Tconvert(c_type, f_type, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; if (H5Tconvert(f_type, c_type, nelmts, buf, NULL, H5P_DEFAULT) < 0) @@ -5285,14 +5285,14 @@ test_conv_enum_1(void) /* Conversions */ HDsnprintf(s, sizeof(s), "Testing random enum conversion O(N)"); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); if (H5Tconvert(t1, t2, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; PASSED(); HDsnprintf(s, sizeof(s), "Testing random enum conversion O(N log N)"); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); if (H5Tconvert(t2, t1, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error; PASSED(); diff --git a/test/err_compat.c b/test/err_compat.c index 5f6378f..155abc6 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -219,7 +219,7 @@ test_error_compat(void) /* Add a newline and flush so the output file looks nicer */ printf("\n"); - HDfflush(stdout); + fflush(stdout); /* Create the dataspace */ dims[0] = DIM0; @@ -352,7 +352,7 @@ test_h5epush1(hid_t file) /* Add a newline and flush so the output file looks nicer */ printf("\n"); - HDfflush(stdout); + fflush(stdout); /* Create the dataspace */ dims[0] = DIM0; diff --git a/test/external.c b/test/external.c index 5412469..41e759c 100644 --- a/test/external.c +++ b/test/external.c @@ -483,12 +483,12 @@ add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, h for (i = 0; i < n_external_files; i++) { if (HDsnprintf(exname, AEF_EXNAME_MAX_LEN, "ext%d.data", i + 1) > AEF_EXNAME_MAX_LEN) { fprintf(stderr, "External file %d overflows name buffer\n", i + 1); - HDfflush(stderr); + fflush(stderr); return -1; } if (H5Pset_external(dcpl_id, exname, offset, max_ext_size) < 0) { fprintf(stderr, "Problem adding external file %s\n", exname); - HDfflush(stderr); + fflush(stderr); return -1; } } diff --git a/test/flush1.c b/test/flush1.c index 575031c..81d0b7d 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -315,8 +315,8 @@ main(void) printf("NOTE: Some tests were skipped since the current VFD lacks SWMR support\n"); /* Flush console output streams */ - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); /* DO NOT CLOSE FILE ID! */ if (H5Pclose(fapl_id) < 0) diff --git a/test/flushrefresh.c b/test/flushrefresh.c index a2a284c..e044c56 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -70,10 +70,10 @@ static FILE *errorfile; #define ERRFILE "flushrefresh_ERROR" #define PROCESS_ERROR \ { \ - errorfile = HDfopen(ERRFILE, "w+"); \ + errorfile = fopen(ERRFILE, "w+"); \ fprintf(errorfile, "Error occurred in flushrefresh.\n"); \ - HDfflush(errorfile); \ - HDfclose(errorfile); \ + fflush(errorfile); \ + fclose(errorfile); \ TEST_ERROR; \ } @@ -1385,8 +1385,8 @@ check_for_errors(void) { FILE *file; - if ((file = HDfopen(ERRFILE, "r"))) { - HDfclose(file); + if ((file = fopen(ERRFILE, "r"))) { + fclose(file); HDremove(ERRFILE); return FAIL; } /* end if */ diff --git a/test/h5test.c b/test/h5test.c index d7a4116..4a47f99 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -330,8 +330,8 @@ h5_restore_err(void) void h5_reset(void) { - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); H5close(); /* Save current error stack reporting routine and redirect to our local one */ @@ -360,8 +360,8 @@ h5_reset(void) void h5_test_init(void) { - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); H5close(); /* Save current error stack reporting routine and redirect to our local one */ @@ -1595,7 +1595,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) FILE *signalfile = NULL; /* Create signal file (which will send signal to some other process) */ - signalfile = HDfopen(TMP_SIGNAL_FILE, "w+"); + signalfile = fopen(TMP_SIGNAL_FILE, "w+"); /* Write messages to signal file, if provided */ if (arg2 != NULL) { @@ -1611,7 +1611,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) assert(arg2 == NULL); } /* end else */ - HDfclose(signalfile); + fclose(signalfile); HDrename(TMP_SIGNAL_FILE, send); } /* h5_send_message() */ @@ -1655,7 +1655,7 @@ h5_wait_message(const char *waitfor) HDtime(&t0); /* Wait for return signal from some other process */ - while ((returnfile = HDfopen(waitfor, "r")) == NULL) { + while ((returnfile = fopen(waitfor, "r")) == NULL) { /* make note of current time. */ HDtime(&t1); @@ -1669,7 +1669,7 @@ h5_wait_message(const char *waitfor) } /* end if */ } /* end while */ - HDfclose(returnfile); + fclose(returnfile); HDunlink(waitfor); return SUCCEED; @@ -1905,13 +1905,13 @@ h5_compare_file_bytes(char *f1name, char *f2name) int ret_value = 0; /* for error handling */ /* Open files for reading */ - f1ptr = HDfopen(f1name, "rb"); + f1ptr = fopen(f1name, "rb"); if (f1ptr == NULL) { fprintf(stderr, "Unable to fopen() %s\n", f1name); ret_value = -1; goto done; } - f2ptr = HDfopen(f2name, "rb"); + f2ptr = fopen(f2name, "rb"); if (f2ptr == NULL) { fprintf(stderr, "Unable to fopen() %s\n", f2name); ret_value = -1; @@ -1936,11 +1936,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) HDrewind(f1ptr); HDrewind(f2ptr); for (ii = 0; ii < f1size; ii++) { - if (HDfread(&f1char, 1, 1, f1ptr) != 1) { + if (fread(&f1char, 1, 1, f1ptr) != 1) { ret_value = -1; goto done; } - if (HDfread(&f2char, 1, 1, f2ptr) != 1) { + if (fread(&f2char, 1, 1, f2ptr) != 1) { ret_value = -1; goto done; } @@ -1953,9 +1953,9 @@ h5_compare_file_bytes(char *f1name, char *f2name) done: if (f1ptr) - HDfclose(f1ptr); + fclose(f1ptr); if (f2ptr) - HDfclose(f2ptr); + fclose(f2ptr); return ret_value; } /* end h5_compare_file_bytes() */ @@ -2045,7 +2045,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) max_buf = 4096 * sizeof(char); - orig_ptr = HDfopen(orig, "rb"); + orig_ptr = fopen(orig, "rb"); if (NULL == orig_ptr) { ret_value = -1; goto done; @@ -2055,7 +2055,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) fsize = (hsize_t)HDftell(orig_ptr); HDrewind(orig_ptr); - dest_ptr = HDfopen(dest, "wb"); + dest_ptr = fopen(dest, "wb"); if (NULL == dest_ptr) { ret_value = -1; goto done; @@ -2069,20 +2069,20 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - if (HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + if (fread(dup_buf, read_size, 1, orig_ptr) != 1) { ret_value = -1; goto done; } - HDfwrite(dup_buf, read_size, 1, dest_ptr); + fwrite(dup_buf, read_size, 1, dest_ptr); fsize -= read_size; read_size = MIN(fsize, max_buf); } done: if (orig_ptr != NULL) - HDfclose(orig_ptr); + fclose(orig_ptr); if (dest_ptr != NULL) - HDfclose(dest_ptr); + fclose(dest_ptr); if (dup_buf != NULL) free(dup_buf); return ret_value; diff --git a/test/h5test.h b/test/h5test.h index 3382eb4..ce6a0ea 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -105,36 +105,36 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ #define TESTING(WHAT) \ do { \ printf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_run_g++; \ } while (0) #define TESTING_2(WHAT) \ do { \ printf(" Testing %-60s", WHAT); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_run_g++; \ } while (0) #define PASSED() \ do { \ HDputs(" PASSED"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_passed_g++; \ } while (0) #define H5_FAILED() \ do { \ HDputs("*FAILED*"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_failed_g++; \ } while (0) #define H5_WARNING() \ do { \ HDputs("*WARNING*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #define SKIPPED() \ do { \ HDputs(" -SKIP-"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_skipped_g++; \ } while (0) #define PUTS_ERROR(s) \ @@ -176,7 +176,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ do { \ printf("Testing %-62s", WHAT); \ HDputs(""); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) /* diff --git a/test/hdfs.c b/test/hdfs.c index c5704a1..bf9e432 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -413,7 +413,7 @@ test_fapl_config_validation(void) TESTING("HDFS fapl configuration validation"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -621,7 +621,7 @@ test_hdfs_fapl(void) TESTING("HDFS fapl "); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -707,7 +707,7 @@ test_vfd_open(void) TESTING("HDFS VFD-level open"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -963,7 +963,7 @@ test_eof_eoa(void) TESTING("HDFS eof/eoa gets and sets"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -1076,7 +1076,7 @@ test_H5FDread_without_eoa_set_fails(void) TESTING("HDFS VFD read-eoa temporal coupling library limitation"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -1178,7 +1178,7 @@ test_read(void) TESTING("HDFS VFD read/range-gets"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -1388,7 +1388,7 @@ test_noops_and_autofails(void) TESTING("HDFS VFD always-fail and no-op routines"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -1530,7 +1530,7 @@ test_H5F_integration(void) TESTING("HDFS file access through HD5F library (H5F API)"); SKIPPED(); HDputs(" HDFS VFD is not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else @@ -1597,7 +1597,7 @@ error: #if HDFS_TEST_DEBUG printf("\nerror!"); - HDfflush(stdout); + fflush(stdout); #endif /* HDFS_TEST_DEBUG */ if (fapl_id >= 0) { diff --git a/test/hyperslab.c b/test/hyperslab.c index 82baee3..6712f5b 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -174,7 +174,7 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size } /* end else */ HDsnprintf(s, sizeof(s), "Testing hyperslab fill %-11s variable hyperslab", dim); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); /* Allocate array */ if (NULL == (dst = (uint8_t *)calloc((size_t)1, nx * ny * nz))) @@ -363,7 +363,7 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ HDsnprintf(s, sizeof(s), "Testing hyperslab copy %-11s %s", dim, sub); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); /* * Allocate arrays @@ -572,7 +572,7 @@ test_multifill(size_t nx) hsize_t i, j; printf("%-70s", "Testing multi-byte fill value"); - HDfflush(stdout); + fflush(stdout); /* Initialize the source and destination */ if (NULL == (src = (struct a_struct *)malloc(nx * sizeof(*src)))) @@ -684,7 +684,7 @@ test_endian(size_t nx) hsize_t i, j; printf("%-70s", "Testing endian conversion by stride"); - HDfflush(stdout); + fflush(stdout); /* Initialize arrays */ if (NULL == (src = (uint8_t *)malloc(nx * 4))) @@ -771,7 +771,7 @@ test_transpose(size_t nx, size_t ny) HDsnprintf(s, sizeof(s), "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); /* Initialize */ if (NULL == (src = (int *)malloc(nx * ny * sizeof(*src)))) @@ -870,7 +870,7 @@ test_sub_super(size_t nx, size_t ny) HDsnprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); /* Initialize */ if (NULL == (full = (uint8_t *)malloc(4 * nx * ny))) @@ -920,7 +920,7 @@ test_sub_super(size_t nx, size_t ny) HDsnprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx, (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny)); printf("%-70s", s); - HDfflush(stdout); + fflush(stdout); /* Setup stride */ size[0] = nx; diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index f0f88f9..e738364 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -64,7 +64,7 @@ static unsigned int g_verbosity = DEFAULT_VERBOSITY; do { \ if ((lvl) <= g_verbosity) { \ fprintf(g_log_stream, __VA_ARGS__); \ - HDfflush(g_log_stream); \ + fflush(g_log_stream); \ } \ } while (0) diff --git a/test/objcopy.c b/test/objcopy.c index b0afc24..076e966 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -5271,7 +5271,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t buf[i] = i; /* create an empty external file */ - HDfclose(HDfopen(FILE_EXT, "w")); + fclose(fopen(FILE_EXT, "w")); /* Initialize the filenames */ h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); diff --git a/test/onion.c b/test/onion.c index ea59cd1..07dc2f7 100644 --- a/test/onion.c +++ b/test/onion.c @@ -2619,7 +2619,7 @@ do_onion_open_and_writes(const char *filename, H5FD_onion_fapl_info_t *onion_inf HDputs("i exp act"); for (z = 0; z < wi->size; z++) printf("%02zx %c %c\n", z, _buf[z], buf_vfy[z]); - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } free(buf_vfy); @@ -2751,7 +2751,7 @@ test_page_aligned_history_create(void) for (k = 0; k < b_list_size_s; k++) { printf("%3zu:: %c : %c\n", k, (k < a_off) ? ' ' : a_list_s[k - a_off], buf[k]); } - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } if (HDmemcmp(b_list_s, buf, a_off) != 0) { @@ -2761,7 +2761,7 @@ test_page_aligned_history_create(void) for (k = 0; k < b_list_size_s; k++) { printf("%3zu:: %c : %c\n", k, (k < a_off) ? b_list_s[k] : ' ', buf[k]); } - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } if (H5FDclose(file) < 0) @@ -3067,7 +3067,7 @@ test_integration_create(void) int expected = i * j - j; if (rdata->arr[i][j] != expected) { printf("ERROR!!! Expected: %d, Got: %d\n", expected, rdata->arr[i][j]); - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } } @@ -3105,7 +3105,7 @@ test_integration_create(void) int expected = i * 6 + j + 1; if (rdata->arr[i][j] != expected) { printf("ERROR!!! Expected: %d, Got: %d\n", expected, rdata->arr[i][j]); - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } } @@ -3144,11 +3144,11 @@ test_integration_create(void) int expected = i * 3 + j + 5; if (rdata->arr[i][j] != expected) { printf("ERROR!!! Expected: %d, Got: %d\n", expected, rdata->arr[i][j]); - HDfflush(stdout); + fflush(stdout); TEST_ERROR; } else { - HDfflush(stdout); + fflush(stdout); } } } diff --git a/test/ros3.c b/test/ros3.c index 12ead60..95b7bf0 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -561,7 +561,7 @@ test_fapl_config_validation(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -842,7 +842,7 @@ test_vfd_open(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -985,14 +985,14 @@ test_eof_eoa(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1096,14 +1096,14 @@ test_H5FDread_without_eoa_set_fails(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1270,14 +1270,14 @@ test_read(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1414,7 +1414,7 @@ test_noops_and_autofails(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1534,14 +1534,14 @@ test_cmp(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1658,14 +1658,14 @@ test_H5F_integration(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1712,7 +1712,7 @@ error: * CLEANUP * ***********/ printf("\nerror!"); - HDfflush(stdout); + fflush(stdout); if (fapl_id >= 0) { H5E_BEGIN_TRY diff --git a/test/s3comms.c b/test/s3comms.c index dd7682c..c2d9ff9 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -1776,7 +1776,7 @@ test_s3r_get_filesize(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -1834,13 +1834,13 @@ test_s3r_open(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); HDputs(" s3 credentials are not loaded"); - HDfflush(stdout); + fflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } @@ -2038,7 +2038,7 @@ test_s3r_read(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - HDfflush(stdout); + fflush(stdout); return 0; } diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 3f94bf2..e14ec7d 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -482,7 +482,7 @@ main(int argc, char *argv[]) char verbose_name[1024]; HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.out.%u", random_seed); - if (NULL == (verbose_file = HDfopen(verbose_name, "w"))) { + if (NULL == (verbose_file = fopen(verbose_name, "w"))) { fprintf(stderr, "Can't open verbose output file!\n"); exit(EXIT_FAILURE); } diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index 5067db0..fa5e99b 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -449,7 +449,7 @@ main(int argc, char *argv[]) char verbose_name[1024]; HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); - if (NULL == (verbose_file = HDfopen(verbose_name, "w"))) { + if (NULL == (verbose_file = fopen(verbose_name, "w"))) { fprintf(stderr, "Can't open verbose output file!\n"); exit(EXIT_FAILURE); } diff --git a/test/swmr_writer.c b/test/swmr_writer.c index c880225..81d4351 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -357,7 +357,7 @@ main(int argc, char *argv[]) char verbose_name[1024]; HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); - if (NULL == (verbose_file = HDfopen(verbose_name, "w"))) { + if (NULL == (verbose_file = fopen(verbose_name, "w"))) { fprintf(stderr, "Can't open verbose output file!\n"); exit(EXIT_FAILURE); } diff --git a/test/testmeta.c b/test/testmeta.c index 1d843a4..048e3a6 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -102,7 +102,7 @@ main(void) /* Removed print statement as it would lock system resources on Windows */ /* * printf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); - * HDfflush(stdout); + * fflush(stdout); */ floatval = (float)j; diff --git a/test/tmisc.c b/test/tmisc.c index a2e8343..67c3c85 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2341,35 +2341,35 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char HDmemcpy(user_block, str, HDstrlen(str)); /* Open the new file */ - new_fp = HDfopen(new_name, "wb"); - CHECK_PTR(new_fp, "HDfopen"); + new_fp = fopen(new_name, "wb"); + CHECK_PTR(new_fp, "fopen"); /* Write the user block to the new file */ - written = HDfwrite(user_block, (size_t)1, size, new_fp); - VERIFY(written, size, "HDfwrite"); + written = fwrite(user_block, (size_t)1, size, new_fp); + VERIFY(written, size, "fwrite"); /* Open the old file */ - old_fp = HDfopen(old_name, "rb"); - CHECK_PTR(old_fp, "HDfopen"); + old_fp = fopen(old_name, "rb"); + CHECK_PTR(old_fp, "fopen"); /* Allocate space for the copy buffer */ copy_buf = malloc((size_t)MISC13_COPY_BUF_SIZE); CHECK_PTR(copy_buf, "malloc"); /* Copy data from the old file to the new file */ - while ((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { + while ((read_in = fread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { /* Write the data to the new file */ - written = HDfwrite(copy_buf, (size_t)1, read_in, new_fp); - VERIFY(written, read_in, "HDfwrite"); + written = fwrite(copy_buf, (size_t)1, read_in, new_fp); + VERIFY(written, read_in, "fwrite"); } /* Close the old file */ - ret = HDfclose(old_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(old_fp); + VERIFY(ret, 0, "fclose"); /* Close the new file */ - ret = HDfclose(new_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(new_fp); + VERIFY(ret, 0, "fclose"); /* Free the copy buffer */ free(copy_buf); diff --git a/test/twriteorder.c b/test/twriteorder.c index 9483a58..88389d7 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -375,7 +375,7 @@ main(int argc, char *argv[]) printf("File created.\n"); } /* flush output before possible fork */ - HDfflush(stdout); + fflush(stdout); if (launch_g == UC_READWRITE) { /* fork process */ diff --git a/test/vfd.c b/test/vfd.c index 4d4ef8d..bef2f51 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2388,7 +2388,7 @@ error: AT(); \ fprintf(stderr, mesg); \ H5Eprint2(H5E_DEFAULT, stderr); \ - HDfflush(stderr); \ + fflush(stderr); \ ret_value = -1; \ goto done; \ } while (0) @@ -2600,7 +2600,7 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err } /* Verify existence of logfile if appropriate */ - logfile = HDfopen(vfd_config->log_file_path, "r"); + logfile = fopen(vfd_config->log_file_path, "r"); if ((TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile)) { SPLITTER_TEST_FAULT("no logfile when one was expected\n"); @@ -2621,7 +2621,7 @@ done: } if (logfile != NULL) - HDfclose(logfile); + fclose(logfile); free(vfd_config); free(filename_rw); @@ -3503,7 +3503,7 @@ setup_rand(void) seed = predefined_seed; fprintf(stdout, "\n%s: predefined_seed = %d.\n\n", __func__, seed); - HDfflush(stdout); + fflush(stdout); HDsrand(seed); } @@ -3512,14 +3512,14 @@ setup_rand(void) if (HDgettimeofday(&tv, NULL) != 0) { fprintf(stdout, "\n%s: gettimeofday() failed -- srand() not called.\n\n", __func__); - HDfflush(stdout); + fflush(stdout); } else { seed = (unsigned)tv.tv_usec; fprintf(stdout, "\n%s: seed = %d.\n\n", __func__, seed); - HDfflush(stdout); + fflush(stdout); HDsrand(seed); } diff --git a/testpar/API/testphdf5.c b/testpar/API/testphdf5.c index b02d0a3..044ebac 100644 --- a/testpar/API/testphdf5.c +++ b/testpar/API/testphdf5.c @@ -83,7 +83,7 @@ pause_proc(void) printf("Proc %d (%*s, %d): to debug, attach %d\n", mpi_rank, mpi_namelen, mpi_name, pid, pid); } printf("waiting(%ds) for file %s ...\n", time_int, greenlight); - HDfflush(stdout); + fflush(stdout); HDsleep(time_int); } MPI_Barrier(MPI_COMM_WORLD); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 1de9b56..e2e0e21 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -486,7 +486,7 @@ print_stats(void) datum_flushes, datum_pinned_flushes, datum_loads); fprintf(stdout, "%d: pins: global / global dirty / local = %ld / %ld / %ld\n", world_mpi_rank, global_pins, global_dirty_pins, local_pins); - HDfflush(stdout); + fflush(stdout); return; @@ -6420,11 +6420,11 @@ trace_file_check(int metadata_write_strategy) if (nerrors == 0) { HDsnprintf(trace_file_name, sizeof(trace_file_name), "t_cache_trace.txt.%d", (int)file_mpi_rank); - if ((trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL) { + if ((trace_file_ptr = fopen(trace_file_name, "r")) == NULL) { nerrors++; if (verbose) - fprintf(stdout, "%d:%s: HDfopen failed.\n", world_mpi_rank, __func__); + fprintf(stdout, "%d:%s: fopen failed.\n", world_mpi_rank, __func__); } } /* end if */ @@ -6512,7 +6512,7 @@ trace_file_check(int metadata_write_strategy) /* Clean up the trace file */ if (trace_file_ptr != NULL) { - HDfclose(trace_file_ptr); + fclose(trace_file_ptr); trace_file_ptr = NULL; HDremove(trace_file_name); } diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index d873c82..1ed713a 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -3592,17 +3592,17 @@ main(int argc, char **argv) int i; fprintf(stdout, "Constructing test files: \n"); - HDfflush(stdout); + fflush(stdout); i = 0; while ((FILENAMES[i] != NULL) && (i < TEST_FILES_TO_CONSTRUCT)) { fprintf(stdout, " writing %s ... ", FILENAMES[i]); - HDfflush(stdout); + fflush(stdout); construct_test_file(i); if (pass) { printf("done.\n"); - HDfflush(stdout); + fflush(stdout); } else { printf("failed.\n"); diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 8933e3a..dacdee5 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -475,7 +475,7 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -631,7 +631,7 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -778,7 +778,7 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -939,7 +939,7 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -1110,7 +1110,7 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -1263,7 +1263,7 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -1427,7 +1427,7 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -1594,7 +1594,7 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -1740,7 +1740,7 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -2176,7 +2176,7 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -2347,7 +2347,7 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -2520,7 +2520,7 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou " ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -2682,7 +2682,7 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H " ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -2843,7 +2843,7 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi " ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1], start[2], block[0], block[1], block[2]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -3031,7 +3031,7 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -3212,7 +3212,7 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -3419,7 +3419,7 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -3618,7 +3618,7 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -3834,7 +3834,7 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4034,7 +4034,7 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4236,7 +4236,7 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -4463,7 +4463,7 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } if (mpi_rank == READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) @@ -5043,7 +5043,7 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5269,7 +5269,7 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5494,7 +5494,7 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5713,7 +5713,7 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -5935,7 +5935,7 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -6173,7 +6173,7 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -6406,7 +6406,7 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -6641,7 +6641,7 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -6883,7 +6883,7 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -7173,7 +7173,7 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id " ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7340,7 +7340,7 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7488,7 +7488,7 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7562,7 +7562,7 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7691,7 +7691,7 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7766,7 +7766,7 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -7936,7 +7936,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -8013,7 +8013,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -8084,7 +8084,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -8149,7 +8149,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -8303,7 +8303,7 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -8358,7 +8358,7 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -8527,7 +8527,7 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } /* Select hyperslab in the file */ @@ -8609,7 +8609,7 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE " ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]); - HDfflush(stdout); + fflush(stdout); } VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index 774087f..cbe9835 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -169,8 +169,8 @@ main(int argc, char *argv[]) if (mpi_rank == 0) PASSED(); - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); /* Some systems like AIX do not like files not being closed when MPI_Finalize * is called. So, we need to get the MPI file handles, close them by hand. @@ -191,8 +191,8 @@ main(int argc, char *argv[]) if (MPI_File_close(mpifh_p) != MPI_SUCCESS) goto error; - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); if (data_g) { free(data_g); @@ -210,11 +210,11 @@ main(int argc, char *argv[]) _exit(EXIT_FAILURE); error: - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); printf("*** ERROR ***\n"); printf("THERE WAS A REAL ERROR IN t_pflush1.\n"); - HDfflush(stdout); + fflush(stdout); if (data_g) free(data_g); diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c index 9fc7f9b..7135617 100644 --- a/testpar/t_subfiling_vfd.c +++ b/testpar/t_subfiling_vfd.c @@ -328,8 +328,8 @@ test_config_file(void) HDsnprintf(config_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, config_dir, SUBF_FILENAME, (uint64_t)file_info.st_ino); - config_file = HDfopen(config_filename, "r"); - VRFY(config_file, "HDfopen succeeded"); + config_file = fopen(config_filename, "r"); + VRFY(config_file, "fopen succeeded"); free(config_filename); @@ -343,7 +343,7 @@ test_config_file(void) config_buf = malloc((size_t)config_file_len + 1); VRFY(config_buf, "malloc succeeded"); - VRFY((HDfread(config_buf, (size_t)config_file_len, 1, config_file) == 1), "HDfread succeeded"); + VRFY((fread(config_buf, (size_t)config_file_len, 1, config_file) == 1), "fread succeeded"); config_buf[config_file_len] = '\0'; /* Check the stripe_size field in the configuration file */ @@ -421,7 +421,7 @@ test_config_file(void) free(subfile_name); free(config_buf); - VRFY((HDfclose(config_file) >= 0), "HDfclose on configuration file succeeded"); + VRFY((fclose(config_file) >= 0), "fclose on configuration file succeeded"); } mpi_code_g = MPI_Barrier(comm_g); @@ -570,9 +570,9 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, j + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -586,8 +586,8 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, num_subfiles + 1, num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); /* Set EOA for following write call */ VRFY((H5FDset_eoa(file_ptr, H5FD_MEM_DEFAULT, file_end_addr + nbytes) >= 0), @@ -616,9 +616,9 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, j + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -632,8 +632,8 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, num_subfiles + 1, num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); free(write_buf); write_buf = NULL; @@ -736,9 +736,9 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, j + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -752,8 +752,8 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, num_subfiles + 1, num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); } mpi_code_g = MPI_Barrier(comm_g); @@ -793,9 +793,9 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, j + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -809,8 +809,8 @@ test_stripe_sizes(void) (uint64_t)file_info.st_ino, num_digits, num_subfiles + 1, num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); } VRFY((H5FDclose(file_ptr) >= 0), "H5FDclose succeeded"); @@ -985,9 +985,9 @@ test_selection_strategies(void) (uint64_t)file_info.st_ino, num_digits, i + 1, expected_num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); } /* Ensure no extra subfiles are present */ @@ -996,8 +996,8 @@ test_selection_strategies(void) expected_num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); @@ -1144,9 +1144,9 @@ test_read_different_stripe_size(void) (uint64_t)file_info.st_ino, num_digits, j + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -1215,14 +1215,14 @@ test_read_different_stripe_size(void) if (j < (num_subfiles / 2)) { /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); } else { /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); } } } @@ -1367,9 +1367,9 @@ test_subfiling_precreate_rank_0(void) (uint64_t)file_info.st_ino, num_digits, i + 1, num_subfiles); /* Ensure file exists */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr, "HDfopen on subfile succeeded"); - VRFY((HDfclose(subfile_ptr) >= 0), "HDfclose on subfile succeeded"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr, "fopen on subfile succeeded"); + VRFY((fclose(subfile_ptr) >= 0), "fclose on subfile succeeded"); /* Check file size */ VRFY((HDstat(tmp_filename, &subfile_info) >= 0), "HDstat succeeded"); @@ -1383,8 +1383,8 @@ test_subfiling_precreate_rank_0(void) (uint64_t)file_info.st_ino, num_digits, num_subfiles + 1, num_subfiles); /* Ensure file doesn't exist */ - subfile_ptr = HDfopen(tmp_filename, "r"); - VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); + subfile_ptr = fopen(tmp_filename, "r"); + VRFY(subfile_ptr == NULL, "fopen on subfile correctly failed"); free(tmp_filename); tmp_filename = NULL; @@ -1829,9 +1829,9 @@ test_subfiling_h5fuse(void) if (MAINPROCESS) { FILE *h5fuse_script; - h5fuse_script = HDfopen("h5fuse.sh", "r"); + h5fuse_script = fopen("h5fuse.sh", "r"); if (h5fuse_script) - HDfclose(h5fuse_script); + fclose(h5fuse_script); else skip_test = 1; } @@ -1958,13 +1958,13 @@ test_subfiling_h5fuse(void) if ((ret = WEXITSTATUS(status)) != 0) { printf("h5fuse process exited with error code %d\n", ret); - HDfflush(stdout); + fflush(stdout); MPI_Abort(comm_g, -1); } } else { printf("h5fuse process terminated abnormally\n"); - HDfflush(stdout); + fflush(stdout); MPI_Abort(comm_g, -1); } } diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index dc28cc9..5b7cd14 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -79,7 +79,7 @@ pause_proc(void) printf("Proc %d (%*s, %d): to debug, attach %d\n", mpi_rank, mpi_namelen, mpi_name, pid, pid); } printf("waiting(%ds) for file %s ...\n", time_int, greenlight); - HDfflush(stdout); + fflush(stdout); HDsleep(time_int); } MPI_Barrier(MPI_COMM_WORLD); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 50c6aae..30edd5f 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -245,7 +245,7 @@ h5tools_set_data_output_file(const char *fname, int is_bin) * so that rawdatastream is changed only when succeeded */ if (rawdatastream && rawdatastream != stdout) { - if (HDfclose(rawdatastream)) + if (fclose(rawdatastream)) HDperror("closing rawdatastream"); else rawdatastream = NULL; @@ -255,13 +255,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawdatastream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawdatastream = f; retvalue = SUCCEED; } @@ -293,7 +293,7 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) * so that rawattrstream is changed only when succeeded */ if (rawattrstream && rawattrstream != stdout) { - if (HDfclose(rawattrstream)) + if (fclose(rawattrstream)) HDperror("closing rawattrstream"); else rawattrstream = NULL; @@ -303,13 +303,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawattrstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawattrstream = f; retvalue = SUCCEED; } @@ -342,7 +342,7 @@ h5tools_set_input_file(const char *fname, int is_bin) * so that rawinstream is changed only when succeeded */ if (rawinstream && rawinstream != stdin) { - if (HDfclose(rawinstream)) + if (fclose(rawinstream)) HDperror("closing rawinstream"); else rawinstream = NULL; @@ -351,13 +351,13 @@ h5tools_set_input_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "rb")) != NULL) { + if ((f = fopen(fname, "rb")) != NULL) { rawinstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "r")) != NULL) { + if ((f = fopen(fname, "r")) != NULL) { rawinstream = f; retvalue = SUCCEED; } @@ -390,7 +390,7 @@ h5tools_set_output_file(const char *fname, int is_bin) * so that rawoutstream is changed only when succeeded */ if (rawoutstream && rawoutstream != stdout) { - if (HDfclose(rawoutstream)) + if (fclose(rawoutstream)) HDperror("closing rawoutstream"); else rawoutstream = NULL; @@ -399,13 +399,13 @@ h5tools_set_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawoutstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawoutstream = f; retvalue = SUCCEED; } @@ -437,7 +437,7 @@ h5tools_set_error_file(const char *fname, int is_bin) * so that rawerrorstream is changed only when succeeded */ if (rawerrorstream && rawerrorstream != stderr) { - if (HDfclose(rawerrorstream)) + if (fclose(rawerrorstream)) HDperror("closing rawerrorstream"); else rawerrorstream = NULL; @@ -447,13 +447,13 @@ h5tools_set_error_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawerrorstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawerrorstream = f; retvalue = SUCCEED; } @@ -1810,9 +1810,9 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t else bytes_in = (size_t)block_index; - bytes_wrote = HDfwrite(mem, 1, bytes_in, stream); + bytes_wrote = fwrite(mem, 1, bytes_in, stream); - if (bytes_wrote != bytes_in || (0 == bytes_wrote && HDferror(stream))) + if (bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(stream))) H5TOOLS_THROW((-1), "fwrite failed"); block_index -= (hsize_t)bytes_wrote; @@ -1843,7 +1843,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char)); - if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream)) + if (1 != fwrite(&tempuchar, sizeof(unsigned char), 1, stream)) H5TOOLS_THROW((-1), "fwrite failed"); } /* i */ } /* for (block_index = 0; block_index < block_nelmts; block_index++) */ @@ -1990,7 +1990,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t H5TOOLS_DEBUG("H5T_OPAQUE"); for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char *)_mem) + block_index * size; - if (size != HDfwrite(mem, sizeof(char), size, stream)) + if (size != fwrite(mem, sizeof(char), size, stream)) H5TOOLS_THROW((-1), "fwrite failed"); } /* end for */ break; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 86fea01..bbe9554 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -33,7 +33,7 @@ /* Stream macros */ #define FLUSHSTREAM(S) \ if (S != NULL) \ - HDfflush(S) + fflush(S) #define PRINTSTREAM(S, F, ...) \ if (S != NULL) \ fprintf(S, F, __VA_ARGS__) diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 0e30cdf..4d0bef2 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -169,7 +169,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; fprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ - HDfflush(stderr); \ + fflush(stderr); \ } while (0) #define H5TOOLS_DEBUG(...) \ @@ -177,7 +177,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; fprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ - HDfflush(stderr); \ + fflush(stderr); \ } while (0) #define H5TOOLS_ENDDEBUG(...) \ @@ -186,7 +186,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ H5tools_INDENT_g -= 2; \ - HDfflush(stderr); \ + fflush(stderr); \ } while (0) #else diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index de8b3ef..7f49f97 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -616,7 +616,7 @@ test_populate_ros3_fa(void) #ifndef H5_HAVE_ROS3_VFD HDputs(" -SKIP-"); HDputs(" Read-Only S3 VFD not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else #if H5TOOLS_UTILS_TEST_DEBUG > 0 diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index a74be6b..85197d3 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -210,7 +210,7 @@ ph5diff_worker(int nID) overflow_file = NULL; } - HDfflush(stdout); + fflush(stdout); HDmemset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; @@ -263,7 +263,7 @@ print_manager_output(void) overflow_file = NULL; } - HDfflush(stdout); + fflush(stdout); HDmemset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; } diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index f5197f7..609e8e0 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -375,7 +375,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) */ if (in->inputClass == 4 /* "IN" */ || in->inputClass == 3 /* "FP" */ || in->inputClass == 7 /* "UIN" */) { - if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) { + if ((strm = fopen(infile, READ_OPEN_FLAGS)) == NULL) { (void)fprintf(stderr, err1, infile); goto error; } @@ -385,7 +385,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) *------------------------------------------------------------------------- */ else { - if ((strm = HDfopen(infile, "r")) == NULL) { + if ((strm = fopen(infile, "r")) == NULL) { (void)fprintf(stderr, err1, infile); goto error; } @@ -459,7 +459,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) error: if (strm) - HDfclose(strm); + fclose(strm); return retval; } @@ -502,7 +502,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) { + if (fread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -533,7 +533,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { + if (fread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -569,7 +569,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -606,7 +606,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -673,7 +673,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) { + if (fread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -700,7 +700,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { + if (fread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -736,7 +736,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -773,7 +773,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -853,7 +853,7 @@ readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ bfp32 = (uint32_t *)in->data; for (i = 0; i < len; i++, bfp32++) { - if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -905,7 +905,7 @@ readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ bfp64 = (uint64_t *)in->data; for (i = 0; i < len; i++, bfp64++) { - if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1462,7 +1462,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif in->inputArchitecture = 0; /* default to NATIVE */ - if ((strm = HDfopen(infile, "r")) == NULL) { + if ((strm = fopen(infile, "r")) == NULL) { (void)fprintf(stderr, err1, infile); goto error; } @@ -2442,7 +2442,7 @@ processConfigurationFile(char *infile, struct Input *in) error: if (strm) - HDfclose(strm); + fclose(strm); return retval; } @@ -4700,14 +4700,14 @@ process(struct Options *opt) if (in->configOptionVector[EXTERNALSTORE] == 1) { /* creating the external file if it doesn't exist */ - if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { + if ((extfile = fopen(in->externFilename, "ab")) == NULL) { (void)fprintf(stderr, "%s", err4); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); return (-1); } - HDfclose(extfile); + fclose(extfile); H5Pset_external(proplist, in->externFilename, (off_t)0, numOfElements * (hsize_t)in->inputSize / 8); } diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 04b29ea..6f318a4 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -49,7 +49,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", requir static void usage(const char *prog) { - HDfflush(stdout); + fflush(stdout); fprintf(stdout, "usage: %s -i -u [-o ] [--clobber]\n", prog); fprintf(stdout, "\n"); fprintf(stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 077f128..d752014 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -50,7 +50,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require static void usage(const char *prog) { - HDfflush(stdout); + fflush(stdout); fprintf(stdout, "usage: %s -i [-o ] [-u | --delete]\n", prog); fprintf(stdout, "\n"); fprintf(stdout, "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n"); @@ -334,12 +334,12 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) HDfseek(infid, from, SEEK_SET); /* Read data to buffer */ - bytes_read = HDfread(buf, (size_t)1, bytes_in, infid); - if (0 == bytes_read && HDferror(infid)) { + bytes_read = fread(buf, (size_t)1, bytes_in, infid); + if (0 == bytes_read && ferror(infid)) { ret_value = -1; goto done; } /* end if */ - if (0 == bytes_read && HDfeof(infid)) { + if (0 == bytes_read && feof(infid)) { goto done; } /* end if */ @@ -352,8 +352,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) to += (off_t)bytes_read; /* Write nchars bytes to output file */ - bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); - if (bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ + bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid); + if (bytes_wrote != bytes_read || (0 == bytes_wrote && ferror(ofid))) { /* error */ ret_value = -1; goto done; } /* end if */ diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index 3e306df..b423f0d 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -260,7 +260,7 @@ main(int argc, char *argv[]) } if (opts->output_file) { - if ((output = HDfopen(opts->output_file, "w")) == NULL) { + if ((output = fopen(opts->output_file, "w")) == NULL) { fprintf(stderr, "%s: cannot open output file\n", progname); perror(opts->output_file); goto finish; diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index b456a4f..79d025d 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -202,7 +202,7 @@ main(int argc, char *argv[]) } if (opts->output_file) { - if ((output = HDfopen(opts->output_file, "w")) == NULL) { + if ((output = fopen(opts->output_file, "w")) == NULL) { fprintf(stderr, "%s: cannot open output file\n", progname); HDperror(opts->output_file); goto finish; @@ -1281,5 +1281,5 @@ usage(const char *prog) printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); printf(" HDF5_PREFIX Data file prefix\n"); printf("\n"); - HDfflush(stdout); + fflush(stdout); } /* end usage() */ diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 7134865..c0a245a 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -392,7 +392,7 @@ read_info(const char *filename, pack_opt_t *options) int i; int ret_value = EXIT_SUCCESS; - if (NULL == (fp = HDfopen(filename, "r"))) { + if (NULL == (fp = fopen(filename, "r"))) { error_msg("cannot open options file %s\n", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -416,26 +416,26 @@ read_info(const char *filename, pack_opt_t *options) i = 0; c = '0'; while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } - if (HDfeof(fp)) + if (feof(fp)) break; } c = '0'; /* go until end */ while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } comp_info[i++] = c; - if (HDfeof(fp)) + if (feof(fp)) break; if (c == 10 /*eol*/) break; @@ -462,7 +462,7 @@ read_info(const char *filename, pack_opt_t *options) done: if (fp) - HDfclose(fp); + fclose(fp); return ret_value; } diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 6744b56..a9e163a 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -207,7 +207,7 @@ leave(int ret) static void usage(const char *prog) { - HDfflush(stdout); + fflush(stdout); fprintf(stdout, "usage: %s [OPTIONS] file\n", prog); fprintf(stdout, "\n"); fprintf(stdout, " ERROR\n"); diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 96da5c8..003c343 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -159,7 +159,7 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("txtin8.txt", "w"); + sp = fopen("txtin8.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) @@ -167,14 +167,14 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("txtin16.txt", "w"); + sp = fopen("txtin16.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) @@ -182,14 +182,14 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("txtin32.txt", "w"); + sp = fopen("txtin32.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) @@ -197,7 +197,7 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); #endif /*------------------------------------------------------------------------- @@ -205,17 +205,17 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("binin32.bin", OPEN_FLAGS); + sp = fopen("binin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp); + (void)fwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binin32.conf", "w"); + sp = fopen("binin32.conf", "w"); (void)fprintf(sp, "PATH /int/bin/32-bit\n"); (void)fprintf(sp, "INPUT-CLASS IN\n"); (void)fprintf(sp, "INPUT-SIZE 32\n"); @@ -226,24 +226,24 @@ main(void) (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("binuin32.bin", OPEN_FLAGS); + sp = fopen("binuin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp); + (void)fwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binuin32.conf", "w"); + sp = fopen("binuin32.conf", "w"); (void)fprintf(sp, "PATH /int/buin/32-bit\n"); (void)fprintf(sp, "INPUT-CLASS UIN\n"); (void)fprintf(sp, "INPUT-SIZE 32\n"); @@ -253,24 +253,24 @@ main(void) (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("binin16.bin", OPEN_FLAGS); + sp = fopen("binin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp); + (void)fwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binin16.conf", "w"); + sp = fopen("binin16.conf", "w"); (void)fprintf(sp, "PATH /int/bin/16-bit\n"); (void)fprintf(sp, "INPUT-CLASS IN\n"); (void)fprintf(sp, "INPUT-SIZE 16\n"); @@ -282,23 +282,23 @@ main(void) (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("binuin16.bin", OPEN_FLAGS); + sp = fopen("binuin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp); + (void)fwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binuin16.conf", "w"); + sp = fopen("binuin16.conf", "w"); (void)fprintf(sp, "PATH /int/buin/16-bit\n"); (void)fprintf(sp, "INPUT-CLASS UIN\n"); (void)fprintf(sp, "INPUT-SIZE 16\n"); @@ -310,24 +310,24 @@ main(void) (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("binin8.bin", OPEN_FLAGS); + sp = fopen("binin8.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp); + (void)fwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binin8.conf", "w"); + sp = fopen("binin8.conf", "w"); (void)fprintf(sp, "PATH /int/bin/8-bit\n"); (void)fprintf(sp, "INPUT-CLASS IN\n"); (void)fprintf(sp, "INPUT-SIZE 8\n"); @@ -342,7 +342,7 @@ main(void) (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); (void)fprintf(sp, "COMPRESSION-PARAM 3\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); #endif /* UNICOS */ @@ -355,17 +355,17 @@ main(void) * binary 64-bit file - rank 2 & 3 */ - sp = HDfopen("binfp64.bin", OPEN_FLAGS); + sp = fopen("binfp64.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp); + (void)fwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); - sp = HDfopen("binfp64.conf", "w"); + sp = fopen("binfp64.conf", "w"); (void)fprintf(sp, "PATH /fp/bin/64-bit\n"); (void)fprintf(sp, "INPUT-CLASS FP\n"); (void)fprintf(sp, "INPUT-SIZE 64\n"); @@ -378,7 +378,7 @@ main(void) (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); (void)fprintf(sp, "COMPRESSION-PARAM 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 @@ -389,15 +389,15 @@ main(void) /* test CR+LF (13,10) and EOF (26) in windows */ char bin8w[4] = {13, 10, 26, 0}; - sp = HDfopen("binin8w.bin", OPEN_FLAGS); + sp = fopen("binin8w.bin", OPEN_FLAGS); for (i = 0; i < 4; i++) { char c = bin8w[i]; - if (HDfwrite(&c, sizeof(char), 1, sp) != 1) + if (fwrite(&c, sizeof(char), 1, sp) != 1) printf("error writing file\n"); } - HDfclose(sp); + fclose(sp); - sp = HDfopen("binin8w.conf", "w"); + sp = fopen("binin8w.conf", "w"); (void)fprintf(sp, "INPUT-CLASS IN\n"); (void)fprintf(sp, "INPUT-SIZE 8\n"); (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); @@ -408,7 +408,7 @@ main(void) (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); (void)fprintf(sp, "DIMENSION-SIZES 4\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); } return (EXIT_SUCCESS); } diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 139ead6..b90ddeb 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -35,7 +35,7 @@ static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file static void usage(const char *prog) { - HDfflush(stdout); + fflush(stdout); fprintf(stdout, "usage: %s -c nb file] \n", prog); fprintf(stdout, " print first 'nb' byts of file to stdoug.\n"); } diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index 4b5606c..501ecc5 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -37,7 +37,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, static void usage(const char *prog) { - HDfflush(stdout); + fflush(stdout); fprintf(stdout, "usage: %s h5_file\n", prog); fprintf(stdout, " Check that h5_fil is HDF5 file and print size of user block \n"); fprintf(stdout, " %s -h\n", prog); diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 5d5cb2f..df1c312 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -107,7 +107,7 @@ main(void) free(buf_data); HDputs(" PASSED"); - HDfflush(stdout); + fflush(stdout); return EXIT_SUCCESS; } diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index c876d9f..805b30b 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -197,6 +197,6 @@ out: H5Pclose(plist); H5Fclose(fil); HDunlink(fname); - HDfflush(stdout); + fflush(stdout); return result; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index e77e288..8131f9d 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -173,7 +173,7 @@ main(void) fprintf(stderr, HEADING, "fill raw"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE @@ -196,7 +196,7 @@ main(void) fprintf(stderr, HEADING, "fill hdf5"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); } @@ -220,7 +220,7 @@ main(void) fprintf(stderr, HEADING, "out raw"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); assert(0 == offset); n = HDwrite(fd, the_data, (size_t)(size[0] * size[1])); @@ -246,7 +246,7 @@ main(void) fprintf(stderr, HEADING, "out hdf5"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); assert(status >= 0); } @@ -270,7 +270,7 @@ main(void) fprintf(stderr, HEADING, "in raw"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); assert(0 == offset); n = HDread(fd, the_data, (size_t)(size[0] * size[1])); @@ -296,7 +296,7 @@ main(void) fprintf(stderr, HEADING, "in hdf5"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); } @@ -325,7 +325,7 @@ main(void) fprintf(stderr, HEADING, "in hdf5 partial"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); } diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index a21bfd8..772badd 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -258,7 +258,7 @@ usage(void) fprintf(stdout, "\n"); fprintf(stdout, " Example: 37M = 37 Megabytes = %d bytes\n", 37 * ONE_MB); fprintf(stdout, "\n"); - HDfflush(stdout); + fflush(stdout); } /* diff --git a/utils/mirror_vfd/mirror_remote.c b/utils/mirror_vfd/mirror_remote.c index aaa7515..4f87c17 100644 --- a/utils/mirror_vfd/mirror_remote.c +++ b/utils/mirror_vfd/mirror_remote.c @@ -65,7 +65,7 @@ mirror_log(struct mirror_log_info *info, unsigned int level, const char *format, } fprintf(stream, "\n"); - HDfflush(stream); + fflush(stream); } /* end if sufficiently verbose to print */ } /* end mirror_log() */ @@ -163,7 +163,7 @@ mirror_log_init(char *path, const char *prefix, unsigned int verbosity) if (path && *path) { FILE *f = NULL; - f = HDfopen(path, "w"); + f = fopen(path, "w"); if (NULL == f) { fprintf(MIRROR_LOG_DEFAULT_STREAM, "WARN custom logging path could not be opened: %s\n", path); @@ -196,7 +196,7 @@ mirror_log_term(loginfo_t *info) return FAIL; } if (info->stream != stderr || info->stream != stdout) { - if (HDfclose(info->stream) < 0) { + if (fclose(info->stream) < 0) { return FAIL; } } diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c index c97861c..e8df52d 100644 --- a/utils/tools/h5dwalk/h5dwalk.c +++ b/utils/tools/h5dwalk/h5dwalk.c @@ -758,7 +758,7 @@ fill_file_list(mfu_flist new_flist, const char *config_filename, int myrank, int char linebuf[PATH_MAX] = { '\0', }; - FILE *config = HDfopen(config_filename, "r"); + FILE *config = fopen(config_filename, "r"); if (config == NULL) return -1; while (HDfgets(linebuf, sizeof(linebuf), config) != NULL) { @@ -774,7 +774,7 @@ fill_file_list(mfu_flist new_flist, const char *config_filename, int myrank, int } linebuf[0] = 0; } - HDfclose(config); + fclose(config); return index; } @@ -1257,7 +1257,7 @@ process_input_file(char *inputname, int myrank, int size) char linebuf[PATH_MAX] = { '\0', }; - FILE *config = HDfopen(inputname, "r"); + FILE *config = fopen(inputname, "r"); mfu_flist flist1 = NULL; if (config == NULL) @@ -1317,7 +1317,7 @@ process_input_file(char *inputname, int myrank, int size) if (output_log_file) { dh5tool_flist_write_text(output_log_file, flist1); } - HDfclose(config); + fclose(config); mfu_flist_free(&flist1); return 0; -- cgit v0.12