From 8f83e3615a19f7e420dab0e08c1c4a82a81635e6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 28 Jul 2019 14:40:13 -0500 Subject: Merge cleanup --- src/H5.c | 202 ++++++++++++++++++++++-------------------------------- src/H5ACpublic.h | 148 +++++++++++++++++++-------------------- src/H5Adense.c | 115 ++++++++++++------------------- src/H5Aint.c | 58 ++++++---------- src/H5Apublic.h | 18 +++-- src/H5Atest.c | 8 +-- src/H5B.c | 14 ++-- src/H5B2.c | 5 +- src/H5Omtime.c | 109 +++++++++-------------------- src/H5win32defs.h | 12 +--- 10 files changed, 282 insertions(+), 407 deletions(-) diff --git a/src/H5.c b/src/H5.c index 34e4613..9845945 100644 --- a/src/H5.c +++ b/src/H5.c @@ -266,11 +266,11 @@ H5_term_library(void) */ #define DOWN(F) \ (((n = H5##F##_term_interface()) && (at + 8) < sizeof loop)? \ - (sprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ + (HDsprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ at += HDstrlen(loop + at), \ n): \ ((n > 0 && (at + 5) < sizeof loop) ? \ - (sprintf(loop + at, "..."), \ + (HDsprintf(loop + at, "..."), \ at += HDstrlen(loop + at), \ n) : n)) @@ -320,8 +320,8 @@ H5_term_library(void) if(pending) { /* Only display the error message if the user is interested in them. */ if(func) { - fprintf(stderr, "HDF5: infinite loop closing library\n"); - fprintf(stderr, " %s\n", loop); + HDfprintf(stderr, "HDF5: infinite loop closing library\n"); + HDfprintf(stderr, " %s\n", loop); #ifndef NDEBUG HDabort(); #endif /* NDEBUG */ @@ -333,18 +333,18 @@ H5_term_library(void) * down if any of the below code involves using the instrumentation code. */ if(H5_MPEinit_g) { - int mpi_initialized; - int mpi_finalized; - int mpe_code; + int mpi_initialized; + int mpi_finalized; + int mpe_code; - MPI_Initialized(&mpi_initialized); - MPI_Finalized(&mpi_finalized); + MPI_Initialized(&mpi_initialized); + MPI_Finalized(&mpi_finalized); if (mpi_initialized && !mpi_finalized) { - mpe_code = MPE_Finish_log("h5log"); - HDassert(mpe_code >=0); - } /* end if */ - H5_MPEinit_g = FALSE; /* turn it off no matter what */ + mpe_code = MPE_Finish_log("h5log"); + HDassert(mpe_code >=0); + } /* end if */ + H5_MPEinit_g = FALSE; /* turn it off no matter what */ } /* end if */ #endif @@ -364,6 +364,7 @@ done: #ifdef H5_HAVE_THREADSAFE H5_API_UNLOCK #endif /* H5_HAVE_THREADSAFE */ + return; } /* end H5_term_library() */ @@ -386,11 +387,6 @@ done: * Failure: negative if this function is called more than * once or if it is called too late. * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -425,11 +421,6 @@ H5dont_atexit(void) * * Failure: negative * - * Programmer: Quincey Koziol - * Saturday, March 11, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -474,13 +465,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Wednesday, August 2, 2000 - * - * Modifications: Neil Fortner - * Wednesday, April 8, 2009 - * Added support for factory free lists - * *------------------------------------------------------------------------- */ herr_t @@ -504,30 +488,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5_debug_mask + * Function: H5_debug_mask * - * Purpose: Set runtime debugging flags according to the string S. The - * string should contain file numbers and package names - * separated by other characters. A file number applies to all - * following package names up to the next file number. The - * initial file number is `2' (the standard error stream). Each - * package name can be preceded by a `+' or `-' to add or remove - * the package from the debugging list (`+' is the default). The - * special name `all' means all packages. + * Purpose: Set runtime debugging flags according to the string S. The + * string should contain file numbers and package names + * separated by other characters. A file number applies to all + * following package names up to the next file number. The + * initial file number is `2' (the standard error stream). Each + * package name can be preceded by a `+' or `-' to add or remove + * the package from the debugging list (`+' is the default). The + * special name `all' means all packages. * - * The name `trace' indicates that API tracing is to be turned - * on or off. + * The name `trace' indicates that API tracing is to be turned + * on or off. * - * Return: void + * The name 'ttop' indicates that only top-level API calls + * should be shown. This also turns on tracing as if the + * 'trace' word was shown. * - * Programmer: Robb Matzke - * Wednesday, August 19, 1998 + * Return: void * - * Modifications: - * Robb Matzke, 2002-08-08 - * Accepts the `ttop' word. If enabled then show only the - * top level API calls, otherwise show all API calls. Also - * turns on tracing as if the `trace' word was present. *------------------------------------------------------------------------- */ static void @@ -539,55 +519,57 @@ H5_debug_mask(const char *s) hbool_t clear; while (s && *s) { - if (HDisalpha(*s) || '-'==*s || '+'==*s) { - /* Enable or Disable debugging? */ - if ('-'==*s) { - clear = TRUE; - s++; - } else if ('+'==*s) { - clear = FALSE; - s++; - } else { - clear = FALSE; - } - - /* Get the name */ - for (i=0; HDisalpha(*s); i++, s++) - if (i=(size_t)H5_NPKGS) - fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); - } - - } else if (HDisdigit(*s)) { - int fd = (int)HDstrtol(s, &rest, 0); - H5_debug_open_stream_t *open_stream; - - if((stream = HDfdopen(fd, "w")) != NULL) { - (void)HDsetvbuf(stream, NULL, _IOLBF, (size_t)0); - - if(NULL == (open_stream = (H5_debug_open_stream_t *)H5MM_malloc(sizeof(H5_debug_open_stream_t)))) { + } else if (!HDstrcmp(pkg_name, "all")) { + for (i=0; i<(size_t)H5_NPKGS; i++) + H5_debug_g.pkg[i].stream = clear ? NULL : stream; + } else { + for (i=0; i<(size_t)H5_NPKGS; i++) { + if (!HDstrcmp(H5_debug_g.pkg[i].name, pkg_name)) { + H5_debug_g.pkg[i].stream = clear ? NULL : stream; + break; + } /* end if */ + } /* end for */ + if (i>=(size_t)H5_NPKGS) + HDfprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); + } /* end if-else */ + + } else if (HDisdigit(*s)) { + int fd = (int)HDstrtol(s, &rest, 0); + H5_debug_open_stream_t *open_stream; + + if((stream = HDfdopen(fd, "w")) != NULL) { + (void)HDsetvbuf(stream, NULL, _IOLBF, (size_t)0); + + if(NULL == (open_stream = (H5_debug_open_stream_t *)H5MM_malloc(sizeof(H5_debug_open_stream_t)))) { (void)HDfclose(stream); return; } /* end if */ @@ -596,11 +578,15 @@ H5_debug_mask(const char *s) open_stream->next = H5_debug_g.open_stream; H5_debug_g.open_stream = open_stream; } /* end if */ - s = rest; - } else { - s++; - } - } + + s = rest; + } else { + s++; + } /* end if-else */ + } /* end while */ + + return; + } /* end H5_debug_mask() */ #ifdef H5_HAVE_PARALLEL @@ -613,8 +599,6 @@ H5_debug_mask(const char *s) * * Return: MPI_SUCCESS * - * Programmer: Mohamad Chaarawi, February 2015 - * *------------------------------------------------------------------------- */ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) @@ -639,13 +623,6 @@ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED key * * Return: Non-negative on success/Negative on failure * - * Programmer: Unknown - * - * Modifications: - * Robb Matzke, 4 Mar 1998 - * Now use "normal" data types for the interface. Any of the arguments - * may be null pointers - * *------------------------------------------------------------------------- */ herr_t @@ -679,13 +656,6 @@ done: * * Failure: abort() * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 - * - * Modifications: - * Albert Cheng, May 12, 2001 - * Added verification of H5_VERS_INFO. - * *------------------------------------------------------------------------- */ #define VERSION_MISMATCH_WARNING \ @@ -810,11 +780,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -837,11 +802,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index ceb225d..6c2e2c8 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -68,13 +68,13 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the - * automatic cache resize code is run, and reports on its activities. + * reporting function. This function is invoked every time the + * automatic cache resize code is run, and reports on its activities. * - * This is a debugging function, and should normally be turned off. + * This is a debugging function, and should normally be turned off. * * open_trace_file: Boolean field indicating whether the trace_file_name - * field should be used to open a trace file for the cache. + * field should be used to open a trace file for the cache. * * The trace file is a debugging feature that allow the capture of * top level metadata cache requests for purposes of debugging and/or @@ -87,14 +87,14 @@ extern "C" { * field is also TRUE. * * close_trace_file: Boolean field indicating whether the current trace - * file (if any) should be closed. + * file (if any) should be closed. * * See the above comments on the open_trace_file field. This field * should be set to FALSE unless there is an open trace file on the * cache that you wish to close. * * trace_file_name: Full path of the trace file to be opened if the - * open_trace_file field is TRUE. + * open_trace_file field is TRUE. * * In the parallel case, an ascii representation of the mpi rank of * the process will be appended to the file name to yield a unique @@ -104,23 +104,23 @@ extern "C" { * characters. * * evictions_enabled: Boolean field used to either report the current - * evictions enabled status of the cache, or to set the cache's - * evictions enabled status. - * - * In general, the metadata cache should always be allowed to - * evict entries. However, in some cases it is advantageous to - * disable evictions briefly, and thereby postpone metadata - * writes. However, this must be done with care, as the cache - * can grow quickly. If you do this, re-enable evictions as - * soon as possible and monitor cache size. - * - * At present, evictions can only be disabled if automatic - * cache resizing is also disabled (that is, ( incr_mode == - * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There - * is no logical reason why this should be so, but it simplifies - * implementation and testing, and I can't think of any reason - * why it would be desireable. If you can think of one, I'll - * revisit the issue. + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + * + * In general, the metadata cache should always be allowed to + * evict entries. However, in some cases it is advantageous to + * disable evictions briefly, and thereby postpone metadata + * writes. However, this must be done with care, as the cache + * can grow quickly. If you do this, re-enable evictions as + * soon as possible and monitor cache size. + * + * At present, evictions can only be disabled if automatic + * cache resizing is also disabled (that is, ( incr_mode == + * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There + * is no logical reason why this should be so, but it simplifies + * implementation and testing, and I can't think of any reason + * why it would be desireable. If you can think of one, I'll + * revisit the issue. * * set_initial_size: Boolean flag indicating whether the size of the * initial size of the cache is to be set to the value given in @@ -360,80 +360,80 @@ extern "C" { * * PHDF5 uses several strategies to prevent such inconsistencies in metadata, * all of which use the fact that the same stream of dirty metadata is seen - * by all processes for purposes of synchronization. This is done by + * by all processes for purposes of synchronization. This is done by * having each process count the number of bytes of dirty metadata generated, - * and then running a "sync point" whenever this count exceeds a user + * and then running a "sync point" whenever this count exceeds a user * specified threshold (see dirty_bytes_threshold below). * - * The current metadata write strategy is indicated by the + * The current metadata write strategy is indicated by the * metadata_write_strategy field. The possible values of this field, along * with the associated metadata write strategies are discussed below. * * dirty_bytes_threshold: Threshold of dirty byte creation used to - * synchronize updates between caches. (See above for outline and - * motivation.) + * synchronize updates between caches. (See above for outline and + * motivation.) * - * This value MUST be consistant across all processes accessing the - * file. This field is ignored unless HDF5 has been compiled for - * parallel. + * This value MUST be consistent across all processes accessing the + * file. This field is ignored unless HDF5 has been compiled for + * parallel. * * metadata_write_strategy: Integer field containing a code indicating the - * desired metadata write strategy. The valid values of this field - * are enumerated and discussed below: + * desired metadata write strategy. The valid values of this field + * are enumerated and discussed below: * * - * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: * - * When metadata_write_strategy is set to this value, only process - * zero is allowed to write dirty metadata to disk. All other - * processes must retain dirty metadata until they are informed at - * a sync point that the dirty metadata in question has been written - * to disk. + * When metadata_write_strategy is set to this value, only process + * zero is allowed to write dirty metadata to disk. All other + * processes must retain dirty metadata until they are informed at + * a sync point that the dirty metadata in question has been written + * to disk. * - * When the sync point is reached (or when there is a user generated - * flush), process zero flushes sufficient entries to bring it into - * complience with its min clean size (or flushes all dirty entries in - * the case of a user generated flush), broad casts the list of - * entries just cleaned to all the other processes, and then exits - * the sync point. + * When the sync point is reached (or when there is a user generated + * flush), process zero flushes sufficient entries to bring it into + * complience with its min clean size (or flushes all dirty entries in + * the case of a user generated flush), broad casts the list of + * entries just cleaned to all the other processes, and then exits + * the sync point. * - * Upon receipt of the broadcast, the other processes mark the indicated - * entries as clean, and leave the sync point as well. + * Upon receipt of the broadcast, the other processes mark the indicated + * entries as clean, and leave the sync point as well. * * - * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: * - * In the distributed metadata write strategy, process zero still makes - * the decisions as to what entries should be flushed, but the actual - * flushes are distributed across the processes in the computation to - * the extent possible. + * In the distributed metadata write strategy, process zero still makes + * the decisions as to what entries should be flushed, but the actual + * flushes are distributed across the processes in the computation to + * the extent possible. * - * In this strategy, when a sync point is triggered (either by dirty - * metadata creation or manual flush), all processes enter a barrier. + * In this strategy, when a sync point is triggered (either by dirty + * metadata creation or manual flush), all processes enter a barrier. * - * On the other side of the barrier, process 0 constructs an ordered - * list of the entries to be flushed, and then broadcasts this list - * to the caches in all the processes. + * On the other side of the barrier, process 0 constructs an ordered + * list of the entries to be flushed, and then broadcasts this list + * to the caches in all the processes. * - * All processes then scan the list of entries to be flushed, flushing - * some, and marking the rest as clean. The algorithm for this purpose - * ensures that each entry in the list is flushed exactly once, and - * all are marked clean in each cache. + * All processes then scan the list of entries to be flushed, flushing + * some, and marking the rest as clean. The algorithm for this purpose + * ensures that each entry in the list is flushed exactly once, and + * all are marked clean in each cache. * - * Note that in the case of a flush of the cache, no message passing - * is necessary, as all processes have the same list of dirty entries, - * and all of these entries must be flushed. Thus in this case it is - * sufficient for each process to sort its list of dirty entries after - * leaving the initial barrier, and use this list as if it had been - * received from process zero. + * Note that in the case of a flush of the cache, no message passing + * is necessary, as all processes have the same list of dirty entries, + * and all of these entries must be flushed. Thus in this case it is + * sufficient for each process to sort its list of dirty entries after + * leaving the initial barrier, and use this list as if it had been + * received from process zero. + * + * To avoid possible messages from the past/future, all caches must + * wait until all caches are done before leaving the sync point. * - * To avoid possible messages from the past/future, all caches must - * wait until all caches are done before leaving the sync point. - * ****************************************************************************/ -#define H5AC__CURR_CACHE_CONFIG_VERSION 1 -#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 +#define H5AC__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 #define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0 #define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1 @@ -443,9 +443,9 @@ typedef struct H5AC_cache_config_t /* general configuration fields: */ int version; - hbool_t rpt_fcn_enabled; + hbool_t rpt_fcn_enabled; - hbool_t open_trace_file; + hbool_t open_trace_file; hbool_t close_trace_file; char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1]; diff --git a/src/H5Adense.c b/src/H5Adense.c index ac2b9b2..a0e7ea0 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -192,9 +192,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); @@ -290,9 +288,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_fnd_cb + * Function: H5A__dense_fnd_cb * - * Purpose: Callback when an attribute is located in an index + * Purpose: Callback when an attribute is located in an index * * Return: Non-negative on success/Negative on failure * @@ -326,7 +324,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) /*------------------------------------------------------------------------- * Function: H5A_dense_open * - * Purpose: Open an attribute in dense storage structures for an object + * Purpose: Open an attribute in dense storage structures for an object * * Return: Non-negative on success/Negative on failure * @@ -349,9 +347,7 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na FUNC_ENTER_NOAPI(NULL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(name); @@ -418,7 +414,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_insert * - * Purpose: Insert an attribute into dense storage structures for an object + * Purpose: Insert an attribute into dense storage structures for an object * * Return: Non-negative on success/Negative on failure * @@ -444,9 +440,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(attr); @@ -576,13 +570,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_write_bt2_cb2 + * Function: H5A__dense_write_bt2_cb2 * - * Purpose: v2 B-tree 'modify' callback to update the record for a creation - * order index + * Purpose: v2 B-tree 'modify' callback to update the record for a creation + * order index * - * Return: Success: 0 - * Failure: 1 + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Tuesday, February 20, 2007 @@ -597,9 +590,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) FUNC_ENTER_STATIC_NOERR - /* - * Check arguments. - */ + /* Check arguments */ HDassert(record); HDassert(new_heap_id); @@ -614,12 +605,11 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) /*------------------------------------------------------------------------- - * Function: H5A__dense_write_bt2_cb + * Function: H5A__dense_write_bt2_cb * - * Purpose: v2 B-tree 'modify' callback to update the data for an attribute + * Purpose: v2 B-tree 'modify' callback to update the data for an attribute * - * Return: Success: 0 - * Failure: 1 + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Tuesday, December 5, 2006 @@ -638,9 +628,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Check arguments */ HDassert(record); HDassert(op_data); @@ -731,9 +719,9 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_write * - * Purpose: Modify an attribute in dense storage structures for an object + * Purpose: Modify an attribute in dense storage structures for an object * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -754,9 +742,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(H5F_addr_defined(ainfo->fheap_addr)); @@ -829,12 +815,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_copy_fh_cb + * Function: H5A__dense_copy_fh_cb * - * Purpose: Callback for fractal heap operator, to make copy of attribute + * Purpose: Callback for fractal heap operator, to make copy of attribute * for calling routine * - * Return: SUCCEED/FAIL + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -875,7 +861,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_rename * - * Purpose: Rename an attribute in dense storage structures for an object + * Purpose: Rename an attribute in dense storage structures for an object * * Return: Non-negative on success/Negative on failure * @@ -902,9 +888,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(old_name); @@ -1001,7 +985,6 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * } } - /* Insert renamed attribute back into dense storage */ /* (Possibly making it shared) */ if(H5A_dense_insert(f, dxpl_id, ainfo, attr_copy) < 0) @@ -1059,11 +1042,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_iterate_bt2_cb + * Function: H5A__dense_iterate_bt2_cb * - * Purpose: v2 B-tree callback for dense attribute storage iterator + * Purpose: v2 B-tree callback for dense attribute storage iterator * - * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP + * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1158,7 +1141,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_iterate * - * Purpose: Iterate over attributes in dense storage structures for an object + * Purpose: Iterate over attributes in dense storage structures for an object * * Return: Non-negative on success/Negative on failure * @@ -1182,9 +1165,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(H5F_addr_defined(ainfo->fheap_addr)); @@ -1294,9 +1275,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_remove_bt2_cb + * Function: H5A__dense_remove_bt2_cb * - * Purpose: v2 B-tree callback for dense attribute storage record removal + * Purpose: v2 B-tree callback for dense attribute storage record removal * * Return: Non-negative on success/Negative on failure * @@ -1360,7 +1341,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_remove * - * Purpose: Remove an attribute from the dense storage of an object + * Purpose: Remove an attribute from the dense storage of an object * * Return: Non-negative on success/Negative on failure * @@ -1383,9 +1364,7 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(name && *name); @@ -1449,9 +1428,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_remove_by_idx_bt2_cb + * Function: H5A__dense_remove_by_idx_bt2_cb * - * Purpose: v2 B-tree callback for dense attribute storage record removal by index + * Purpose: v2 B-tree callback for dense attribute storage record removal by index * * Return: Non-negative on success/Negative on failure * @@ -1578,8 +1557,8 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_remove_by_idx * - * Purpose: Remove an attribute from the dense storage of an object, - * according to the order within an index + * Purpose: Remove an attribute from the dense storage of an object, + * according to the order within an index * * Return: Non-negative on success/Negative on failure * @@ -1602,9 +1581,7 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); @@ -1709,7 +1686,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_exists * - * Purpose: Check if an attribute exists in dense storage structures for + * Purpose: Check if an attribute exists in dense storage structures for * an object * * Return: Non-negative on success/Negative on failure @@ -1732,9 +1709,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * FUNC_ENTER_NOAPI(NULL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); HDassert(name); @@ -1797,9 +1772,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5A__dense_delete_bt2_cb + * Function: H5A__dense_delete_bt2_cb * - * Purpose: v2 B-tree callback for dense attribute storage deletion + * Purpose: v2 B-tree callback for dense attribute storage deletion * * Return: Non-negative on success/Negative on failure * @@ -1864,7 +1839,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_dense_delete * - * Purpose: Delete all dense storage structures for attributes on an object + * Purpose: Delete all dense storage structures for attributes on an object * * Return: Non-negative on success/Negative on failure * @@ -1883,9 +1858,7 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); HDassert(ainfo); diff --git a/src/H5Aint.c b/src/H5Aint.c index 894e356..fb63789 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -129,7 +129,7 @@ H5FL_SEQ_DEFINE(H5A_t_ptr); * H5S_t *space; IN: Dataspace of attribute * hid_t acpl_id IN: Attribute creation property list * - * Return: attribute structure on success, NULL on Failure. + * Return: Attribute structure on success, NULL on Failure. * * Programmer: Quincey Koziol * April 2, 1998 @@ -148,7 +148,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, FUNC_ENTER_NOAPI_NOINIT - /* check args */ + /* Check args */ HDassert(loc); HDassert(name); HDassert(type); @@ -366,7 +366,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -412,7 +412,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_open_by_name * - * Purpose: Open an attribute in an object header, according to it's name + * Purpose: Open an attribute in an object header, according to it's name * * Return: Non-negative on success/Negative on failure * @@ -430,7 +430,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -909,19 +909,15 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) /*------------------------------------------------------------------------- * Function: H5A_copy * - * Purpose: Copies attribute OLD_ATTR. + * Purpose: Copies attribute OLD_ATTR. * - * Return: Success: Pointer to a new copy of the OLD_ATTR argument. + * Return: Success: Pointer to a new copy of the OLD_ATTR argument. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Thursday, December 4, 1997 * - * Modification:Raymond Lu - * 4 June 2008 - * Changed some attribute information to be shared. - * *------------------------------------------------------------------------- */ H5A_t * @@ -1023,17 +1019,13 @@ done: /*------------------------------------------------------------------------- * Function: H5A_close * - * Purpose: Frees an attribute and all associated memory. + * Purpose: Frees an attribute and all associated memory. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Raymond Lu - * 4 June 2008 - * Changed some attribute object information to be shared. *------------------------------------------------------------------------- */ herr_t @@ -1189,7 +1181,7 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1232,10 +1224,6 @@ done: * 24 June 2008 * Changed the table of attribute objects to be the table of * pointers to attribute objects for the ease of operation. - * - * Vailin Choi; September 2011 - * Change "oh_modified" from boolean to unsigned - * (See H5Oprivate.h for possible flags) *------------------------------------------------------------------------- */ static herr_t @@ -1287,11 +1275,10 @@ done: * Purpose: Builds a table containing a sorted list of attributes for * an object * - * Note: Used for building table of attributes in non-native iteration + * Note: Used for building table of attributes in non-native iteration * order for an index * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Dec 18, 2006 @@ -1396,12 +1383,11 @@ done: * Purpose: Builds a table containing a sorted list of attributes for * an object * - * Note: Used for building table of attributes in non-native iteration + * Note: Used for building table of attributes in non-native iteration * order for an index. Uses the "name" index to retrieve records, - * but the 'idx_type' index for sorting them. + * but the 'idx_type' index for sorting them. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Dec 11, 2006 @@ -1552,7 +1538,7 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1587,7 +1573,7 @@ H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) static int H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1733,7 +1719,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_attr_release_table * - * Purpose: Release table containing a list of attributes for an object + * Purpose: Release table containing a list of attributes for an object * * Return: Success: Non-negative * Failure: Negative @@ -1778,8 +1764,8 @@ done: * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. * - * Return: Success: TRUE/FALSE whether message was found & retrieved - * Failure: FAIL if error occurred + * Return: Success: TRUE/FALSE whether message was found & retrieved + * Failure: FAIL if error occurred * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1977,7 +1963,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si */ if(H5O_msg_reset_share(H5O_DTYPE_ID, attr_dst->shared->dt) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset datatype sharing") - } /* end if */ + } /* Copy the dataspace for the attribute. Make sure the maximal dimension is also copied. * Otherwise the comparison in the test may complain about it. SLU 2011/4/12 */ @@ -2228,7 +2214,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, /* Update shared message info from named datatype info */ H5T_update_shared(attr_dst->shared->dt); - } /* end if */ + } /* Try to share both the datatype and dataset. This does nothing if the * datatype is committed or sharing is disabled. diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 586940b..7162f6e 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -22,10 +22,6 @@ #include "H5Opublic.h" /* Object Headers */ #include "H5Tpublic.h" /* Datatypes */ -#ifdef __cplusplus -extern "C" { -#endif - /* Information struct for attribute (for H5Aget_info/H5Aget_info_by_idx) */ typedef struct { hbool_t corder_valid; /* Indicate if creation order is valid */ @@ -38,7 +34,19 @@ typedef struct { typedef herr_t (*H5A_operator2_t)(hid_t location_id/*in*/, const char *attr_name/*in*/, const H5A_info_t *ainfo/*in*/, void *op_data/*in,out*/); -/* Public function prototypes */ + +/********************/ +/* Public Variables */ +/********************/ + + +/*********************/ +/* Public Prototypes */ +/*********************/ +#ifdef __cplusplus +extern "C" { +#endif + H5_DLL hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id); H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, diff --git a/src/H5Atest.c b/src/H5Atest.c index a10f7ca..09a4834 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Atest.c - * Dec 18 2006 - * Quincey Koziol + * Created: H5Atest.c * - * Purpose: Attribute testing routines. + * Purpose: Attribute testing routines. * *------------------------------------------------------------------------- */ @@ -93,7 +91,7 @@ htri_t H5A_is_shared_test(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5B.c b/src/H5B.c index 5443155..197afa9 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -307,7 +307,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned idx = 0, lt = 0, rt; /* Final, left & right key indices */ int cmp = 1; /* Key comparison value */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -444,8 +444,8 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, side = "LEFT"; else side = "MIDDLE"; - fprintf(H5DEBUG(B), "H5B_split: %3u {%5.3f,%5.3f,%5.3f} %6s", - shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side); + HDfprintf(H5DEBUG(B), "H5B_split: %3u {%5.3f,%5.3f,%5.3f} %6s", + shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side); } #endif @@ -472,7 +472,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, nright = shared->two_k - nleft; #ifdef H5B_DEBUG if(H5DEBUG(B)) - fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); + HDfprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); #endif /* @@ -1201,7 +1201,7 @@ herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -1698,7 +1698,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey) { H5B_shared_t *shared = NULL; /* New shared B-tree struct */ size_t u; /* Local index variable */ - H5B_shared_t *ret_value; /* Return value */ + H5B_shared_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1806,7 +1806,7 @@ H5B_copy(const H5B_t *old_bt) { H5B_t *new_node = NULL; H5B_shared_t *shared; /* Pointer to shared B-tree info */ - H5B_t *ret_value; + H5B_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5B2.c b/src/H5B2.c index 5a588b4..7b5e46d 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -130,7 +130,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ haddr_t hdr_addr; /* B-tree header address */ - H5B2_t *ret_value; /* Return value */ + H5B2_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -494,7 +494,6 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, if(cmp > 0) idx++; - if(cmp != 0) { /* Get node pointer for next node to search */ next_node_ptr=internal->node_ptrs[idx]; @@ -736,7 +735,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, } /* end if */ else /* Index that is greater than the number of records in the tree? */ - HDassert("Index off end of tree??" && 0); + HDassert(0 && "Index off end of tree??"); } /* end if */ /* Decrement depth we're at in B-tree */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index e4db09b..b244267 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -122,14 +122,14 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { time_t *mesg; - uint32_t tmp_time; /* Temporary copy of the time */ - void *ret_value; /* Return value */ + uint32_t tmp_time; /* Temporary copy of the time */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(f); - assert(p); + HDassert(f); + HDassert(p); /* decode */ if(*p++ != H5O_MTIME_VERSION) @@ -143,7 +143,7 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ /* The return value */ if (NULL==(mesg = H5FL_MALLOC(time_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); *mesg = (time_t)tmp_time; /* Set return value */ @@ -179,13 +179,6 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; struct tm tm; void *ret_value = NULL; /* Return value */ -#if _MSC_VER >= 1900 /* VS 2015 */ - /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - * variable declared in time.h. That variable was deprecated and in VS 2015 - * is removed, with _get_timezone replacing it. - */ - long timezone = 0; -#endif FUNC_ENTER_NOAPI_NOINIT @@ -193,54 +186,22 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 HDassert(f); HDassert(p); - /* Initialize time zone information */ - if(!ntzset) { - HDtzset(); - ntzset = TRUE; - } /* end if */ - /* decode */ for(i = 0; i < 14; i++) if(!HDisdigit(p[i])) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") - /* - * Convert YYYYMMDDhhmmss UTC to a time_t. This is a little problematic - * because mktime() operates on local times. We convert to local time - * and then figure out the adjustment based on the local time zone and - * daylight savings setting. - */ + /* Convert YYYYMMDDhhmmss UTC to a time_t. */ HDmemset(&tm, 0, sizeof tm); - tm.tm_year = (p[0]-'0')*1000 + (p[1]-'0')*100 + - (p[2]-'0')*10 + (p[3]-'0') - 1900; + tm.tm_year = (p[0]-'0')*1000 + (p[1]-'0')*100 + (p[2]-'0')*10 + (p[3]-'0') - 1900; tm.tm_mon = (p[4]-'0')*10 + (p[5]-'0') - 1; tm.tm_mday = (p[6]-'0')*10 + (p[7]-'0'); tm.tm_hour = (p[8]-'0')*10 + (p[9]-'0'); tm.tm_min = (p[10]-'0')*10 + (p[11]-'0'); tm.tm_sec = (p[12]-'0')*10 + (p[13]-'0'); - tm.tm_isdst = -1; /*figure it out*/ - if((time_t)-1 == (the_time = HDmktime(&tm))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") - -#if defined(H5_HAVE_TM_GMTOFF) - /* BSD-like systems */ - the_time += tm.tm_gmtoff; -#elif defined(H5_HAVE_TIMEZONE) - #if _MSC_VER >= 1900 /* VS 2015 */ - HDget_timezone(&timezone); - #endif - /* GNU/Linux systems */ - the_time -= timezone - (tm.tm_isdst ? 3600 : 0); -#else - /* - * The catch-all. If we can't convert a character string universal - * coordinated time to a time_t value reliably then we can't decode the - * modification time message. This really isn't as bad as it sounds -- the - * only way a user can get the modification time is from our internal - * query routines, which can gracefully recover. - */ - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") -#endif + tm.tm_isdst = -1; /* (figure it out) */ + if((time_t)-1 == (the_time = H5_make_time(&tm))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't construct time info") /* The return value */ if(NULL == (mesg = H5FL_MALLOC(time_t))) @@ -276,9 +237,9 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg); + HDassert(f); + HDassert(p); + HDassert(mesg); /* Version */ *p++ = H5O_MTIME_VERSION; @@ -319,15 +280,15 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg); + HDassert(f); + HDassert(p); + HDassert(mesg); /* encode */ tm = HDgmtime(mesg); - sprintf((char*)p, "%04d%02d%02d%02d%02d%02d", - 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + HDsprintf((char*)p, "%04d%02d%02d%02d%02d%02d", + 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); FUNC_LEAVE_NOAPI(SUCCEED) } @@ -356,12 +317,12 @@ H5O_mtime_copy(const void *_mesg, void *_dest) { const time_t *mesg = (const time_t *) _mesg; time_t *dest = (time_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(mesg); + HDassert(mesg); if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -402,8 +363,8 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disabl FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); FUNC_LEAVE_NOAPI(8) } /* end H5O_mtime_new_size() */ @@ -435,8 +396,8 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_sh FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); FUNC_LEAVE_NOAPI(16) } @@ -469,15 +430,13 @@ H5O_mtime_reset(void H5_ATTR_UNUSED *_mesg) /*------------------------------------------------------------------------- * Function: H5O_mtime_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -504,8 +463,6 @@ H5O_mtime_free(void *mesg) * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -519,18 +476,18 @@ H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(mesg); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); /* debug */ tm = HDlocaltime(mesg); HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Time:", buf); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Time:", buf); FUNC_LEAVE_NOAPI(SUCCEED) } diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 479e620..5411068 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -115,6 +115,9 @@ struct timespec #define HDroundf(V) Wroundf(V) #endif /* MSC_VER < 1700 */ +#endif /* H5_HAVE_VISUAL_STUDIO */ + + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -149,15 +152,6 @@ extern "C" { #define HDgetlogin() Wgetlogin() #define HDsnprintf c99_snprintf /*varargs*/ #define HDvsnprintf c99_vsnprintf /*varargs*/ -#if _MSC_VER >= 1900 /* VS 2015 */ - /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - * variable declared in time.h. That variable was deprecated and in VS 2015 - * is removed, with _get_timezone replacing it. - */ - #define HDget_timezone(V) _get_timezone(V); -#endif /* VS 2015 */ - -#endif /* H5_HAVE_VISUAL_STUDIO */ /* Non-POSIX functions */ -- cgit v0.12