diff options
-rw-r--r-- | src/H5C.c | 86 | ||||
-rw-r--r-- | src/H5Cpkg.h | 15 | ||||
-rw-r--r-- | src/H5Cprivate.h | 236 | ||||
-rw-r--r-- | src/H5Dint.c | 102 | ||||
-rw-r--r-- | src/H5FDcore.c | 16 | ||||
-rw-r--r-- | src/H5FDfamily.c | 50 | ||||
-rw-r--r-- | src/H5detect.c | 69 |
7 files changed, 293 insertions, 281 deletions
@@ -79,16 +79,16 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Cpkg.h" /* Cache */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ /****************/ @@ -556,7 +556,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%scache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -1706,7 +1706,7 @@ done: * Function: H5C_mark_entry_unserialized * * Purpose: Mark a pinned or protected entry as unserialized. The target - * entry MUST be either pinned or protected, and MAY be both. + * entry MUST be either pinned or protected, and MAY be both. * * Return: Non-negative on success/Negative on failure * @@ -1751,7 +1751,7 @@ done: * Function: H5C_mark_entry_serialized * * Purpose: Mark a pinned entry as serialized. The target entry MUST be - * pinned. + * pinned. * * Return: Non-negative on success/Negative on failure * @@ -2095,7 +2095,7 @@ done: * Function: H5C_pin_protected_entry() * * Purpose: Pin a protected cache entry. The entry must be protected - * at the time of call, and must be unpinned. + * at the time of call, and must be unpinned. * * Return: Non-negative on success/Negative on failure * @@ -2450,7 +2450,7 @@ H5C_protect(H5F_t * f, * ******************************************* * * Set the flush_last field - * of the newly loaded entry before inserting it into the + * of the newly loaded entry before inserting it into the * index. Must do this, as the index tracked the number of * entries with the flush_last field set, but assumes that * the field will not change after insertion into the index. @@ -2544,10 +2544,10 @@ H5C_protect(H5F_t * f, /* check to see if the cache is now oversized due to the cache * size reduction. If it is, try to evict enough entries to * bring the cache size down to the current maximum cache size. - * - * Also, if the min_clean_size requirement is not met, we - * should also call H5C__make_space_in_cache() to bring us - * into complience. + * + * Also, if the min_clean_size requirement is not met, we + * should also call H5C__make_space_in_cache() to bring us + * into complience. */ if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -2883,7 +2883,7 @@ done: * Function: H5C_unpin_entry() * * Purpose: Unpin a cache entry. The entry can be either protected or - * unprotected at the time of call, but must be pinned. + * unprotected at the time of call, but must be pinned. * * Return: Non-negative on success/Negative on failure * @@ -3366,7 +3366,7 @@ done: * Function: H5C_validate_resize_config() * * Purpose: Run a sanity check on the specified sections of the - * provided instance of struct H5C_auto_size_ctl_t. + * provided instance of struct H5C_auto_size_ctl_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. @@ -3525,11 +3525,11 @@ done: /*------------------------------------------------------------------------- * Function: H5C_create_flush_dependency() * - * Purpose: Initiates a parent<->child entry flush dependency. The parent + * Purpose: Initiates a parent<->child entry flush dependency. The parent * entry must be pinned or protected at the time of call, and must * have all dependencies removed before the cache can shut down. * - * Note: Flush dependencies in the cache indicate that a child entry + * Note: Flush dependencies in the cache indicate that a child entry * must be flushed to the file before its parent. (This is * currently used to implement Single-Writer/Multiple-Reader (SWMR) * I/O access for data structures in the file). @@ -3669,7 +3669,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_destroy_flush_dependency() * - * Purpose: Terminates a parent<-> child entry flush dependency. The + * Purpose: Terminates a parent<-> child entry flush dependency. The * parent entry must be pinned. * * Return: Non-negative on success/Negative on failure @@ -3791,7 +3791,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__pin_entry_from_client() * - * Purpose: Internal routine to pin a cache entry from a client action. + * Purpose: Internal routine to pin a cache entry from a client action. * * Return: Non-negative on success/Negative on failure * @@ -3840,7 +3840,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__unpin_entry_real() * - * Purpose: Internal routine to unpin a cache entry. + * Purpose: Internal routine to unpin a cache entry. * * Return: Non-negative on success/Negative on failure * @@ -3886,7 +3886,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__unpin_entry_from_client() * - * Purpose: Internal routine to unpin a cache entry from a client action. + * Purpose: Internal routine to unpin a cache entry from a client action. * * Return: Non-negative on success/Negative on failure * @@ -4180,7 +4180,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) * * ( 0 <= new_min_clean_size ). * - * by definition. + * by definition. */ HDassert( new_min_clean_size <= new_max_cache_size ); HDassert( (cache_ptr->resize_ctl).min_size <= new_max_cache_size ); @@ -4447,8 +4447,8 @@ done: * * Purpose: Evict clean entries in the cache that haven't * been accessed for at least - * (cache_ptr->resize_ctl).epochs_before_eviction epochs, - * and flush dirty entries that haven't been accessed for + * (cache_ptr->resize_ctl).epochs_before_eviction epochs, + * and flush dirty entries that haven't been accessed for * that amount of time. * * Depending on configuration, the function will either @@ -4583,7 +4583,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte || (prev_ptr->is_protected) || (prev_ptr->is_pinned)) { /* Something has happened to the LRU -- start over - * from the tail. + * from the tail. */ restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; @@ -4642,10 +4642,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. - * - * Since all entries are clean, serialize() will not be called, - * and thus we needn't test to see if the LRU has been changed - * out from under us. + * + * Since all entries are clean, serialize() will not be called, + * and thus we needn't test to see if the LRU has been changed + * out from under us. */ entry_ptr = prev_ptr; } /* end while */ @@ -4735,7 +4735,7 @@ done: * Function: H5C__autoadjust__ageout__remove_all_markers * * Purpose: Remove all epoch markers from the LRU list and mark them - * as inactive. + * as inactive. * * Return: SUCCEED on success/FAIL on failure. * @@ -5000,9 +5000,9 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, } /* note that we don't cycle the epoch markers. We can - * argue either way as to whether we should, but for now - * we don't. - */ + * argue either way as to whether we should, but for now + * we don't. + */ if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) { @@ -6948,7 +6948,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitt } #endif /* H5C_COLLECT_CACHE_STATS */ - /* reset entries_removed_counter and + /* reset entries_removed_counter and * last_entry_removed_ptr prior to the call to * H5C__flush_single_entry() so that we can spot * unexpected removals of entries from the cache, @@ -7008,12 +7008,12 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitt if ( didnt_flush_entry ) { - /* epoch markers don't get flushed, and we don't touch + /* epoch markers don't get flushed, and we don't touch * entries that are in the process of being flushed. * Hence no need for sanity checks, as we haven't * flushed anything. Thus just set entry_ptr to prev_ptr * and go on. - */ + */ entry_ptr = prev_ptr; } else if ( ( restart_scan ) @@ -8338,7 +8338,7 @@ done: * * Purpose: Serialize an entry and generate its image. * - * Note: This may cause the entry to be re-sized and/or moved in + * Note: This may cause the entry to be re-sized and/or moved in * the cache. * * As we will not update the metadata cache's data structures diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 47ee1ce..1969a8a 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -26,6 +26,9 @@ * reason why this file was created. */ +/* clang-format off */ +/* Maintain current format by disabling format for this file */ + #if !(defined H5C_FRIEND || defined H5C_MODULE) #error "Do not include this file outside the H5C package!" #endif @@ -1654,8 +1657,8 @@ if ( ( (cache_ptr)->index_size != \ * Function: H5C__REMOVE_ENTRY_FROM_SLIST * * Purpose: Remove the specified instance of H5C_cache_entry_t from the - * index skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * index skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * * Return: N/A * @@ -1743,7 +1746,7 @@ if ( ( (cache_ptr)->index_size != \ * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE * * Purpose: Update cache_ptr->slist_size for a change in the size of - * and entry in the slist. + * and entry in the slist. * * Return: N/A * @@ -3723,10 +3726,11 @@ typedef struct H5C_tag_info_t { * one. * * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t - * which contains the 'next' entry for an iteration. Removing + * which contains the 'next' entry for an iteration. Removing * this entry must trigger a rescan of the iteration, so each * entry removed from the cache is compared against this pointer - * and the pointer is reset to NULL if the watched entry is removed. + * and the pointer is reset to NULL if the watched entry is + * removed. * (This functions similarly to a "dead man's switch") * * @@ -4925,4 +4929,5 @@ H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_ #endif /* H5C_TESTING */ #endif /* _H5Cpkg_H */ +/* clang-format on */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index d20cb55..c65b9ff 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -99,6 +99,7 @@ #define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2 #define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4 #define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8 +/* clang-format off */ #define H5C_RESIZE_CFG__VALIDATE_ALL \ ( \ H5C_RESIZE_CFG__VALIDATE_GENERAL | \ @@ -106,6 +107,7 @@ H5C_RESIZE_CFG__VALIDATE_DECREMENT | \ H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \ ) +/* clang-format on */ /* Cache configuration versions */ #define H5C__CURR_AUTO_SIZE_CTL_VER 1 @@ -141,47 +143,47 @@ * * * These flags apply to H5C_insert_entry(): - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__PIN_ENTRY_FLAG + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__PIN_ENTRY_FLAG * H5C__FLUSH_LAST_FLAG ; super block only * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_protect() - * H5C__READ_ONLY_FLAG + * H5C__READ_ONLY_FLAG * H5C__FLUSH_LAST_FLAG ; super block only * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_unprotect(): - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__DELETED_FLAG - * H5C__DIRTIED_FLAG - * H5C__PIN_ENTRY_FLAG - * H5C__UNPIN_ENTRY_FLAG - * H5C__FREE_FILE_SPACE_FLAG - * H5C__TAKE_OWNERSHIP_FLAG + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__DELETED_FLAG + * H5C__DIRTIED_FLAG + * H5C__PIN_ENTRY_FLAG + * H5C__UNPIN_ENTRY_FLAG + * H5C__FREE_FILE_SPACE_FLAG + * H5C__TAKE_OWNERSHIP_FLAG * * These flags apply to H5C_expunge_entry(): - * H5C__FREE_FILE_SPACE_FLAG + * H5C__FREE_FILE_SPACE_FLAG * * These flags apply to H5C_evict(): - * H5C__EVICT_ALLOW_LAST_PINS_FLAG + * H5C__EVICT_ALLOW_LAST_PINS_FLAG * * These flags apply to H5C_flush_cache(): - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination * with H5C__FLUSH_INVALIDATE_FLAG) - * H5C__DURING_FLUSH_FLAG + * H5C__DURING_FLUSH_FLAG * * These flags apply to H5C_flush_single_entry(): - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG - * H5C__TAKE_OWNERSHIP_FLAG - * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG - * H5C__GENERATE_IMAGE_FLAG - * H5C__UPDATE_PAGE_BUFFER_FLAG + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__TAKE_OWNERSHIP_FLAG + * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG + * H5C__GENERATE_IMAGE_FLAG + * H5C__UPDATE_PAGE_BUFFER_FLAG */ #define H5C__NO_FLAGS_SET 0x00000 #define H5C__SET_FLUSH_MARKER_FLAG 0x00001 @@ -331,11 +333,11 @@ typedef struct H5C_t H5C_t; * returned in the parameter "image_len_ptr". * * For an entry with H5C__CLASS_NO_FLAGS_SET: - * This function returns in "image_len_ptr" the on disk size of the + * This function returns in "image_len_ptr" the on disk size of the * entry. * * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG: - * This function returns in "image_len_ptr" an initial guess of the + * This function returns in "image_len_ptr" an initial guess of the * entry's on disk size. This many bytes will be loaded from * the file and then passed to 'get_final_load_size' callback * for the actual (final) image length to be determined. @@ -370,7 +372,7 @@ typedef struct H5C_t H5C_t; * * GET_FINAL_LOAD_SIZE: Pointer to the 'get final load size' function. * - * This function determines the final size of a speculatively loaded + * This function determines the final size of a speculatively loaded * metadata cache entry based on the parameter "image" and the "udata" * parameters. This callback _must_ be implemented for cache clients * which set the H5C__CLASS_SPECULATIVE_LOAD_FLAG and must return the @@ -419,7 +421,7 @@ typedef struct H5C_t H5C_t; * * It computes the checksum based on the metadata stored in the * parameter "image_ptr" and the actual length of the metadata in the - * parameter "len" which is obtained from the "get_load_size" callback. + * parameter "len" which is obtained from the "get_load_size" callback. * * The typedef for the verify_chksum callback is as follows: * @@ -438,7 +440,7 @@ typedef struct H5C_t H5C_t; * * DESERIALIZE: Pointer to the deserialize function. * - * This function must be able to deserialize a buffer containing the + * This function must be able to deserialize a buffer containing the * on-disk image of a metadata cache entry, allocate and initialize the * equivalent in core representation, and return a pointer to that * representation. @@ -507,7 +509,7 @@ typedef struct H5C_t H5C_t; * typedef herr_t (*H5C_image_len_func_t)(void *thing, * size_t *image_len_ptr); * - * The parameters of the image_len callback are as follows: + * The parameters of the image_len callback are as follows: * * thing: Pointer to the in core representation of the entry. * @@ -531,11 +533,11 @@ typedef struct H5C_t H5C_t; * it needs a current on-disk image of the metadata entry for purposes * either constructing a journal or flushing the entry to disk. * - * If the client needs to change the address or length of the entry prior - * to flush, the pre-serialize callback is responsible for these actions, - * so that the actual serialize callback (described below) is only - * responsible for serializing the data structure, not moving it on disk - * or resizing it. + * If the client needs to change the address or length of the entry prior + * to flush, the pre-serialize callback is responsible for these actions, + * so that the actual serialize callback (described below) is only + * responsible for serializing the data structure, not moving it on disk + * or resizing it. * * In addition, the client may use the pre-serialize callback to * ensure that the entry is ready to be flushed -- in particular, @@ -848,11 +850,11 @@ typedef enum H5C_notify_action_t { H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache * via the insert call */ - H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the + H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the * from file via the protect call */ - H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to - * file. + H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to + * file. */ H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted * from cache. @@ -1014,8 +1016,8 @@ typedef int H5C_ring_t; * on disk image of the metadata cache entry is stored. * * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is - * written to disk + * callbacks must be used to update this image before it is + * written to disk * * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr * is up to date, and set to false when the entry is dirtied. @@ -1037,23 +1039,23 @@ typedef int H5C_ring_t; * * This field is set to FALSE in the protect call, and may * be set to TRUE by the H5C_mark_entry_dirty() call at any - * time prior to the unprotect call. + * time prior to the unprotect call. * * The H5C_mark_entry_dirty() call exists as a convenience - * function for the fractal heap code which may not know if - * an entry is protected or pinned, but knows that is either - * protected or pinned. The dirtied field was added as in - * the parallel case, it is necessary to know whether a - * protected entry is dirty prior to the protect call. + * function for the fractal heap code which may not know if + * an entry is protected or pinned, but knows that is either + * protected or pinned. The dirtied field was added as in + * the parallel case, it is necessary to know whether a + * protected entry is dirty prior to the protect call. * * is_protected: Boolean flag indicating whether this entry is protected - * (or locked, to use more conventional terms). When it is - * protected, the entry cannot be flushed or accessed until - * it is unprotected (or unlocked -- again to use more - * conventional terms). + * (or locked, to use more conventional terms). When it is + * protected, the entry cannot be flushed or accessed until + * it is unprotected (or unlocked -- again to use more + * conventional terms). * - * Note that protected entries are removed from the LRU lists - * and inserted on the protected list. + * Note that protected entries are removed from the LRU lists + * and inserted on the protected list. * * is_read_only: Boolean flag that is only meaningful if is_protected is * TRUE. In this circumstance, it indicates whether the @@ -1063,10 +1065,10 @@ typedef int H5C_ring_t; * and is_read_only are both TRUE), we allow the entry to be * protected more than once. * - * In this case, the number of readers is maintained in the - * ro_ref_count field (see below), and unprotect calls simply - * decrement that field until it drops to zero, at which point - * the entry is actually unprotected. + * In this case, the number of readers is maintained in the + * ro_ref_count field (see below), and unprotect calls simply + * decrement that field until it drops to zero, at which point + * the entry is actually unprotected. * * ro_ref_count: Integer field used to maintain a count of the number of * outstanding read-only protects on this entry. This field @@ -1089,12 +1091,12 @@ typedef int H5C_ring_t; * * 2) A pinned entry can be accessed or modified at any time. * This places an extra burden on the pre-serialize and - * serialize callbacks, which must ensure that a pinned - * entry is consistent and ready to write to disk before - * generating an image. + * serialize callbacks, which must ensure that a pinned + * entry is consistent and ready to write to disk before + * generating an image. * * 3) A pinned entry can be marked as dirty (and possibly - * change size) while it is unprotected. + * change size) while it is unprotected. * * 4) The flush-destroy code must allow pinned entries to * be unpinned (and possibly unprotected) during the @@ -1156,11 +1158,11 @@ typedef int H5C_ring_t; * other times, this field should be set to FALSE. * * flush_in_progress: Boolean flag that is set to true iff the entry - * is in the process of being flushed. This allows the cache - * to detect when a call is the result of a flush callback. + * is in the process of being flushed. This allows the cache + * to detect when a call is the result of a flush callback. * * destroy_in_progress: Boolean flag that is set to true iff the entry - * is in the process of being flushed and destroyed. + * is in the process of being flushed and destroyed. * * * Fields supporting rings for flush ordering: @@ -1579,17 +1581,17 @@ typedef int H5C_ring_t; * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow * collection of statistics on individual cache entries. * - * accesses: int32_t containing the number of times this cache entry has - * been referenced in its lifetime. + * accesses: int32_t containing the number of times this cache entry has + * been referenced in its lifetime. * * clears: int32_t containing the number of times this cache entry has - * been cleared in its life time. + * been cleared in its life time. * - * flushes: int32_t containing the number of times this cache entry has - * been flushed to file in its life time. + * flushes: int32_t containing the number of times this cache entry has + * been flushed to file in its life time. * - * pins: int32_t containing the number of times this cache entry has - * been pinned in cache in its life time. + * pins: int32_t containing the number of times this cache entry has + * been pinned in cache in its life time. * ****************************************************************************/ typedef struct H5C_cache_entry_t { @@ -1706,7 +1708,7 @@ typedef struct H5C_cache_entry_t { * ring: Instance of H5C_ring_t indicating the flush ordering ring * to which this entry is assigned. * - * age: Number of times this prefetech entry has appeared in + * age: Number of times this prefetech entry has appeared in * the current sequence of cache images. This field is * initialized to 0 if the instance of H5C_image_entry_t * is constructed from a regular entry. @@ -1756,17 +1758,17 @@ typedef struct H5C_cache_entry_t { * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are - * not in the image are removed from this count and + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are + * not in the image are removed from this count and * from the fd_parent_addrs array below. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. * * fd_parent_addrs: If the entry is a child in one or more flush dependency * relationship when H5C_prep_for_file_close() is called, this @@ -1779,27 +1781,27 @@ typedef struct H5C_cache_entry_t { * Note that while this list of addresses is initially taken * from the flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not - * in the image are removed from this list, and from the - * fd_parent_count above. + * (i.e. include_in_image is TRUE), any parents that are not + * in the image are removed from this list, and from the + * fd_parent_count above. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. * * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush - * dependency children. + * relationship, this field contains the number of flush + * dependency children. * - * In all other cases, the field is set to zero. + * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any children + * (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * * fd_dirty_child_count: If the entry is a parent in a flush dependency @@ -1811,16 +1813,16 @@ typedef struct H5C_cache_entry_t { * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children - * that are not in the image are removed from this count. + * (i.e. include_in_image is TRUE), any dirty children + * that are not in the image are removed from this count. * * image_ptr: Pointer to void. When not NULL, this field points to a - * dynamically allocated block of size bytes in which the - * on disk image of the metadata cache entry is stored. + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is - * written to disk + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is + * written to disk * * ****************************************************************************/ @@ -1857,7 +1859,7 @@ typedef struct H5C_image_entry_t { * version number, or an error will be flagged. * * report_fcn: Pointer to the function that is to be called to report - * activities each time the auto cache resize code is executed. If the + * activities each time the auto cache resize code is executed. If the * field is NULL, no call is made. * * If the field is not NULL, it must contain the address of a function @@ -1882,16 +1884,16 @@ typedef struct H5C_image_entry_t { * be greater than or equal to min_size. * * min_size: Minimum size to which the cache can be adjusted. The - * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must + * supplied value must fall in the closed interval + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must * be less than or equal to max_size. * * epoch_length: Number of accesses on the cache over which to collect * hit rate stats before running the automatic cache resize code, - * if it is enabled. + * if it is enabled. * * At the end of an epoch, we discard prior hit rate data and start - * collecting afresh. The epoch_length must lie in the closed + * collecting afresh. The epoch_length must lie in the closed * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. * * @@ -1917,30 +1919,30 @@ typedef struct H5C_image_entry_t { * all available space. * * lower_hr_threshold: Lower hit rate threshold. If the increment mode - * (incr_mode) is H5C_incr__threshold and the hit rate drops below the - * value supplied in this field in an epoch, increment the cache size by - * size_increment. Note that cache size may not be incremented above - * max_size, and that the increment may be further restricted by the - * max_increment field if it is enabled. + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above + * max_size, and that the increment may be further restricted by the + * max_increment field if it is enabled. * - * When enabled, this field must contain a value in the range [0.0, 1.0]. - * Depending on the incr_mode selected, it may also have to be less than - * upper_hr_threshold. + * When enabled, this field must contain a value in the range [0.0, 1.0]. + * Depending on the incr_mode selected, it may also have to be less than + * upper_hr_threshold. * * increment: Double containing the multiplier used to derive the new - * cache size from the old if a cache size increment is triggered. - * The increment must be greater than 1.0, and should not exceed 2.0. + * cache size from the old if a cache size increment is triggered. + * The increment must be greater than 1.0, and should not exceed 2.0. * - * The new cache size is obtained by multiplying the current max cache - * size by the increment, and then clamping to max_size and to stay - * within the max_increment as necessary. + * The new cache size is obtained by multiplying the current max cache + * size by the increment, and then clamping to max_size and to stay + * within the max_increment as necessary. * * apply_max_increment: Boolean flag indicating whether the max_increment - * field should be used to limit the maximum cache size increment. + * field should be used to limit the maximum cache size increment. * * max_increment: If enabled by the apply_max_increment field described - * above, this field contains the maximum number of bytes by which the - * cache size can be increased in a single re-size. + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. * * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated * type whose value indicates whether and by what algorithm we should @@ -2202,11 +2204,11 @@ typedef struct H5C_auto_size_ctl_t { #define H5C__DEFAULT_CACHE_IMAGE_CTL \ { \ - /* version = */ H5C__CURR_CACHE_IMAGE_CTL_VER, \ - /* generate_image = */ FALSE, \ - /* save_resize_status = */ FALSE, \ - /* entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, \ - /* flags = */ H5C_CI__ALL_FLAGS \ + H5C__CURR_CACHE_IMAGE_CTL_VER, /* = version */ \ + FALSE, /* = generate_image */ \ + FALSE, /* = save_resize_status */ \ + H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, /* = entry_ageout */ \ + H5C_CI__ALL_FLAGS /* = flags */ \ } typedef struct H5C_cache_image_ctl_t { diff --git a/src/H5Dint.c b/src/H5Dint.c index 079fef7..e2c9f07 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -134,10 +134,10 @@ H5FL_EXTERN(H5D_chunk_info_t); H5FL_BLK_EXTERN(type_conv); /* Disable warning for intentional identical branches here -QAK */ -H5_GCC_DIAG_OFF(larger-than=) +H5_GCC_DIAG_OFF("larger-than=") /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; -H5_GCC_DIAG_ON(larger-than=) +H5_GCC_DIAG_ON("larger-than=") /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ @@ -155,7 +155,7 @@ static hbool_t H5D_top_package_initialize_s = FALSE; static const char *H5D_prefix_ext_env = NULL; static const char *H5D_prefix_vds_env = NULL; - + /*------------------------------------------------------------------------- * Function: H5D_init * @@ -178,7 +178,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_init() */ - + /*-------------------------------------------------------------------------- NAME H5D__init_package -- Initialize interface-specific information @@ -241,7 +241,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__init_package() */ - + /*------------------------------------------------------------------------- * Function: H5D_top_term_package * @@ -295,7 +295,7 @@ H5D_top_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5D_top_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5D_term_package * @@ -332,7 +332,7 @@ H5D_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5D_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5D__close_cb * @@ -369,7 +369,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__close_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__create_named * @@ -422,7 +422,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create_named() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_space_status * @@ -495,7 +495,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_space_status() */ - + /*------------------------------------------------------------------------- * Function: H5D__new * @@ -566,7 +566,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__new() */ - + /*------------------------------------------------------------------------- * Function: H5D__init_type * @@ -641,7 +641,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__init_type() */ - + /*------------------------------------------------------------------------- * Function: H5D__cache_dataspace_info * @@ -681,7 +681,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__cache_dataspace_info() */ - + /*------------------------------------------------------------------------- * Function: H5D__init_space * @@ -724,7 +724,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__init_space() */ - + /*------------------------------------------------------------------------- * Function: H5D__use_minimized_dset_headers * @@ -762,7 +762,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5D__use_minimized_dset_headers */ - + /*------------------------------------------------------------------------- * Function: H5D__calculate_minimium_header_size * @@ -882,7 +882,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5D__calculate_minimum_header_size */ - + /*------------------------------------------------------------------------- * Function: H5D__prepare_minimized_oh * @@ -925,7 +925,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5D__prepare_minimized_oh */ - + /*------------------------------------------------------------------------- * Function: H5D__update_oh_info * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__update_oh_info() */ - + /*-------------------------------------------------------------------------- * Function: H5D__build_file_prefix @@ -1213,7 +1213,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__build_file_prefix() */ - + /*------------------------------------------------------------------------- * Function: H5D__create * @@ -1463,7 +1463,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__create() */ - + /*------------------------------------------------------------------------- * Function: H5D__open_name * @@ -1521,7 +1521,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__open_name() */ - + /* *------------------------------------------------------------------------- * Function: H5D_open @@ -1656,7 +1656,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_open() */ - + /* *------------------------------------------------------------------------- * Function: H5D__flush_append_setup @@ -1731,7 +1731,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__append_flush_setup() */ - + /*------------------------------------------------------------------------- * Function: H5D__open_oid * @@ -1901,7 +1901,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__open_oid() */ - + /*------------------------------------------------------------------------- * Function: H5D_close * @@ -2106,7 +2106,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_close() */ - + /*------------------------------------------------------------------------- * Function: H5D_mult_refresh_close * @@ -2186,7 +2186,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mult_refresh_close() */ - + /*------------------------------------------------------------------------- * Function: H5D_mult_refresh_reopen * @@ -2233,7 +2233,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_mult_refresh_reopen() */ - + /*------------------------------------------------------------------------- * Function: H5D_oloc * @@ -2252,7 +2252,7 @@ H5D_oloc(H5D_t *dataset) FUNC_LEAVE_NOAPI(dataset ? &(dataset->oloc) : (H5O_loc_t *)NULL) } /* end H5D_oloc() */ - + /*------------------------------------------------------------------------- * Function: H5D_nameof * @@ -2271,7 +2271,7 @@ H5D_nameof(const H5D_t *dataset) FUNC_LEAVE_NOAPI(dataset ? &(dataset->path) : NULL) } /* end H5D_nameof() */ - + /*------------------------------------------------------------------------- * Function: H5D__alloc_storage * @@ -2437,7 +2437,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__alloc_storage() */ - + /*------------------------------------------------------------------------- * Function: H5D__init_storage * @@ -2509,7 +2509,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__init_storage() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_storage_size * @@ -2564,7 +2564,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__get_storage_size() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_offset * @@ -2611,7 +2611,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_offset() */ - + /*------------------------------------------------------------------------- * Function: H5D__vlen_get_buf_size_alloc * @@ -2649,7 +2649,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__vlen_get_buf_size_alloc() */ - + /*------------------------------------------------------------------------- * Function: H5D__vlen_get_buf_size_cb * @@ -2685,7 +2685,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__vlen_get_buf_size_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__vlen_get_buf_size * @@ -2784,7 +2784,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__vlen_get_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5D__vlen_get_buf_size_gen_cb * @@ -2840,7 +2840,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__vlen_get_buf_size_gen_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D__vlen_get_buf_size_gen * @@ -2953,7 +2953,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__vlen_get_buf_size_gen() */ - + /*------------------------------------------------------------------------- * Function: H5D__check_filters * @@ -3003,7 +3003,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__check_filters() */ - + /*------------------------------------------------------------------------- * Function: H5D__set_extent * @@ -3187,7 +3187,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__set_extent() */ - + /*------------------------------------------------------------------------- * Function: H5D__flush_sieve_buf * @@ -3224,7 +3224,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__flush_sieve_buf() */ - + /*------------------------------------------------------------------------- * Function: H5D__flush_real * @@ -3255,7 +3255,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__flush_real() */ - + /*------------------------------------------------------------------------- * Function: H5D__flush * @@ -3288,7 +3288,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__flush() */ - + /*------------------------------------------------------------------------- * Function: H5D__format_convert * @@ -3439,7 +3439,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__format_convert() */ - + /*------------------------------------------------------------------------- * Function: H5D__mark * @@ -3500,7 +3500,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__mark() */ - + /*------------------------------------------------------------------------- * Function: H5D__flush_all_cb * @@ -3533,7 +3533,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__flush_all_cb() */ - + /*------------------------------------------------------------------------- * Function: H5D_flush_all * @@ -3561,7 +3561,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_flush_all() */ - + /*------------------------------------------------------------------------- * Function: H5D_get_create_plist * @@ -3738,7 +3738,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_create_plist() */ - + /*------------------------------------------------------------------------- * Function: H5D_get_access_plist * @@ -3835,7 +3835,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_access_plist() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_space * @@ -3875,7 +3875,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_space() */ - + /*------------------------------------------------------------------------- * Function: H5D__get_type * @@ -3931,7 +3931,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__get_type() */ - + /*------------------------------------------------------------------------- * Function: H5D__refresh * diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 2afe7ea..cb29fb2 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -1090,6 +1090,7 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) FUNC_ENTER_STATIC_NOERR + /* clang-format off */ /* Set the VFL feature flags that this driver supports */ if(flags) { *flags = 0; @@ -1106,6 +1107,7 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } } /* end if */ + /* clang-format on */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__core_query() */ @@ -1275,7 +1277,7 @@ static herr_t H5FD__core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - H5FD_core_t *file = (H5FD_core_t*)_file; + H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1484,7 +1486,7 @@ done: * If we are not closing, we realloc the buffer to size equal * to the smallest multiple of the allocation increment that * equals or exceeds the eoa and set the eof accordingly. - * Note that we no longer truncate the backing store to the + * Note that we no longer truncate the backing store to the * new eof if applicable. * -- JRM * @@ -1584,9 +1586,9 @@ done: * Function: H5FD__core_lock * * Purpose: To place an advisory lock on a file. - * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * The lock type to apply depends on the parameter "rw": + * TRUE--opens for write: an exclusive lock + * FALSE--opens for read: a shared lock * * Return: SUCCEED/FAIL * @@ -1640,7 +1642,7 @@ done: static herr_t H5FD__core_unlock(H5FD_t *_file) { - H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ + H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1653,7 +1655,7 @@ H5FD__core_unlock(H5FD_t *_file) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 076f08c..03aa27d 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -237,7 +237,7 @@ H5FD__family_term(void) * * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -280,11 +280,11 @@ done: * Function: H5Pget_fapl_family * * Purpose: Returns information about the family file access property - * list though the function arguments. + * list though the function arguments. * * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -328,7 +328,7 @@ done: * * Return: Success: Ptr to new file access property list. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Friday, August 13, 1999 @@ -372,7 +372,7 @@ done: * * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -425,7 +425,7 @@ done: * * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -457,7 +457,7 @@ done: * * Return: Success: The super block driver data size. * - * Failure: never fails + * Failure: never fails * * Programmer: Raymond Lu * Tuesday, May 10, 2005 @@ -486,7 +486,7 @@ H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) * * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Raymond Lu * Tuesday, May 10, 2005 @@ -521,7 +521,7 @@ H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out /*------------------------------------------------------------------------- * Function: H5FD__family_sb_decode * - * Purpose: This function has 2 separate purpose. One is to decodes the + * Purpose: This function has 2 separate purpose. One is to decodes the * superblock information for this driver. The NAME argument is * the eight-character (plus null termination) name stored in i * the file. The FILE argument is updated according to the @@ -529,7 +529,7 @@ H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out * * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Raymond Lu * Tuesday, May 10, 2005 @@ -582,7 +582,7 @@ done: * public fields will be initialized by the * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -595,7 +595,7 @@ done: * memb_name & temp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static H5FD_t * H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) @@ -746,7 +746,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_open() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- @@ -756,7 +756,7 @@ H5_GCC_DIAG_ON(format-nonliteral) * * Return: Success: Non-negative * - * Failure: Negative with as many members closed as + * Failure: Negative with as many members closed as * possible. The only subsequent operation * permitted on the file is a close operation. * @@ -809,7 +809,7 @@ H5FD__family_close(H5FD_t *_file) * * Return: Success: like strcmp() * - * Failure: never fails (arguments were checked by the + * Failure: never fails (arguments were checked by the * caller). * * Programmer: Robb Matzke @@ -842,7 +842,7 @@ H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) * (listed in H5FDpublic.h) * * Return: Success: non-negative - * Failure: negative + * Failure: negative * * Programmer: Quincey Koziol * Friday, August 25, 2000 @@ -882,7 +882,7 @@ H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) * * Return: Success: The end-of-address-marker * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -907,7 +907,7 @@ H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -920,7 +920,7 @@ H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * memb_name in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) { @@ -987,7 +987,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- @@ -1000,7 +1000,7 @@ H5_GCC_DIAG_ON(format-nonliteral) * the end of the family of files or the current * EOA, whichever is larger. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -1096,7 +1096,7 @@ done: * Return: Success: Zero. Result is stored in caller-supplied * buffer BUF. * - * Failure: -1, contents of buffer BUF are undefined. + * Failure: -1, contents of buffer BUF are undefined. * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -1163,7 +1163,7 @@ done: * * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -1227,7 +1227,7 @@ done: * Purpose: Flushes all family members. * * Return: Success: 0 - * Failure: -1, as many files flushed as possible. + * Failure: -1, as many files flushed as possible. * * Programmer: Robb Matzke * Wednesday, August 4, 1999 @@ -1262,7 +1262,7 @@ done: * * Return: Success: 0 * - * Failure: -1, as many files truncated as possible. + * Failure: -1, as many files truncated as possible. * * Programmer: Quincey Koziol * Saturday, February 23, 2008 diff --git a/src/H5detect.c b/src/H5detect.c index 138695b..652dab8 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -43,13 +43,16 @@ static const char *FileHeader = "\n\ */ #undef NDEBUG #include "H5private.h" +/* Do NOT use HDfprintf in this file as it is not linked with the library, + * which contains the H5system.c file in which the function is defined. + */ #include "H5Tpublic.h" #include "H5Rpublic.h" /* Disable warning about cast increasing the alignment of the target type, * that's _exactly_ what this code is probing. -QAK */ -H5_GCC_DIAG_OFF(cast-align) +H5_GCC_DIAG_OFF("cast-align") #if defined(__has_attribute) # if __has_attribute(no_sanitize_address) @@ -117,9 +120,9 @@ typedef struct malign_t { FILE *rawoutstream = NULL; /* global variables types detection code */ -H5_GCC_DIAG_OFF(larger-than=) +H5_GCC_DIAG_OFF("larger-than=") static detected_t d_g[MAXDETECT]; -H5_GCC_DIAG_ON(larger-than=) +H5_GCC_DIAG_ON("larger-than=") static malign_t m_g[MAXDETECT]; static volatile int nd_g = 0, na_g = 0; @@ -155,7 +158,7 @@ static H5JMP_BUF jbuf_g; #endif - + /*------------------------------------------------------------------------- * Function: precision * @@ -208,7 +211,7 @@ precision (detected_t *d) } } - + /*------------------------------------------------------------------------- * Function: DETECT_I/DETECT_BYTE * @@ -263,7 +266,7 @@ precision (detected_t *d) DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \ } - + /*------------------------------------------------------------------------- * Function: DETECT_F * @@ -302,10 +305,10 @@ precision (detected_t *d) for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask = (unsigned char) (_byte_mask << 1)) { \ _buf1[_i] ^= _byte_mask; \ HDmemcpy((void *)&_v2, (const void *)_buf1, sizeof(TYPE)); \ - H5_GCC_DIAG_OFF(float-equal) \ + H5_GCC_DIAG_OFF("float-equal") \ if(_v1 != _v2) \ _pad_mask[_i] |= _byte_mask; \ - H5_GCC_DIAG_ON(float-equal) \ + H5_GCC_DIAG_ON("float-equal") \ _buf1[_i] ^= _byte_mask; \ } /* end for */ \ \ @@ -360,7 +363,7 @@ precision (detected_t *d) } \ } - + /*------------------------------------------------------------------------- * Function: DETECT_M * @@ -411,10 +414,10 @@ precision (detected_t *d) else /* Little-Endian */ \ HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ _val2 = *((TYPE*)(_buf+align_g[_ano])); \ - H5_GCC_DIAG_OFF(float-equal) \ + H5_GCC_DIAG_OFF("float-equal") \ if(_val!=_val2) \ H5LONGJMP(jbuf_g, 1); \ - H5_GCC_DIAG_ON(float-equal) \ + H5_GCC_DIAG_ON("float-equal") \ /* End Cray Check */ \ (INFO.align)=align_g[_ano]; \ } else { \ @@ -435,7 +438,7 @@ precision (detected_t *d) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigsegv_handler * @@ -468,7 +471,7 @@ sigsegv_handler(int H5_ATTR_UNUSED signo) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigbus_handler * @@ -501,7 +504,7 @@ sigbus_handler(int H5_ATTR_UNUSED signo) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigill_handler * @@ -532,7 +535,7 @@ sigill_handler(int H5_ATTR_UNUSED signo) } #endif - + /*------------------------------------------------------------------------- * Function: print_results * @@ -811,7 +814,7 @@ done:\n\ fprintf(rawoutstream, "/* sigill_handler called: %d times */\n", sigill_handler_called_g); } /* end print_results() */ - + /*------------------------------------------------------------------------- * Function: iprint * @@ -901,7 +904,7 @@ iprint(detected_t *d) } - + /*------------------------------------------------------------------------- * Function: byte_cmp * @@ -928,7 +931,7 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask) return -1; } - + /*------------------------------------------------------------------------- * Function: bit_cmp * @@ -969,7 +972,7 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, return 0; } - + /*------------------------------------------------------------------------- * Function: fix_order * @@ -1037,7 +1040,7 @@ fix_order(int n, int last, int *perm, const char **mesg) } } - + /*------------------------------------------------------------------------- * Function: imp_bit * @@ -1091,7 +1094,7 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_ return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } - + /*------------------------------------------------------------------------- * Function: find_bias * @@ -1122,7 +1125,7 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a) return bias; } - + /*------------------------------------------------------------------------- * Function: print_header * @@ -1263,7 +1266,7 @@ bit.\n"; } - + /*------------------------------------------------------------------------- * Function: detect_C89_integers * @@ -1285,7 +1288,7 @@ detect_C89_integers(void) DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- * Function: detect_C89_floats * @@ -1301,7 +1304,7 @@ detect_C89_floats(void) DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers8 * @@ -1357,7 +1360,7 @@ detect_C99_integers8(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers16 * @@ -1389,7 +1392,7 @@ detect_C99_integers16(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers32 * @@ -1421,7 +1424,7 @@ detect_C99_integers32(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers64 * @@ -1467,7 +1470,7 @@ detect_C99_integers64(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers * @@ -1487,7 +1490,7 @@ detect_C99_integers(void) detect_C99_integers64(); } - + /*------------------------------------------------------------------------- * Function: detect_C99_floats * @@ -1512,7 +1515,7 @@ detect_C99_floats(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_alignments * @@ -1590,7 +1593,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) } #endif - + /*------------------------------------------------------------------------- * Function: main * @@ -1682,4 +1685,4 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } -H5_GCC_DIAG_ON(cast-align) +H5_GCC_DIAG_ON("cast-align") |