summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:39:03 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:39:03 (GMT)
commit753adc730358861c489c1da7e4ccd018af6b351c (patch)
treea3545e5f0dfa63f636f171f30f116eb532272cb1 /src
parent06e367c49b1d0e0875a3aae69817fbceb4020aa9 (diff)
downloadhdf5-753adc730358861c489c1da7e4ccd018af6b351c.zip
hdf5-753adc730358861c489c1da7e4ccd018af6b351c.tar.gz
hdf5-753adc730358861c489c1da7e4ccd018af6b351c.tar.bz2
Merge clang-format changes from develop
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt26
-rw-r--r--src/H5ACprivate.h160
-rw-r--r--src/H5C.c2814
-rw-r--r--src/H5Cpkg.h1518
-rw-r--r--src/H5Cprivate.h833
-rw-r--r--src/H5Dint.c513
-rw-r--r--src/H5FDcore.c88
-rw-r--r--src/H5FDfamily.c584
-rw-r--r--src/H5FDmulti.c1250
-rw-r--r--src/H5FDprivate.h20
-rw-r--r--src/H5Fprivate.h304
-rw-r--r--src/H5Gpkg.h44
-rw-r--r--src/H5Gprivate.h30
-rw-r--r--src/H5Lprivate.h19
-rw-r--r--src/H5Lpublic.h16
-rw-r--r--src/H5MFpkg.h12
-rw-r--r--src/H5PL.c11
-rw-r--r--src/H5Tconv.c4444
-rw-r--r--src/H5Tnative.c98
-rw-r--r--src/H5VMprivate.h78
-rw-r--r--src/H5detect.c26
-rw-r--r--src/H5public.h66
-rw-r--r--src/H5system.c48
23 files changed, 6532 insertions, 6470 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 46e6aa3..fc69998 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -704,6 +704,7 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Lpkg.h
${HDF5_SRC_DIR}/H5Lprivate.h
+ ${HDF5_SRC_DIR}/H5MFpkg.h
${HDF5_SRC_DIR}/H5MFprivate.h
${HDF5_SRC_DIR}/H5MMprivate.h
@@ -916,6 +917,13 @@ else ()
endif ()
endif ()
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_SRC_DETECT_FORMAT ${HDF5_SRC_DIR}/H5detect.c)
+endif ()
+
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
@@ -925,6 +933,13 @@ target_link_libraries (H5make_libsettings
PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_SRC_LIBSETTINGS_FORMAT H5make_libsettings)
+endif ()
+
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
${HDF5_BINARY_DIR}/gen_SRCS.stamp2
@@ -1027,6 +1042,17 @@ if (BUILD_SHARED_LIBS)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_SRC_FORMAT ${HDF5_LIB_TARGET})
+ else ()
+ clang_format (HDF5_SRC_FORMAT ${HDF5_LIBSH_TARGET})
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
if (NOT HDF5_INSTALL_NO_DEVELOPMENT)
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 08ce75a..1889930 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -13,12 +13,12 @@
/*-------------------------------------------------------------------------
*
- * Created: H5ACprivate.h
- * Jul 9 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5ACprivate.h
+ * Jul 9 1997
+ * Robb Matzke <matzke@llnl.gov>
*
- * Purpose: Constants and typedefs available to the rest of the
- * library.
+ * Purpose: Constants and typedefs available to the rest of the
+ * library.
*
*-------------------------------------------------------------------------
*/
@@ -26,42 +26,42 @@
#ifndef _H5ACprivate_H
#define _H5ACprivate_H
-#include "H5ACpublic.h" /*public prototypes */
+#include "H5ACpublic.h" /*public prototypes */
/* Pivate headers needed by this header */
-#include "H5private.h" /* Generic Functions */
-#include "H5Cprivate.h" /* Cache */
-#include "H5Fprivate.h" /* File access */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Cprivate.h" /* Cache */
+#include "H5Fprivate.h" /* File access */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_METADATA_TRACE_FILE
-#define H5AC__TRACE_FILE_ENABLED 1
+#define H5AC__TRACE_FILE_ENABLED 1
#else /* H5_METADATA_TRACE_FILE */
-#define H5AC__TRACE_FILE_ENABLED 0
+#define H5AC__TRACE_FILE_ENABLED 0
#endif /* H5_METADATA_TRACE_FILE */
/* Types of metadata objects cached */
typedef enum {
- H5AC_BT_ID = 0, /*B-tree nodes */
- H5AC_SNODE_ID, /*symbol table nodes */
- H5AC_LHEAP_PRFX_ID, /*local heap prefix */
- H5AC_LHEAP_DBLK_ID, /*local heap data block */
- H5AC_GHEAP_ID, /*global heap */
- H5AC_OHDR_ID, /*object header */
- H5AC_OHDR_CHK_ID, /*object header chunk */
- H5AC_BT2_HDR_ID, /*v2 B-tree header */
- H5AC_BT2_INT_ID, /*v2 B-tree internal node */
- H5AC_BT2_LEAF_ID, /*v2 B-tree leaf node */
- H5AC_FHEAP_HDR_ID, /*fractal heap header */
- H5AC_FHEAP_DBLOCK_ID, /*fractal heap direct block */
- H5AC_FHEAP_IBLOCK_ID, /*fractal heap indirect block */
- H5AC_FSPACE_HDR_ID, /*free space header */
- H5AC_FSPACE_SINFO_ID,/*free space sections */
+ H5AC_BT_ID = 0, /*B-tree nodes */
+ H5AC_SNODE_ID, /*symbol table nodes */
+ H5AC_LHEAP_PRFX_ID, /*local heap prefix */
+ H5AC_LHEAP_DBLK_ID, /*local heap data block */
+ H5AC_GHEAP_ID, /*global heap */
+ H5AC_OHDR_ID, /*object header */
+ H5AC_OHDR_CHK_ID, /*object header chunk */
+ H5AC_BT2_HDR_ID, /*v2 B-tree header */
+ H5AC_BT2_INT_ID, /*v2 B-tree internal node */
+ H5AC_BT2_LEAF_ID, /*v2 B-tree leaf node */
+ H5AC_FHEAP_HDR_ID, /*fractal heap header */
+ H5AC_FHEAP_DBLOCK_ID, /*fractal heap direct block */
+ H5AC_FHEAP_IBLOCK_ID, /*fractal heap indirect block */
+ H5AC_FSPACE_HDR_ID, /*free space header */
+ H5AC_FSPACE_SINFO_ID,/*free space sections */
H5AC_SOHM_TABLE_ID, /*shared object header message master table */
H5AC_SOHM_LIST_ID, /*shared message index stored as a list */
H5AC_SUPERBLOCK_ID, /* file superblock */
- H5AC_TEST_ID, /*test entry -- not used for actual files */
- H5AC_NTYPES /* Number of types, must be last */
+ H5AC_TEST_ID, /*test entry -- not used for actual files */
+ H5AC_NTYPES /* Number of types, must be last */
} H5AC_type_t;
/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when
@@ -75,11 +75,11 @@ typedef enum {
*/
#if H5C_COLLECT_CACHE_STATS
-#define H5AC_DUMP_STATS_ON_CLOSE 0
+#define H5AC_DUMP_STATS_ON_CLOSE 0
#else /* H5C_COLLECT_CACHE_STATS */
-#define H5AC_DUMP_STATS_ON_CLOSE 0
+#define H5AC_DUMP_STATS_ON_CLOSE 0
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -87,45 +87,45 @@ typedef enum {
* At present, these are the same as those given in H5Cprivate.h.
*/
-#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE
-#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE
+#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE
+#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE
/*
- * Class methods pertaining to caching. Each type of cached object will
+ * Class methods pertaining to caching. Each type of cached object will
* have a constant variable with permanent life-span that describes how
- * to cache the object. That variable will be of type H5AC_class_t and
+ * to cache the object. That variable will be of type H5AC_class_t and
* have the following required fields...
*
- * LOAD: Loads an object from disk to memory. The function
- * should allocate some data structure and return it.
+ * LOAD: Loads an object from disk to memory. The function
+ * should allocate some data structure and return it.
*
- * FLUSH: Writes some data structure back to disk. It would be
- * wise for the data structure to include dirty flags to
- * indicate whether it really needs to be written. This
- * function is also responsible for freeing memory allocated
- * by the LOAD method if the DEST argument is non-zero (by
+ * FLUSH: Writes some data structure back to disk. It would be
+ * wise for the data structure to include dirty flags to
+ * indicate whether it really needs to be written. This
+ * function is also responsible for freeing memory allocated
+ * by the LOAD method if the DEST argument is non-zero (by
* calling the DEST method).
*
- * DEST: Just frees memory allocated by the LOAD method.
+ * DEST: Just frees memory allocated by the LOAD method.
*
- * CLEAR: Just marks object as non-dirty.
+ * CLEAR: Just marks object as non-dirty.
*
- * SIZE: Report the size (on disk) of the specified cache object.
- * Note that the space allocated on disk may not be contiguous.
+ * SIZE: Report the size (on disk) of the specified cache object.
+ * Note that the space allocated on disk may not be contiguous.
*/
#define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET
-#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG
+#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG
#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG
-typedef H5C_load_func_t H5AC_load_func_t;
-typedef H5C_flush_func_t H5AC_flush_func_t;
-typedef H5C_dest_func_t H5AC_dest_func_t;
-typedef H5C_clear_func_t H5AC_clear_func_t;
-typedef H5C_size_func_t H5AC_size_func_t;
+typedef H5C_load_func_t H5AC_load_func_t;
+typedef H5C_flush_func_t H5AC_flush_func_t;
+typedef H5C_dest_func_t H5AC_dest_func_t;
+typedef H5C_clear_func_t H5AC_clear_func_t;
+typedef H5C_size_func_t H5AC_size_func_t;
-typedef H5C_class_t H5AC_class_t;
+typedef H5C_class_t H5AC_class_t;
/* The H5AC_NSLOTS #define is now obsolete, as the metadata cache no longer
@@ -133,7 +133,7 @@ typedef H5C_class_t H5AC_class_t;
* interface between the metadata cache and the rest of HDF. It should
* be removed when we get to dealing with the size_hint parameter in
* H5AC_create().
- * JRM - 5/20/04
+ * JRM - 5/20/04
*
* Old comment on H5AC_NSLOTS follows:
*
@@ -144,7 +144,7 @@ typedef H5C_class_t H5AC_class_t;
#define H5AC_NSLOTS 10330 /* The library "likes" this number... */
-typedef H5C_cache_entry_t H5AC_info_t;
+typedef H5C_cache_entry_t H5AC_info_t;
/*===----------------------------------------------------------------------===
@@ -163,7 +163,7 @@ typedef enum H5AC_protect_t {
/* Typedef for metadata cache (defined in H5Cpkg.h) */
-typedef H5C_t H5AC_t;
+typedef H5C_t H5AC_t;
/* Metadata specific properties for FAPL */
/* (Only used for parallel I/O) */
@@ -191,6 +191,7 @@ extern hid_t H5AC_ind_dxpl_id;
#define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED
+/* clang-format off */
#ifdef H5_HAVE_PARALLEL
#define H5AC__DEFAULT_CACHE_CONFIG \
{ \
@@ -223,9 +224,9 @@ extern hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1F, \
- /* int dirty_bytes_threshold = */ (256 * 1024), \
- /* int metadata_write_strategy = */ \
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
+ /* int dirty_bytes_threshold = */ (256 * 1024), \
+ /* int metadata_write_strategy = */ \
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
#else /* H5_HAVE_PARALLEL */
#define H5AC__DEFAULT_CACHE_CONFIG \
@@ -259,11 +260,12 @@ extern hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1F, \
- /* int dirty_bytes_threshold = */ (256 * 1024), \
- /* int metadata_write_strategy = */ \
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
+ /* int dirty_bytes_threshold = */ (256 * 1024), \
+ /* int metadata_write_strategy = */ \
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
#endif /* H5_HAVE_PARALLEL */
+/* clang-format on */
/*
@@ -275,17 +277,17 @@ extern hid_t H5AC_ind_dxpl_id;
* the equivalent flags from H5Cprivate.h.
*/
-#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET
-#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG
-#define H5AC__DELETED_FLAG H5C__DELETED_FLAG
-#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG
-#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG
-#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG
-#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG
-#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG
+#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET
+#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG
+#define H5AC__DELETED_FLAG H5C__DELETED_FLAG
+#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG
+#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG
+#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG
+#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG
+#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG
#define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG
#define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG
-#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG
+#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG
#define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG
@@ -293,10 +295,10 @@ extern hid_t H5AC_ind_dxpl_id;
* H5AC_get_entry_status() call.
*/
-#define H5AC_ES__IN_CACHE 0x0001
-#define H5AC_ES__IS_DIRTY 0x0002
-#define H5AC_ES__IS_PROTECTED 0x0004
-#define H5AC_ES__IS_PINNED 0x0008
+#define H5AC_ES__IN_CACHE 0x0001
+#define H5AC_ES__IS_DIRTY 0x0002
+#define H5AC_ES__IS_PROTECTED 0x0004
+#define H5AC_ES__IS_PINNED 0x0008
/* external function declarations: */
@@ -304,7 +306,7 @@ extern hid_t H5AC_ind_dxpl_id;
H5_DLL herr_t H5AC_init(void);
H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr,
- unsigned * status_ptr);
+ unsigned * status_ptr);
H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
haddr_t addr, void *thing, unsigned int flags);
H5_DLL herr_t H5AC_pin_protected_entry(void *thing);
@@ -314,11 +316,11 @@ H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size);
H5_DLL herr_t H5AC_unpin_entry(void *thing);
H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id,
const H5AC_class_t *type, haddr_t addr,
- void *thing, unsigned flags);
+ void *thing, unsigned flags);
H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id);
H5_DLL herr_t H5AC_mark_entry_dirty(void *thing);
H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type,
- haddr_t old_addr, haddr_t new_addr);
+ haddr_t old_addr, haddr_t new_addr);
H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id);
@@ -357,7 +359,7 @@ H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr);
H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr);
H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr,
- const char * trace_file_name);
+ const char * trace_file_name);
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
diff --git a/src/H5C.c b/src/H5C.c
index b3f76dc..aa92610 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -19,73 +19,73 @@
*
* Purpose: Functions in this file implement a generic cache for
* things which exist on disk, and which may be
- * unambiguously referenced by their disk addresses.
+ * unambiguously referenced by their disk addresses.
*
* The code in this module was initially written in
- * support of a complete re-write of the metadata cache
- * in H5AC.c However, other uses for the cache code
- * suggested themselves, and thus this file was created
- * in an attempt to support re-use.
+ * support of a complete re-write of the metadata cache
+ * in H5AC.c However, other uses for the cache code
+ * suggested themselves, and thus this file was created
+ * in an attempt to support re-use.
*
- * For a detailed overview of the cache, please see the
- * header comment for H5C_t in H5Cpkg.h.
+ * For a detailed overview of the cache, please see the
+ * header comment for H5C_t in H5Cpkg.h.
*
*-------------------------------------------------------------------------
*/
/**************************************************************************
*
- * To Do:
+ * To Do:
*
- * Code Changes:
+ * Code Changes:
*
- * - Remove extra functionality in H5C_flush_single_entry()?
+ * - Remove extra functionality in H5C_flush_single_entry()?
*
- * - Change protect/unprotect to lock/unlock.
+ * - Change protect/unprotect to lock/unlock.
*
- * - Flush entries in increasing address order in
- * H5C_make_space_in_cache().
+ * - Flush entries in increasing address order in
+ * H5C_make_space_in_cache().
*
- * - Also in H5C_make_space_in_cache(), use high and low water marks
- * to reduce the number of I/O calls.
+ * - Also in H5C_make_space_in_cache(), use high and low water marks
+ * to reduce the number of I/O calls.
*
- * - When flushing, attempt to combine contiguous entries to reduce
- * I/O overhead. Can't do this just yet as some entries are not
- * contiguous. Do this in parallel only or in serial as well?
+ * - When flushing, attempt to combine contiguous entries to reduce
+ * I/O overhead. Can't do this just yet as some entries are not
+ * contiguous. Do this in parallel only or in serial as well?
*
- * - Create MPI type for dirty objects when flushing in parallel.
+ * - Create MPI type for dirty objects when flushing in parallel.
*
- * - Now that TBBT routines aren't used, fix nodes in memory to
+ * - Now that TBBT routines aren't used, fix nodes in memory to
* point directly to the skip list node from the LRU list, eliminating
* skip list lookups when evicting objects from the cache.
*
- * Tests:
+ * Tests:
*
- * - Trim execution time. (This is no longer a major issue with the
- * shift from the TBBT to a hash table for indexing.)
+ * - Trim execution time. (This is no longer a major issue with the
+ * shift from the TBBT to a hash table for indexing.)
*
- * - Add random tests.
+ * - Add random tests.
*
**************************************************************************/
-#define H5C_PACKAGE /*suppress error about including H5Cpkg */
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+#define H5C_PACKAGE /*suppress error about including H5Cpkg */
+#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#ifdef H5_HAVE_PARALLEL
#include "H5ACprivate.h" /* Metadata cache */
#endif /* H5_HAVE_PARALLEL */
-#include "H5Cpkg.h" /* Cache */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* Files */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Cpkg.h" /* Cache */
+#include "H5Dprivate.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* Files */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
-#include "H5SLprivate.h" /* Skip lists */
+#include "H5SLprivate.h" /* Skip lists */
/*
@@ -133,7 +133,7 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr,
size_t old_entry_size,
size_t new_entry_size);
-static herr_t H5C_flush_single_entry(H5F_t * f,
+static herr_t H5C_flush_single_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type_ptr,
@@ -143,9 +143,9 @@ static herr_t H5C_flush_single_entry(H5F_t * f,
hbool_t del_entry_from_slist_on_destroy);
static herr_t H5C_flush_invalidate_cache(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- unsigned flags);
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
+ unsigned flags);
static void * H5C_load_entry(H5F_t * f,
hid_t dxpl_id,
@@ -165,7 +165,7 @@ static herr_t H5C_verify_not_in_index(H5C_t * cache_ptr,
H5C_cache_entry_t * entry_ptr);
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
-
+
/****************************************************************************
*
* #defines and declarations for epoch marker cache entries.
@@ -181,13 +181,13 @@ static herr_t H5C_verify_not_in_index(H5C_t * cache_ptr,
* it is needed to dimension arrays in H5C_t.
*/
-#define H5C__EPOCH_MARKER_TYPE H5C__MAX_NUM_TYPE_IDS
+#define H5C__EPOCH_MARKER_TYPE H5C__MAX_NUM_TYPE_IDS
static void *H5C_epoch_marker_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
void *udata);
static herr_t H5C_epoch_marker_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
haddr_t addr, void *thing,
- unsigned *flags_ptr);
+ unsigned *flags_ptr);
static herr_t H5C_epoch_marker_dest(H5F_t *f, void *thing);
static herr_t H5C_epoch_marker_clear(H5F_t *f, void *thing, hbool_t dest);
static herr_t H5C_epoch_marker_notify(H5C_notify_action_t action, void *thing);
@@ -235,7 +235,7 @@ H5C_epoch_marker_flush(H5F_t H5_ATTR_UNUSED *f,
hbool_t H5_ATTR_UNUSED dest,
haddr_t H5_ATTR_UNUSED addr,
void H5_ATTR_UNUSED *thing,
- unsigned H5_ATTR_UNUSED * flags_ptr)
+ unsigned H5_ATTR_UNUSED * flags_ptr)
{
herr_t ret_value = FAIL; /* Return value */
@@ -309,80 +309,80 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5C_apply_candidate_list
*
* Purpose: Apply the supplied candidate list.
*
- * We used to do this by simply having each process write
- * every mpi_size-th entry in the candidate list, starting
- * at index mpi_rank, and mark all the others clean.
+ * We used to do this by simply having each process write
+ * every mpi_size-th entry in the candidate list, starting
+ * at index mpi_rank, and mark all the others clean.
*
- * However, this can cause unnecessary contention in a file
- * system by increasing the number of processes writing to
- * adjacent locations in the HDF5 file.
+ * However, this can cause unnecessary contention in a file
+ * system by increasing the number of processes writing to
+ * adjacent locations in the HDF5 file.
*
- * To attempt to minimize this, we now arange matters such
- * that each process writes n adjacent entries in the
- * candidate list, and marks all others clean. We must do
- * this in such a fashion as to guarantee that each entry
- * on the candidate list is written by exactly one process,
- * and marked clean by all others.
+ * To attempt to minimize this, we now arange matters such
+ * that each process writes n adjacent entries in the
+ * candidate list, and marks all others clean. We must do
+ * this in such a fashion as to guarantee that each entry
+ * on the candidate list is written by exactly one process,
+ * and marked clean by all others.
*
- * To do this, first construct a table mapping mpi_rank
- * to the index of the first entry in the candidate list to
- * be written by the process of that mpi_rank, and then use
- * the table to control which entries are written and which
- * are marked as clean as a function of the mpi_rank.
+ * To do this, first construct a table mapping mpi_rank
+ * to the index of the first entry in the candidate list to
+ * be written by the process of that mpi_rank, and then use
+ * the table to control which entries are written and which
+ * are marked as clean as a function of the mpi_rank.
*
- * Note that the table must be identical on all processes, as
- * all see the same candidate list, mpi_size, and mpi_rank --
- * the inputs used to construct the table.
+ * Note that the table must be identical on all processes, as
+ * all see the same candidate list, mpi_size, and mpi_rank --
+ * the inputs used to construct the table.
*
- * We construct the table as follows. Let:
+ * We construct the table as follows. Let:
*
- * n = num_candidates / mpi_size;
+ * n = num_candidates / mpi_size;
*
- * m = num_candidates % mpi_size;
+ * m = num_candidates % mpi_size;
*
- * Now allocate an array of integers of length mpi_size + 1,
- * and call this array candidate_assignment_table.
+ * Now allocate an array of integers of length mpi_size + 1,
+ * and call this array candidate_assignment_table.
*
- * Conceptually, if the number of candidates is a multiple
- * of the mpi_size, we simply pass through the candidate list
- * and assign n entries to each process to flush, with the
- * index of the first entry to flush in the location in
- * the candidate_assignment_table indicated by the mpi_rank
- * of the process.
+ * Conceptually, if the number of candidates is a multiple
+ * of the mpi_size, we simply pass through the candidate list
+ * and assign n entries to each process to flush, with the
+ * index of the first entry to flush in the location in
+ * the candidate_assignment_table indicated by the mpi_rank
+ * of the process.
*
- * In the more common case in which the candidate list isn't
- * isn't a multiple of the mpi_size, we pretend it is, and
- * give num_candidates % mpi_size processes one extra entry
- * each to make things work out.
+ * In the more common case in which the candidate list isn't
+ * isn't a multiple of the mpi_size, we pretend it is, and
+ * give num_candidates % mpi_size processes one extra entry
+ * each to make things work out.
*
- * Once the table is constructed, we determine the first and
- * last entry this process is to flush as follows:
+ * Once the table is constructed, we determine the first and
+ * last entry this process is to flush as follows:
*
- * first_entry_to_flush = candidate_assignment_table[mpi_rank]
+ * first_entry_to_flush = candidate_assignment_table[mpi_rank]
*
- * last_entry_to_flush =
- * candidate_assignment_table[mpi_rank + 1] - 1;
- *
- * With these values determined, we simply scan through the
- * candidate list, marking all entries in the range
- * [first_entry_to_flush, last_entry_to_flush] for flush,
- * and all others to be cleaned.
+ * last_entry_to_flush =
+ * candidate_assignment_table[mpi_rank + 1] - 1;
*
- * Finally, we scan the LRU from tail to head, flushing
- * or marking clean the candidate entries as indicated.
- * If necessary, we scan the pinned list as well.
+ * With these values determined, we simply scan through the
+ * candidate list, marking all entries in the range
+ * [first_entry_to_flush, last_entry_to_flush] for flush,
+ * and all others to be cleaned.
*
- * Note that this function will fail if any protected or
- * clean entries appear on the candidate list.
+ * Finally, we scan the LRU from tail to head, flushing
+ * or marking clean the candidate entries as indicated.
+ * If necessary, we scan the pinned list as well.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * Note that this function will fail if any protected or
+ * clean entries appear on the candidate list.
+ *
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -393,9 +393,9 @@ done:
*
* Modifications:
*
- * Heavily reworked to have each process flush a group of
- * adjacent entries.
- * JRM -- 4/15/10
+ * Heavily reworked to have each process flush a group of
+ * adjacent entries.
+ * JRM -- 4/15/10
*
*-------------------------------------------------------------------------
*/
@@ -413,26 +413,26 @@ H5C_apply_candidate_list(H5F_t * f,
{
hbool_t first_flush = FALSE;
int i;
- int m;
- int n;
- int first_entry_to_flush;
- int last_entry_to_flush;
- int entries_to_clear = 0;
- int entries_to_flush = 0;
- int entries_cleared = 0;
- int entries_flushed = 0;
- int entries_examined = 0;
- int initial_list_len;
+ int m;
+ int n;
+ int first_entry_to_flush;
+ int last_entry_to_flush;
+ int entries_to_clear = 0;
+ int entries_to_flush = 0;
+ int entries_cleared = 0;
+ int entries_flushed = 0;
+ int entries_examined = 0;
+ int initial_list_len;
int * candidate_assignment_table = NULL;
- haddr_t addr;
- H5C_cache_entry_t * clear_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
- H5C_cache_entry_t * flush_ptr = NULL;
+ haddr_t addr;
+ H5C_cache_entry_t * clear_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * flush_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- haddr_t last_addr;
+ haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- char tbl_buf[1024];
+ char tbl_buf[1024];
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
herr_t ret_value = SUCCEED; /* Return value */
@@ -447,13 +447,13 @@ H5C_apply_candidate_list(H5F_t * f,
HDassert( mpi_rank < mpi_size );
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n",
+ HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n",
FUNC, mpi_rank);
for ( i = 0; i < 1024; i++ ) tbl_buf[i] = '\0';
sprintf(&(tbl_buf[0]), "candidate list = ");
for ( i = 0; i < num_candidates; i++ )
{
- sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx",
+ sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx",
(long long)(*(candidates_list_ptr + i)));
}
sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
@@ -475,7 +475,7 @@ H5C_apply_candidate_list(H5F_t * f,
for(i = 1; i < mpi_size; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
} /* end if */
- else {
+ else {
for(i = 1; i <= m; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
@@ -492,7 +492,7 @@ H5C_apply_candidate_list(H5F_t * f,
#if H5C_DO_SANITY_CHECKS
/* verify that the candidate assignment table has the expected form */
- for ( i = 1; i < mpi_size - 1; i++ )
+ for ( i = 1; i < mpi_size - 1; i++ )
{
int a, b;
@@ -517,7 +517,7 @@ H5C_apply_candidate_list(H5F_t * f,
sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
- HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n",
+ HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n",
FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush);
HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank);
@@ -547,14 +547,14 @@ H5C_apply_candidate_list(H5F_t * f,
} else if ( entry_ptr->is_protected ) {
/* For now at least, we can't deal with protected entries.
* If we encounter one, scream and die. If it becomes an
- * issue, we should be able to work around this.
+ * issue, we should be able to work around this.
*/
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?.")
} else {
/* determine whether the entry is to be cleared or flushed,
- * and mark it accordingly. We will scan the protected and
+ * and mark it accordingly. We will scan the protected and
* pinned list shortly, and clear or flush according to these
- * markings.
+ * markings.
*/
if((i >= first_entry_to_flush) && (i <= last_entry_to_flush)) {
entries_to_flush++;
@@ -568,13 +568,13 @@ H5C_apply_candidate_list(H5F_t * f,
} /* end for */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %d/%d/%d.\n",
+ HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %d/%d/%d.\n",
FUNC, mpi_rank, (int)num_candidates, (int)entries_to_clear,
(int)entries_to_flush);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
- /* We have now marked all the entries on the candidate list for
+ /* We have now marked all the entries on the candidate list for
* either flush or clear -- now scan the LRU and the pinned list
* for these entries and do the deed.
*
@@ -602,7 +602,7 @@ H5C_apply_candidate_list(H5F_t * f,
entries_cleared++;
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
- HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
+ HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
(long long)clear_ptr->addr);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -622,7 +622,7 @@ H5C_apply_candidate_list(H5F_t * f,
entries_flushed++;
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
- HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
+ HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
(long long)flush_ptr->addr);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -643,8 +643,8 @@ H5C_apply_candidate_list(H5F_t * f,
} /* end while */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %d/%d/%d.\n",
- FUNC, mpi_rank, entries_examined,
+ HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %d/%d/%d.\n",
+ FUNC, mpi_rank, entries_examined,
entries_cleared, entries_flushed);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -653,7 +653,7 @@ H5C_apply_candidate_list(H5F_t * f,
*/
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: scanning pinned entry list. len = %d\n",
+ HDfprintf(stdout, "%s:%d: scanning pinned entry list. len = %d\n",
FUNC, mpi_rank, (int)(cache_ptr->pel_len));
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -667,7 +667,7 @@ H5C_apply_candidate_list(H5F_t * f,
entries_cleared++;
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
- HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
+ HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
(long long)clear_ptr->addr);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -687,7 +687,7 @@ H5C_apply_candidate_list(H5F_t * f,
entries_flushed++;
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
- HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
+ HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
(long long)flush_ptr->addr);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -706,9 +706,9 @@ H5C_apply_candidate_list(H5F_t * f,
} /* end while */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout,
- "%s:%d: pel entries examined/cleared/flushed = %d/%d/%d.\n",
- FUNC, mpi_rank, entries_examined,
+ HDfprintf(stdout,
+ "%s:%d: pel entries examined/cleared/flushed = %d/%d/%d.\n",
+ FUNC, mpi_rank, entries_examined,
entries_cleared, entries_flushed);
HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank);
@@ -726,15 +726,15 @@ done:
} /* H5C_apply_candidate_list() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_construct_candidate_list__clean_cache
*
- * Purpose: Construct the list of entries that should be flushed to
- * clean all entries in the cache.
+ * Purpose: Construct the list of entries that should be flushed to
+ * clean all entries in the cache.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -767,21 +767,21 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
* point, it is possible that some dirty entries may reside on the
* pinned list at this point.
*/
- HDassert( cache_ptr->slist_size <=
+ HDassert( cache_ptr->slist_size <=
(cache_ptr->dLRU_list_size + cache_ptr->pel_size) );
- HDassert( cache_ptr->slist_len <=
+ HDassert( cache_ptr->slist_len <=
(cache_ptr->dLRU_list_len + cache_ptr->pel_len) );
if(space_needed > 0) { /* we have work to do */
H5C_cache_entry_t *entry_ptr;
int nominated_entries_count = 0;
size_t nominated_entries_size = 0;
- haddr_t nominated_addr;
+ haddr_t nominated_addr;
HDassert( cache_ptr->slist_len > 0 );
/* Scan the dirty LRU list from tail forward and nominate sufficient
- * entries to free up the necessary space.
+ * entries to free up the necessary space.
*/
entry_ptr = cache_ptr->dLRU_tail_ptr;
while((nominated_entries_size < space_needed) &&
@@ -803,7 +803,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
} /* end while */
HDassert( entry_ptr == NULL );
- /* it is possible that there are some dirty entries on the
+ /* it is possible that there are some dirty entries on the
* protected entry list as well -- scan it too if necessary
*/
entry_ptr = cache_ptr->pel_head_ptr;
@@ -837,15 +837,15 @@ done:
} /* H5C_construct_candidate_list__clean_cache() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_construct_candidate_list__min_clean
*
- * Purpose: Construct the list of entries that should be flushed to
- * get the cache back within its min clean constraints.
+ * Purpose: Construct the list of entries that should be flushed to
+ * get the cache back within its min clean constraints.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -868,7 +868,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
HDassert( cache_ptr != NULL );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- /* compute the number of bytes (if any) that must be flushed to get the
+ /* compute the number of bytes (if any) that must be flushed to get the
* cache back within its min clean constraints.
*/
if(cache_ptr->max_cache_size > cache_ptr->index_size) {
@@ -896,13 +896,13 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
HDassert( cache_ptr->slist_len > 0 );
/* Scan the dirty LRU list from tail forward and nominate sufficient
- * entries to free up the necessary space.
+ * entries to free up the necessary space.
*/
entry_ptr = cache_ptr->dLRU_tail_ptr;
while((nominated_entries_size < space_needed) &&
(nominated_entries_count < cache_ptr->slist_len) &&
(entry_ptr != NULL)) {
- haddr_t nominated_addr;
+ haddr_t nominated_addr;
HDassert( ! (entry_ptr->is_protected) );
HDassert( ! (entry_ptr->is_read_only) );
@@ -927,21 +927,21 @@ done:
} /* H5C_construct_candidate_list__min_clean() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_create
*
* Purpose: Allocate, initialize, and return the address of a new
- * instance of H5C_t.
+ * instance of H5C_t.
*
- * In general, the max_cache_size parameter must be positive,
- * and the min_clean_size parameter must lie in the closed
- * interval [0, max_cache_size].
+ * In general, the max_cache_size parameter must be positive,
+ * and the min_clean_size parameter must lie in the closed
+ * interval [0, max_cache_size].
*
- * The check_write_permitted parameter must either be NULL,
- * or point to a function of type H5C_write_permitted_func_t.
- * If it is NULL, the cache will use the write_permitted
- * flag to determine whether writes are permitted.
+ * The check_write_permitted parameter must either be NULL,
+ * or point to a function of type H5C_write_permitted_func_t.
+ * If it is NULL, the cache will use the write_permitted
+ * flag to determine whether writes are permitted.
*
* Return: Success: Pointer to the new instance.
*
@@ -953,12 +953,12 @@ done:
*-------------------------------------------------------------------------
*/
H5C_t *
-H5C_create(size_t max_cache_size,
- size_t min_clean_size,
- int max_type_id,
- const char * (* type_name_table_ptr),
+H5C_create(size_t max_cache_size,
+ size_t min_clean_size,
+ int max_type_id,
+ const char * (* type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted,
- hbool_t write_permitted,
+ hbool_t write_permitted,
H5C_log_flush_func_t log_flush,
void * aux_ptr)
{
@@ -986,7 +986,7 @@ H5C_create(size_t max_cache_size,
if ( NULL == (cache_ptr = H5FL_CALLOC(H5C_t)) ) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, \
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, \
"memory allocation failed")
}
@@ -999,39 +999,39 @@ H5C_create(size_t max_cache_size,
* the fields.
*/
- cache_ptr->magic = H5C__H5C_T_MAGIC;
+ cache_ptr->magic = H5C__H5C_T_MAGIC;
- cache_ptr->flush_in_progress = FALSE;
+ cache_ptr->flush_in_progress = FALSE;
- cache_ptr->trace_file_ptr = NULL;
+ cache_ptr->trace_file_ptr = NULL;
- cache_ptr->aux_ptr = aux_ptr;
+ cache_ptr->aux_ptr = aux_ptr;
- cache_ptr->max_type_id = max_type_id;
+ cache_ptr->max_type_id = max_type_id;
- cache_ptr->type_name_table_ptr = type_name_table_ptr;
+ cache_ptr->type_name_table_ptr = type_name_table_ptr;
- cache_ptr->max_cache_size = max_cache_size;
- cache_ptr->min_clean_size = min_clean_size;
+ cache_ptr->max_cache_size = max_cache_size;
+ cache_ptr->min_clean_size = min_clean_size;
- cache_ptr->check_write_permitted = check_write_permitted;
- cache_ptr->write_permitted = write_permitted;
+ cache_ptr->check_write_permitted = check_write_permitted;
+ cache_ptr->write_permitted = write_permitted;
- cache_ptr->log_flush = log_flush;
+ cache_ptr->log_flush = log_flush;
- cache_ptr->evictions_enabled = TRUE;
+ cache_ptr->evictions_enabled = TRUE;
- cache_ptr->index_len = 0;
- cache_ptr->index_size = (size_t)0;
- cache_ptr->clean_index_size = (size_t)0;
- cache_ptr->dirty_index_size = (size_t)0;
+ cache_ptr->index_len = 0;
+ cache_ptr->index_size = (size_t)0;
+ cache_ptr->clean_index_size = (size_t)0;
+ cache_ptr->dirty_index_size = (size_t)0;
- cache_ptr->slist_len = 0;
- cache_ptr->slist_size = (size_t)0;
+ cache_ptr->slist_len = 0;
+ cache_ptr->slist_size = (size_t)0;
#if H5C_DO_SANITY_CHECKS
- cache_ptr->slist_len_increase = 0;
- cache_ptr->slist_size_increase = 0;
+ cache_ptr->slist_len_increase = 0;
+ cache_ptr->slist_size_increase = 0;
#endif /* H5C_DO_SANITY_CHECKS */
for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ )
@@ -1039,102 +1039,102 @@ H5C_create(size_t max_cache_size,
(cache_ptr->index)[i] = NULL;
}
- cache_ptr->pl_len = 0;
- cache_ptr->pl_size = (size_t)0;
- cache_ptr->pl_head_ptr = NULL;
- cache_ptr->pl_tail_ptr = NULL;
+ cache_ptr->pl_len = 0;
+ cache_ptr->pl_size = (size_t)0;
+ cache_ptr->pl_head_ptr = NULL;
+ cache_ptr->pl_tail_ptr = NULL;
- cache_ptr->pel_len = 0;
- cache_ptr->pel_size = (size_t)0;
- cache_ptr->pel_head_ptr = NULL;
- cache_ptr->pel_tail_ptr = NULL;
+ cache_ptr->pel_len = 0;
+ cache_ptr->pel_size = (size_t)0;
+ cache_ptr->pel_head_ptr = NULL;
+ cache_ptr->pel_tail_ptr = NULL;
- cache_ptr->LRU_list_len = 0;
- cache_ptr->LRU_list_size = (size_t)0;
- cache_ptr->LRU_head_ptr = NULL;
- cache_ptr->LRU_tail_ptr = NULL;
+ cache_ptr->LRU_list_len = 0;
+ cache_ptr->LRU_list_size = (size_t)0;
+ cache_ptr->LRU_head_ptr = NULL;
+ cache_ptr->LRU_tail_ptr = NULL;
- cache_ptr->cLRU_list_len = 0;
- cache_ptr->cLRU_list_size = (size_t)0;
- cache_ptr->cLRU_head_ptr = NULL;
- cache_ptr->cLRU_tail_ptr = NULL;
+ cache_ptr->cLRU_list_len = 0;
+ cache_ptr->cLRU_list_size = (size_t)0;
+ cache_ptr->cLRU_head_ptr = NULL;
+ cache_ptr->cLRU_tail_ptr = NULL;
- cache_ptr->dLRU_list_len = 0;
- cache_ptr->dLRU_list_size = (size_t)0;
- cache_ptr->dLRU_head_ptr = NULL;
- cache_ptr->dLRU_tail_ptr = NULL;
+ cache_ptr->dLRU_list_len = 0;
+ cache_ptr->dLRU_list_size = (size_t)0;
+ cache_ptr->dLRU_head_ptr = NULL;
+ cache_ptr->dLRU_tail_ptr = NULL;
- cache_ptr->size_increase_possible = FALSE;
+ cache_ptr->size_increase_possible = FALSE;
cache_ptr->flash_size_increase_possible = FALSE;
cache_ptr->flash_size_increase_threshold = 0;
- cache_ptr->size_decrease_possible = FALSE;
- cache_ptr->resize_enabled = FALSE;
- cache_ptr->cache_full = FALSE;
- cache_ptr->size_decreased = FALSE;
-
- (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER;
- (cache_ptr->resize_ctl).rpt_fcn = NULL;
- (cache_ptr->resize_ctl).set_initial_size = FALSE;
- (cache_ptr->resize_ctl).initial_size = H5C__DEF_AR_INIT_SIZE;
- (cache_ptr->resize_ctl).min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC;
- (cache_ptr->resize_ctl).max_size = H5C__DEF_AR_MAX_SIZE;
- (cache_ptr->resize_ctl).min_size = H5C__DEF_AR_MIN_SIZE;
- (cache_ptr->resize_ctl).epoch_length = H5C__DEF_AR_EPOCH_LENGTH;
-
- (cache_ptr->resize_ctl).incr_mode = H5C_incr__off;
- (cache_ptr->resize_ctl).lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD;
- (cache_ptr->resize_ctl).increment = H5C__DEF_AR_INCREMENT;
- (cache_ptr->resize_ctl).apply_max_increment = TRUE;
- (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT;
+ cache_ptr->size_decrease_possible = FALSE;
+ cache_ptr->resize_enabled = FALSE;
+ cache_ptr->cache_full = FALSE;
+ cache_ptr->size_decreased = FALSE;
+
+ (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER;
+ (cache_ptr->resize_ctl).rpt_fcn = NULL;
+ (cache_ptr->resize_ctl).set_initial_size = FALSE;
+ (cache_ptr->resize_ctl).initial_size = H5C__DEF_AR_INIT_SIZE;
+ (cache_ptr->resize_ctl).min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC;
+ (cache_ptr->resize_ctl).max_size = H5C__DEF_AR_MAX_SIZE;
+ (cache_ptr->resize_ctl).min_size = H5C__DEF_AR_MIN_SIZE;
+ (cache_ptr->resize_ctl).epoch_length = H5C__DEF_AR_EPOCH_LENGTH;
+
+ (cache_ptr->resize_ctl).incr_mode = H5C_incr__off;
+ (cache_ptr->resize_ctl).lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD;
+ (cache_ptr->resize_ctl).increment = H5C__DEF_AR_INCREMENT;
+ (cache_ptr->resize_ctl).apply_max_increment = TRUE;
+ (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT;
(cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off;
(cache_ptr->resize_ctl).flash_multiple = 1.0f;
(cache_ptr->resize_ctl).flash_threshold = 0.25f;
- (cache_ptr->resize_ctl).decr_mode = H5C_decr__off;
- (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD;
- (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT;
- (cache_ptr->resize_ctl).apply_max_decrement = TRUE;
- (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT;
+ (cache_ptr->resize_ctl).decr_mode = H5C_decr__off;
+ (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD;
+ (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT;
+ (cache_ptr->resize_ctl).apply_max_decrement = TRUE;
+ (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT;
(cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT;
(cache_ptr->resize_ctl).apply_empty_reserve = TRUE;
- (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE;
+ (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE;
- cache_ptr->epoch_markers_active = 0;
+ cache_ptr->epoch_markers_active = 0;
/* no need to initialize the ring buffer itself */
- cache_ptr->epoch_marker_ringbuf_first = 1;
- cache_ptr->epoch_marker_ringbuf_last = 0;
- cache_ptr->epoch_marker_ringbuf_size = 0;
+ cache_ptr->epoch_marker_ringbuf_first = 1;
+ cache_ptr->epoch_marker_ringbuf_last = 0;
+ cache_ptr->epoch_marker_ringbuf_size = 0;
for ( i = 0; i < H5C__MAX_EPOCH_MARKERS; i++ )
{
- (cache_ptr->epoch_marker_active)[i] = FALSE;
+ (cache_ptr->epoch_marker_active)[i] = FALSE;
#ifndef NDEBUG
- ((cache_ptr->epoch_markers)[i]).magic =
- H5C__H5C_CACHE_ENTRY_T_MAGIC;
+ ((cache_ptr->epoch_markers)[i]).magic =
+ H5C__H5C_CACHE_ENTRY_T_MAGIC;
#endif /* NDEBUG */
- ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i;
- ((cache_ptr->epoch_markers)[i]).size = (size_t)0;
- ((cache_ptr->epoch_markers)[i]).type = &epoch_marker_class;
- ((cache_ptr->epoch_markers)[i]).is_dirty = FALSE;
- ((cache_ptr->epoch_markers)[i]).dirtied = FALSE;
- ((cache_ptr->epoch_markers)[i]).is_protected = FALSE;
- ((cache_ptr->epoch_markers)[i]).is_read_only = FALSE;
- ((cache_ptr->epoch_markers)[i]).ro_ref_count = 0;
- ((cache_ptr->epoch_markers)[i]).is_pinned = FALSE;
- ((cache_ptr->epoch_markers)[i]).in_slist = FALSE;
- ((cache_ptr->epoch_markers)[i]).ht_next = NULL;
- ((cache_ptr->epoch_markers)[i]).ht_prev = NULL;
- ((cache_ptr->epoch_markers)[i]).next = NULL;
- ((cache_ptr->epoch_markers)[i]).prev = NULL;
- ((cache_ptr->epoch_markers)[i]).aux_next = NULL;
- ((cache_ptr->epoch_markers)[i]).aux_prev = NULL;
+ ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i;
+ ((cache_ptr->epoch_markers)[i]).size = (size_t)0;
+ ((cache_ptr->epoch_markers)[i]).type = &epoch_marker_class;
+ ((cache_ptr->epoch_markers)[i]).is_dirty = FALSE;
+ ((cache_ptr->epoch_markers)[i]).dirtied = FALSE;
+ ((cache_ptr->epoch_markers)[i]).is_protected = FALSE;
+ ((cache_ptr->epoch_markers)[i]).is_read_only = FALSE;
+ ((cache_ptr->epoch_markers)[i]).ro_ref_count = 0;
+ ((cache_ptr->epoch_markers)[i]).is_pinned = FALSE;
+ ((cache_ptr->epoch_markers)[i]).in_slist = FALSE;
+ ((cache_ptr->epoch_markers)[i]).ht_next = NULL;
+ ((cache_ptr->epoch_markers)[i]).ht_prev = NULL;
+ ((cache_ptr->epoch_markers)[i]).next = NULL;
+ ((cache_ptr->epoch_markers)[i]).prev = NULL;
+ ((cache_ptr->epoch_markers)[i]).aux_next = NULL;
+ ((cache_ptr->epoch_markers)[i]).aux_prev = NULL;
#if H5C_COLLECT_CACHE_ENTRY_STATS
- ((cache_ptr->epoch_markers)[i]).accesses = 0;
- ((cache_ptr->epoch_markers)[i]).clears = 0;
- ((cache_ptr->epoch_markers)[i]).flushes = 0;
- ((cache_ptr->epoch_markers)[i]).pins = 0;
+ ((cache_ptr->epoch_markers)[i]).accesses = 0;
+ ((cache_ptr->epoch_markers)[i]).clears = 0;
+ ((cache_ptr->epoch_markers)[i]).flushes = 0;
+ ((cache_ptr->epoch_markers)[i]).pins = 0;
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
}
@@ -1147,7 +1147,7 @@ H5C_create(size_t max_cache_size,
H5C_stats__reset(cache_ptr);
- cache_ptr->prefix[0] = '\0'; /* empty string */
+ cache_ptr->prefix[0] = '\0'; /* empty string */
/* Set return value */
ret_value = cache_ptr;
@@ -1172,19 +1172,19 @@ done:
} /* H5C_create() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_def_auto_resize_rpt_fcn
*
* Purpose: Print results of a automatic cache resize.
*
- * This function should only be used where HDprintf() behaves
- * well -- i.e. not on Windows.
+ * This function should only be used where HDprintf() behaves
+ * well -- i.e. not on Windows.
*
* Return: void
*
* Programmer: John Mainzer
- * 10/27/04
+ * 10/27/04
*
*-------------------------------------------------------------------------
*/
@@ -1224,7 +1224,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",
+ "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n",
cache_ptr->prefix,
old_max_cache_size,
old_min_clean_size,
@@ -1298,7 +1298,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
}
HDfprintf(stdout,
- "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n",
+ "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n",
cache_ptr->prefix,
old_max_cache_size,
old_min_clean_size,
@@ -1312,7 +1312,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
cache_ptr->prefix, hit_rate,
(cache_ptr->resize_ctl).lower_hr_threshold);
HDfprintf(stdout,
- "%s cache already at maximum size so no change.\n",
+ "%s cache already at maximum size so no change.\n",
cache_ptr->prefix);
break;
@@ -1320,7 +1320,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
HDfprintf(stdout,
"%sAuto cache resize -- hit rate (%lf) -- can't decrease.\n",
cache_ptr->prefix, hit_rate);
- HDfprintf(stdout, "%s cache already at minimum size.\n",
+ HDfprintf(stdout, "%s cache already at minimum size.\n",
cache_ptr->prefix);
break;
@@ -1344,7 +1344,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
cache_ptr->prefix, hit_rate,
(cache_ptr->resize_ctl).lower_hr_threshold);
HDfprintf(stdout,
- "%s cache not full so no increase in size.\n",
+ "%s cache not full so no increase in size.\n",
cache_ptr->prefix);
break;
@@ -1358,7 +1358,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
} /* H5C_def_auto_resize_rpt_fcn() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_dest
*
@@ -1367,26 +1367,26 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
* This function fails if any object are protected since the
* resulting file might not be consistent.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the destroy (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). This is useful in the metadata
- * cache, but may not be needed elsewhere. If so, just use the
- * same dxpl_id for both parameters.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the destroy (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). This is useful in the metadata
+ * cache, but may not be needed elsewhere. If so, just use the
+ * same dxpl_id for both parameters.
*
- * Note that *cache_ptr has been freed upon successful return.
+ * Note that *cache_ptr has been freed upon successful return.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
- * 6/2/04
+ * 6/2/04
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_dest(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id)
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id)
{
H5C_t * cache_ptr = f->shared->cache;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1415,14 +1415,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_dest() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_expunge_entry
*
* Purpose: Use this function to tell the cache to expunge an entry
- * from the cache without writing it to disk even if it is
- * dirty. The entry may not be either pinned or protected.
+ * from the cache without writing it to disk even if it is
+ * dirty. The entry may not be either pinned or protected.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1436,14 +1436,14 @@ H5C_expunge_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
- haddr_t addr,
- unsigned flags)
+ haddr_t addr,
+ unsigned flags)
{
- H5C_t * cache_ptr;
- herr_t result;
- hbool_t first_flush = TRUE;
- H5C_cache_entry_t * entry_ptr = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5C_t * cache_ptr;
+ herr_t result;
+ hbool_t first_flush = TRUE;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1481,13 +1481,13 @@ H5C_expunge_entry(H5F_t * f,
if ( entry_ptr->is_protected ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \
- "Target entry is protected.")
+ "Target entry is protected.")
}
if ( entry_ptr->is_pinned ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \
- "Target entry is pinned.")
+ "Target entry is pinned.")
}
/* Pass along 'free file space' flag to cache client */
@@ -1526,30 +1526,30 @@ done:
} /* H5C_expunge_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_flush_cache
*
- * Purpose: Flush (and possibly destroy) the entries contained in the
- * specified cache.
+ * Purpose: Flush (and possibly destroy) the entries contained in the
+ * specified cache.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be flushed. However
- * all unprotected entries should be flushed before the
- * function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be flushed. However
+ * all unprotected entries should be flushed before the
+ * function returns failure.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the flush (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). This is useful in the metadata
- * cache, but may not be needed elsewhere. If so, just use the
- * same dxpl_id for both parameters.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the flush (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). This is useful in the metadata
+ * cache, but may not be needed elsewhere. If so, just use the
+ * same dxpl_id for both parameters.
*
* Return: Non-negative on success/Negative on failure or if there was
- * a request to flush all items and something was protected.
+ * a request to flush all items and something was protected.
*
* Programmer: John Mainzer
- * 6/2/04
+ * 6/2/04
*
*-------------------------------------------------------------------------
*/
@@ -1558,22 +1558,22 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
{
H5C_t * cache_ptr = f->shared->cache;
herr_t status;
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
hbool_t destroy;
- hbool_t flushed_entries_last_pass;
- hbool_t flush_marked_entries;
- hbool_t first_flush = TRUE;
- hbool_t ignore_protected;
- hbool_t tried_to_flush_protected_entry = FALSE;
- int32_t passes = 0;
- int32_t protected_entries = 0;
- H5SL_node_t * node_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
- H5C_cache_entry_t * next_entry_ptr = NULL;
+ hbool_t flushed_entries_last_pass;
+ hbool_t flush_marked_entries;
+ hbool_t first_flush = TRUE;
+ hbool_t ignore_protected;
+ hbool_t tried_to_flush_protected_entry = FALSE;
+ int32_t passes = 0;
+ int32_t protected_entries = 0;
+ H5SL_node_t * node_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * next_entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- int64_t flushed_entries_count;
- size_t flushed_entries_size;
- int64_t initial_slist_len;
+ int64_t flushed_entries_count;
+ size_t flushed_entries_size;
+ int64_t initial_slist_len;
size_t initial_slist_size;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -1602,9 +1602,9 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if ( destroy ) {
status = H5C_flush_invalidate_cache(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- flags);
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ flags);
if ( status < 0 ) {
@@ -1612,23 +1612,23 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
* just scream and die.
*/
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "flush invalidate failed.")
+ "flush invalidate failed.")
}
} else {
- /* When we are only flushing marked entries, the slist will usually
- * still contain entries when we have flushed everything we should.
- * Thus we track whether we have flushed any entries in the last
- * pass, and terminate if we haven't.
- */
+ /* When we are only flushing marked entries, the slist will usually
+ * still contain entries when we have flushed everything we should.
+ * Thus we track whether we have flushed any entries in the last
+ * pass, and terminate if we haven't.
+ */
- flushed_entries_last_pass = TRUE;
+ flushed_entries_last_pass = TRUE;
while ( ( passes < H5C__MAX_PASSES_ON_FLUSH ) &&
- ( cache_ptr->slist_len != 0 ) &&
- ( protected_entries == 0 ) &&
- ( flushed_entries_last_pass ) )
- {
- flushed_entries_last_pass = FALSE;
+ ( cache_ptr->slist_len != 0 ) &&
+ ( protected_entries == 0 ) &&
+ ( flushed_entries_last_pass ) )
+ {
+ flushed_entries_last_pass = FALSE;
node_ptr = H5SL_first(cache_ptr->slist_ptr);
if ( node_ptr != NULL ) {
@@ -1638,13 +1638,13 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if ( next_entry_ptr == NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr == NULL 1 ?!?!");
+ "next_entry_ptr == NULL 1 ?!?!");
}
#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
+ HDassert( next_entry_ptr->magic ==
H5C__H5C_CACHE_ENTRY_T_MAGIC );
#endif /* NDEBUG */
- HDassert( next_entry_ptr->is_dirty );
+ HDassert( next_entry_ptr->is_dirty );
HDassert( next_entry_ptr->in_slist );
} else {
@@ -1653,91 +1653,91 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
}
- HDassert( node_ptr != NULL );
+ HDassert( node_ptr != NULL );
#if H5C_DO_SANITY_CHECKS
- /* For sanity checking, try to verify that the skip list has
- * the expected size and number of entries at the end of each
- * internal while loop (see below).
- *
- * Doing this get a bit tricky, as depending on flags, we may
- * or may not flush all the entries in the slist.
- *
- * To make things more entertaining, with the advent of the
- * fractal heap, the entry flush callback can cause entries
- * to be dirtied, resized, and/or moved.
- *
- * To deal with this, we first make note of the initial
- * skip list length and size:
- */
+ /* For sanity checking, try to verify that the skip list has
+ * the expected size and number of entries at the end of each
+ * internal while loop (see below).
+ *
+ * Doing this get a bit tricky, as depending on flags, we may
+ * or may not flush all the entries in the slist.
+ *
+ * To make things more entertaining, with the advent of the
+ * fractal heap, the entry flush callback can cause entries
+ * to be dirtied, resized, and/or moved.
+ *
+ * To deal with this, we first make note of the initial
+ * skip list length and size:
+ */
initial_slist_len = cache_ptr->slist_len;
initial_slist_size = cache_ptr->slist_size;
- /* We then zero counters that we use to track the number
- * and total size of entries flushed:
- */
+ /* We then zero counters that we use to track the number
+ * and total size of entries flushed:
+ */
flushed_entries_count = 0;
flushed_entries_size = 0;
- /* As mentioned above, there is the possibility that
- * entries will be dirtied, resized, and/or flushed during
- * our pass through the skip list. To capture the number
- * of entries added, and the skip list size delta,
- * zero the slist_len_increase and slist_size_increase of
- * the cache's instance of H5C_t. These fields will be
- * updated elsewhere to account for slist insertions and/or
- * dirty entry size changes.
- */
- cache_ptr->slist_len_increase = 0;
- cache_ptr->slist_size_increase = 0;
-
- /* at the end of the loop, use these values to compute the
- * expected slist length and size and compare this with the
- * value recorded in the cache's instance of H5C_t.
- */
+ /* As mentioned above, there is the possibility that
+ * entries will be dirtied, resized, and/or flushed during
+ * our pass through the skip list. To capture the number
+ * of entries added, and the skip list size delta,
+ * zero the slist_len_increase and slist_size_increase of
+ * the cache's instance of H5C_t. These fields will be
+ * updated elsewhere to account for slist insertions and/or
+ * dirty entry size changes.
+ */
+ cache_ptr->slist_len_increase = 0;
+ cache_ptr->slist_size_increase = 0;
+
+ /* at the end of the loop, use these values to compute the
+ * expected slist length and size and compare this with the
+ * value recorded in the cache's instance of H5C_t.
+ */
#endif /* H5C_DO_SANITY_CHECKS */
- while ( node_ptr != NULL )
- {
+ while ( node_ptr != NULL )
+ {
entry_ptr = next_entry_ptr;
/* With the advent of the fractal heap, it is possible
- * that the flush callback will dirty and/or resize
- * other entries in the cache. In particular, while
- * Quincey has promised me that this will never happen,
- * it is possible that the flush callback for an
- * entry may protect an entry that is not in the cache,
- * perhaps causing the cache to flush and possibly
- * evict the entry associated with node_ptr to make
- * space for the new entry.
- *
- * Thus we do a bit of extra sanity checking on entry_ptr,
- * and break out of this scan of the skip list if we
- * detect minor problems. We have a bit of leaway on the
- * number of passes though the skip list, so this shouldn't
- * be an issue in the flush in and of itself, as it should
- * be all but impossible for this to happen more than once
- * in any flush.
- *
- * Observe that that breaking out of the scan early
- * shouldn't break the sanity checks just after the end
- * of this while loop.
- *
- * If an entry has merely been marked clean and removed from
- * the s-list, we simply break out of the scan.
- *
- * If the entry has been evicted, we flag an error and
- * exit.
- */
+ * that the flush callback will dirty and/or resize
+ * other entries in the cache. In particular, while
+ * Quincey has promised me that this will never happen,
+ * it is possible that the flush callback for an
+ * entry may protect an entry that is not in the cache,
+ * perhaps causing the cache to flush and possibly
+ * evict the entry associated with node_ptr to make
+ * space for the new entry.
+ *
+ * Thus we do a bit of extra sanity checking on entry_ptr,
+ * and break out of this scan of the skip list if we
+ * detect minor problems. We have a bit of leaway on the
+ * number of passes though the skip list, so this shouldn't
+ * be an issue in the flush in and of itself, as it should
+ * be all but impossible for this to happen more than once
+ * in any flush.
+ *
+ * Observe that that breaking out of the scan early
+ * shouldn't break the sanity checks just after the end
+ * of this while loop.
+ *
+ * If an entry has merely been marked clean and removed from
+ * the s-list, we simply break out of the scan.
+ *
+ * If the entry has been evicted, we flag an error and
+ * exit.
+ */
#ifndef NDEBUG
- if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
+ if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"entry_ptr->magic invalid ?!?!");
- } else
+ } else
#endif /* NDEBUG */
- if ( ( ! entry_ptr->is_dirty ) ||
+ if ( ( ! entry_ptr->is_dirty ) ||
( ! entry_ptr->in_slist ) ) {
/* the s-list has been modified out from under us.
@@ -1758,9 +1758,9 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if ( next_entry_ptr == NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"next_entry_ptr == NULL 2 ?!?!");
- }
+ }
#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
+ HDassert( next_entry_ptr->magic ==
H5C__H5C_CACHE_ENTRY_T_MAGIC );
#endif /* NDEBUG */
HDassert( next_entry_ptr->is_dirty );
@@ -1782,14 +1782,14 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
* an error.
*/
tried_to_flush_protected_entry = TRUE;
- protected_entries++;
+ protected_entries++;
} else if ( entry_ptr->is_pinned ) {
- /* Test to see if we are can flush the entry now.
- * If we can, go ahead and flush. Note that we
- * aren't trying to do a destroy here, so that
- * is not an issue.
- */
+ /* Test to see if we are can flush the entry now.
+ * If we can, go ahead and flush. Note that we
+ * aren't trying to do a destroy here, so that
+ * is not an issue.
+ */
if ( TRUE ) { /* When we get to multithreaded cache,
* we will need either locking code,
* and/or a test to see if the entry
@@ -1810,17 +1810,17 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if ( status < 0 ) {
/* This shouldn't happen -- if it does, we are
- * toast so just scream and die.
+ * toast so just scream and die.
*/
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
"dirty pinned entry flush failed.")
}
- flushed_entries_last_pass = TRUE;
- }
+ flushed_entries_last_pass = TRUE;
+ }
} else {
#if H5C_DO_SANITY_CHECKS
flushed_entries_count++;
- flushed_entries_size += entry_ptr->size;
+ flushed_entries_size += entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@@ -1833,12 +1833,12 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if ( status < 0 ) {
/* This shouldn't happen -- if it does, we are
- * toast so just scream and die.
+ * toast so just scream and die.
*/
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
"Can't flush entry.")
}
- flushed_entries_last_pass = TRUE;
+ flushed_entries_last_pass = TRUE;
}
}
} /* while ( node_ptr != NULL ) */
@@ -1846,15 +1846,15 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
#if H5C_DO_SANITY_CHECKS
/* Verify that the slist size and length are as expected. */
- HDassert( (initial_slist_len + cache_ptr->slist_len_increase -
+ HDassert( (initial_slist_len + cache_ptr->slist_len_increase -
flushed_entries_count) == cache_ptr->slist_len );
- HDassert( (initial_slist_size + cache_ptr->slist_size_increase -
- flushed_entries_size) == cache_ptr->slist_size );
+ HDassert( (initial_slist_size + cache_ptr->slist_size_increase -
+ flushed_entries_size) == cache_ptr->slist_size );
#endif /* H5C_DO_SANITY_CHECKS */
- passes++;
+ passes++;
- } /* while */
+ } /* while */
HDassert( protected_entries <= cache_ptr->pl_len );
@@ -1863,15 +1863,15 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
( tried_to_flush_protected_entry ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "cache has protected items")
+ "cache has protected items")
}
- if ( ( cache_ptr->slist_len != 0 ) &&
- ( passes >= H5C__MAX_PASSES_ON_FLUSH ) ) {
+ if ( ( cache_ptr->slist_len != 0 ) &&
+ ( passes >= H5C__MAX_PASSES_ON_FLUSH ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "flush pass limit exceeded.")
- }
+ "flush pass limit exceeded.")
+ }
#if H5C_DO_SANITY_CHECKS
if ( ! flush_marked_entries ) {
@@ -1891,28 +1891,28 @@ done:
} /* H5C_flush_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_flush_to_min_clean
*
- * Purpose: Flush dirty entries until the caches min clean size is
- * attained.
+ * Purpose: Flush dirty entries until the caches min clean size is
+ * attained.
*
- * This function is used in the implementation of the
- * metadata cache in PHDF5. To avoid "messages from the
- * future", the cache on process 0 can't be allowed to
- * flush entries until the other processes have reached
- * the same point in the calculation. If this constraint
- * is not met, it is possible that the other processes will
- * read metadata generated at a future point in the
- * computation.
+ * This function is used in the implementation of the
+ * metadata cache in PHDF5. To avoid "messages from the
+ * future", the cache on process 0 can't be allowed to
+ * flush entries until the other processes have reached
+ * the same point in the calculation. If this constraint
+ * is not met, it is possible that the other processes will
+ * read metadata generated at a future point in the
+ * computation.
*
*
* Return: Non-negative on success/Negative on failure or if
- * write is not permitted.
+ * write is not permitted.
*
* Programmer: John Mainzer
- * 9/16/05
+ * 9/16/05
*
*-------------------------------------------------------------------------
*/
@@ -1922,18 +1922,18 @@ H5C_flush_to_min_clean(H5F_t * f,
hid_t secondary_dxpl_id)
{
H5C_t * cache_ptr;
- herr_t result;
- hbool_t first_flush = TRUE;
- hbool_t write_permitted;
+ herr_t result;
+ hbool_t first_flush = TRUE;
+ hbool_t write_permitted;
#if 0 /* modified code -- commented out for now */
- int i;
- int flushed_entries_count = 0;
- size_t flushed_entries_size = 0;
- size_t space_needed = 0;
- haddr_t * flushed_entries_list = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
+ int i;
+ int flushed_entries_count = 0;
+ size_t flushed_entries_size = 0;
+ size_t space_needed = 0;
+ haddr_t * flushed_entries_list = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
#endif /* JRM */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
@@ -2051,7 +2051,7 @@ H5C_flush_to_min_clean(H5F_t * f,
/* Flush the marked entries */
- result = H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id,
+ result = H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id,
H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG);
if ( result < 0 ) {
@@ -2070,7 +2070,7 @@ H5C_flush_to_min_clean(H5F_t * f,
H5C__SEARCH_INDEX_NO_STATS(cache_ptr, flushed_entries_list[i], \
entry_ptr, FAIL)
- /* At present, the above search must always succeed. However,
+ /* At present, the above search must always succeed. However,
* that may change. Write the code so we need only remove the
* following assert in that event.
*/
@@ -2085,18 +2085,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_flush_to_min_clean() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_cache_auto_resize_config
*
- * Purpose: Copy the current configuration of the cache automatic
- * re-sizing function into the instance of H5C_auto_size_ctl_t
- * pointed to by config_ptr.
+ * Purpose: Copy the current configuration of the cache automatic
+ * re-sizing function into the instance of H5C_auto_size_ctl_t
+ * pointed to by config_ptr.
*
* Return: SUCCEED on success, and FAIL on failure.
*
* Programmer: John Mainzer
- * 10/8/04
+ * 10/8/04
*
*-------------------------------------------------------------------------
*/
@@ -2129,20 +2129,20 @@ done:
} /* H5C_get_cache_auto_resize_config() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_cache_size
*
- * Purpose: Return the cache maximum size, the minimum clean size, the
- * current size, and the current number of entries in
+ * Purpose: Return the cache maximum size, the minimum clean size, the
+ * current size, and the current number of entries in
* *max_size_ptr, *min_clean_size_ptr, *cur_size_ptr, and
- * *cur_num_entries_ptr respectively. If any of these
- * parameters are NULL, skip that value.
+ * *cur_num_entries_ptr respectively. If any of these
+ * parameters are NULL, skip that value.
*
* Return: SUCCEED on success, and FAIL on failure.
*
* Programmer: John Mainzer
- * 10/8/04
+ * 10/8/04
*
*-------------------------------------------------------------------------
*/
@@ -2188,20 +2188,20 @@ done:
} /* H5C_get_cache_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_cache_hit_rate
*
- * Purpose: Compute and return the current cache hit rate in
+ * Purpose: Compute and return the current cache hit rate in
* *hit_rate_ptr. If there have been no accesses since the
* last time the cache hit rate stats were reset, set
- * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is
- * undefined.
+ * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is
+ * undefined.
*
* Return: SUCCEED on success, and FAIL on failure.
*
* Programmer: John Mainzer
- * 10/7/04
+ * 10/7/04
*
*-------------------------------------------------------------------------
*/
@@ -2243,21 +2243,21 @@ done:
} /* H5C_get_cache_hit_rate() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_get_entry_status
*
* Purpose: This function is used to determine whether the cache
- * contains an entry with the specified base address. If
- * the entry exists, it also reports some status information
- * on the entry.
+ * contains an entry with the specified base address. If
+ * the entry exists, it also reports some status information
+ * on the entry.
*
- * Status information is reported in the locations pointed
- * to by the size_ptr, in_cache_ptr, is_dirty_ptr, and
- * is_protected_ptr. While in_cache_ptr must be defined,
- * the remaining pointers may be NULL, in which case the
- * associated data is not reported.
+ * Status information is reported in the locations pointed
+ * to by the size_ptr, in_cache_ptr, is_dirty_ptr, and
+ * is_protected_ptr. While in_cache_ptr must be defined,
+ * the remaining pointers may be NULL, in which case the
+ * associated data is not reported.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2273,11 +2273,11 @@ H5C_get_entry_status(const H5F_t *f,
hbool_t * in_cache_ptr,
hbool_t * is_dirty_ptr,
hbool_t * is_protected_ptr,
- hbool_t * is_pinned_ptr)
+ hbool_t * is_pinned_ptr)
{
H5C_t * cache_ptr;
- H5C_cache_entry_t * entry_ptr = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2339,7 +2339,7 @@ done:
} /* H5C_get_entry_status() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_evictions_enabled()
*
@@ -2380,7 +2380,7 @@ done:
} /* H5C_get_evictions_enabled() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_trace_file_ptr
*
@@ -2411,7 +2411,7 @@ H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5C_get_trace_file_ptr() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_get_trace_file_ptr_from_entry
*
@@ -2443,7 +2443,7 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5C_get_trace_file_ptr_from_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_insert_entry
*
@@ -2451,45 +2451,45 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
* exist on disk yet, but it must have an address and disk
* space reserved.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the insertion (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). This is useful in the
- * metadata cache, but may not be needed elsewhere. If so,
- * just use the same dxpl_id for both parameters.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the insertion (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). This is useful in the
+ * metadata cache, but may not be needed elsewhere. If so,
+ * just use the same dxpl_id for both parameters.
*
- * The primary_dxpl_id is the dxpl_id passed to the
- * check_write_permitted function if such a function has been
- * provided.
+ * The primary_dxpl_id is the dxpl_id passed to the
+ * check_write_permitted function if such a function has been
+ * provided.
*
- * Observe that this function cannot occasion a read.
+ * Observe that this function cannot occasion a read.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
- * 6/2/04
+ * 6/2/04
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_insert_entry(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
const H5C_class_t * type,
- haddr_t addr,
- void * thing,
+ haddr_t addr,
+ void * thing,
unsigned int flags)
{
H5C_t * cache_ptr;
- herr_t result;
- herr_t ret_value = SUCCEED; /* Return value */
- hbool_t first_flush = TRUE;
- hbool_t insert_pinned;
+ herr_t result;
+ herr_t ret_value = SUCCEED; /* Return value */
+ hbool_t first_flush = TRUE;
+ hbool_t insert_pinned;
hbool_t set_flush_marker;
- hbool_t write_permitted = TRUE;
- size_t empty_space;
- H5C_cache_entry_t * entry_ptr;
- H5C_cache_entry_t * test_entry_ptr;
+ hbool_t write_permitted = TRUE;
+ size_t empty_space;
+ H5C_cache_entry_t * entry_ptr;
+ H5C_cache_entry_t * test_entry_ptr;
FUNC_ENTER_NOAPI(FAIL)
@@ -2615,24 +2615,24 @@ H5C_insert_entry(H5F_t * f,
}
if ( ( cache_ptr->evictions_enabled )
- &&
+ &&
( ( (cache_ptr->index_size + entry_ptr->size) >
- cache_ptr->max_cache_size
- )
- ||
- (
- ( ( empty_space + cache_ptr->clean_index_size ) <
- cache_ptr->min_clean_size )
- )
- )
+ cache_ptr->max_cache_size
+ )
+ ||
+ (
+ ( ( empty_space + cache_ptr->clean_index_size ) <
+ cache_ptr->min_clean_size )
+ )
+ )
) {
size_t space_needed;
- if ( empty_space <= entry_ptr->size ) {
+ if ( empty_space <= entry_ptr->size ) {
cache_ptr->cache_full = TRUE;
- }
+ }
if ( cache_ptr->check_write_permitted != NULL ) {
@@ -2740,30 +2740,30 @@ done:
} /* H5C_insert_entry() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_mark_entries_as_clean
*
* Purpose: When the H5C code is used to implement the metadata caches
- * in PHDF5, only the cache with MPI_rank 0 is allowed to
- * actually write entries to disk -- all other caches must
- * retain dirty entries until they are advised that the
- * entries are clean.
+ * in PHDF5, only the cache with MPI_rank 0 is allowed to
+ * actually write entries to disk -- all other caches must
+ * retain dirty entries until they are advised that the
+ * entries are clean.
*
- * This function exists to allow the H5C code to receive these
- * notifications.
+ * This function exists to allow the H5C code to receive these
+ * notifications.
*
- * The function receives a list of entry base addresses
- * which must refer to dirty entries in the cache. If any
- * of the entries are either clean or don't exist, the
- * function flags an error.
+ * The function receives a list of entry base addresses
+ * which must refer to dirty entries in the cache. If any
+ * of the entries are either clean or don't exist, the
+ * function flags an error.
*
- * The function scans the list of entries and flushes all
- * those that are currently unprotected with the
- * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently
- * protected are flagged for clearing when they are
- * unprotected.
+ * The function scans the list of entries and flushes all
+ * those that are currently unprotected with the
+ * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently
+ * protected are flagged for clearing when they are
+ * unprotected.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2781,21 +2781,21 @@ H5C_mark_entries_as_clean(H5F_t * f,
haddr_t * ce_array_ptr)
{
H5C_t * cache_ptr;
- hbool_t first_flush = TRUE;
- int entries_cleared;
- int entries_examined;
+ hbool_t first_flush = TRUE;
+ int entries_cleared;
+ int entries_examined;
int i;
- int initial_list_len;
- haddr_t addr;
+ int initial_list_len;
+ haddr_t addr;
#if H5C_DO_SANITY_CHECKS
- int pinned_entries_marked = 0;
- int protected_entries_marked = 0;
- int other_entries_marked = 0;
- haddr_t last_addr;
+ int pinned_entries_marked = 0;
+ int protected_entries_marked = 0;
+ int other_entries_marked = 0;
+ haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
- H5C_cache_entry_t * clear_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5C_cache_entry_t * clear_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2856,7 +2856,7 @@ H5C_mark_entries_as_clean(H5F_t * f,
if ( entry_ptr == NULL ) {
#if H5C_DO_SANITY_CHECKS
- HDfprintf(stdout,
+ HDfprintf(stdout,
"H5C_mark_entries_as_clean: entry[%d] = %ld not in cache.\n",
(int)i,
(long)addr);
@@ -2867,7 +2867,7 @@ H5C_mark_entries_as_clean(H5F_t * f,
} else if ( ! entry_ptr->is_dirty ) {
#if H5C_DO_SANITY_CHECKS
- HDfprintf(stdout,
+ HDfprintf(stdout,
"H5C_mark_entries_as_clean: entry %ld is not dirty!?!\n",
(long)addr);
#endif /* H5C_DO_SANITY_CHECKS */
@@ -2900,18 +2900,18 @@ H5C_mark_entries_as_clean(H5F_t * f,
*/
entry_ptr->clear_on_unprotect = TRUE;
#if H5C_DO_SANITY_CHECKS
- if ( entry_ptr->is_protected ) {
+ if ( entry_ptr->is_protected ) {
- protected_entries_marked++;
+ protected_entries_marked++;
- } else if ( entry_ptr->is_pinned ) {
+ } else if ( entry_ptr->is_pinned ) {
- pinned_entries_marked++;
+ pinned_entries_marked++;
- } else {
+ } else {
- other_entries_marked++;
- }
+ other_entries_marked++;
+ }
#endif /* H5C_DO_SANITY_CHECKS */
}
#endif /* end modified code */
@@ -3032,31 +3032,31 @@ done:
} /* H5C_mark_entries_as_clean() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_mark_entry_dirty
*
- * Purpose: Mark a pinned or protected entry as dirty. The target entry
- * MUST be either pinned or protected, and MAY be both.
+ * Purpose: Mark a pinned or protected entry as dirty. The target entry
+ * MUST be either pinned or protected, and MAY be both.
*
- * In the protected case, this call is the functional
- * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect
- * call.
+ * In the protected case, this call is the functional
+ * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect
+ * call.
*
- * In the pinned but not protected case, if the entry is not
- * already dirty, the function places function marks the entry
- * dirty and places it on the skip list.
+ * In the pinned but not protected case, if the entry is not
+ * already dirty, the function places function marks the entry
+ * dirty and places it on the skip list.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 5/15/06
*
- * JRM -- 11/5/08
- * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to
- * update the new clean_index_size and dirty_index_size
- * fields of H5C_t in the case that the entry was clean
- * prior to this call, and is pinned and not protected.
+ * JRM -- 11/5/08
+ * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to
+ * update the new clean_index_size and dirty_index_size
+ * fields of H5C_t in the case that the entry was clean
+ * prior to this call, and is pinned and not protected.
*
*-------------------------------------------------------------------------
*/
@@ -3077,23 +3077,23 @@ H5C_mark_entry_dirty(void *thing)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
if ( entry_ptr->is_protected ) {
- HDassert( ! ((entry_ptr)->is_read_only) );
+ HDassert( ! ((entry_ptr)->is_read_only) );
/* set the dirtied flag */
entry_ptr->dirtied = TRUE;
} else if ( entry_ptr->is_pinned ) {
- hbool_t was_pinned_unprotected_and_clean;
+ hbool_t was_pinned_unprotected_and_clean;
- was_pinned_unprotected_and_clean = ! ( entry_ptr->is_dirty );
+ was_pinned_unprotected_and_clean = ! ( entry_ptr->is_dirty );
/* mark the entry as dirty if it isn't already */
entry_ptr->is_dirty = TRUE;
- if ( was_pinned_unprotected_and_clean ) {
+ if ( was_pinned_unprotected_and_clean ) {
- H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr);
- }
+ H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr);
+ }
if ( ! (entry_ptr->in_slist) ) {
@@ -3112,7 +3112,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_mark_entry_dirty() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_move_entry
@@ -3133,20 +3133,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_move_entry(H5C_t * cache_ptr,
+H5C_move_entry(H5C_t * cache_ptr,
const H5C_class_t * type,
- haddr_t old_addr,
- haddr_t new_addr)
+ haddr_t old_addr,
+ haddr_t new_addr)
{
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- hbool_t was_dirty;
+ hbool_t was_dirty;
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
- H5C_cache_entry_t * entry_ptr = NULL;
- H5C_cache_entry_t * test_entry_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * test_entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- hbool_t removed_entry_from_slist = FALSE;
+ hbool_t removed_entry_from_slist = FALSE;
#endif /* H5C_DO_SANITY_CHECKS */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -3179,7 +3179,7 @@ H5C_move_entry(H5C_t * cache_ptr,
if ( entry_ptr->is_protected ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \
- "Target entry is protected.")
+ "Target entry is protected.")
}
H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL)
@@ -3241,14 +3241,14 @@ H5C_move_entry(H5C_t * cache_ptr,
was_dirty = entry_ptr->is_dirty;
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
- if ( ! ( entry_ptr->flush_in_progress ) ) {
+ if ( ! ( entry_ptr->flush_in_progress ) ) {
entry_ptr->is_dirty = TRUE;
- }
+ }
H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL)
- if ( ! ( entry_ptr->flush_in_progress ) ) {
+ if ( ! ( entry_ptr->flush_in_progress ) ) {
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
@@ -3256,22 +3256,22 @@ H5C_move_entry(H5C_t * cache_ptr,
if ( removed_entry_from_slist ) {
- /* we just removed the entry from the slist. Thus we
- * must touch up cache_ptr->slist_len_increase and
- * cache_ptr->slist_size_increase to keep from skewing
- * the sanity checks.
- */
- HDassert( cache_ptr->slist_len_increase > 1 );
- HDassert( cache_ptr->slist_size_increase > entry_ptr->size );
+ /* we just removed the entry from the slist. Thus we
+ * must touch up cache_ptr->slist_len_increase and
+ * cache_ptr->slist_size_increase to keep from skewing
+ * the sanity checks.
+ */
+ HDassert( cache_ptr->slist_len_increase > 1 );
+ HDassert( cache_ptr->slist_size_increase > entry_ptr->size );
- cache_ptr->slist_len_increase -= 1;
- cache_ptr->slist_size_increase -= entry_ptr->size;
- }
+ cache_ptr->slist_len_increase -= 1;
+ cache_ptr->slist_size_increase -= entry_ptr->size;
+ }
#endif /* H5C_DO_SANITY_CHECKS */
H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL)
- }
+ }
}
H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr)
@@ -3290,15 +3290,15 @@ done:
} /* H5C_move_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_resize_entry
*
- * Purpose: Resize a pinned or protected entry.
+ * Purpose: Resize a pinned or protected entry.
*
- * Resizing an entry dirties it, so if the entry is not
- * already dirty, the function places the entry on the
- * skip list.
+ * Resizing an entry dirties it, so if the entry is not
+ * already dirty, the function places the entry on the
+ * skip list.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3331,7 +3331,7 @@ H5C_resize_entry(void *thing, size_t new_size)
/* update for change in entry size if necessary */
if ( entry_ptr->size != new_size ) {
- hbool_t was_clean;
+ hbool_t was_clean;
/* make note of whether the entry was clean to begin with */
was_clean = ! ( entry_ptr->is_dirty );
@@ -3343,7 +3343,7 @@ H5C_resize_entry(void *thing, size_t new_size)
if ( cache_ptr->flash_size_increase_possible ) {
if ( new_size > entry_ptr->size ) {
- size_t size_increase;
+ size_t size_increase;
size_increase = new_size - entry_ptr->size;
@@ -3367,21 +3367,21 @@ H5C_resize_entry(void *thing, size_t new_size)
} /* end if */
/* update the hash table */
- H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
+ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
(new_size), (entry_ptr), (was_clean));
/* if the entry is in the skip list, update that too */
if ( entry_ptr->in_slist ) {
- H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
+ H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
(new_size));
} /* end if */
/* update statistics just before changing the entry size */
- H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \
+ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \
(new_size));
- /* finally, update the entry size proper */
- entry_ptr->size = new_size;
+ /* finally, update the entry size proper */
+ entry_ptr->size = new_size;
if(!entry_ptr->in_slist) {
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
@@ -3396,12 +3396,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_resize_entry() */
-
+
/*-------------------------------------------------------------------------
* 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.
+ * Purpose: Pin a protected cache entry. The entry must be protected
+ * at the time of call, and must be unpinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3446,43 +3446,43 @@ done:
} /* H5C_pin_protected_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_protect
*
* Purpose: If the target entry is not in the cache, load it. If
- * necessary, attempt to evict one or more entries to keep
- * the cache within its maximum size.
+ * necessary, attempt to evict one or more entries to keep
+ * the cache within its maximum size.
*
- * Mark the target entry as protected, and return its address
- * to the caller. The caller must call H5C_unprotect() when
- * finished with the entry.
+ * Mark the target entry as protected, and return its address
+ * to the caller. The caller must call H5C_unprotect() when
+ * finished with the entry.
*
- * While it is protected, the entry may not be either evicted
- * or flushed -- nor may it be accessed by another call to
- * H5C_protect. Any attempt to do so will result in a failure.
+ * While it is protected, the entry may not be either evicted
+ * or flushed -- nor may it be accessed by another call to
+ * H5C_protect. Any attempt to do so will result in a failure.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the insertion (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). This is useful in the
- * metadata cache, but may not be needed elsewhere. If so,
- * just use the same dxpl_id for both parameters.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the insertion (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). This is useful in the
+ * metadata cache, but may not be needed elsewhere. If so,
+ * just use the same dxpl_id for both parameters.
*
- * All reads are performed with the primary_dxpl_id.
+ * All reads are performed with the primary_dxpl_id.
*
- * Similarly, the primary_dxpl_id is passed to the
- * check_write_permitted function if it is called.
+ * Similarly, the primary_dxpl_id is passed to the
+ * check_write_permitted function if it is called.
*
* Return: Success: Ptr to the desired entry
* Failure: NULL
*
* Programmer: John Mainzer - 6/2/04
*
- * JRM -- 11/13/08
- * Modified function to call H5C_make_space_in_cache() when
- * the min_clean_size is violated, not just when there isn't
- * enough space for and entry that has just been loaded.
+ * JRM -- 11/13/08
+ * Modified function to call H5C_make_space_in_cache() when
+ * the min_clean_size is violated, not just when there isn't
+ * enough space for and entry that has just been loaded.
*
* The purpose of this modification is to avoid "metadata
* blizzards" in the write only case. In such instances,
@@ -3498,25 +3498,25 @@ done:
*-------------------------------------------------------------------------
*/
void *
-H5C_protect(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
+H5C_protect(H5F_t * f,
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
const H5C_class_t * type,
- haddr_t addr,
+ haddr_t addr,
void * udata,
- unsigned flags)
+ unsigned flags)
{
- H5C_t * cache_ptr;
- hbool_t hit;
- hbool_t first_flush;
- hbool_t have_write_permitted = FALSE;
- hbool_t read_only = FALSE;
- hbool_t write_permitted;
- herr_t result;
- size_t empty_space;
- void * thing;
- H5C_cache_entry_t * entry_ptr;
- void * ret_value; /* Return value */
+ H5C_t * cache_ptr;
+ hbool_t hit;
+ hbool_t first_flush;
+ hbool_t have_write_permitted = FALSE;
+ hbool_t read_only = FALSE;
+ hbool_t write_permitted;
+ herr_t result;
+ size_t empty_space;
+ void * thing;
+ H5C_cache_entry_t * entry_ptr;
+ void * ret_value; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -3536,7 +3536,7 @@ H5C_protect(H5F_t * f,
#if H5C_DO_EXTREME_SANITY_CHECKS
if ( H5C_validate_lru_list(cache_ptr) < 0 ) {
- HDassert(0);
+ HDassert(0);
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \
"LRU sanity check failed.\n");
}
@@ -3544,7 +3544,7 @@ H5C_protect(H5F_t * f,
if ( (flags & H5C__READ_ONLY_FLAG) != 0 )
{
- read_only = TRUE;
+ read_only = TRUE;
}
/* first check to see if the target is in cache */
@@ -3557,7 +3557,7 @@ H5C_protect(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "incorrect cache entry type")
hit = TRUE;
- thing = (void *)entry_ptr;
+ thing = (void *)entry_ptr;
} else {
@@ -3600,27 +3600,27 @@ H5C_protect(H5F_t * f,
}
- /* try to free up if necceary and if evictions are permitted. Note
- * that if evictions are enabled, we will call H5C_make_space_in_cache()
- * regardless if the min_free_space requirement is not met.
- */
+ /* try to free up if necceary and if evictions are permitted. Note
+ * that if evictions are enabled, we will call H5C_make_space_in_cache()
+ * regardless if the min_free_space requirement is not met.
+ */
if ( ( cache_ptr->evictions_enabled ) &&
( ( (cache_ptr->index_size + entry_ptr->size) >
- cache_ptr->max_cache_size)
- ||
- ( ( empty_space + cache_ptr->clean_index_size ) <
- cache_ptr->min_clean_size )
- )
+ cache_ptr->max_cache_size)
+ ||
+ ( ( empty_space + cache_ptr->clean_index_size ) <
+ cache_ptr->min_clean_size )
+ )
) {
size_t space_needed;
- if ( empty_space <= entry_ptr->size ) {
+ if ( empty_space <= entry_ptr->size ) {
cache_ptr->cache_full = TRUE;
- }
+ }
if ( cache_ptr->check_write_permitted != NULL ) {
@@ -3672,10 +3672,10 @@ H5C_protect(H5F_t * f,
*
* Second, when writes are not permitted it is also possible
* for the cache to grow without bound.
- *
- * Third, the user may choose to disable evictions -- causing
- * the cache to grow without bound until evictions are
- * re-enabled.
+ *
+ * Third, the user may choose to disable evictions -- causing
+ * the cache to grow without bound until evictions are
+ * re-enabled.
*
* Finally, we usually don't check to see if the cache is
* oversized at the end of an unprotect. As a result, it is
@@ -3724,30 +3724,30 @@ H5C_protect(H5F_t * f,
if ( entry_ptr->is_protected ) {
- if ( ( read_only ) && ( entry_ptr->is_read_only ) ) {
+ if ( ( read_only ) && ( entry_ptr->is_read_only ) ) {
- HDassert( entry_ptr->ro_ref_count > 0 );
+ HDassert( entry_ptr->ro_ref_count > 0 );
- (entry_ptr->ro_ref_count)++;
+ (entry_ptr->ro_ref_count)++;
- } else {
+ } else {
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \
"Target already protected & not read only?!?.")
- }
+ }
} else {
- H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL)
+ H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL)
- entry_ptr->is_protected = TRUE;
+ entry_ptr->is_protected = TRUE;
- if ( read_only ) {
+ if ( read_only ) {
- entry_ptr->is_read_only = TRUE;
- entry_ptr->ro_ref_count = 1;
- }
+ entry_ptr->is_read_only = TRUE;
+ entry_ptr->ro_ref_count = 1;
+ }
- entry_ptr->dirtied = FALSE;
+ entry_ptr->dirtied = FALSE;
}
H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit)
@@ -3814,10 +3814,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 ) {
@@ -3831,14 +3831,14 @@ H5C_protect(H5F_t * f,
}
if ( ( cache_ptr->index_size > cache_ptr->max_cache_size )
- ||
- ( ( empty_space + cache_ptr->clean_index_size ) <
- cache_ptr->min_clean_size) ) {
+ ||
+ ( ( empty_space + cache_ptr->clean_index_size ) <
+ cache_ptr->min_clean_size) ) {
- if ( cache_ptr->index_size > cache_ptr->max_cache_size ) {
+ if ( cache_ptr->index_size > cache_ptr->max_cache_size ) {
cache_ptr->cache_full = TRUE;
- }
+ }
result = H5C_make_space_in_cache(f, primary_dxpl_id,
secondary_dxpl_id,
@@ -3868,7 +3868,7 @@ done:
} /* H5C_protect() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_reset_cache_hit_rate_stats()
@@ -3884,7 +3884,7 @@ done:
herr_t
H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -3893,8 +3893,8 @@ H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.")
}
- cache_ptr->cache_hits = 0;
- cache_ptr->cache_accesses = 0;
+ cache_ptr->cache_hits = 0;
+ cache_ptr->cache_accesses = 0;
done:
@@ -3902,23 +3902,23 @@ done:
} /* H5C_reset_cache_hit_rate_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_set_cache_auto_resize_config
*
- * Purpose: Set the cache automatic resize configuration to the
- * provided values if they are in range, and fail if they
- * are not.
+ * Purpose: Set the cache automatic resize configuration to the
+ * provided values if they are in range, and fail if they
+ * are not.
*
- * If the new configuration enables automatic cache resizing,
- * coerce the cache max size and min clean size into agreement
- * with the new policy and re-set the full cache hit rate
- * stats.
+ * If the new configuration enables automatic cache resizing,
+ * coerce the cache max size and min clean size into agreement
+ * with the new policy and re-set the full cache hit rate
+ * stats.
*
* Return: SUCCEED on success, and FAIL on failure.
*
* Programmer: John Mainzer
- * 10/8/04
+ * 10/8/04
*
*-------------------------------------------------------------------------
*/
@@ -3926,10 +3926,10 @@ herr_t
H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
H5C_auto_size_ctl_t *config_ptr)
{
- herr_t result;
+ herr_t result;
size_t new_max_cache_size;
size_t new_min_clean_size;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -4054,7 +4054,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
if ( config_ptr->max_size == config_ptr->min_size ) {
cache_ptr->size_increase_possible = FALSE;
- cache_ptr->flash_size_increase_possible = FALSE;
+ cache_ptr->flash_size_increase_possible = FALSE;
cache_ptr->size_decrease_possible = FALSE;
}
@@ -4098,7 +4098,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
/* since new_min_clean_size is of type size_t, we have
*
- * ( 0 <= new_min_clean_size )
+ * ( 0 <= new_min_clean_size )
*
* by definition.
*/
@@ -4185,7 +4185,7 @@ done:
} /* H5C_set_cache_auto_resize_config() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_set_evictions_enabled()
*
@@ -4226,7 +4226,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr,
*/
if ( ( evictions_enabled != TRUE ) &&
( ( cache_ptr->resize_ctl.incr_mode != H5C_incr__off ) ||
- ( cache_ptr->resize_ctl.decr_mode != H5C_decr__off ) ) ) {
+ ( cache_ptr->resize_ctl.decr_mode != H5C_decr__off ) ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"Can't disable evictions when auto resize enabled.")
@@ -4240,12 +4240,12 @@ done:
} /* H5C_set_evictions_enabled() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_set_prefix
*
* Purpose: Set the values of the prefix field of H5C_t. This
- * filed is used to label some debugging output.
+ * filed is used to label some debugging output.
*
* Return: Non-negative on success/Negative on failure
*
@@ -4279,7 +4279,7 @@ done:
} /* H5C_set_prefix() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_set_trace_file_ptr
*
@@ -4300,7 +4300,7 @@ herr_t
H5C_set_trace_file_ptr(H5C_t * cache_ptr,
FILE * trace_file_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -4319,7 +4319,7 @@ done:
} /* H5C_set_trace_file_ptr() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_stats
*
@@ -4330,9 +4330,9 @@ done:
* Programmer: John Mainzer
* 6/2/04
*
- * JRM -- 11/13/08
- * Added code displaying the max_clean_index_size and
- * max_dirty_index_size.
+ * JRM -- 11/13/08
+ * Added code displaying the max_clean_index_size and
+ * max_dirty_index_size.
*
* MAM -- 01/06/09
* Added code displaying the calls_to_msic,
@@ -4350,15 +4350,15 @@ H5C_stats(H5C_t * cache_ptr,
#endif /* H5C_COLLECT_CACHE_STATS */
display_detailed_stats)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
#if H5C_COLLECT_CACHE_STATS
- int i;
+ int i;
int64_t total_hits = 0;
int64_t total_misses = 0;
- int64_t total_write_protects = 0;
- int64_t total_read_protects = 0;
- int64_t max_read_protects = 0;
+ int64_t total_write_protects = 0;
+ int64_t total_read_protects = 0;
+ int64_t max_read_protects = 0;
int64_t total_insertions = 0;
int64_t total_pinned_insertions = 0;
int64_t total_clears = 0;
@@ -4367,24 +4367,24 @@ H5C_stats(H5C_t * cache_ptr,
int64_t total_moves = 0;
int64_t total_entry_flush_moves = 0;
int64_t total_cache_flush_moves = 0;
- int64_t total_size_increases = 0;
- int64_t total_size_decreases = 0;
- int64_t total_entry_flush_size_changes = 0;
- int64_t total_cache_flush_size_changes = 0;
- int64_t total_pins = 0;
- int64_t total_unpins = 0;
- int64_t total_dirty_pins = 0;
- int64_t total_pinned_flushes = 0;
- int64_t total_pinned_clears = 0;
+ int64_t total_size_increases = 0;
+ int64_t total_size_decreases = 0;
+ int64_t total_entry_flush_size_changes = 0;
+ int64_t total_cache_flush_size_changes = 0;
+ int64_t total_pins = 0;
+ int64_t total_unpins = 0;
+ int64_t total_dirty_pins = 0;
+ int64_t total_pinned_flushes = 0;
+ int64_t total_pinned_clears = 0;
int32_t aggregate_max_accesses = 0;
int32_t aggregate_min_accesses = 1000000;
int32_t aggregate_max_clears = 0;
int32_t aggregate_max_flushes = 0;
size_t aggregate_max_size = 0;
- int32_t aggregate_max_pins = 0;
+ int32_t aggregate_max_pins = 0;
double hit_rate;
- double average_successful_search_depth = 0.0;
- double average_failed_search_depth = 0.0;
+ double average_successful_search_depth = 0.0;
+ double average_failed_search_depth = 0.0;
double average_entries_skipped_per_calls_to_msic = 0.0;
double average_entries_scanned_per_calls_to_msic = 0.0;
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -4407,32 +4407,32 @@ H5C_stats(H5C_t * cache_ptr,
total_hits += cache_ptr->hits[i];
total_misses += cache_ptr->misses[i];
- total_write_protects += cache_ptr->write_protects[i];
- total_read_protects += cache_ptr->read_protects[i];
- if ( max_read_protects < cache_ptr->max_read_protects[i] ) {
- max_read_protects = cache_ptr->max_read_protects[i];
- }
+ total_write_protects += cache_ptr->write_protects[i];
+ total_read_protects += cache_ptr->read_protects[i];
+ if ( max_read_protects < cache_ptr->max_read_protects[i] ) {
+ max_read_protects = cache_ptr->max_read_protects[i];
+ }
total_insertions += cache_ptr->insertions[i];
total_pinned_insertions += cache_ptr->pinned_insertions[i];
total_clears += cache_ptr->clears[i];
total_flushes += cache_ptr->flushes[i];
total_evictions += cache_ptr->evictions[i];
total_moves += cache_ptr->moves[i];
- total_entry_flush_moves
- += cache_ptr->entry_flush_moves[i];
- total_cache_flush_moves
- += cache_ptr->cache_flush_moves[i];
+ total_entry_flush_moves
+ += cache_ptr->entry_flush_moves[i];
+ total_cache_flush_moves
+ += cache_ptr->cache_flush_moves[i];
total_size_increases += cache_ptr->size_increases[i];
total_size_decreases += cache_ptr->size_decreases[i];
- total_entry_flush_size_changes
- += cache_ptr->entry_flush_size_changes[i];
- total_cache_flush_size_changes
- += cache_ptr->cache_flush_size_changes[i];
- total_pins += cache_ptr->pins[i];
- total_unpins += cache_ptr->unpins[i];
- total_dirty_pins += cache_ptr->dirty_pins[i];
- total_pinned_flushes += cache_ptr->pinned_flushes[i];
- total_pinned_clears += cache_ptr->pinned_clears[i];
+ total_entry_flush_size_changes
+ += cache_ptr->entry_flush_size_changes[i];
+ total_cache_flush_size_changes
+ += cache_ptr->cache_flush_size_changes[i];
+ total_pins += cache_ptr->pins[i];
+ total_unpins += cache_ptr->unpins[i];
+ total_dirty_pins += cache_ptr->dirty_pins[i];
+ total_pinned_flushes += cache_ptr->pinned_flushes[i];
+ total_pinned_clears += cache_ptr->pinned_clears[i];
#if H5C_COLLECT_CACHE_ENTRY_STATS
if ( aggregate_max_accesses < cache_ptr->max_accesses[i] )
aggregate_max_accesses = cache_ptr->max_accesses[i];
@@ -4577,14 +4577,14 @@ H5C_stats(H5C_t * cache_ptr,
(long)total_evictions);
HDfprintf(stdout,
- "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n",
+ "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n",
cache_ptr->prefix,
(long)total_insertions,
(long)total_pinned_insertions,
(long)total_moves);
HDfprintf(stdout,
- "%s Total entry / cache flush moves = %ld / %ld\n",
+ "%s Total entry / cache flush moves = %ld / %ld\n",
cache_ptr->prefix,
(long)total_entry_flush_moves,
(long)total_cache_flush_moves);
@@ -4600,10 +4600,10 @@ H5C_stats(H5C_t * cache_ptr,
(long)total_cache_flush_size_changes);
HDfprintf(stdout,
- "%s Total entry pins (dirty) / unpins = %ld (%ld) / %ld\n",
+ "%s Total entry pins (dirty) / unpins = %ld (%ld) / %ld\n",
cache_ptr->prefix,
(long)total_pins,
- (long)total_dirty_pins,
+ (long)total_dirty_pins,
(long)total_unpins);
HDfprintf(stdout, "%s Total pinned flushes / clears = %ld / %ld\n",
@@ -4661,7 +4661,7 @@ H5C_stats(H5C_t * cache_ptr,
HDfprintf(stdout, "%s aggregate max_size / max_pins = %d / %d\n",
cache_ptr->prefix,
(int)aggregate_max_size,
- (int)aggregate_max_pins);
+ (int)aggregate_max_pins);
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -4761,7 +4761,7 @@ H5C_stats(H5C_t * cache_ptr,
"%s entry max_size / max_pins = %d / %d\n",
cache_ptr->prefix,
(int)(cache_ptr->max_size[i]),
- (int)(cache_ptr->max_pins[i]));
+ (int)(cache_ptr->max_pins[i]));
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -4778,7 +4778,7 @@ done:
} /* H5C_stats() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_stats__reset
@@ -4789,9 +4789,9 @@ done:
*
* Programmer: John Mainzer, 4/28/04
*
- * JRM 11/13/08
- * Added initialization for the new max_clean_index_size and
- * max_dirty_index_size fields.
+ * JRM 11/13/08
+ * Added initialization for the new max_clean_index_size and
+ * max_dirty_index_size fields.
*
* MAM -- 01/06/09
* Added code to initalize the calls_to_msic,
@@ -4821,50 +4821,50 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr)
#if H5C_COLLECT_CACHE_STATS
for ( i = 0; i <= cache_ptr->max_type_id; i++ )
{
- cache_ptr->hits[i] = 0;
- cache_ptr->misses[i] = 0;
- cache_ptr->write_protects[i] = 0;
- cache_ptr->read_protects[i] = 0;
- cache_ptr->max_read_protects[i] = 0;
- cache_ptr->insertions[i] = 0;
- cache_ptr->pinned_insertions[i] = 0;
- cache_ptr->clears[i] = 0;
- cache_ptr->flushes[i] = 0;
- cache_ptr->evictions[i] = 0;
- cache_ptr->moves[i] = 0;
- cache_ptr->entry_flush_moves[i] = 0;
- cache_ptr->cache_flush_moves[i] = 0;
- cache_ptr->pins[i] = 0;
- cache_ptr->unpins[i] = 0;
- cache_ptr->dirty_pins[i] = 0;
- cache_ptr->pinned_flushes[i] = 0;
- cache_ptr->pinned_clears[i] = 0;
- cache_ptr->size_increases[i] = 0;
- cache_ptr->size_decreases[i] = 0;
- cache_ptr->entry_flush_size_changes[i] = 0;
- cache_ptr->cache_flush_size_changes[i] = 0;
- }
-
- cache_ptr->total_ht_insertions = 0;
- cache_ptr->total_ht_deletions = 0;
- cache_ptr->successful_ht_searches = 0;
- cache_ptr->total_successful_ht_search_depth = 0;
- cache_ptr->failed_ht_searches = 0;
- cache_ptr->total_failed_ht_search_depth = 0;
-
- cache_ptr->max_index_len = 0;
- cache_ptr->max_index_size = (size_t)0;
- cache_ptr->max_clean_index_size = (size_t)0;
- cache_ptr->max_dirty_index_size = (size_t)0;
-
- cache_ptr->max_slist_len = 0;
- cache_ptr->max_slist_size = (size_t)0;
-
- cache_ptr->max_pl_len = 0;
- cache_ptr->max_pl_size = (size_t)0;
-
- cache_ptr->max_pel_len = 0;
- cache_ptr->max_pel_size = (size_t)0;
+ cache_ptr->hits[i] = 0;
+ cache_ptr->misses[i] = 0;
+ cache_ptr->write_protects[i] = 0;
+ cache_ptr->read_protects[i] = 0;
+ cache_ptr->max_read_protects[i] = 0;
+ cache_ptr->insertions[i] = 0;
+ cache_ptr->pinned_insertions[i] = 0;
+ cache_ptr->clears[i] = 0;
+ cache_ptr->flushes[i] = 0;
+ cache_ptr->evictions[i] = 0;
+ cache_ptr->moves[i] = 0;
+ cache_ptr->entry_flush_moves[i] = 0;
+ cache_ptr->cache_flush_moves[i] = 0;
+ cache_ptr->pins[i] = 0;
+ cache_ptr->unpins[i] = 0;
+ cache_ptr->dirty_pins[i] = 0;
+ cache_ptr->pinned_flushes[i] = 0;
+ cache_ptr->pinned_clears[i] = 0;
+ cache_ptr->size_increases[i] = 0;
+ cache_ptr->size_decreases[i] = 0;
+ cache_ptr->entry_flush_size_changes[i] = 0;
+ cache_ptr->cache_flush_size_changes[i] = 0;
+ }
+
+ cache_ptr->total_ht_insertions = 0;
+ cache_ptr->total_ht_deletions = 0;
+ cache_ptr->successful_ht_searches = 0;
+ cache_ptr->total_successful_ht_search_depth = 0;
+ cache_ptr->failed_ht_searches = 0;
+ cache_ptr->total_failed_ht_search_depth = 0;
+
+ cache_ptr->max_index_len = 0;
+ cache_ptr->max_index_size = (size_t)0;
+ cache_ptr->max_clean_index_size = (size_t)0;
+ cache_ptr->max_dirty_index_size = (size_t)0;
+
+ cache_ptr->max_slist_len = 0;
+ cache_ptr->max_slist_size = (size_t)0;
+
+ cache_ptr->max_pl_len = 0;
+ cache_ptr->max_pl_size = (size_t)0;
+
+ cache_ptr->max_pel_len = 0;
+ cache_ptr->max_pel_size = (size_t)0;
cache_ptr->calls_to_msic = 0;
cache_ptr->total_entries_skipped_in_msic = 0;
@@ -4877,12 +4877,12 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr)
for ( i = 0; i <= cache_ptr->max_type_id; i++ )
{
- cache_ptr->max_accesses[i] = 0;
- cache_ptr->min_accesses[i] = 1000000;
- cache_ptr->max_clears[i] = 0;
- cache_ptr->max_flushes[i] = 0;
- cache_ptr->max_size[i] = (size_t)0;
- cache_ptr->max_pins[i] = 0;
+ cache_ptr->max_accesses[i] = 0;
+ cache_ptr->min_accesses[i] = 1000000;
+ cache_ptr->max_clears[i] = 0;
+ cache_ptr->max_flushes[i] = 0;
+ cache_ptr->max_size[i] = (size_t)0;
+ cache_ptr->max_pins[i] = 0;
}
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -4892,7 +4892,7 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr)
} /* H5C_stats__reset() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_dump_cache
*
@@ -5023,12 +5023,12 @@ done:
} /* H5C_dump_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_unpin_entry()
*
- * Purpose: Unpin a cache entry. The entry must be unprotected at
- * the time of call, and must be pinned.
+ * Purpose: Unpin a cache entry. The entry must be unprotected at
+ * the time of call, and must be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -5037,9 +5037,9 @@ done:
*
* Modifications:
*
- * JRM -- 4/26/06
- * Modified routine to allow it to operate on protected
- * entries.
+ * JRM -- 4/26/06
+ * Modified routine to allow it to operate on protected
+ * entries.
*
*-------------------------------------------------------------------------
*/
@@ -5078,36 +5078,36 @@ done:
} /* H5C_unpin_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_unprotect
*
- * Purpose: Undo an H5C_protect() call -- specifically, mark the
- * entry as unprotected, remove it from the protected list,
- * and give it back to the replacement policy.
+ * Purpose: Undo an H5C_protect() call -- specifically, mark the
+ * entry as unprotected, remove it from the protected list,
+ * and give it back to the replacement policy.
*
- * The TYPE and ADDR arguments must be the same as those in
- * the corresponding call to H5C_protect() and the THING
- * argument must be the value returned by that call to
- * H5C_protect().
+ * The TYPE and ADDR arguments must be the same as those in
+ * the corresponding call to H5C_protect() and the THING
+ * argument must be the value returned by that call to
+ * H5C_protect().
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the unprotect (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). Since an uprotect cannot
- * occasion a write at present, all this is moot for now.
- * However, things change, and in any case,
- * H5C_flush_single_entry() needs primary_dxpl_id and
- * secondary_dxpl_id in its parameter list.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the unprotect (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). Since an uprotect cannot
+ * occasion a write at present, all this is moot for now.
+ * However, things change, and in any case,
+ * H5C_flush_single_entry() needs primary_dxpl_id and
+ * secondary_dxpl_id in its parameter list.
*
- * The function can't cause a read either, so the dxpl_id
- * parameters are moot in this case as well.
+ * The function can't cause a read either, so the dxpl_id
+ * parameters are moot in this case as well.
*
* Return: Non-negative on success/Negative on failure
*
- * If the deleted flag is TRUE, simply remove the target entry
- * from the cache, clear it, and free it without writing it to
- * disk.
+ * If the deleted flag is TRUE, simply remove the target entry
+ * from the cache, clear it, and free it without writing it to
+ * disk.
*
* Return: Non-negative on success/Negative on failure
*
@@ -5117,28 +5117,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_unprotect(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
+H5C_unprotect(H5F_t * f,
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
const H5C_class_t * type,
- haddr_t addr,
- void * thing,
+ haddr_t addr,
+ void * thing,
unsigned int flags)
{
- H5C_t * cache_ptr;
- hbool_t deleted;
- hbool_t dirtied;
+ H5C_t * cache_ptr;
+ hbool_t deleted;
+ hbool_t dirtied;
hbool_t set_flush_marker;
- hbool_t pin_entry;
- hbool_t unpin_entry;
- hbool_t free_file_space;
- hbool_t take_ownership;
- hbool_t was_clean;
+ hbool_t pin_entry;
+ hbool_t unpin_entry;
+ hbool_t free_file_space;
+ hbool_t take_ownership;
+ hbool_t was_clean;
#ifdef H5_HAVE_PARALLEL
- hbool_t clear_entry = FALSE;
+ hbool_t clear_entry = FALSE;
#endif /* H5_HAVE_PARALLEL */
- H5C_cache_entry_t * entry_ptr;
- H5C_cache_entry_t * test_entry_ptr;
+ H5C_cache_entry_t * entry_ptr;
+ H5C_cache_entry_t * test_entry_ptr;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -5194,16 +5194,16 @@ H5C_unprotect(H5F_t * f,
*/
if ( entry_ptr->ro_ref_count > 1 ) {
- HDassert( entry_ptr->is_protected );
+ HDassert( entry_ptr->is_protected );
HDassert( entry_ptr->is_read_only );
- if ( dirtied ) {
+ if ( dirtied ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
"Read only entry modified(1)??")
- }
+ }
- (entry_ptr->ro_ref_count)--;
+ (entry_ptr->ro_ref_count)--;
/* Pin or unpin the entry as requested. */
if ( pin_entry ) {
@@ -5213,36 +5213,36 @@ H5C_unprotect(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \
"Entry already pinned???")
}
- entry_ptr->is_pinned = TRUE;
- H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr)
+ entry_ptr->is_pinned = TRUE;
+ H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr)
} else if ( unpin_entry ) {
if ( ! ( entry_ptr->is_pinned ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, \
- "Entry already unpinned???")
+ "Entry already unpinned???")
}
- entry_ptr->is_pinned = FALSE;
- H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr)
+ entry_ptr->is_pinned = FALSE;
+ H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr)
}
} else {
- if ( entry_ptr->is_read_only ) {
+ if ( entry_ptr->is_read_only ) {
- HDassert( entry_ptr->ro_ref_count == 1 );
+ HDassert( entry_ptr->ro_ref_count == 1 );
- if ( dirtied ) {
+ if ( dirtied ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
"Read only entry modified(2)??")
- }
+ }
- entry_ptr->is_read_only = FALSE;
- entry_ptr->ro_ref_count = 0;
- }
+ entry_ptr->is_read_only = FALSE;
+ entry_ptr->ro_ref_count = 0;
+ }
#ifdef H5_HAVE_PARALLEL
/* When the H5C code is used to implement the metadata cache in the
@@ -5284,8 +5284,8 @@ H5C_unprotect(H5F_t * f,
if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) {
- H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr)
- }
+ H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr)
+ }
/* Pin or unpin the entry as requested. */
if ( pin_entry ) {
@@ -5295,18 +5295,18 @@ H5C_unprotect(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \
"Entry already pinned???")
}
- entry_ptr->is_pinned = TRUE;
- H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr)
+ entry_ptr->is_pinned = TRUE;
+ H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr)
} else if ( unpin_entry ) {
if ( ! ( entry_ptr->is_pinned ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, \
- "Entry already unpinned???")
+ "Entry already unpinned???")
}
- entry_ptr->is_pinned = FALSE;
- H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr)
+ entry_ptr->is_pinned = FALSE;
+ H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr)
}
@@ -5345,14 +5345,14 @@ H5C_unprotect(H5F_t * f,
/* the following first flush flag will never be used as we are
* calling H5C_flush_single_entry with both the
* H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags.
- * However, it is needed for the function call.
+ * However, it is needed for the function call.
*/
- hbool_t dummy_first_flush = TRUE;
+ hbool_t dummy_first_flush = TRUE;
unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG |
H5C__FLUSH_INVALIDATE_FLAG);
- /* we can't delete a pinned entry */
- HDassert ( ! (entry_ptr->is_pinned ) );
+ /* we can't delete a pinned entry */
+ HDassert ( ! (entry_ptr->is_pinned ) );
/* verify that the target entry is in the cache. */
@@ -5396,10 +5396,10 @@ H5C_unprotect(H5F_t * f,
/* the following first flush flag will never be used as we are
* calling H5C_flush_single_entry with the
- * H5C__FLUSH_CLEAR_ONLY_FLAG flag. However, it is needed for
- * the function call.
+ * H5C__FLUSH_CLEAR_ONLY_FLAG flag. However, it is needed for
+ * the function call.
*/
- hbool_t dummy_first_flush = TRUE;
+ hbool_t dummy_first_flush = TRUE;
/* verify that the target entry is in the cache. */
@@ -5447,15 +5447,15 @@ done:
} /* H5C_unprotect() */
-
+
/*-------------------------------------------------------------------------
* 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.
+ * Purpose: Run a sanity check on the specified sections of the
+ * 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.
+ * Do nothing and return SUCCEED if no errors are detected,
+ * and flag an error and return FAIL otherwise.
*
* Return: Non-negative on success/Negative on failure
*
@@ -5705,25 +5705,25 @@ done:
} /* H5C_validate_resize_config() */
-
+
/*************************************************************************/
/**************************** Private Functions: *************************/
/*************************************************************************/
/*-------------------------------------------------------------------------
*
- * Function: H5C__auto_adjust_cache_size
+ * Function: H5C__auto_adjust_cache_size
*
- * Purpose: Obtain the current full cache hit rate, and compare it
- * with the hit rate thresholds for modifying cache size.
- * If one of the thresholds has been crossed, adjusts the
- * size of the cache accordingly.
+ * Purpose: Obtain the current full cache hit rate, and compare it
+ * with the hit rate thresholds for modifying cache size.
+ * If one of the thresholds has been crossed, adjusts the
+ * size of the cache accordingly.
*
- * The function then resets the full cache hit rate
- * statistics, and exits.
+ * The function then resets the full cache hit rate
+ * statistics, and exits.
*
* Return: Non-negative on success/Negative on failure or if there was
- * an attempt to flush a protected item.
+ * an attempt to flush a protected item.
*
*
* Programmer: John Mainzer, 10/7/04
@@ -5737,16 +5737,16 @@ H5C__auto_adjust_cache_size(H5F_t * f,
hbool_t write_permitted,
hbool_t * first_flush_ptr)
{
- H5C_t * cache_ptr = f->shared->cache;
- herr_t result;
- hbool_t inserted_epoch_marker = FALSE;
- size_t new_max_cache_size = 0;
- size_t old_max_cache_size = 0;
- size_t new_min_clean_size = 0;
- size_t old_min_clean_size = 0;
- double hit_rate;
- enum H5C_resize_status status = in_spec; /* will change if needed */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5C_t * cache_ptr = f->shared->cache;
+ herr_t result;
+ hbool_t inserted_epoch_marker = FALSE;
+ size_t new_max_cache_size = 0;
+ size_t old_max_cache_size = 0;
+ size_t new_min_clean_size = 0;
+ size_t old_min_clean_size = 0;
+ double hit_rate;
+ enum H5C_resize_status status = in_spec; /* will change if needed */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -5991,9 +5991,9 @@ H5C__auto_adjust_cache_size(H5F_t * f,
/* new_min_clean_size is of size_t, and thus must be non-negative.
* Hence we have
*
- * ( 0 <= new_min_clean_size ).
+ * ( 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 );
@@ -6011,8 +6011,8 @@ H5C__auto_adjust_cache_size(H5F_t * f,
cache_ptr->size_decreased = TRUE;
}
- /* update flash cache size increase fields as appropriate */
- if ( cache_ptr->flash_size_increase_possible ) {
+ /* update flash cache size increase fields as appropriate */
+ if ( cache_ptr->flash_size_increase_possible ) {
switch ( (cache_ptr->resize_ctl).flash_incr_mode )
{
@@ -6063,17 +6063,17 @@ done:
} /* H5C__auto_adjust_cache_size() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__autoadjust__ageout
*
* Purpose: Implement the ageout automatic cache size decrement
- * algorithm. Note that while this code evicts aged out
- * entries, the code does not change the maximum cache size.
- * Instead, the function simply computes the new value (if
- * any change is indicated) and reports this value in
- * *new_max_cache_size_ptr.
+ * algorithm. Note that while this code evicts aged out
+ * entries, the code does not change the maximum cache size.
+ * Instead, the function simply computes the new value (if
+ * any change is indicated) and reports this value in
+ * *new_max_cache_size_ptr.
*
* Return: Non-negative on success/Negative on failure or if there was
* an attempt to flush a protected item.
@@ -6094,9 +6094,9 @@ H5C__autoadjust__ageout(H5F_t * f,
hbool_t * first_flush_ptr)
{
H5C_t * cache_ptr = f->shared->cache;
- herr_t result;
- size_t test_size;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t result;
+ size_t test_size;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -6188,16 +6188,16 @@ done:
} /* H5C__autoadjust__ageout() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__autoadjust__ageout__cycle_epoch_marker
*
* Purpose: Remove the oldest epoch marker from the LRU list,
- * and reinsert it at the head of the LRU list. Also
- * remove the epoch marker's index from the head of the
- * ring buffer, and re-insert it at the tail of the ring
- * buffer.
+ * and reinsert it at the head of the LRU list. Also
+ * remove the epoch marker's index from the head of the
+ * ring buffer, and re-insert it at the tail of the ring
+ * buffer.
*
* Return: SUCCEED on success/FAIL on failure.
*
@@ -6282,47 +6282,47 @@ done:
} /* H5C__autoadjust__ageout__cycle_epoch_marker() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__autoadjust__ageout__evict_aged_out_entries
*
* Purpose: Evict clean entries in the cache that haven't
- * been accessed for at least
+ * been accessed for at least
* (cache_ptr->resize_ctl).epochs_before_eviction epochs,
- * and flush dirty entries that haven't been accessed for
- * that amount of time.
+ * and flush dirty entries that haven't been accessed for
+ * that amount of time.
*
- * Depending on configuration, the function will either
- * flush or evict all such entries, or all such entries it
- * encounters until it has freed the maximum amount of space
- * allowed under the maximum decrement.
+ * Depending on configuration, the function will either
+ * flush or evict all such entries, or all such entries it
+ * encounters until it has freed the maximum amount of space
+ * allowed under the maximum decrement.
*
- * If we are running in parallel mode, writes may not be
- * permitted. If so, the function simply skips any dirty
- * entries it may encounter.
+ * If we are running in parallel mode, writes may not be
+ * permitted. If so, the function simply skips any dirty
+ * entries it may encounter.
*
- * The function makes no attempt to maintain the minimum
- * clean size, as there is no guarantee that the cache size
- * will be changed.
+ * The function makes no attempt to maintain the minimum
+ * clean size, as there is no guarantee that the cache size
+ * will be changed.
*
- * If there is no cache size change, the minimum clean size
- * constraint will be met through a combination of clean
- * entries and free space in the cache.
+ * If there is no cache size change, the minimum clean size
+ * constraint will be met through a combination of clean
+ * entries and free space in the cache.
*
- * If there is a cache size reduction, the minimum clean size
- * will be re-calculated, and will be enforced the next time
- * we have to make space in the cache.
+ * If there is a cache size reduction, the minimum clean size
+ * will be re-calculated, and will be enforced the next time
+ * we have to make space in the cache.
*
* The primary_dxpl_id and secondary_dxpl_id parameters
* specify the dxpl_ids used depending on the value of
- * *first_flush_ptr. The idea is to use the primary_dxpl_id
- * on the first write in a sequence of writes, and to use
- * the secondary_dxpl_id on all subsequent writes.
+ * *first_flush_ptr. The idea is to use the primary_dxpl_id
+ * on the first write in a sequence of writes, and to use
+ * the secondary_dxpl_id on all subsequent writes.
*
* This is useful in the metadata cache, but may not be
- * needed elsewhere. If so, just use the same dxpl_id for
- * both parameters.
+ * needed elsewhere. If so, just use the same dxpl_id for
+ * both parameters.
*
* Observe that this function cannot occasion a read.
*
@@ -6339,11 +6339,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
hbool_t write_permitted,
hbool_t * first_flush_ptr)
{
- H5C_t * cache_ptr = f->shared->cache;
+ H5C_t * cache_ptr = f->shared->cache;
herr_t result;
- size_t eviction_size_limit;
- size_t bytes_evicted = 0;
- hbool_t prev_is_dirty = FALSE;
+ size_t eviction_size_limit;
+ size_t bytes_evicted = 0;
+ hbool_t prev_is_dirty = FALSE;
H5C_cache_entry_t * entry_ptr;
H5C_cache_entry_t * next_ptr;
H5C_cache_entry_t * prev_ptr;
@@ -6380,10 +6380,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
{
HDassert( ! (entry_ptr->is_protected) );
- next_ptr = entry_ptr->next;
+ next_ptr = entry_ptr->next;
prev_ptr = entry_ptr->prev;
- if ( prev_ptr != NULL ) {
+ if ( prev_ptr != NULL ) {
prev_is_dirty = prev_ptr->is_dirty;
}
@@ -6430,7 +6430,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
} else
#endif /* NDEBUG */
- if ( ( prev_ptr->is_dirty != prev_is_dirty )
+ if ( ( prev_ptr->is_dirty != prev_is_dirty )
||
( prev_ptr->next != next_ptr )
||
@@ -6439,7 +6439,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
( prev_ptr->is_pinned ) ) {
/* something has happened to the LRU -- start over
- * from the tail.
+ * from the tail.
*/
entry_ptr = cache_ptr->LRU_tail_ptr;
@@ -6448,11 +6448,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
entry_ptr = prev_ptr;
}
- } else {
+ } else {
- entry_ptr = NULL;
+ entry_ptr = NULL;
- }
+ }
} /* end while */
/* for now at least, don't bother to maintain the minimum clean size,
@@ -6535,14 +6535,14 @@ done:
} /* H5C__autoadjust__ageout__evict_aged_out_entries() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__autoadjust__ageout__insert_new_marker
*
* Purpose: Find an unused marker cache entry, mark it as used, and
- * insert it at the head of the LRU list. Also add the
- * marker's index in the epoch_markers array.
+ * insert it at the head of the LRU list. Also add the
+ * marker's index in the epoch_markers array.
*
* Return: SUCCEED on success/FAIL on failure.
*
@@ -6613,13 +6613,13 @@ done:
} /* H5C__autoadjust__ageout__insert_new_marker() */
-
+
/*-------------------------------------------------------------------------
*
* 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.
*
@@ -6692,15 +6692,15 @@ done:
} /* H5C__autoadjust__ageout__remove_all_markers() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__autoadjust__ageout__remove_excess_markers
*
* Purpose: Remove epoch markers from the end of the LRU list and
- * mark them as inactive until the number of active markers
- * equals the the current value of
- * (cache_ptr->resize_ctl).epochs_before_eviction.
+ * mark them as inactive until the number of active markers
+ * equals the the current value of
+ * (cache_ptr->resize_ctl).epochs_before_eviction.
*
* Return: SUCCEED on success/FAIL on failure.
*
@@ -6711,9 +6711,9 @@ done:
static herr_t
H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
- int i;
- int ring_buf_index;
+ herr_t ret_value = SUCCEED; /* Return value */
+ int i;
+ int ring_buf_index;
FUNC_ENTER_NOAPI_NOINIT
@@ -6780,7 +6780,7 @@ done:
} /* H5C__autoadjust__ageout__remove_excess_markers() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__flash_increase_cache_size
@@ -6846,7 +6846,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr,
HDassert( (cache_ptr->max_cache_size - cache_ptr->index_size)
< space_needed );
space_needed -= cache_ptr->max_cache_size -
- cache_ptr->index_size;
+ cache_ptr->index_size;
}
space_needed =
(size_t)(((double)space_needed) *
@@ -6905,9 +6905,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 ) {
@@ -6944,41 +6944,41 @@ done:
} /* H5C__flash_increase_cache_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_flush_invalidate_cache
*
- * Purpose: Flush and destroy the entries contained in the target
- * cache.
+ * Purpose: Flush and destroy the entries contained in the target
+ * cache.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be either flushed or
- * destroyed. However all unprotected entries should be
- * flushed and destroyed before the function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be either flushed or
+ * destroyed. However all unprotected entries should be
+ * flushed and destroyed before the function returns failure.
*
- * While pinned entries can usually be flushed, they cannot
- * be destroyed. However, they should be unpinned when all
- * the entries that reference them have been destroyed (thus
- * reduding the pinned entry's reference count to 0, allowing
- * it to be unpinned).
+ * While pinned entries can usually be flushed, they cannot
+ * be destroyed. However, they should be unpinned when all
+ * the entries that reference them have been destroyed (thus
+ * reduding the pinned entry's reference count to 0, allowing
+ * it to be unpinned).
*
- * If pinned entries are present, the function makes repeated
- * passes through the cache, flushing all dirty entries
- * (including the pinned dirty entries where permitted) and
- * destroying all unpinned entries. This process is repeated
- * until either the cache is empty, or the number of pinned
- * entries stops decreasing on each pass.
+ * If pinned entries are present, the function makes repeated
+ * passes through the cache, flushing all dirty entries
+ * (including the pinned dirty entries where permitted) and
+ * destroying all unpinned entries. This process is repeated
+ * until either the cache is empty, or the number of pinned
+ * entries stops decreasing on each pass.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the flush (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id).
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the flush (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id).
*
* Return: Non-negative on success/Negative on failure or if there was
- * a request to flush all items and something was protected.
+ * a request to flush all items and something was protected.
*
* Programmer: John Mainzer
- * 3/24/065
+ * 3/24/065
*
*-------------------------------------------------------------------------
*/
@@ -6986,27 +6986,27 @@ static herr_t
H5C_flush_invalidate_cache(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
- unsigned flags)
+ unsigned flags)
{
- H5C_t * cache_ptr = f->shared->cache;
+ H5C_t * cache_ptr = f->shared->cache;
herr_t status;
- hbool_t first_flush = TRUE;
- int32_t protected_entries = 0;
- int32_t i;
- int32_t cur_pel_len;
- int32_t old_pel_len;
- int32_t passes = 0;
- unsigned cooked_flags;
- H5SL_node_t * node_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
- H5C_cache_entry_t * next_entry_ptr = NULL;
+ hbool_t first_flush = TRUE;
+ int32_t protected_entries = 0;
+ int32_t i;
+ int32_t cur_pel_len;
+ int32_t old_pel_len;
+ int32_t passes = 0;
+ unsigned cooked_flags;
+ H5SL_node_t * node_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * next_entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- int64_t actual_slist_len = 0;
- int64_t initial_slist_len = 0;
+ int64_t actual_slist_len = 0;
+ int64_t initial_slist_len = 0;
size_t actual_slist_size = 0;
size_t initial_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
@@ -7068,11 +7068,11 @@ H5C_flush_invalidate_cache(H5F_t * f,
while ( cache_ptr->index_len > 0 )
{
- /* first, try to flush-destroy any dirty entries. Do this by
- * making a scan through the slist. Note that new dirty entries
- * may be created by the flush call backs. Thus it is possible
- * that the slist will not be empty after we finish the scan.
- */
+ /* first, try to flush-destroy any dirty entries. Do this by
+ * making a scan through the slist. Note that new dirty entries
+ * may be created by the flush call backs. Thus it is possible
+ * that the slist will not be empty after we finish the scan.
+ */
if ( cache_ptr->slist_len == 0 ) {
@@ -7095,7 +7095,7 @@ H5C_flush_invalidate_cache(H5F_t * f,
"next_entry_ptr == NULL 1 ?!?!");
}
#ifndef NDEBUG
- HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
+ HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
#endif /* NDEBUG */
HDassert( next_entry_ptr->is_dirty );
HDassert( next_entry_ptr->in_slist );
@@ -7122,13 +7122,13 @@ H5C_flush_invalidate_cache(H5F_t * f,
cache_ptr->slist_len_increase = 0;
cache_ptr->slist_size_increase = 0;
- /* Finally, reset the actual_slist_len and actual_slist_size
- * fields to zero, as these fields are used to accumulate
- * the slist lenght and size that we see as we scan through
- * the slist.
- */
- actual_slist_len = 0;
- actual_slist_size = 0;
+ /* Finally, reset the actual_slist_len and actual_slist_size
+ * fields to zero, as these fields are used to accumulate
+ * the slist lenght and size that we see as we scan through
+ * the slist.
+ */
+ actual_slist_len = 0;
+ actual_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
while ( node_ptr != NULL )
@@ -7155,27 +7155,27 @@ H5C_flush_invalidate_cache(H5F_t * f,
*
* Observe that that breaking out of the scan early
* shouldn't break the sanity checks just after the end
- * of this while loop.
- *
- * If an entry has merely been marked clean and removed from
- * the s-list, we simply break out of the scan.
- *
- * If the entry has been evicted, we flag an error and
- * exit.
+ * of this while loop.
+ *
+ * If an entry has merely been marked clean and removed from
+ * the s-list, we simply break out of the scan.
+ *
+ * If the entry has been evicted, we flag an error and
+ * exit.
*/
#ifndef NDEBUG
- if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
+ if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"entry_ptr->magic is invalid ?!?!");
- } else
+ } else
#endif /* NDEBUG */
- if ( ( ! entry_ptr->is_dirty ) ||
+ if ( ( ! entry_ptr->is_dirty ) ||
( ! entry_ptr->in_slist ) ) {
/* the s-list has been modified out from under us.
- * break out of the loop.
+ * break out of the loop.
*/
break;
}
@@ -7190,9 +7190,9 @@ H5C_flush_invalidate_cache(H5F_t * f,
if ( next_entry_ptr == NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"next_entry_ptr == NULL 2 ?!?!");
- }
+ }
#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
+ HDassert( next_entry_ptr->magic ==
H5C__H5C_CACHE_ENTRY_T_MAGIC );
#endif /* NDEBUG */
HDassert( next_entry_ptr->is_dirty );
@@ -7201,11 +7201,11 @@ H5C_flush_invalidate_cache(H5F_t * f,
} else {
next_entry_ptr = NULL;
- }
+ }
/* Note that we now remove nodes from the slist as we flush
- * the associated entries, instead of leaving them there
- * until we are done, and then destroying all nodes in
+ * the associated entries, instead of leaving them there
+ * until we are done, and then destroying all nodes in
* the slist.
*
* While this optimization used to be easy, with the possibility
@@ -7219,15 +7219,15 @@ H5C_flush_invalidate_cache(H5F_t * f,
#if H5C_DO_SANITY_CHECKS
/* update actual_slist_len & actual_slist_size before
- * the flush. Note that the entry will be removed
- * from the slist after the flush, and thus may be
- * resized by the flush callback. This is OK, as
- * we will catch the size delta in
- * cache_ptr->slist_size_increase.
- *
- * Note that we include pinned entries in this count, even
- * though we will not actually flush them.
- */
+ * the flush. Note that the entry will be removed
+ * from the slist after the flush, and thus may be
+ * resized by the flush callback. This is OK, as
+ * we will catch the size delta in
+ * cache_ptr->slist_size_increase.
+ *
+ * Note that we include pinned entries in this count, even
+ * though we will not actually flush them.
+ */
actual_slist_len++;
actual_slist_size += entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -7237,20 +7237,20 @@ H5C_flush_invalidate_cache(H5F_t * f,
/* we have major problems -- but lets flush
* everything we can before we flag an error.
*/
- protected_entries++;
+ protected_entries++;
} else if ( entry_ptr->is_pinned ) {
- /* Test to see if we are can flush the entry now.
+ /* Test to see if we are can flush the entry now.
* If we can, go ahead and flush, but don't tell
* H5C_flush_single_entry() to destroy the entry
* as pinned entries can't be evicted.
*/
- if ( TRUE ) { /* When we get to multithreaded cache,
- * we will need either locking code, and/or
- * a test to see if the entry is in flushable
- * condition here.
- */
+ if ( TRUE ) { /* When we get to multithreaded cache,
+ * we will need either locking code, and/or
+ * a test to see if the entry is in flushable
+ * condition here.
+ */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@@ -7293,38 +7293,38 @@ H5C_flush_invalidate_cache(H5F_t * f,
} /* end while loop scanning skip list */
#if H5C_DO_SANITY_CHECKS
- /* It is possible that entries were added to the slist during
- * the scan, either before or after scan pointer. The following
- * asserts take this into account.
+ /* It is possible that entries were added to the slist during
+ * the scan, either before or after scan pointer. The following
+ * asserts take this into account.
*
* Don't bother with the sanity checks if node_ptr != NULL, as
* in this case we broke out of the loop because it got changed
* out from under us.
*/
- if ( node_ptr == NULL ) {
+ if ( node_ptr == NULL ) {
HDassert( (actual_slist_len + cache_ptr->slist_len) ==
- (initial_slist_len + cache_ptr->slist_len_increase) );
+ (initial_slist_len + cache_ptr->slist_len_increase) );
HDassert( (actual_slist_size + cache_ptr->slist_size) ==
- (initial_slist_size + cache_ptr->slist_size_increase) );
- }
+ (initial_slist_size + cache_ptr->slist_size_increase) );
+ }
#endif /* H5C_DO_SANITY_CHECKS */
/* Since we are doing a destroy, we must make a pass through
* the hash table and try to flush - destroy all entries that
* remain.
- *
- * It used to be that all entries remaining in the cache at
- * this point had to be clean, but with the fractal heap mods
- * this may not be the case. If so, we will flush entries out
- * of increasing address order.
- *
- * Writes to disk are possible here.
+ *
+ * It used to be that all entries remaining in the cache at
+ * this point had to be clean, but with the fractal heap mods
+ * this may not be the case. If so, we will flush entries out
+ * of increasing address order.
+ *
+ * Writes to disk are possible here.
*/
for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ )
{
- next_entry_ptr = cache_ptr->index[i];
+ next_entry_ptr = cache_ptr->index[i];
while ( next_entry_ptr != NULL )
{
@@ -7332,7 +7332,7 @@ H5C_flush_invalidate_cache(H5F_t * f,
next_entry_ptr = entry_ptr->ht_next;
#ifndef NDEBUG
- HDassert ( ( next_entry_ptr == NULL ) ||
+ HDassert ( ( next_entry_ptr == NULL ) ||
( next_entry_ptr->magic ==
H5C__H5C_CACHE_ENTRY_T_MAGIC ) );
#endif /* NDEBUG */
@@ -7344,7 +7344,7 @@ H5C_flush_invalidate_cache(H5F_t * f,
/* we have major problems -- but lets flush and destroy
* everything we can before we flag an error.
*/
- protected_entries++;
+ protected_entries++;
if ( ! entry_ptr->in_slist ) {
@@ -7370,23 +7370,23 @@ H5C_flush_invalidate_cache(H5F_t * f,
"Entry flush destroy failed.")
}
}
- /* We can't do anything if the entry is pinned. The
- * hope is that the entry will be unpinned as the
- * result of destroys of entries that reference it.
- *
- * We detect this by noting the change in the number
- * of pinned entries from pass to pass. If it stops
- * shrinking before it hits zero, we scream and die.
- */
+ /* We can't do anything if the entry is pinned. The
+ * hope is that the entry will be unpinned as the
+ * result of destroys of entries that reference it.
+ *
+ * We detect this by noting the change in the number
+ * of pinned entries from pass to pass. If it stops
+ * shrinking before it hits zero, we scream and die.
+ */
/* if the flush function on the entry we last evicted
* loaded an entry into cache (as Quincey has promised me
* it never will), and if the cache was full, it is
* possible that *next_entry_ptr was flushed or evicted.
*
* Test to see if this happened here. Note that if this
- * test is triggred, we are accessing a deallocated piece
- * of dynamically allocated memory, so we just scream and
- * die.
+ * test is triggred, we are accessing a deallocated piece
+ * of dynamically allocated memory, so we just scream and
+ * die.
*/
#ifndef NDEBUG
if ( ( next_entry_ptr != NULL ) &&
@@ -7403,33 +7403,33 @@ H5C_flush_invalidate_cache(H5F_t * f,
} /* end while loop scanning hash table bin */
} /* end for loop scanning hash table */
- old_pel_len = cur_pel_len;
- cur_pel_len = cache_ptr->pel_len;
+ old_pel_len = cur_pel_len;
+ cur_pel_len = cache_ptr->pel_len;
- if ( ( cur_pel_len > 0 ) && ( cur_pel_len >= old_pel_len ) ) {
+ if ( ( cur_pel_len > 0 ) && ( cur_pel_len >= old_pel_len ) ) {
- /* The number of pinned entries is positive, and it is not
- * declining. Scream and die.
- */
+ /* The number of pinned entries is positive, and it is not
+ * declining. Scream and die.
+ */
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
"Pinned entry count not decreasing, cur_pel_len = %d, old_pel_len = %d", (int)cur_pel_len, (int)old_pel_len)
} else if ( ( cur_pel_len == 0 ) && ( old_pel_len == 0 ) ) {
- /* increment the pass count */
- passes++;
- }
+ /* increment the pass count */
+ passes++;
+ }
- if ( passes >= H5C__MAX_PASSES_ON_FLUSH ) {
+ if ( passes >= H5C__MAX_PASSES_ON_FLUSH ) {
- /* we have exceeded the maximum number of passes through the
- * cache to flush and destroy all entries. Scream and die.
- */
+ /* we have exceeded the maximum number of passes through the
+ * cache to flush and destroy all entries. Scream and die.
+ */
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "Maximum passes on flush exceeded.")
- }
+ "Maximum passes on flush exceeded.")
+ }
} /* main while loop */
/* Invariants, after destroying all entries in the hash table */
@@ -7451,12 +7451,12 @@ H5C_flush_invalidate_cache(H5F_t * f,
if ( protected_entries > 0 ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "Cache has protected entries.")
+ "Cache has protected entries.")
} else if ( cur_pel_len > 0 ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "Can't unpin all pinned entries.")
+ "Can't unpin all pinned entries.")
}
@@ -7466,74 +7466,74 @@ done:
} /* H5C_flush_invalidate_cache() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_flush_single_entry
*
* Purpose: Flush or clear (and evict if requested) the cache entry
- * with the specified address and type. If the type is NULL,
- * any unprotected entry at the specified address will be
- * flushed (and possibly evicted).
- *
- * Attempts to flush a protected entry will result in an
- * error.
- *
- * *first_flush_ptr should be true if only one
- * flush is contemplated before the next load, or if this
- * is the first of a sequence of flushes that will be
- * completed before the next load. *first_flush_ptr is set
- * to false if a flush actually takes place, and should be
- * left false until the end of the sequence.
- *
- * The primary_dxpl_id is used if *first_flush_ptr is TRUE
- * on entry, and a flush actually takes place. The
- * secondary_dxpl_id is used in any subsequent flush where
- * *first_flush_ptr is FALSE on entry.
- *
- * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will
- * be cleared and not flushed -- in the case *first_flush_ptr,
- * primary_dxpl_id, and secondary_dxpl_id are all irrelevent,
- * and the call can't be part of a sequence of flushes.
- *
- * If the caller knows the address of the TBBT node at
- * which the target entry resides, it can avoid a lookup
- * by supplying that address in the tgt_node_ptr parameter.
- * If this parameter is NULL, the function will do a TBBT
- * search for the entry instead.
- *
- * The function does nothing silently if there is no entry
- * at the supplied address, or if the entry found has the
- * wrong type.
+ * with the specified address and type. If the type is NULL,
+ * any unprotected entry at the specified address will be
+ * flushed (and possibly evicted).
+ *
+ * Attempts to flush a protected entry will result in an
+ * error.
+ *
+ * *first_flush_ptr should be true if only one
+ * flush is contemplated before the next load, or if this
+ * is the first of a sequence of flushes that will be
+ * completed before the next load. *first_flush_ptr is set
+ * to false if a flush actually takes place, and should be
+ * left false until the end of the sequence.
+ *
+ * The primary_dxpl_id is used if *first_flush_ptr is TRUE
+ * on entry, and a flush actually takes place. The
+ * secondary_dxpl_id is used in any subsequent flush where
+ * *first_flush_ptr is FALSE on entry.
+ *
+ * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will
+ * be cleared and not flushed -- in the case *first_flush_ptr,
+ * primary_dxpl_id, and secondary_dxpl_id are all irrelevent,
+ * and the call can't be part of a sequence of flushes.
+ *
+ * If the caller knows the address of the TBBT node at
+ * which the target entry resides, it can avoid a lookup
+ * by supplying that address in the tgt_node_ptr parameter.
+ * If this parameter is NULL, the function will do a TBBT
+ * search for the entry instead.
+ *
+ * The function does nothing silently if there is no entry
+ * at the supplied address, or if the entry found has the
+ * wrong type.
*
* Return: Non-negative on success/Negative on failure or if there was
- * an attempt to flush a protected item.
+ * an attempt to flush a protected item.
*
* Programmer: John Mainzer, 5/5/04
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5C_flush_single_entry(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
+H5C_flush_single_entry(H5F_t * f,
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
const H5C_class_t * type_ptr,
- haddr_t addr,
- unsigned flags,
- hbool_t * first_flush_ptr,
- hbool_t del_entry_from_slist_on_destroy)
+ haddr_t addr,
+ unsigned flags,
+ hbool_t * first_flush_ptr,
+ hbool_t del_entry_from_slist_on_destroy)
{
- H5C_t * cache_ptr = f->shared->cache;
- hbool_t destroy;
- hbool_t clear_only;
- hbool_t take_ownership;
- hbool_t was_dirty;
- hbool_t destroy_entry;
- herr_t status;
- int type_id;
- unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET;
+ H5C_t * cache_ptr = f->shared->cache;
+ hbool_t destroy;
+ hbool_t clear_only;
+ hbool_t take_ownership;
+ hbool_t was_dirty;
+ hbool_t destroy_entry;
+ herr_t status;
+ int type_id;
+ unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET;
H5C_cache_entry_t * entry_ptr = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -7597,10 +7597,10 @@ H5C_flush_single_entry(H5F_t * f,
{
/* we have work to do */
- /* We will set flush_in_progress back to FALSE at the end if the
- * entry still exists at that point.
- */
- entry_ptr->flush_in_progress = TRUE;
+ /* We will set flush_in_progress back to FALSE at the end if the
+ * entry still exists at that point.
+ */
+ entry_ptr->flush_in_progress = TRUE;
#ifdef H5_HAVE_PARALLEL
#ifndef NDEBUG
@@ -7650,12 +7650,12 @@ H5C_flush_single_entry(H5F_t * f,
*
* We must do deletions now as the callback routines will free the
* entry if destroy is true.
- *
- * Note that it is possible that the entry will be moved during
- * its call to flush. This will upset H5C_move_entry() if we
- * don't tell it that it doesn't have to worry about updating the
- * index and SLIST. Use the destroy_in_progress field for this
- * purpose.
+ *
+ * Note that it is possible that the entry will be moved during
+ * its call to flush. This will upset H5C_move_entry() if we
+ * don't tell it that it doesn't have to worry about updating the
+ * index and SLIST. Use the destroy_in_progress field for this
+ * purpose.
*/
if ( destroy ) {
@@ -7686,18 +7686,18 @@ H5C_flush_single_entry(H5F_t * f,
/* Clear the dirty flag only, if requested */
if ( clear_only ) {
- if ( destroy ) {
+ if ( destroy ) {
#ifndef NDEBUG
- /* we are about to call the clear callback with the
- * destroy flag set -- this will result in *entry_ptr
- * being freed. Set the magic field to bad magic
- * so we can detect a freed cache entry if we see
- * one.
- */
- entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC;
+ /* we are about to call the clear callback with the
+ * destroy flag set -- this will result in *entry_ptr
+ * being freed. Set the magic field to bad magic
+ * so we can detect a freed cache entry if we see
+ * one.
+ */
+ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC;
#endif /* NDEBUG */
entry_ptr->cache_ptr = NULL;
- }
+ }
/* Call the callback routine to clear all dirty flags for object */
if ( (entry_ptr->type->clear)(f, entry_ptr, destroy_entry) < 0 ) {
@@ -7715,18 +7715,18 @@ H5C_flush_single_entry(H5F_t * f,
}
#endif /* H5C_DO_SANITY_CHECKS */
- if ( destroy ) {
+ if ( destroy ) {
#ifndef NDEBUG
- /* we are about to call the flush callback with the
- * destroy flag set -- this will result in *entry_ptr
- * being freed. Set the magic field to bad magic
- * so we can detect a freed cache entry if we see
- * one.
- */
- entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC;
+ /* we are about to call the flush callback with the
+ * destroy flag set -- this will result in *entry_ptr
+ * being freed. Set the magic field to bad magic
+ * so we can detect a freed cache entry if we see
+ * one.
+ */
+ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC;
#endif /* NDEBUG */
entry_ptr->cache_ptr = NULL;
- }
+ }
/* Only block for all the processes on the first piece of metadata
*/
@@ -7735,7 +7735,7 @@ H5C_flush_single_entry(H5F_t * f,
status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy_entry,
entry_ptr->addr, entry_ptr,
- &flush_flags);
+ &flush_flags);
*first_flush_ptr = FALSE;
} else {
@@ -7755,38 +7755,38 @@ H5C_flush_single_entry(H5F_t * f,
if ( flush_flags != H5C_CALLBACK__NO_FLAGS_SET ) {
/* In the parallel case, flush operations can
- * cause problems. If they occur, scream and
- * die.
- *
- * At present, in the parallel case, the aux_ptr
- * will only be set if there is more than one
- * process. Thus we can use this to detect
- * the parallel case.
- *
- * This works for now, but if we start using the
- * aux_ptr for other purposes, we will have to
- * change this test accordingly.
- *
- * NB: While this test detects entryies that attempt
- * to resize or move themselves during a flush
- * in the parallel case, it will not detect an
- * entry that dirties, resizes, and/or moves
- * other entries during its flush.
- *
- * From what Quincey tells me, this test is
- * sufficient for now, as any flush routine that
- * does the latter will also do the former.
- *
- * If that ceases to be the case, further
- * tests will be necessary.
- */
- if ( cache_ptr->aux_ptr != NULL ) {
+ * cause problems. If they occur, scream and
+ * die.
+ *
+ * At present, in the parallel case, the aux_ptr
+ * will only be set if there is more than one
+ * process. Thus we can use this to detect
+ * the parallel case.
+ *
+ * This works for now, but if we start using the
+ * aux_ptr for other purposes, we will have to
+ * change this test accordingly.
+ *
+ * NB: While this test detects entryies that attempt
+ * to resize or move themselves during a flush
+ * in the parallel case, it will not detect an
+ * entry that dirties, resizes, and/or moves
+ * other entries during its flush.
+ *
+ * From what Quincey tells me, this test is
+ * sufficient for now, as any flush routine that
+ * does the latter will also do the former.
+ *
+ * If that ceases to be the case, further
+ * tests will be necessary.
+ */
+ if ( cache_ptr->aux_ptr != NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "resize/move in serialize occurred in parallel case.")
+ "resize/move in serialize occurred in parallel case.")
- }
- }
+ }
+ }
#endif /* H5_HAVE_PARALLEL */
}
@@ -7796,7 +7796,7 @@ H5C_flush_single_entry(H5F_t * f,
}
- if ( ( ! destroy ) && ( was_dirty ) ) {
+ if ( ( ! destroy ) && ( was_dirty ) ) {
H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr);
}
@@ -7810,17 +7810,17 @@ H5C_flush_single_entry(H5F_t * f,
HDassert( !(entry_ptr->is_read_only) );
HDassert( (entry_ptr->ro_ref_count) == 0 );
- if ( (flush_flags & H5C_CALLBACK__SIZE_CHANGED_FLAG) != 0 ) {
+ if ( (flush_flags & H5C_CALLBACK__SIZE_CHANGED_FLAG) != 0 ) {
- /* The entry size changed as a result of the flush.
- *
- * Most likely, the entry was compressed, and the
- * new version is of a different size than the old.
- *
- * In any case, we must update entry and cache size
- * accordingly.
- */
- size_t new_size;
+ /* The entry size changed as a result of the flush.
+ *
+ * Most likely, the entry was compressed, and the
+ * new version is of a different size than the old.
+ *
+ * In any case, we must update entry and cache size
+ * accordingly.
+ */
+ size_t new_size;
if ( (entry_ptr->type->size)(f, (void *)entry_ptr, &new_size)
< 0 ) {
@@ -7829,61 +7829,61 @@ H5C_flush_single_entry(H5F_t * f,
"Can't get entry size after flush")
}
- if ( new_size != entry_ptr->size ) {
+ if ( new_size != entry_ptr->size ) {
HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE );
/* update the hash table for the size change
- * We pass TRUE as the was_clean parameter, as we
- * have already updated the clean and dirty index
- * size fields for the fact that the entry has
- * been flushed. (See above call to
- * H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN()).
- */
- H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), \
- (entry_ptr->size), \
+ * We pass TRUE as the was_clean parameter, as we
+ * have already updated the clean and dirty index
+ * size fields for the fact that the entry has
+ * been flushed. (See above call to
+ * H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN()).
+ */
+ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), \
+ (entry_ptr->size), \
(new_size), \
- (entry_ptr), \
- (TRUE))
-
- /* The entry can't be protected since we just flushed it.
- * Thus we must update the replacement policy data
- * structures for the size change. The macro deals
- * with the pinned case.
- */
- H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, \
- new_size)
-
- /* The entry can't be in the slist, so no need to update
- * the slist for the size change.
- */
-
- /* update stats for the size change */
- H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \
- entry_ptr, \
- new_size)
-
- /* finally, update the entry size proper */
- entry_ptr->size = new_size;
- }
- }
+ (entry_ptr), \
+ (TRUE))
+
+ /* The entry can't be protected since we just flushed it.
+ * Thus we must update the replacement policy data
+ * structures for the size change. The macro deals
+ * with the pinned case.
+ */
+ H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, \
+ new_size)
+
+ /* The entry can't be in the slist, so no need to update
+ * the slist for the size change.
+ */
+
+ /* update stats for the size change */
+ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \
+ entry_ptr, \
+ new_size)
+
+ /* finally, update the entry size proper */
+ entry_ptr->size = new_size;
+ }
+ }
- if ( (flush_flags & H5C_CALLBACK__MOVED_FLAG) != 0 ) {
+ if ( (flush_flags & H5C_CALLBACK__MOVED_FLAG) != 0 ) {
- /* The entry was moved as the result of the flush.
- *
- * Most likely, the entry was compressed, and the
- * new version is larger than the old and thus had
- * to be relocated.
- *
- * At preset, all processing for this case is
- * handled elsewhere. But lets keep the if statement
- * around just in case.
- */
+ /* The entry was moved as the result of the flush.
+ *
+ * Most likely, the entry was compressed, and the
+ * new version is larger than the old and thus had
+ * to be relocated.
+ *
+ * At preset, all processing for this case is
+ * handled elsewhere. But lets keep the if statement
+ * around just in case.
+ */
- }
+ }
- entry_ptr->flush_in_progress = FALSE;
+ entry_ptr->flush_in_progress = FALSE;
}
if ( cache_ptr->log_flush ) {
@@ -7903,26 +7903,26 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_flush_single_entry() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_load_entry
*
* Purpose: Attempt to load the entry at the specified disk address
- * and with the specified type into memory. If successful.
- * return the in memory address of the entry. Return NULL
- * on failure.
+ * and with the specified type into memory. If successful.
+ * return the in memory address of the entry. Return NULL
+ * on failure.
*
- * Note that this function simply loads the entry into
- * core. It does not insert it into the cache.
+ * Note that this function simply loads the entry into
+ * core. It does not insert it into the cache.
*
* Return: Non-NULL on success / NULL on failure.
*
* Programmer: John Mainzer, 5/18/04
*
- * QAK -- 1/31/08
- * Added initialization for the new free_file_space_on_destroy
- * field.
+ * QAK -- 1/31/08
+ * Added initialization for the new free_file_space_on_destroy
+ * field.
*
*-------------------------------------------------------------------------
*/
@@ -7933,9 +7933,9 @@ H5C_load_entry(H5F_t * f,
haddr_t addr,
void * udata)
{
- void * thing = NULL; /* Pointer to thing loaded */
- H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */
- void * ret_value; /* Return value */
+ void * thing = NULL; /* Pointer to thing loaded */
+ H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */
+ void * ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -7963,11 +7963,11 @@ H5C_load_entry(H5F_t * f,
*
* To support this bug fix, I have replace the old assert:
*
- * HDassert( entry->is_dirty == FALSE );
+ * HDassert( entry->is_dirty == FALSE );
*
* with:
*
- * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) );
+ * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) );
*
* Note that type id 5 is associated with object headers in the metadata
* cache.
@@ -8018,35 +8018,35 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_load_entry() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_make_space_in_cache
*
* Purpose: Attempt to evict cache entries until the index_size
- * is at least needed_space below max_cache_size.
+ * is at least needed_space below max_cache_size.
*
- * In passing, also attempt to bring cLRU_list_size to a
- * value greater than min_clean_size.
+ * In passing, also attempt to bring cLRU_list_size to a
+ * value greater than min_clean_size.
*
- * Depending on circumstances, both of these goals may
- * be impossible, as in parallel mode, we must avoid generating
- * a write as part of a read (to avoid deadlock in collective
- * I/O), and in all cases, it is possible (though hopefully
- * highly unlikely) that the protected list may exceed the
- * maximum size of the cache.
+ * Depending on circumstances, both of these goals may
+ * be impossible, as in parallel mode, we must avoid generating
+ * a write as part of a read (to avoid deadlock in collective
+ * I/O), and in all cases, it is possible (though hopefully
+ * highly unlikely) that the protected list may exceed the
+ * maximum size of the cache.
*
- * Thus the function simply does its best, returning success
- * unless an error is encountered.
+ * Thus the function simply does its best, returning success
+ * unless an error is encountered.
*
- * The primary_dxpl_id and secondary_dxpl_id parameters
- * specify the dxpl_ids used on the first write occasioned
- * by the call (primary_dxpl_id), and on all subsequent
- * writes (secondary_dxpl_id). This is useful in the metadata
- * cache, but may not be needed elsewhere. If so, just use the
- * same dxpl_id for both parameters.
+ * The primary_dxpl_id and secondary_dxpl_id parameters
+ * specify the dxpl_ids used on the first write occasioned
+ * by the call (primary_dxpl_id), and on all subsequent
+ * writes (secondary_dxpl_id). This is useful in the metadata
+ * cache, but may not be needed elsewhere. If so, just use the
+ * same dxpl_id for both parameters.
*
- * Observe that this function cannot occasion a read.
+ * Observe that this function cannot occasion a read.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -8076,28 +8076,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5C_make_space_in_cache(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- size_t space_needed,
- hbool_t write_permitted,
+H5C_make_space_in_cache(H5F_t * f,
+ hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id,
+ size_t space_needed,
+ hbool_t write_permitted,
hbool_t * first_flush_ptr)
{
- H5C_t * cache_ptr = f->shared->cache;
- herr_t result;
+ H5C_t * cache_ptr = f->shared->cache;
+ herr_t result;
#if H5C_COLLECT_CACHE_STATS
int32_t clean_entries_skipped = 0;
int32_t total_entries_scanned = 0;
#endif /* H5C_COLLECT_CACHE_STATS */
- int32_t entries_examined = 0;
- int32_t initial_list_len;
- size_t empty_space;
- hbool_t prev_is_dirty = FALSE;
+ int32_t entries_examined = 0;
+ int32_t initial_list_len;
+ size_t empty_space;
+ hbool_t prev_is_dirty = FALSE;
hbool_t didnt_flush_entry = FALSE;
- H5C_cache_entry_t * entry_ptr;
- H5C_cache_entry_t * prev_ptr;
- H5C_cache_entry_t * next_ptr;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5C_cache_entry_t * entry_ptr;
+ H5C_cache_entry_t * prev_ptr;
+ H5C_cache_entry_t * next_ptr;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -8107,7 +8107,7 @@ H5C_make_space_in_cache(H5F_t * f,
HDassert( first_flush_ptr != NULL );
HDassert( ( *first_flush_ptr == TRUE ) || ( *first_flush_ptr == FALSE ) );
HDassert( cache_ptr->index_size ==
- (cache_ptr->clean_index_size + cache_ptr->dirty_index_size) );
+ (cache_ptr->clean_index_size + cache_ptr->dirty_index_size) );
if ( write_permitted ) {
@@ -8115,27 +8115,27 @@ H5C_make_space_in_cache(H5F_t * f,
entry_ptr = cache_ptr->LRU_tail_ptr;
- if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) {
+ if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) {
- empty_space = 0;
+ empty_space = 0;
- } else {
+ } else {
- empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
+ empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
- }
+ }
while ( ( ( (cache_ptr->index_size + space_needed)
>
cache_ptr->max_cache_size
)
- ||
- (
- ( empty_space + cache_ptr->clean_index_size )
- <
- ( cache_ptr->min_clean_size )
+ ||
+ (
+ ( empty_space + cache_ptr->clean_index_size )
+ <
+ ( cache_ptr->min_clean_size )
)
- )
+ )
&&
( entries_examined <= (2 * initial_list_len) )
&&
@@ -8146,13 +8146,13 @@ H5C_make_space_in_cache(H5F_t * f,
HDassert( ! (entry_ptr->is_read_only) );
HDassert( (entry_ptr->ro_ref_count) == 0 );
- next_ptr = entry_ptr->next;
+ next_ptr = entry_ptr->next;
prev_ptr = entry_ptr->prev;
- if ( prev_ptr != NULL ) {
+ if ( prev_ptr != NULL ) {
- prev_is_dirty = prev_ptr->is_dirty;
- }
+ prev_is_dirty = prev_ptr->is_dirty;
+ }
if ( (entry_ptr->type)->id != H5C__EPOCH_MARKER_TYPE ) {
@@ -8225,67 +8225,67 @@ H5C_make_space_in_cache(H5F_t * f,
"unable to flush entry")
}
- if ( prev_ptr != NULL ) {
+ if ( prev_ptr != NULL ) {
#ifndef NDEBUG
- if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
+ if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
- /* something horrible has happened to *prev_ptr --
- * scream and die.
- */
+ /* something horrible has happened to *prev_ptr --
+ * scream and die.
+ */
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "*prev_ptr corrupt 1")
+ "*prev_ptr corrupt 1")
}
#endif /* NDEBUG */
- if ( didnt_flush_entry ) {
+ if ( didnt_flush_entry ) {
- /* epoch markers don't get flushed, so the sanity checks
- * on normal entries will fail -- thus just set entry_ptr
- * to prev_ptr and go on.
- */
+ /* epoch markers don't get flushed, so the sanity checks
+ * on normal entries will fail -- thus just set entry_ptr
+ * to prev_ptr and go on.
+ */
entry_ptr = prev_ptr;
- } else if ( ( prev_ptr->is_dirty != prev_is_dirty )
- ||
- ( prev_ptr->next != next_ptr )
- ||
- ( prev_ptr->is_protected )
- ||
- ( prev_ptr->is_pinned ) ) {
+ } else if ( ( prev_ptr->is_dirty != prev_is_dirty )
+ ||
+ ( prev_ptr->next != next_ptr )
+ ||
+ ( prev_ptr->is_protected )
+ ||
+ ( prev_ptr->is_pinned ) ) {
- /* something has happened to the LRU -- start over
- * from the tail.
- */
- entry_ptr = cache_ptr->LRU_tail_ptr;
+ /* something has happened to the LRU -- start over
+ * from the tail.
+ */
+ entry_ptr = cache_ptr->LRU_tail_ptr;
- } else {
+ } else {
- entry_ptr = prev_ptr;
+ entry_ptr = prev_ptr;
- }
- } else {
+ }
+ } else {
- entry_ptr = NULL;
+ entry_ptr = NULL;
- }
+ }
- entries_examined++;
+ entries_examined++;
- if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) {
+ if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) {
- empty_space = 0;
+ empty_space = 0;
- } else {
+ } else {
- empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
+ empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
- }
+ }
- HDassert( cache_ptr->index_size ==
- (cache_ptr->clean_index_size +
- cache_ptr->dirty_index_size) );
+ HDassert( cache_ptr->index_size ==
+ (cache_ptr->clean_index_size +
+ cache_ptr->dirty_index_size) );
- }
+ }
#if H5C_COLLECT_CACHE_STATS
cache_ptr->calls_to_msic++;
@@ -8304,18 +8304,18 @@ H5C_make_space_in_cache(H5F_t * f,
}
#endif /* H5C_COLLECT_CACHE_STATS */
- HDassert( ( entries_examined > (2 * initial_list_len) ) ||
- ( (cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) >
- cache_ptr->max_cache_size ) ||
- ( ( cache_ptr->clean_index_size + empty_space )
- >= cache_ptr->min_clean_size ) );
+ HDassert( ( entries_examined > (2 * initial_list_len) ) ||
+ ( (cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) >
+ cache_ptr->max_cache_size ) ||
+ ( ( cache_ptr->clean_index_size + empty_space )
+ >= cache_ptr->min_clean_size ) );
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
HDassert( ( entries_examined > (2 * initial_list_len) ) ||
- ( cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size ) );
+ ( cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size ) );
HDassert( ( entries_examined > (2 * initial_list_len) ) ||
- ( cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size ) );
+ ( cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size ) );
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
@@ -8359,7 +8359,7 @@ H5C_make_space_in_cache(H5F_t * f,
}
entry_ptr = prev_ptr;
- entries_examined++;
+ entries_examined++;
}
}
@@ -8369,16 +8369,16 @@ done:
} /* H5C_make_space_in_cache() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_validate_lru_list
*
* Purpose: Debugging function that scans the LRU list for errors.
*
- * If an error is detected, the function generates a
- * diagnostic and returns FAIL. If no error is detected,
- * the function returns SUCCEED.
+ * If an error is detected, the function generates a
+ * diagnostic and returns FAIL. If no error is detected,
+ * the function returns SUCCEED.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
*
@@ -8391,10 +8391,10 @@ done:
static herr_t
H5C_validate_lru_list(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
int32_t len = 0;
size_t size = 0;
- H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
FUNC_ENTER_NOAPI_NOINIT
@@ -8487,18 +8487,18 @@ done:
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_verify_not_in_index
*
* Purpose: Debugging function that scans the hash table to verify
- * that the specified instance of H5C_cache_entry_t is not
- * present.
+ * that the specified instance of H5C_cache_entry_t is not
+ * present.
*
- * If an error is detected, the function generates a
- * diagnostic and returns FAIL. If no error is detected,
- * the function returns SUCCEED.
+ * If an error is detected, the function generates a
+ * diagnostic and returns FAIL. If no error is detected,
+ * the function returns SUCCEED.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
*
@@ -8512,10 +8512,10 @@ static herr_t
H5C_verify_not_in_index(H5C_t * cache_ptr,
H5C_cache_entry_t * entry_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
int32_t i;
int32_t depth;
- H5C_cache_entry_t * scan_ptr = NULL;
+ H5C_cache_entry_t * scan_ptr = NULL;
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 3041ce1..7ab359b 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -17,15 +17,18 @@
* Purpose: This file contains declarations which are normally visible
* only within the H5C package.
*
- * Source files outside the H5C package should include
- * H5Cprivate.h instead.
+ * Source files outside the H5C package should include
+ * H5Cprivate.h instead.
*
- * The one exception to this rule is test/cache.c. The test
- * code is easier to write if it can look at the cache's
- * internal data structures. Indeed, this is the main
- * reason why this file was created.
+ * The one exception to this rule is test/cache.c. The test
+ * code is easier to write if it can look at the cache's
+ * internal data structures. Indeed, this is the main
+ * reason why this file was created.
*/
+/* clang-format off */
+/* Maintain current format by disabling format for this file */
+
#ifndef H5C_PACKAGE
#error "Do not include this file outside the H5C package!"
#endif
@@ -49,10 +52,10 @@
* The current value was obtained via personal communication with
* Quincey. I have applied a fudge factor of 2.
*
- * -- JRM
+ * -- JRM
*/
-#define H5C__MAX_PASSES_ON_FLUSH 4
+#define H5C__MAX_PASSES_ON_FLUSH 4
@@ -87,19 +90,19 @@
* Note that index_size and index_len now refer to the total size of
* and number of entries in the hash table.
*
- * JRM - 7/19/04
+ * JRM - 7/19/04
*
* The TBBT has since been replaced with a skip list. This change
* greatly predates this note.
*
- * JRM - 9/26/05
+ * JRM - 9/26/05
*
- * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC.
- * This field is used to validate pointers to instances of
- * H5C_t.
+ * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC.
+ * This field is used to validate pointers to instances of
+ * H5C_t.
*
* flush_in_progress: Boolean flag indicating whether a flush is in
- * progress.
+ * progress.
*
* trace_file_ptr: File pointer pointing to the trace file, which is used
* to record cache operations for use in simulations and design
@@ -113,15 +116,15 @@
* When we get to using H5C in other places, we may add
* code to write trace file data at the H5C level as well.
*
- * aux_ptr: Pointer to void used to allow wrapper code to associate
- * its data with an instance of H5C_t. The H5C cache code
- * sets this field to NULL, and otherwise leaves it alone.
+ * aux_ptr: Pointer to void used to allow wrapper code to associate
+ * its data with an instance of H5C_t. The H5C cache code
+ * sets this field to NULL, and otherwise leaves it alone.
*
- * max_type_id: Integer field containing the maximum type id number assigned
- * to a type of entry in the cache. All type ids from 0 to
- * max_type_id inclusive must be defined. The names of the
- * types are stored in the type_name_table discussed below, and
- * indexed by the ids.
+ * max_type_id: Integer field containing the maximum type id number assigned
+ * to a type of entry in the cache. All type ids from 0 to
+ * max_type_id inclusive must be defined. The names of the
+ * types are stored in the type_name_table discussed below, and
+ * indexed by the ids.
*
* type_name_table_ptr: Pointer to an array of pointer to char of length
* max_type_id + 1. The strings pointed to by the entries
@@ -139,15 +142,15 @@
* to reduce its size as entries are unprotected.
*
* b) When running in parallel mode, the cache may not be
- * permitted to flush a dirty entry in response to a read.
- * If there are no clean entries available to evict, the
- * cache will exceed its maximum size. Again the cache
+ * permitted to flush a dirty entry in response to a read.
+ * If there are no clean entries available to evict, the
+ * cache will exceed its maximum size. Again the cache
* will attempt to reduce its size to the max_cache_size
* limit on the next cache write.
*
- * c) When an entry increases in size, the cache may exceed
- * the max_cache_size limit until the next time the cache
- * attempts to load or insert an entry.
+ * c) When an entry increases in size, the cache may exceed
+ * the max_cache_size limit until the next time the cache
+ * attempts to load or insert an entry.
*
* min_clean_size: Nominal minimum number of clean bytes in the cache.
* The cache attempts to maintain this number of bytes of
@@ -160,19 +163,19 @@
* the cache as a whole:
*
* check_write_permitted: In certain applications, the cache may not
- * be allowed to write to disk at certain time. If specified,
- * the check_write_permitted function is used to determine if
- * a write is permissible at any given point in time.
+ * be allowed to write to disk at certain time. If specified,
+ * the check_write_permitted function is used to determine if
+ * a write is permissible at any given point in time.
*
- * If no such function is specified (i.e. this field is NULL),
- * the cache uses the following write_permitted field to
- * determine whether writes are permitted.
+ * If no such function is specified (i.e. this field is NULL),
+ * the cache uses the following write_permitted field to
+ * determine whether writes are permitted.
*
* write_permitted: If check_write_permitted is NULL, this boolean flag
- * indicates whether writes are permitted.
+ * indicates whether writes are permitted.
*
- * log_flush: If provided, this function is called whenever a dirty
- * entry is flushed to disk.
+ * log_flush: If provided, this function is called whenever a dirty
+ * entry is flushed to disk.
*
*
* In cases where memory is plentiful, and performance is an issue, it
@@ -180,18 +183,18 @@
* writes. The following field is used to implement this.
*
* evictions_enabled: Boolean flag that is initialized to TRUE. When
- * this flag is set to FALSE, the metadata cache will not
- * attempt to evict entries to make space for newly protected
- * entries, and instead the will grow without limit.
- *
- * Needless to say, this feature must be used with care.
+ * this flag is set to FALSE, the metadata cache will not
+ * attempt to evict entries to make space for newly protected
+ * entries, and instead the will grow without limit.
+ *
+ * Needless to say, this feature must be used with care.
*
*
* The cache requires an index to facilitate searching for entries. The
* following fields support that index.
*
* index_len: Number of entries currently in the hash table used to index
- * the cache.
+ * the cache.
*
* index_size: Number of bytes of cache entries currently stored in the
* hash table used to index the cache.
@@ -203,51 +206,51 @@
* of the cache's memory footprint.
*
* clean_index_size: Number of bytes of clean entries currently stored in
- * the hash table. Note that the index_size field (above)
- * is also the sum of the sizes of all entries in the cache.
- * Thus we should have the invarient that clean_index_size +
- * dirty_index_size == index_size.
- *
- * WARNING:
- *
- * 1) The clean_index_size field is not maintained by the
- * index macros, as the hash table doesn't care whether
- * the entry is clean or dirty. Instead the field is
- * maintained in the H5C__UPDATE_RP macros.
- *
- * 2) The value of the clean_index_size must not be mistaken
- * for the current clean size of the cache. Rather, the
- * clean size of the cache is the current value of
- * clean_index_size plus the amount of empty space (if any)
+ * the hash table. Note that the index_size field (above)
+ * is also the sum of the sizes of all entries in the cache.
+ * Thus we should have the invarient that clean_index_size +
+ * dirty_index_size == index_size.
+ *
+ * WARNING:
+ *
+ * 1) The clean_index_size field is not maintained by the
+ * index macros, as the hash table doesn't care whether
+ * the entry is clean or dirty. Instead the field is
+ * maintained in the H5C__UPDATE_RP macros.
+ *
+ * 2) The value of the clean_index_size must not be mistaken
+ * for the current clean size of the cache. Rather, the
+ * clean size of the cache is the current value of
+ * clean_index_size plus the amount of empty space (if any)
* in the cache.
*
* dirty_index_size: Number of bytes of dirty entries currently stored in
- * the hash table. Note that the index_size field (above)
- * is also the sum of the sizes of all entries in the cache.
- * Thus we should have the invarient that clean_index_size +
- * dirty_index_size == index_size.
+ * the hash table. Note that the index_size field (above)
+ * is also the sum of the sizes of all entries in the cache.
+ * Thus we should have the invarient that clean_index_size +
+ * dirty_index_size == index_size.
*
- * WARNING:
+ * WARNING:
*
- * 1) The dirty_index_size field is not maintained by the
- * index macros, as the hash table doesn't care whether
- * the entry is clean or dirty. Instead the field is
- * maintained in the H5C__UPDATE_RP macros.
+ * 1) The dirty_index_size field is not maintained by the
+ * index macros, as the hash table doesn't care whether
+ * the entry is clean or dirty. Instead the field is
+ * maintained in the H5C__UPDATE_RP macros.
*
- * index: Array of pointer to H5C_cache_entry_t of size
- * H5C__HASH_TABLE_LEN. At present, this value is a power
- * of two, not the usual prime number.
+ * index: Array of pointer to H5C_cache_entry_t of size
+ * H5C__HASH_TABLE_LEN. At present, this value is a power
+ * of two, not the usual prime number.
*
- * I hope that the variable size of cache elements, the large
- * hash table size, and the way in which HDF5 allocates space
- * will combine to avoid problems with periodicity. If so, we
- * can use a trivial hash function (a bit-and and a 3 bit left
- * shift) with some small savings.
+ * I hope that the variable size of cache elements, the large
+ * hash table size, and the way in which HDF5 allocates space
+ * will combine to avoid problems with periodicity. If so, we
+ * can use a trivial hash function (a bit-and and a 3 bit left
+ * shift) with some small savings.
*
- * If not, it will become evident in the statistics. Changing
- * to the usual prime number length hash table will require
- * changing the H5C__HASH_FCN macro and the deletion of the
- * H5C__HASH_MASK #define. No other changes should be required.
+ * If not, it will become evident in the statistics. Changing
+ * to the usual prime number length hash table will require
+ * changing the H5C__HASH_FCN macro and the deletion of the
+ * H5C__HASH_MASK #define. No other changes should be required.
*
*
* When we flush the cache, we need to write entries out in increasing
@@ -287,11 +290,11 @@
* H5C_DO_SANITY_CHECKS is TRUE.
*
* slist_len_increase: Number of entries that have been added to the
- * slist since the last time this field was set to zero.
+ * slist since the last time this field was set to zero.
*
* slist_size_increase: Total size of all entries that have been added
- * to the slist since the last time this field was set to
- * zero.
+ * to the slist since the last time this field was set to
+ * zero.
*
*
* When a cache entry is protected, it must be removed from the LRU
@@ -324,7 +327,7 @@
*
* Pinning an entry has the following implications:
*
- * 1) A pinned entry cannot be evicted. Thus unprotected
+ * 1) A pinned entry cannot be evicted. Thus unprotected
* pinned entries reside in the pinned entry list, instead
* of the LRU list(s) (or other lists maintained by the current
* replacement policy code).
@@ -346,21 +349,21 @@
*
* Maintaining the pinned entry list requires the following fields:
*
- * pel_len: Number of entries currently residing on the pinned
- * entry list.
+ * pel_len: Number of entries currently residing on the pinned
+ * entry list.
*
- * pel_size: Number of bytes of cache entries currently residing on
- * the pinned entry list.
+ * pel_size: Number of bytes of cache entries currently residing on
+ * the pinned entry list.
*
* pel_head_ptr: Pointer to the head of the doubly linked list of pinned
- * but not protected entries. Note that cache entries on
- * this list are linked by their next and prev fields.
+ * but not protected entries. Note that cache entries on
+ * this list are linked by their next and prev fields.
*
* This field is NULL if the list is empty.
*
* pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned
- * but not protected entries. Note that cache entries on
- * this list are linked by their next and prev fields.
+ * but not protected entries. Note that cache entries on
+ * this list are linked by their next and prev fields.
*
* This field is NULL if the list is empty.
*
@@ -491,10 +494,10 @@
* the structure described below:
*
* size_increase_possible: Depending on the configuration data given
- * in the resize_ctl field, it may or may not be possible
- * to increase the size of the cache. Rather than test for
- * all the ways this can happen, we simply set this flag when
- * we receive a new configuration.
+ * in the resize_ctl field, it may or may not be possible
+ * to increase the size of the cache. Rather than test for
+ * all the ways this can happen, we simply set this flag when
+ * we receive a new configuration.
*
* flash_size_increase_possible: Depending on the configuration data given
* in the resize_ctl field, it may or may not be possible
@@ -514,80 +517,80 @@
* all the ways this can happen, we simply set this flag when
* we receive a new configuration.
*
- * cache_full: Boolean flag used to keep track of whether the cache is
- * full, so we can refrain from increasing the size of a
- * cache which hasn't used up the space alotted to it.
+ * cache_full: Boolean flag used to keep track of whether the cache is
+ * full, so we can refrain from increasing the size of a
+ * cache which hasn't used up the space alotted to it.
*
- * The field is initialized to FALSE, and then set to TRUE
- * whenever we attempt to make space in the cache.
+ * The field is initialized to FALSE, and then set to TRUE
+ * whenever we attempt to make space in the cache.
*
* resize_enabled: This is another convenience flag which is set whenever
- * a new set of values for resize_ctl are provided. Very
- * simply,
+ * a new set of values for resize_ctl are provided. Very
+ * simply,
*
- * resize_enabled = size_increase_possible ||
+ * resize_enabled = size_increase_possible ||
* size_decrease_possible;
*
* size_decreased: Boolean flag set to TRUE whenever the maximun cache
- * size is decreased. The flag triggers a call to
- * H5C_make_space_in_cache() on the next call to H5C_protect().
+ * size is decreased. The flag triggers a call to
+ * H5C_make_space_in_cache() on the next call to H5C_protect().
*
- * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration
- * data for automatic cache resizing.
+ * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration
+ * data for automatic cache resizing.
*
* epoch_markers_active: Integer field containing the number of epoch
- * markers currently in use in the LRU list. This value
- * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1].
+ * markers currently in use in the LRU list. This value
+ * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1].
*
* epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS.
- * This array is used to track which epoch markers are currently
- * in use.
+ * This array is used to track which epoch markers are currently
+ * in use.
*
* epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1.
*
- * To manage the epoch marker cache entries, it is necessary
- * to track their order in the LRU list. This is done with
- * epoch_marker_ringbuf. When markers are inserted at the
- * head of the LRU list, the index of the marker in the
- * epoch_markers array is inserted at the tail of the ring
- * buffer. When it becomes the epoch_marker_active'th marker
- * in the LRU list, it will have worked its way to the head
- * of the ring buffer as well. This allows us to remove it
- * without scanning the LRU list if such is required.
+ * To manage the epoch marker cache entries, it is necessary
+ * to track their order in the LRU list. This is done with
+ * epoch_marker_ringbuf. When markers are inserted at the
+ * head of the LRU list, the index of the marker in the
+ * epoch_markers array is inserted at the tail of the ring
+ * buffer. When it becomes the epoch_marker_active'th marker
+ * in the LRU list, it will have worked its way to the head
+ * of the ring buffer as well. This allows us to remove it
+ * without scanning the LRU list if such is required.
*
* epoch_marker_ringbuf_first: Integer field containing the index of the
- * first entry in the ring buffer.
+ * first entry in the ring buffer.
*
* epoch_marker_ringbuf_last: Integer field containing the index of the
- * last entry in the ring buffer.
+ * last entry in the ring buffer.
*
* epoch_marker_ringbuf_size: Integer field containing the number of entries
- * in the ring buffer.
+ * in the ring buffer.
*
* epoch_markers: Array of instances of H5C_cache_entry_t of length
- * H5C__MAX_EPOCH_MARKERS. The entries are used as markers
- * in the LRU list to identify cache entries that haven't
- * been accessed for some (small) specified number of
- * epochs. These entries (if any) can then be evicted and
- * the cache size reduced -- ideally without evicting any
- * of the current working set. Needless to say, the epoch
- * length and the number of epochs before an unused entry
- * must be chosen so that all, or almost all, the working
- * set will be accessed before the limit.
- *
- * Epoch markers only appear in the LRU list, never in
- * the index or slist. While they are of type
- * H5C__EPOCH_MARKER_TYPE, and have associated class
- * functions, these functions should never be called.
- *
- * The addr fields of these instances of H5C_cache_entry_t
- * are set to the index of the instance in the epoch_markers
- * array, the size is set to 0, and the type field points
- * to the constant structure epoch_marker_class defined
- * in H5C.c. The next and prev fields are used as usual
- * to link the entry into the LRU list.
- *
- * All other fields are unused.
+ * H5C__MAX_EPOCH_MARKERS. The entries are used as markers
+ * in the LRU list to identify cache entries that haven't
+ * been accessed for some (small) specified number of
+ * epochs. These entries (if any) can then be evicted and
+ * the cache size reduced -- ideally without evicting any
+ * of the current working set. Needless to say, the epoch
+ * length and the number of epochs before an unused entry
+ * must be chosen so that all, or almost all, the working
+ * set will be accessed before the limit.
+ *
+ * Epoch markers only appear in the LRU list, never in
+ * the index or slist. While they are of type
+ * H5C__EPOCH_MARKER_TYPE, and have associated class
+ * functions, these functions should never be called.
+ *
+ * The addr fields of these instances of H5C_cache_entry_t
+ * are set to the index of the instance in the epoch_markers
+ * array, the size is set to 0, and the type field points
+ * to the constant structure epoch_marker_class defined
+ * in H5C.c. The next and prev fields are used as usual
+ * to link the entry into the LRU list.
+ *
+ * All other fields are unused.
*
*
* Cache hit rate collection fields:
@@ -597,14 +600,14 @@
* collection is enabled. The following fields support this capability.
*
* cache_hits: Number of cache hits since the last time the cache hit
- * rate statistics were reset. Note that when automatic cache
- * re-sizing is enabled, this field will be reset every automatic
- * resize epoch.
+ * rate statistics were reset. Note that when automatic cache
+ * re-sizing is enabled, this field will be reset every automatic
+ * resize epoch.
*
* cache_accesses: Number of times the cache has been accessed while
- * since the last since the last time the cache hit rate statistics
- * were reset. Note that when automatic cache re-sizing is enabled,
- * this field will be reset every automatic resize epoch.
+ * since the last since the last time the cache hit rate statistics
+ * were reset. Note that when automatic cache re-sizing is enabled,
+ * this field will be reset every automatic resize epoch.
*
*
* Statistics collection fields:
@@ -614,138 +617,138 @@
* is true.
*
* hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been in cache when requested in
- * the current epoch.
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been in cache when requested in
+ * the current epoch.
*
* misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has not been in cache when
- * requested in the current epoch.
+ * are used to record the number of times an entry with type id
+ * equal to the array index has not been in cache when
+ * requested in the current epoch.
*
* write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry with
- * type id equal to the array index has been write protected
- * in the current epoch.
+ * cells are used to record the number of times an entry with
+ * type id equal to the array index has been write protected
+ * in the current epoch.
*
- * Observe that (hits + misses) = (write_protects + read_protects).
+ * Observe that (hits + misses) = (write_protects + read_protects).
*
* read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry with
- * type id equal to the array index has been read protected in
- * the current epoch.
+ * cells are used to record the number of times an entry with
+ * type id equal to the array index has been read protected in
+ * the current epoch.
*
* Observe that (hits + misses) = (write_protects + read_protects).
*
* max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to maximum number of simultaneous read
- * protects on any entry with type id equal to the array index
- * in the current epoch.
+ * The cells are used to maximum number of simultaneous read
+ * protects on any entry with type id equal to the array index
+ * in the current epoch.
*
* insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been inserted into the
- * cache in the current epoch.
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been inserted into the
+ * cache in the current epoch.
*
- * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been inserted
- * pinned into the cache in the current epoch.
+ * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been inserted
+ * pinned into the cache in the current epoch.
*
* clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been cleared in the current
- * epoch.
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been cleared in the current
+ * epoch.
*
* flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been written to disk in the
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been written to disk in the
* current epoch.
*
* evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been evicted from the cache in
- * the current epoch.
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been evicted from the cache in
+ * the current epoch.
*
* moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been moved in the current
- * epoch.
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been moved in the current
+ * epoch.
*
- * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been moved
- * during its flush callback in the current epoch.
+ * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been moved
+ * during its flush callback in the current epoch.
*
- * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been moved
- * during a cache flush in the current epoch.
+ * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been moved
+ * during a cache flush in the current epoch.
*
* pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been pinned in the current
- * epoch.
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been pinned in the current
+ * epoch.
*
* unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been unpinned in the current
- * epoch.
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been unpinned in the current
+ * epoch.
*
- * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been marked dirty while pinned
- * in the current epoch.
+ * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been marked dirty while pinned
+ * in the current epoch.
*
* pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry
- * with type id equal to the array index has been flushed while
- * pinned in the current epoch.
+ * cells are used to record the number of times an entry
+ * with type id equal to the array index has been flushed while
+ * pinned in the current epoch.
*
* pinned_cleared: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry
- * with type id equal to the array index has been cleared while
- * pinned in the current epoch.
+ * cells are used to record the number of times an entry
+ * with type id equal to the array index has been cleared while
+ * pinned in the current epoch.
*
* size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has increased in
- * size in the current epoch.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has increased in
+ * size in the current epoch.
*
* size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has decreased in
- * size in the current epoch.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has decreased in
+ * size in the current epoch.
*
* entry_flush_size_changes: Array of int64 of length
- * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
- * the number of times an entry with type id equal to the
- * array index has changed size while in its flush callback.
+ * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
+ * the number of times an entry with type id equal to the
+ * array index has changed size while in its flush callback.
*
* cache_flush_size_changes: Array of int64 of length
- * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
- * the number of times an entry with type id equal to the
- * array index has changed size during a cache flush
+ * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
+ * the number of times an entry with type id equal to the
+ * array index has changed size during a cache flush
*
* total_ht_insertions: Number of times entries have been inserted into the
- * hash table in the current epoch.
+ * hash table in the current epoch.
*
* total_ht_deletions: Number of times entries have been deleted from the
* hash table in the current epoch.
*
* successful_ht_searches: int64 containing the total number of successful
- * searches of the hash table in the current epoch.
+ * searches of the hash table in the current epoch.
*
* total_successful_ht_search_depth: int64 containing the total number of
- * entries other than the targets examined in successful
- * searches of the hash table in the current epoch.
+ * entries other than the targets examined in successful
+ * searches of the hash table in the current epoch.
*
* failed_ht_searches: int64 containing the total number of unsuccessful
* searches of the hash table in the current epoch.
*
* total_failed_ht_search_depth: int64 containing the total number of
* entries examined in unsuccessful searches of the hash
- * table in the current epoch.
+ * table in the current epoch.
*
* max_index_len: Largest value attained by the index_len field in the
* current epoch.
@@ -754,10 +757,10 @@
* current epoch.
*
* max_clean_index_size: Largest value attained by the clean_index_size field
- * in the current epoch.
+ * in the current epoch.
*
* max_dirty_index_size: Largest value attained by the dirty_index_size field
- * in the current epoch.
+ * in the current epoch.
*
* max_slist_len: Largest value attained by the slist_len field in the
* current epoch.
@@ -798,31 +801,31 @@
* and H5C_COLLECT_CACHE_ENTRY_STATS are true.
*
* max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been
- * accessed in the current epoch.
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been
+ * accessed in the current epoch.
*
* min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the minimum number of times any single
- * entry with type id equal to the array index has been
- * accessed in the current epoch.
+ * are used to record the minimum number of times any single
+ * entry with type id equal to the array index has been
+ * accessed in the current epoch.
*
* max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been cleared
- * in the current epoch.
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been cleared
+ * in the current epoch.
*
* max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been
- * flushed in the current epoch.
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been
+ * flushed in the current epoch.
*
- * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
* are used to record the maximum size of any single entry
- * with type id equal to the array index that has resided in
- * the cache in the current epoch.
+ * with type id equal to the array index that has resided in
+ * the cache in the current epoch.
*
- * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
* are used to record the maximum number of times that any single
* entry with type id equal to the array index that has been
* marked as pinned in the cache in the current epoch.
@@ -830,100 +833,100 @@
*
* Fields supporting testing:
*
- * prefix Array of char used to prefix debugging output. The
- * field is intended to allow marking of output of with
- * the processes mpi rank.
+ * prefix Array of char used to prefix debugging output. The
+ * field is intended to allow marking of output of with
+ * the processes mpi rank.
*
****************************************************************************/
#define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */
-#define H5C__H5C_T_MAGIC 0x005CAC0E
-#define H5C__MAX_NUM_TYPE_IDS 19
-#define H5C__PREFIX_LEN 32
+#define H5C__H5C_T_MAGIC 0x005CAC0E
+#define H5C__MAX_NUM_TYPE_IDS 19
+#define H5C__PREFIX_LEN 32
struct H5C_t
{
- uint32_t magic;
+ uint32_t magic;
- hbool_t flush_in_progress;
+ hbool_t flush_in_progress;
- FILE * trace_file_ptr;
+ FILE * trace_file_ptr;
- void * aux_ptr;
+ void * aux_ptr;
- int32_t max_type_id;
+ int32_t max_type_id;
const char * (* type_name_table_ptr);
size_t max_cache_size;
size_t min_clean_size;
- H5C_write_permitted_func_t check_write_permitted;
- hbool_t write_permitted;
+ H5C_write_permitted_func_t check_write_permitted;
+ hbool_t write_permitted;
- H5C_log_flush_func_t log_flush;
+ H5C_log_flush_func_t log_flush;
- hbool_t evictions_enabled;
+ hbool_t evictions_enabled;
int32_t index_len;
size_t index_size;
- size_t clean_index_size;
- size_t dirty_index_size;
- H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]);
+ size_t clean_index_size;
+ size_t dirty_index_size;
+ H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]);
int32_t slist_len;
size_t slist_size;
H5SL_t * slist_ptr;
#if H5C_DO_SANITY_CHECKS
- int64_t slist_len_increase;
- int64_t slist_size_increase;
+ int64_t slist_len_increase;
+ int64_t slist_size_increase;
#endif /* H5C_DO_SANITY_CHECKS */
int32_t pl_len;
size_t pl_size;
- H5C_cache_entry_t * pl_head_ptr;
- H5C_cache_entry_t * pl_tail_ptr;
+ H5C_cache_entry_t * pl_head_ptr;
+ H5C_cache_entry_t * pl_tail_ptr;
int32_t pel_len;
size_t pel_size;
- H5C_cache_entry_t * pel_head_ptr;
- H5C_cache_entry_t * pel_tail_ptr;
+ H5C_cache_entry_t * pel_head_ptr;
+ H5C_cache_entry_t * pel_tail_ptr;
int32_t LRU_list_len;
size_t LRU_list_size;
- H5C_cache_entry_t * LRU_head_ptr;
- H5C_cache_entry_t * LRU_tail_ptr;
+ H5C_cache_entry_t * LRU_head_ptr;
+ H5C_cache_entry_t * LRU_tail_ptr;
int32_t cLRU_list_len;
size_t cLRU_list_size;
- H5C_cache_entry_t * cLRU_head_ptr;
- H5C_cache_entry_t * cLRU_tail_ptr;
+ H5C_cache_entry_t * cLRU_head_ptr;
+ H5C_cache_entry_t * cLRU_tail_ptr;
int32_t dLRU_list_len;
size_t dLRU_list_size;
- H5C_cache_entry_t * dLRU_head_ptr;
- H5C_cache_entry_t * dLRU_tail_ptr;
-
- hbool_t size_increase_possible;
- hbool_t flash_size_increase_possible;
- size_t flash_size_increase_threshold;
- hbool_t size_decrease_possible;
- hbool_t resize_enabled;
- hbool_t cache_full;
- hbool_t size_decreased;
- H5C_auto_size_ctl_t resize_ctl;
-
- int32_t epoch_markers_active;
- hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS];
- int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1];
- int32_t epoch_marker_ringbuf_first;
- int32_t epoch_marker_ringbuf_last;
- int32_t epoch_marker_ringbuf_size;
- H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS];
-
- int64_t cache_hits;
- int64_t cache_accesses;
+ H5C_cache_entry_t * dLRU_head_ptr;
+ H5C_cache_entry_t * dLRU_tail_ptr;
+
+ hbool_t size_increase_possible;
+ hbool_t flash_size_increase_possible;
+ size_t flash_size_increase_threshold;
+ hbool_t size_decrease_possible;
+ hbool_t resize_enabled;
+ hbool_t cache_full;
+ hbool_t size_decreased;
+ H5C_auto_size_ctl_t resize_ctl;
+
+ int32_t epoch_markers_active;
+ hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS];
+ int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1];
+ int32_t epoch_marker_ringbuf_first;
+ int32_t epoch_marker_ringbuf_last;
+ int32_t epoch_marker_ringbuf_size;
+ H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS];
+
+ int64_t cache_hits;
+ int64_t cache_accesses;
#if H5C_COLLECT_CACHE_STATS
@@ -951,12 +954,12 @@ struct H5C_t
int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t total_ht_insertions;
- int64_t total_ht_deletions;
- int64_t successful_ht_searches;
- int64_t total_successful_ht_search_depth;
- int64_t failed_ht_searches;
- int64_t total_failed_ht_search_depth;
+ int64_t total_ht_insertions;
+ int64_t total_ht_deletions;
+ int64_t successful_ht_searches;
+ int64_t total_successful_ht_search_depth;
+ int64_t failed_ht_searches;
+ int64_t total_failed_ht_search_depth;
int32_t max_index_len;
size_t max_index_size;
@@ -992,10 +995,10 @@ struct H5C_t
#endif /* H5C_COLLECT_CACHE_STATS */
- char prefix[H5C__PREFIX_LEN];
+ char prefix[H5C__PREFIX_LEN];
};
-
+
/****************************************************************************/
/***************************** Macro Definitions ****************************/
/****************************************************************************/
@@ -1018,7 +1021,7 @@ struct H5C_t
* to the HGOTO_ERROR macro, which may not be appropriate in all cases.
* If so, we will need versions of the insertion and deletion macros which
* do not reference the sanity checking macros.
- * JRM - 5/5/04
+ * JRM - 5/5/04
*
* Changes:
*
@@ -1093,7 +1096,7 @@ struct H5C_t
* sanity checking macros. These macro are used to update the size of
* a DLL when one of its entries changes size.
*
- * JRM - 9/8/05
+ * JRM - 9/8/05
*
****************************************************************************/
@@ -1259,8 +1262,8 @@ if ( ( (new_size) > (dll_size) ) || \
#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \
H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \
- (dll_size) -= (old_size); \
- (dll_size) += (new_size); \
+ (dll_size) -= (old_size); \
+ (dll_size) += (new_size); \
H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size)
#if H5C_DO_SANITY_CHECKS
@@ -1405,7 +1408,7 @@ if ( ( (entry_ptr) == NULL ) || \
(Size) -= entry_ptr->size; \
}
-
+
/***********************************************************************
*
* Stats collection macros
@@ -1419,15 +1422,15 @@ if ( ( (entry_ptr) == NULL ) || \
*
* Changes:
*
- * JRM -- 3/21/06
- * Added / updated macros for pinned entry related stats.
+ * JRM -- 3/21/06
+ * Added / updated macros for pinned entry related stats.
*
- * JRM -- 8/9/06
- * More pinned entry stats related updates.
+ * JRM -- 8/9/06
+ * More pinned entry stats related updates.
*
- * JRM -- 3/31/07
- * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on
- * read and write protects.
+ * JRM -- 3/31/07
+ * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on
+ * read and write protects.
*
* MAM -- 1/15/09
* Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain
@@ -1457,62 +1460,62 @@ if ( ( (entry_ptr) == NULL ) || \
(cache_ptr)->dirty_index_size;
#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \
- (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++;
+ (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++;
#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \
if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
- (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
+ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
- (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
+ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \
- if ( cache_ptr->flush_in_progress ) { \
+ if ( cache_ptr->flush_in_progress ) { \
((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \
- } \
+ } \
if ( entry_ptr->flush_in_progress ) { \
((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \
- } \
- (((cache_ptr)->moves)[(entry_ptr)->type->id])++;
+ } \
+ (((cache_ptr)->moves)[(entry_ptr)->type->id])++;
#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\
- if ( cache_ptr->flush_in_progress ) { \
+ if ( cache_ptr->flush_in_progress ) { \
((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \
- } \
+ } \
if ( entry_ptr->flush_in_progress ) { \
((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \
- } \
- if ( (entry_ptr)->size < (new_size) ) { \
- ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \
+ } \
+ if ( (entry_ptr)->size < (new_size) ) { \
+ ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
(cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \
(cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \
- } else if ( (entry_ptr)->size > (new_size) ) { \
- ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \
- }
+ } else if ( (entry_ptr)->size > (new_size) ) { \
+ ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \
+ }
#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \
- (cache_ptr)->total_ht_insertions++;
+ (cache_ptr)->total_ht_insertions++;
#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \
- (cache_ptr)->total_ht_deletions++;
+ (cache_ptr)->total_ht_deletions++;
#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \
- if ( success ) { \
- (cache_ptr)->successful_ht_searches++; \
- (cache_ptr)->total_successful_ht_search_depth += depth; \
- } else { \
- (cache_ptr)->failed_ht_searches++; \
- (cache_ptr)->total_failed_ht_search_depth += depth; \
- }
+ if ( success ) { \
+ (cache_ptr)->successful_ht_searches++; \
+ (cache_ptr)->total_successful_ht_search_depth += depth; \
+ } else { \
+ (cache_ptr)->failed_ht_searches++; \
+ (cache_ptr)->total_failed_ht_search_depth += depth; \
+ }
#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \
- ((cache_ptr)->unpins)[(entry_ptr)->type->id]++;
+ ((cache_ptr)->unpins)[(entry_ptr)->type->id]++;
#if H5C_COLLECT_CACHE_ENTRY_STATS
@@ -1520,24 +1523,24 @@ if ( ( (entry_ptr) == NULL ) || \
(entry_ptr)->accesses = 0; \
(entry_ptr)->clears = 0; \
(entry_ptr)->flushes = 0; \
- (entry_ptr)->pins = 0;
+ (entry_ptr)->pins = 0;
#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
- (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \
+ (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \
if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
- } \
+ (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
+ } \
((entry_ptr)->clears)++;
#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
- (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
+ (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
- } \
+ (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
+ } \
((entry_ptr)->flushes)++;
#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \
+ (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \
if ( (entry_ptr)->accesses > \
((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) { \
((cache_ptr)->max_accesses)[(entry_ptr)->type->id] \
@@ -1570,23 +1573,23 @@ if ( ( (entry_ptr) == NULL ) || \
}
#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) { \
+ (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
(entry_ptr)->pins++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
- } \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+ } \
if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
- (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
+ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
- (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
+ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
if ( (entry_ptr)->size > \
((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \
((cache_ptr)->max_size)[(entry_ptr)->type->id] \
@@ -1594,20 +1597,20 @@ if ( ( (entry_ptr) == NULL ) || \
}
#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
- if ( hit ) \
+ if ( hit ) \
((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
- else \
+ else \
((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
if ( ! ((entry_ptr)->is_read_only) ) { \
- ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
- } else { \
- ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
- if ( ((entry_ptr)->ro_ref_count) > \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
- ((entry_ptr)->ro_ref_count); \
- } \
- } \
+ ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
+ } else { \
+ ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
+ if ( ((entry_ptr)->ro_ref_count) > \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
+ ((entry_ptr)->ro_ref_count); \
+ } \
+ } \
if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
(cache_ptr)->max_index_len = (cache_ptr)->index_len; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
@@ -1623,12 +1626,12 @@ if ( ( (entry_ptr) == NULL ) || \
((entry_ptr)->accesses)++;
#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
(entry_ptr)->pins++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
#else /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -1636,52 +1639,52 @@ if ( ( (entry_ptr) == NULL ) || \
#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
- } \
- (((cache_ptr)->clears)[(entry_ptr)->type->id])++;
+ (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
+ } \
+ (((cache_ptr)->clears)[(entry_ptr)->type->id])++;
#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
- (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
+ (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
- }
+ (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
+ }
#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->evictions)[(entry_ptr)->type->id])++;
+ (((cache_ptr)->evictions)[(entry_ptr)->type->id])++;
#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
- } \
+ (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) { \
+ (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+ } \
if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
- (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
+ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
- (cache_ptr)->max_slist_size = (cache_ptr)->slist_size;
+ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size;
#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
- if ( hit ) \
+ if ( hit ) \
((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
- else \
+ else \
((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
if ( ! ((entry_ptr)->is_read_only) ) { \
- ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
- } else { \
- ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
- if ( ((entry_ptr)->ro_ref_count) > \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
- ((entry_ptr)->ro_ref_count); \
- } \
- } \
+ ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
+ } else { \
+ ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
+ if ( ((entry_ptr)->ro_ref_count) > \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
+ ((entry_ptr)->ro_ref_count); \
+ } \
+ } \
if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
(cache_ptr)->max_index_len = (cache_ptr)->index_len; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
@@ -1691,11 +1694,11 @@ if ( ( (entry_ptr) == NULL ) || \
(cache_ptr)->max_pl_size = (cache_ptr)->pl_size;
#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -1719,7 +1722,7 @@ if ( ( (entry_ptr) == NULL ) || \
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
/***********************************************************************
*
* Hash table access and manipulation macros:
@@ -1736,15 +1739,15 @@ if ( ( (entry_ptr) == NULL ) || \
* the clean_index_size and dirty_index_size fields of H5C_t. Also
* added macros to allow us to track entry cleans and dirties.
*
- * JRM -- 11/5/08
+ * JRM -- 11/5/08
*
***********************************************************************/
/* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */
-#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3)
+#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3)
-#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3)
+#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3)
#if H5C_DO_SANITY_CHECKS
@@ -1760,7 +1763,7 @@ if ( ( (cache_ptr) == NULL ) || \
( k >= H5C__HASH_TABLE_LEN ) || \
( (cache_ptr)->index_size != \
((cache_ptr)->clean_index_size + \
- (cache_ptr)->dirty_index_size) ) ) { \
+ (cache_ptr)->dirty_index_size) ) ) { \
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \
"Pre HT insert SC failed") \
}
@@ -1785,7 +1788,7 @@ if ( ( (cache_ptr) == NULL ) || \
( (entry_ptr)->ht_prev != NULL ) ) || \
( (cache_ptr)->index_size != \
((cache_ptr)->clean_index_size + \
- (cache_ptr)->dirty_index_size) ) ) { \
+ (cache_ptr)->dirty_index_size) ) ) { \
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \
}
@@ -1835,7 +1838,7 @@ if ( ( (cache_ptr) == NULL ) || \
}
#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
- entry_ptr, was_clean) \
+ entry_ptr, was_clean) \
if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->index_len <= 0 ) || \
( (cache_ptr)->index_size <= 0 ) || \
@@ -1849,27 +1852,27 @@ if ( ( (cache_ptr) == NULL ) || \
(cache_ptr)->dirty_index_size) ) || \
( (entry_ptr == NULL) ) || \
( ( !( was_clean ) || \
- ( (cache_ptr)->clean_index_size < (old_size) ) ) && \
- ( ( (was_clean) ) || \
- ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \
+ ( (cache_ptr)->clean_index_size < (old_size) ) ) && \
+ ( ( (was_clean) ) || \
+ ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \
( (entry_ptr) == NULL ) ) { \
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
"Pre HT entry size change SC failed") \
}
#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
- entry_ptr) \
+ entry_ptr) \
if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->index_len <= 0 ) || \
( (cache_ptr)->index_size <= 0 ) || \
( (new_size) > (cache_ptr)->index_size ) || \
( (cache_ptr)->index_size != \
- ((cache_ptr)->clean_index_size + \
+ ((cache_ptr)->clean_index_size + \
(cache_ptr)->dirty_index_size) ) || \
( ( !((entry_ptr)->is_dirty ) || \
- ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \
- ( ( ((entry_ptr)->is_dirty) ) || \
- ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \
+ ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \
+ ( ( ((entry_ptr)->is_dirty) ) || \
+ ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \
( ( (cache_ptr)->index_len == 1 ) && \
( (cache_ptr)->index_size != (new_size) ) ) ) { \
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
@@ -1930,9 +1933,9 @@ if ( (cache_ptr)->index_size != \
#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr)
#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr)
#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
- entry_ptr, was_clean)
+ entry_ptr, was_clean)
#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
- entry_ptr)
+ entry_ptr)
#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr)
#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr)
@@ -1959,7 +1962,7 @@ if ( (cache_ptr)->index_size != \
if ( (entry_ptr)->is_dirty ) { \
(cache_ptr)->dirty_index_size += (entry_ptr)->size; \
} else { \
- (cache_ptr)->clean_index_size += (entry_ptr)->size; \
+ (cache_ptr)->clean_index_size += (entry_ptr)->size; \
} \
H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \
}
@@ -1988,7 +1991,7 @@ if ( (cache_ptr)->index_size != \
if ( (entry_ptr)->is_dirty ) { \
(cache_ptr)->dirty_index_size -= (entry_ptr)->size; \
} else { \
- (cache_ptr)->clean_index_size -= (entry_ptr)->size; \
+ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \
} \
H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \
}
@@ -2075,27 +2078,27 @@ if ( (cache_ptr)->index_size != \
}
#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \
- entry_ptr, was_clean) \
+ entry_ptr, was_clean) \
{ \
H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
- entry_ptr, was_clean) \
+ entry_ptr, was_clean) \
(cache_ptr)->index_size -= (old_size); \
(cache_ptr)->index_size += (new_size); \
if ( was_clean ) { \
(cache_ptr)->clean_index_size -= (old_size); \
} else { \
- (cache_ptr)->dirty_index_size -= (old_size); \
+ (cache_ptr)->dirty_index_size -= (old_size); \
} \
if ( (entry_ptr)->is_dirty ) { \
(cache_ptr)->dirty_index_size += (new_size); \
} else { \
- (cache_ptr)->clean_index_size += (new_size); \
+ (cache_ptr)->clean_index_size += (new_size); \
} \
H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
entry_ptr) \
}
-
+
/**************************************************************************
*
* Skip list insertion and deletion macros:
@@ -2107,11 +2110,11 @@ if ( (cache_ptr)->index_size != \
/*-------------------------------------------------------------------------
*
- * Macro: H5C__INSERT_ENTRY_IN_SLIST
+ * Macro: H5C__INSERT_ENTRY_IN_SLIST
*
* Purpose: Insert the specified instance of H5C_cache_entry_t into
- * the skip list in the specified instance of H5C_t. Update
- * the associated length and size fields.
+ * the skip list in the specified instance of H5C_t. Update
+ * the associated length and size fields.
*
* Return: N/A
*
@@ -2119,39 +2122,39 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 7/21/04
- * Updated function to set the in_tree flag when inserting
- * an entry into the tree. Also modified the function to
- * update the tree size and len fields instead of the similar
- * index fields.
+ * JRM -- 7/21/04
+ * Updated function to set the in_tree flag when inserting
+ * an entry into the tree. Also modified the function to
+ * update the tree size and len fields instead of the similar
+ * index fields.
*
- * All of this is part of the modifications to support the
- * hash table.
+ * All of this is part of the modifications to support the
+ * hash table.
*
- * JRM -- 7/27/04
- * Converted the function H5C_insert_entry_in_tree() into
- * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of
- * wringing a little more speed out of the cache.
+ * JRM -- 7/27/04
+ * Converted the function H5C_insert_entry_in_tree() into
+ * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of
+ * wringing a little more speed out of the cache.
*
- * Note that we don't bother to check if the entry is already
- * in the tree -- if it is, H5SL_insert() will fail.
+ * Note that we don't bother to check if the entry is already
+ * in the tree -- if it is, H5SL_insert() will fail.
*
- * QAK -- 11/27/04
- * Switched over to using skip list routines.
+ * QAK -- 11/27/04
+ * Switched over to using skip list routines.
*
- * JRM -- 6/27/06
- * Added fail_val parameter.
+ * JRM -- 6/27/06
+ * Added fail_val parameter.
*
- * JRM -- 8/25/06
- * Added the H5C_DO_SANITY_CHECKS version of the macro.
+ * JRM -- 8/25/06
+ * Added the H5C_DO_SANITY_CHECKS version of the macro.
*
- * This version maintains the slist_len_increase and
- * slist_size_increase fields that are used in sanity
- * checks in the flush routines.
+ * This version maintains the slist_len_increase and
+ * slist_size_increase fields that are used in sanity
+ * checks in the flush routines.
*
- * All this is needed as the fractal heap needs to be
- * able to dirty, resize and/or move entries during the
- * flush.
+ * All this is needed as the fractal heap needs to be
+ * able to dirty, resize and/or move entries during the
+ * flush.
*
*-------------------------------------------------------------------------
*/
@@ -2210,14 +2213,14 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_DO_SANITY_CHECKS */
-
+
/*-------------------------------------------------------------------------
*
* 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
*
@@ -2225,20 +2228,20 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 7/21/04
- * Updated function for the addition of the hash table.
+ * JRM -- 7/21/04
+ * Updated function for the addition of the hash table.
*
- * JRM - 7/27/04
- * Converted from the function H5C_remove_entry_from_tree()
- * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of
- * wringing a little more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted from the function H5C_remove_entry_from_tree()
+ * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of
+ * wringing a little more performance out of the cache.
*
- * QAK -- 11/27/04
- * Switched over to using skip list routines.
+ * QAK -- 11/27/04
+ * Switched over to using skip list routines.
*
- * JRM -- 3/28/07
- * Updated sanity checks for the new is_read_only and
- * ro_ref_count fields in H5C_cache_entry_t.
+ * JRM -- 3/28/07
+ * Updated sanity checks for the new is_read_only and
+ * ro_ref_count fields in H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2268,13 +2271,13 @@ if ( (cache_ptr)->index_size != \
(entry_ptr)->in_slist = FALSE; \
} /* H5C__REMOVE_ENTRY_FROM_SLIST */
-
+
/*-------------------------------------------------------------------------
*
* 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
*
@@ -2282,15 +2285,15 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 8/27/06
- * Added the H5C_DO_SANITY_CHECKS version of the macro.
+ * JRM -- 8/27/06
+ * Added the H5C_DO_SANITY_CHECKS version of the macro.
*
- * This version maintains the slist_size_increase field
- * that are used in sanity checks in the flush routines.
+ * This version maintains the slist_size_increase field
+ * that are used in sanity checks in the flush routines.
*
- * All this is needed as the fractal heap needs to be
- * able to dirty, resize and/or move entries during the
- * flush.
+ * All this is needed as the fractal heap needs to be
+ * able to dirty, resize and/or move entries during the
+ * flush.
*
*-------------------------------------------------------------------------
*/
@@ -2342,7 +2345,7 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_DO_SANITY_CHECKS */
-
+
/**************************************************************************
*
* Replacement policy update macros:
@@ -2354,18 +2357,18 @@ if ( (cache_ptr)->index_size != \
/*-------------------------------------------------------------------------
*
- * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS
+ * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS
*
* Purpose: For efficiency, we sometimes change the order of flushes --
- * but doing so can confuse the replacement policy. This
- * macro exists to allow us to specify an entry as the
- * most recently touched so we can repair any such
- * confusion.
+ * but doing so can confuse the replacement policy. This
+ * macro exists to allow us to specify an entry as the
+ * most recently touched so we can repair any such
+ * confusion.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the macro
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the macro
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -2373,15 +2376,15 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 3/20/06
- * Modified macro to ignore pinned entries. Pinned entries
- * do not appear in the data structures maintained by the
- * replacement policy code, and thus this macro has nothing
- * to do if called for such an entry.
+ * JRM -- 3/20/06
+ * Modified macro to ignore pinned entries. Pinned entries
+ * do not appear in the data structures maintained by the
+ * replacement policy code, and thus this macro has nothing
+ * to do if called for such an entry.
*
- * JRM -- 3/28/07
- * Added sanity checks using the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM -- 3/28/07
+ * Added sanity checks using the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2403,16 +2406,16 @@ if ( (cache_ptr)->index_size != \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the head.\
- */ \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* Use the dirty flag to infer whether the entry is on the clean or \
@@ -2466,16 +2469,16 @@ if ( (cache_ptr)->index_size != \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the head \
- */ \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* End modified LRU specific code. */ \
@@ -2484,18 +2487,18 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_EVICTION
+ * Macro: H5C__UPDATE_RP_FOR_EVICTION
*
* Purpose: Update the replacement policy data structures for an
- * eviction of the specified cache entry.
+ * eviction of the specified cache entry.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -2503,27 +2506,27 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM - 7/27/04
- * Converted the function H5C_update_rp_for_eviction() to the
- * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze
- * a bit more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted the function H5C_update_rp_for_eviction() to the
+ * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze
+ * a bit more performance out of the cache.
*
- * At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause difficulties with
- * the pre-processor, I'll have to remove them.
+ * At least for the first cut, I am leaving the comments and
+ * white space in the macro. If they cause difficulties with
+ * the pre-processor, I'll have to remove them.
*
- * JRM - 7/28/04
- * Split macro into two version, one supporting the clean and
- * dirty LRU lists, and the other not. Yet another attempt
- * at optimization.
+ * JRM - 7/28/04
+ * Split macro into two version, one supporting the clean and
+ * dirty LRU lists, and the other not. Yet another attempt
+ * at optimization.
*
- * JRM - 3/20/06
- * Pinned entries can't be evicted, so this entry should never
- * be called on a pinned entry. Added assert to verify this.
+ * JRM - 3/20/06
+ * Pinned entries can't be evicted, so this entry should never
+ * be called on a pinned entry. Added assert to verify this.
*
- * JRM -- 3/28/07
- * Added sanity checks for the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM -- 3/28/07
+ * Added sanity checks for the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2595,18 +2598,18 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_FLUSH
+ * Macro: H5C__UPDATE_RP_FOR_FLUSH
*
* Purpose: Update the replacement policy data structures for a flush
- * of the specified cache entry.
+ * of the specified cache entry.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -2614,29 +2617,29 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM - 7/27/04
- * Converted the function H5C_update_rp_for_flush() to the
- * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze
- * a bit more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted the function H5C_update_rp_for_flush() to the
+ * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze
+ * a bit more performance out of the cache.
*
- * At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause difficulties with
- * pre-processor, I'll have to remove them.
+ * At least for the first cut, I am leaving the comments and
+ * white space in the macro. If they cause difficulties with
+ * pre-processor, I'll have to remove them.
*
- * JRM - 7/28/04
- * Split macro into two versions, one supporting the clean and
- * dirty LRU lists, and the other not. Yet another attempt
- * at optimization.
+ * JRM - 7/28/04
+ * Split macro into two versions, one supporting the clean and
+ * dirty LRU lists, and the other not. Yet another attempt
+ * at optimization.
*
- * JRM - 3/20/06
- * While pinned entries can be flushed, they don't reside in
- * the replacement policy data structures when unprotected.
- * Thus I modified this macro to do nothing if the entry is
- * pinned.
+ * JRM - 3/20/06
+ * While pinned entries can be flushed, they don't reside in
+ * the replacement policy data structures when unprotected.
+ * Thus I modified this macro to do nothing if the entry is
+ * pinned.
*
- * JRM - 3/28/07
- * Added sanity checks based on the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM - 3/28/07
+ * Added sanity checks based on the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2658,28 +2661,28 @@ if ( (cache_ptr)->index_size != \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the \
- * head. \
- */ \
+ * head. \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* since the entry is being flushed or cleared, one would think \
- * that it must be dirty -- but that need not be the case. Use the \
- * dirty flag to infer whether the entry is on the clean or dirty \
- * LRU list, and remove it. Then insert it at the head of the \
- * clean LRU list. \
+ * that it must be dirty -- but that need not be the case. Use the \
+ * dirty flag to infer whether the entry is on the clean or dirty \
+ * LRU list, and remove it. Then insert it at the head of the \
+ * clean LRU list. \
* \
* The function presumes that a dirty entry will be either cleared \
- * or flushed shortly, so it is OK if we put a dirty entry on the \
- * clean LRU list. \
+ * or flushed shortly, so it is OK if we put a dirty entry on the \
+ * clean LRU list. \
*/ \
\
if ( (entry_ptr)->is_dirty ) { \
@@ -2720,17 +2723,17 @@ if ( (cache_ptr)->index_size != \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the \
- * head. \
- */ \
+ * head. \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* End modified LRU specific code. */ \
@@ -2739,18 +2742,18 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_INSERTION
+ * Macro: H5C__UPDATE_RP_FOR_INSERTION
*
* Purpose: Update the replacement policy data structures for an
- * insertion of the specified cache entry.
+ * insertion of the specified cache entry.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -2758,31 +2761,31 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM - 7/27/04
- * Converted the function H5C_update_rp_for_insertion() to the
- * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze
- * a bit more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted the function H5C_update_rp_for_insertion() to the
+ * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze
+ * a bit more performance out of the cache.
*
- * At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause difficulties with
- * pre-processor, I'll have to remove them.
+ * At least for the first cut, I am leaving the comments and
+ * white space in the macro. If they cause difficulties with
+ * pre-processor, I'll have to remove them.
*
- * JRM - 7/28/04
- * Split macro into two version, one supporting the clean and
- * dirty LRU lists, and the other not. Yet another attempt
- * at optimization.
+ * JRM - 7/28/04
+ * Split macro into two version, one supporting the clean and
+ * dirty LRU lists, and the other not. Yet another attempt
+ * at optimization.
*
- * JRM - 3/10/06
- * This macro should never be called on a pinned entry.
- * Inserted an assert to verify this.
+ * JRM - 3/10/06
+ * This macro should never be called on a pinned entry.
+ * Inserted an assert to verify this.
*
- * JRM - 8/9/06
- * Not any more. We must now allow insertion of pinned
- * entries. Updated macro to support this.
+ * JRM - 8/9/06
+ * Not any more. We must now allow insertion of pinned
+ * entries. Updated macro to support this.
*
- * JRM - 3/28/07
- * Added sanity checks using the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM - 3/28/07
+ * Added sanity checks using the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2814,7 +2817,7 @@ if ( (cache_ptr)->index_size != \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* insert the entry at the head of the clean or dirty LRU list as \
@@ -2855,7 +2858,7 @@ if ( (cache_ptr)->index_size != \
(cache_ptr)->pel_tail_ptr, \
(cache_ptr)->pel_len, \
(cache_ptr)->pel_size, (fail_val)) \
- \
+ \
} else { \
\
/* modified LRU specific code */ \
@@ -2864,7 +2867,7 @@ if ( (cache_ptr)->index_size != \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* End modified LRU specific code. */ \
@@ -2873,22 +2876,22 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_PROTECT
+ * Macro: H5C__UPDATE_RP_FOR_PROTECT
*
* Purpose: Update the replacement policy data structures for a
- * protect of the specified cache entry.
+ * protect of the specified cache entry.
*
- * To do this, unlink the specified entry from any data
- * structures used by the replacement policy, and add the
- * entry to the protected list.
+ * To do this, unlink the specified entry from any data
+ * structures used by the replacement policy, and add the
+ * entry to the protected list.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -2896,28 +2899,28 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM - 7/27/04
- * Converted the function H5C_update_rp_for_protect() to the
- * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze
- * a bit more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted the function H5C_update_rp_for_protect() to the
+ * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze
+ * a bit more performance out of the cache.
*
- * At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause difficulties with
- * pre-processor, I'll have to remove them.
+ * At least for the first cut, I am leaving the comments and
+ * white space in the macro. If they cause difficulties with
+ * pre-processor, I'll have to remove them.
*
- * JRM - 7/28/04
- * Split macro into two version, one supporting the clean and
- * dirty LRU lists, and the other not. Yet another attempt
- * at optimization.
+ * JRM - 7/28/04
+ * Split macro into two version, one supporting the clean and
+ * dirty LRU lists, and the other not. Yet another attempt
+ * at optimization.
*
- * JRM - 3/17/06
- * Modified macro to attempt to remove pinned entriese from
- * the pinned entry list instead of from the data structures
- * maintained by the replacement policy.
+ * JRM - 3/17/06
+ * Modified macro to attempt to remove pinned entriese from
+ * the pinned entry list instead of from the data structures
+ * maintained by the replacement policy.
*
- * JRM - 3/28/07
- * Added sanity checks based on the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM - 3/28/07
+ * Added sanity checks based on the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -2933,12 +2936,12 @@ if ( (cache_ptr)->index_size != \
HDassert( !((entry_ptr)->is_read_only) ); \
HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \
HDassert( (entry_ptr)->size > 0 ); \
- \
+ \
if ( (entry_ptr)->is_pinned ) { \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \
- (cache_ptr)->pel_tail_ptr, \
- (cache_ptr)->pel_len, \
+ (cache_ptr)->pel_tail_ptr, \
+ (cache_ptr)->pel_len, \
(cache_ptr)->pel_size, (fail_val)) \
HDassert( (cache_ptr)->pel_len >= 0 ); \
\
@@ -2950,7 +2953,7 @@ if ( (cache_ptr)->index_size != \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* Similarly, remove the entry from the clean or dirty LRU list \
@@ -2996,12 +2999,12 @@ if ( (cache_ptr)->index_size != \
HDassert( !((entry_ptr)->is_read_only) ); \
HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \
HDassert( (entry_ptr)->size > 0 ); \
- \
+ \
if ( (entry_ptr)->is_pinned ) { \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \
- (cache_ptr)->pel_tail_ptr, \
- (cache_ptr)->pel_len, \
+ (cache_ptr)->pel_tail_ptr, \
+ (cache_ptr)->pel_len, \
(cache_ptr)->pel_size, (fail_val)) \
HDassert( (cache_ptr)->pel_len >= 0 ); \
\
@@ -3013,7 +3016,7 @@ if ( (cache_ptr)->index_size != \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* End modified LRU specific code. */ \
@@ -3031,18 +3034,18 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_MOVE
+ * Macro: H5C__UPDATE_RP_FOR_MOVE
*
* Purpose: Update the replacement policy data structures for a
- * move of the specified cache entry.
+ * move of the specified cache entry.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -3064,20 +3067,20 @@ if ( (cache_ptr)->index_size != \
HDassert( (entry_ptr)->size > 0 ); \
\
if ( ! ( (entry_ptr)->is_pinned ) ) { \
- \
+ \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the head. \
- */ \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* remove the entry from either the clean or dirty LUR list as \
@@ -3086,43 +3089,43 @@ if ( (cache_ptr)->index_size != \
if ( was_dirty ) { \
\
H5C__AUX_DLL_REMOVE((entry_ptr), \
- (cache_ptr)->dLRU_head_ptr, \
+ (cache_ptr)->dLRU_head_ptr, \
(cache_ptr)->dLRU_tail_ptr, \
(cache_ptr)->dLRU_list_len, \
(cache_ptr)->dLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
\
} else { \
\
H5C__AUX_DLL_REMOVE((entry_ptr), \
- (cache_ptr)->cLRU_head_ptr, \
+ (cache_ptr)->cLRU_head_ptr, \
(cache_ptr)->cLRU_tail_ptr, \
(cache_ptr)->cLRU_list_len, \
(cache_ptr)->cLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
} \
\
/* insert the entry at the head of either the clean or dirty \
- * LRU list as appropriate. \
+ * LRU list as appropriate. \
*/ \
\
if ( (entry_ptr)->is_dirty ) { \
\
H5C__AUX_DLL_PREPEND((entry_ptr), \
- (cache_ptr)->dLRU_head_ptr, \
+ (cache_ptr)->dLRU_head_ptr, \
(cache_ptr)->dLRU_tail_ptr, \
(cache_ptr)->dLRU_list_len, \
(cache_ptr)->dLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
\
} else { \
\
H5C__AUX_DLL_PREPEND((entry_ptr), \
- (cache_ptr)->cLRU_head_ptr, \
+ (cache_ptr)->cLRU_head_ptr, \
(cache_ptr)->cLRU_tail_ptr, \
(cache_ptr)->cLRU_list_len, \
(cache_ptr)->cLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
} \
\
/* End modified LRU specific code. */ \
@@ -3142,20 +3145,20 @@ if ( (cache_ptr)->index_size != \
HDassert( (entry_ptr)->size > 0 ); \
\
if ( ! ( (entry_ptr)->is_pinned ) ) { \
- \
+ \
/* modified LRU specific code */ \
\
/* remove the entry from the LRU list, and re-insert it at the head. \
- */ \
+ */ \
\
H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \
(cache_ptr)->LRU_tail_ptr, \
- (cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_len, \
(cache_ptr)->LRU_list_size, (fail_val)) \
\
/* End modified LRU specific code. */ \
@@ -3164,25 +3167,25 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE
+ * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE
*
* Purpose: Update the replacement policy data structures for a
- * size change of the specified cache entry.
+ * size change of the specified cache entry.
*
- * To do this, determine if the entry is pinned. If it is,
- * update the size of the pinned entry list.
+ * To do this, determine if the entry is pinned. If it is,
+ * update the size of the pinned entry list.
*
- * If it isn't pinned, the entry must handled by the
- * replacement policy. Update the appropriate replacement
- * policy data structures.
+ * If it isn't pinned, the entry must handled by the
+ * replacement policy. Update the appropriate replacement
+ * policy data structures.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -3190,9 +3193,9 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 3/28/07
- * Added sanity checks based on the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM -- 3/28/07
+ * Added sanity checks based on the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -3209,43 +3212,43 @@ if ( (cache_ptr)->index_size != \
HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \
HDassert( (entry_ptr)->size > 0 ); \
HDassert( new_size > 0 ); \
- \
+ \
if ( (entry_ptr)->is_pinned ) { \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \
- (cache_ptr)->pel_size, \
- (entry_ptr)->size, \
- (new_size)); \
- \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \
+ (cache_ptr)->pel_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
+ \
} else { \
\
/* modified LRU specific code */ \
\
- /* Update the size of the LRU list */ \
+ /* Update the size of the LRU list */ \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \
- (cache_ptr)->LRU_list_size, \
- (entry_ptr)->size, \
- (new_size)); \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
\
/* Similarly, update the size of the clean or dirty LRU list as \
- * appropriate. At present, the entry must be clean, but that \
- * could change. \
+ * appropriate. At present, the entry must be clean, but that \
+ * could change. \
*/ \
\
if ( (entry_ptr)->is_dirty ) { \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \
- (cache_ptr)->dLRU_list_size, \
- (entry_ptr)->size, \
- (new_size)); \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \
+ (cache_ptr)->dLRU_list_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
\
} else { \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \
- (cache_ptr)->cLRU_list_size, \
- (entry_ptr)->size, \
- (new_size)); \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \
+ (cache_ptr)->cLRU_list_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
} \
\
/* End modified LRU specific code. */ \
@@ -3265,24 +3268,24 @@ if ( (cache_ptr)->index_size != \
HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \
HDassert( (entry_ptr)->size > 0 ); \
HDassert( new_size > 0 ); \
- \
+ \
if ( (entry_ptr)->is_pinned ) { \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \
- (cache_ptr)->pel_size, \
- (entry_ptr)->size, \
- (new_size)); \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \
+ (cache_ptr)->pel_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
\
} else { \
\
/* modified LRU specific code */ \
\
- /* Update the size of the LRU list */ \
+ /* Update the size of the LRU list */ \
\
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \
- (cache_ptr)->LRU_list_size, \
- (entry_ptr)->size, \
- (new_size)); \
+ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \
+ (cache_ptr)->LRU_list_size, \
+ (entry_ptr)->size, \
+ (new_size)); \
\
/* End modified LRU specific code. */ \
} \
@@ -3291,22 +3294,22 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_UNPIN
+ * Macro: H5C__UPDATE_RP_FOR_UNPIN
*
* Purpose: Update the replacement policy data structures for an
- * unpin of the specified cache entry.
+ * unpin of the specified cache entry.
*
- * To do this, unlink the specified entry from the protected
- * entry list, and re-insert it in the data structures used
- * by the current replacement policy.
+ * To do this, unlink the specified entry from the protected
+ * entry list, and re-insert it in the data structures used
+ * by the current replacement policy.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the macro
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the macro
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -3314,9 +3317,9 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM -- 3/28/07
- * Added sanity checks based on the new is_read_only and
- * ro_ref_count fields of struct H5C_cache_entry_t.
+ * JRM -- 3/28/07
+ * Added sanity checks based on the new is_read_only and
+ * ro_ref_count fields of struct H5C_cache_entry_t.
*
*-------------------------------------------------------------------------
*/
@@ -3358,20 +3361,20 @@ if ( (cache_ptr)->index_size != \
if ( (entry_ptr)->is_dirty ) { \
\
H5C__AUX_DLL_PREPEND((entry_ptr), \
- (cache_ptr)->dLRU_head_ptr, \
+ (cache_ptr)->dLRU_head_ptr, \
(cache_ptr)->dLRU_tail_ptr, \
(cache_ptr)->dLRU_list_len, \
(cache_ptr)->dLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
\
} else { \
\
H5C__AUX_DLL_PREPEND((entry_ptr), \
- (cache_ptr)->cLRU_head_ptr, \
+ (cache_ptr)->cLRU_head_ptr, \
(cache_ptr)->cLRU_tail_ptr, \
(cache_ptr)->cLRU_list_len, \
(cache_ptr)->cLRU_list_size, \
- (fail_val)) \
+ (fail_val)) \
} \
\
/* End modified LRU specific code. */ \
@@ -3414,22 +3417,22 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
+
/*-------------------------------------------------------------------------
*
- * Macro: H5C__UPDATE_RP_FOR_UNPROTECT
+ * Macro: H5C__UPDATE_RP_FOR_UNPROTECT
*
* Purpose: Update the replacement policy data structures for an
- * unprotect of the specified cache entry.
+ * unprotect of the specified cache entry.
*
- * To do this, unlink the specified entry from the protected
- * list, and re-insert it in the data structures used by the
- * current replacement policy.
+ * To do this, unlink the specified entry from the protected
+ * list, and re-insert it in the data structures used by the
+ * current replacement policy.
*
- * At present, we only support the modified LRU policy, so
- * this function deals with that case unconditionally. If
- * we ever support other replacement policies, the function
- * should switch on the current policy and act accordingly.
+ * At present, we only support the modified LRU policy, so
+ * this function deals with that case unconditionally. If
+ * we ever support other replacement policies, the function
+ * should switch on the current policy and act accordingly.
*
* Return: N/A
*
@@ -3437,24 +3440,24 @@ if ( (cache_ptr)->index_size != \
*
* Modifications:
*
- * JRM - 7/27/04
- * Converted the function H5C_update_rp_for_unprotect() to
- * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to
- * squeeze a bit more performance out of the cache.
+ * JRM - 7/27/04
+ * Converted the function H5C_update_rp_for_unprotect() to
+ * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to
+ * squeeze a bit more performance out of the cache.
*
- * At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause difficulties with
- * pre-processor, I'll have to remove them.
+ * At least for the first cut, I am leaving the comments and
+ * white space in the macro. If they cause difficulties with
+ * pre-processor, I'll have to remove them.
*
- * JRM - 7/28/04
- * Split macro into two version, one supporting the clean and
- * dirty LRU lists, and the other not. Yet another attempt
- * at optimization.
+ * JRM - 7/28/04
+ * Split macro into two version, one supporting the clean and
+ * dirty LRU lists, and the other not. Yet another attempt
+ * at optimization.
*
- * JRM - 3/17/06
- * Modified macro to put pinned entries on the pinned entry
- * list instead of inserting them in the data structures
- * maintained by the replacement policy.
+ * JRM - 3/17/06
+ * Modified macro to put pinned entries on the pinned entry
+ * list instead of inserting them in the data structures
+ * maintained by the replacement policy.
*
*-------------------------------------------------------------------------
*/
@@ -3561,4 +3564,5 @@ if ( (cache_ptr)->index_size != \
#endif /* _H5Cpkg_H */
+/* clang-format on */
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index efddb3c..e9b8c1b 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -13,12 +13,12 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Cprivate.h
- * 6/3/04
- * John Mainzer
+ * Created: H5Cprivate.h
+ * 6/3/04
+ * John Mainzer
*
- * Purpose: Constants and typedefs available to the rest of the
- * library.
+ * Purpose: Constants and typedefs available to the rest of the
+ * library.
*
* Modifications:
*
@@ -28,28 +28,28 @@
#ifndef _H5Cprivate_H
#define _H5Cprivate_H
-#include "H5Cpublic.h" /* public prototypes */
+#include "H5Cpublic.h" /* public prototypes */
/* Pivate headers needed by this header */
-#include "H5private.h" /* Generic Functions */
-#include "H5Fprivate.h" /* File access */
+#include "H5private.h" /* Generic Functions */
+#include "H5Fprivate.h" /* File access */
-#define H5C_DO_SANITY_CHECKS 0
-#define H5C_DO_EXTREME_SANITY_CHECKS 0
+#define H5C_DO_SANITY_CHECKS 0
+#define H5C_DO_EXTREME_SANITY_CHECKS 0
/* This sanity checking constant was picked out of the air. Increase
* or decrease it if appropriate. Its purposes is to detect corrupt
* object sizes, so it probably doesn't matter if it is a bit big.
*
- * JRM - 5/17/04
+ * JRM - 5/17/04
*/
-#define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024))
+#define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024))
/* H5C_COLLECT_CACHE_STATS controls overall collection of statistics
* on cache activity. In general, this #define should be set to 0.
*/
-#define H5C_COLLECT_CACHE_STATS 0
+#define H5C_COLLECT_CACHE_STATS 0
/* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics
* in individual cache entries.
@@ -59,11 +59,11 @@
*/
#if H5C_COLLECT_CACHE_STATS
-#define H5C_COLLECT_CACHE_ENTRY_STATS 1
+#define H5C_COLLECT_CACHE_ENTRY_STATS 1
#else
-#define H5C_COLLECT_CACHE_ENTRY_STATS 0
+#define H5C_COLLECT_CACHE_ENTRY_STATS 0
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -92,32 +92,32 @@ typedef struct H5C_t H5C_t;
/*
- * Class methods pertaining to caching. Each type of cached object will
+ * Class methods pertaining to caching. Each type of cached object will
* have a constant variable with permanent life-span that describes how
- * to cache the object. That variable will be of type H5C_class_t and
+ * to cache the object. That variable will be of type H5C_class_t and
* have the following required fields...
*
- * LOAD: Loads an object from disk to memory. The function
- * should allocate some data structure and return it.
+ * LOAD: Loads an object from disk to memory. The function
+ * should allocate some data structure and return it.
*
- * FLUSH: Writes some data structure back to disk. It would be
- * wise for the data structure to include dirty flags to
- * indicate whether it really needs to be written. This
- * function is also responsible for freeing memory allocated
- * by the LOAD method if the DEST argument is non-zero (by
+ * FLUSH: Writes some data structure back to disk. It would be
+ * wise for the data structure to include dirty flags to
+ * indicate whether it really needs to be written. This
+ * function is also responsible for freeing memory allocated
+ * by the LOAD method if the DEST argument is non-zero (by
* calling the DEST method).
*
- * DEST: Just frees memory allocated by the LOAD method.
+ * DEST: Just frees memory allocated by the LOAD method.
*
- * CLEAR: Just marks object as non-dirty.
+ * CLEAR: Just marks object as non-dirty.
*
- * SIZE: Report the size (on disk) of the specified cache object.
- * Note that the space allocated on disk may not be contiguous.
+ * SIZE: Report the size (on disk) of the specified cache object.
+ * Note that the space allocated on disk may not be contiguous.
*/
-#define H5C_CALLBACK__NO_FLAGS_SET 0x0
-#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
-#define H5C_CALLBACK__MOVED_FLAG 0x2
+#define H5C_CALLBACK__NO_FLAGS_SET 0x0
+#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
+#define H5C_CALLBACK__MOVED_FLAG 0x2
/* Actions that can be reported to 'notify' client callback */
typedef enum H5C_notify_action_t {
@@ -138,7 +138,7 @@ typedef herr_t (*H5C_flush_func_t)(H5F_t *f,
hbool_t dest,
haddr_t addr,
void *thing,
- unsigned * flags_ptr);
+ unsigned * flags_ptr);
typedef herr_t (*H5C_dest_func_t)(H5F_t *f,
void *thing);
typedef herr_t (*H5C_clear_func_t)(H5F_t *f,
@@ -151,12 +151,12 @@ typedef herr_t (*H5C_size_func_t)(const H5F_t *f,
size_t *size_ptr);
typedef struct H5C_class_t {
- int id;
- H5C_load_func_t load;
- H5C_flush_func_t flush;
- H5C_dest_func_t dest;
- H5C_clear_func_t clear;
- H5C_size_func_t size;
+ int id;
+ H5C_load_func_t load;
+ H5C_flush_func_t flush;
+ H5C_dest_func_t dest;
+ H5C_clear_func_t clear;
+ H5C_size_func_t size;
} H5C_class_t;
@@ -181,8 +181,8 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* size.
*/
-#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
-#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
+#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
+#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
/* Default max cache size and min clean size are give here to make
@@ -209,9 +209,9 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
*
* The fields of this structure are discussed individually below:
*
- * JRM - 4/26/04
+ * JRM - 4/26/04
*
- * magic: Unsigned 32 bit integer that must always be set to
+ * magic: Unsigned 32 bit integer that must always be set to
* H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid.
* The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC
* just before the entry is freed.
@@ -232,157 +232,157 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
*
* This field is only compiled in debug mode.
*
- * addr: Base address of the cache entry on disk.
+ * addr: Base address of the cache entry on disk.
*
- * size: Length of the cache entry on disk. Note that unlike normal
- * caches, the entries in this cache are of variable length.
- * The entries should never overlap, and when we do writebacks,
- * we will want to writeback adjacent entries where possible.
+ * size: Length of the cache entry on disk. Note that unlike normal
+ * caches, the entries in this cache are of variable length.
+ * The entries should never overlap, and when we do writebacks,
+ * we will want to writeback adjacent entries where possible.
*
- * NB: At present, entries need not be contiguous on disk. Until
- * we fix this, we can't do much with writing back adjacent
- * entries.
+ * NB: At present, entries need not be contiguous on disk. Until
+ * we fix this, we can't do much with writing back adjacent
+ * entries.
*
- * type: Pointer to the instance of H5C_class_t containing pointers
- * to the methods for cache entries of the current type. This
- * field should be NULL when the instance of H5C_cache_entry_t
- * is not in use.
+ * type: Pointer to the instance of H5C_class_t containing pointers
+ * to the methods for cache entries of the current type. This
+ * field should be NULL when the instance of H5C_cache_entry_t
+ * is not in use.
*
- * The name is not particularly descriptive, but is retained
- * to avoid changes in existing code.
+ * The name is not particularly descriptive, but is retained
+ * to avoid changes in existing code.
*
- * is_dirty: Boolean flag indicating whether the contents of the cache
- * entry has been modified since the last time it was written
- * to disk.
+ * is_dirty: Boolean flag indicating whether the contents of the cache
+ * entry has been modified since the last time it was written
+ * to disk.
*
- * NOTE: For historical reasons, this field is not maintained
- * by the cache. Instead, the module using the cache
- * sets this flag when it modifies the entry, and the
- * flush and clear functions supplied by that module
- * reset the dirty when appropriate.
+ * NOTE: For historical reasons, this field is not maintained
+ * by the cache. Instead, the module using the cache
+ * sets this flag when it modifies the entry, and the
+ * flush and clear functions supplied by that module
+ * reset the dirty when appropriate.
*
- * This is a bit quirky, so we may want to change this
- * someday. However it will require a change in the
- * cache interface.
+ * This is a bit quirky, so we may want to change this
+ * someday. However it will require a change in the
+ * cache interface.
*
- * Update: Management of the is_dirty field has been largely
- * moved into the cache. The only remaining exceptions
- * are the flush and clear functions supplied by the
- * modules using the cache. These still clear the
- * is_dirty field as before. -- JRM 7/5/05
+ * Update: Management of the is_dirty field has been largely
+ * moved into the cache. The only remaining exceptions
+ * are the flush and clear functions supplied by the
+ * modules using the cache. These still clear the
+ * is_dirty field as before. -- JRM 7/5/05
*
- * dirtied: Boolean flag used to indicate that the entry has been
- * dirtied while protected.
+ * dirtied: Boolean flag used to indicate that the entry has been
+ * dirtied while protected.
*
- * This field is set to FALSE in the protect call, and may
- * be set to TRUE by the
- * H5C_mark_entry_dirty()
- * call at an time prior to the unprotect call.
+ * This field is set to FALSE in the protect call, and may
+ * be set to TRUE by the
+ * H5C_mark_entry_dirty()
+ * call at an 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 was dirty prior to the protect 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 was 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
- * entry has been protected read only, or read/write.
+ * TRUE. In this circumstance, it indicates whether the
+ * entry has been protected read only, or read/write.
*
- * If the entry has been protected read only (i.e. is_protected
- * and is_read_only are both TRUE), we allow the entry to be
- * protected more than once.
+ * If the entry has been protected read only (i.e. is_protected
+ * 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
- * must be zero whenever either is_protected or is_read_only
- * are TRUE.
+ * outstanding read only protects on this entry. This field
+ * must be zero whenever either is_protected or is_read_only
+ * are TRUE.
*
- * is_pinned: Boolean flag indicating whether the entry has been pinned
- * in the cache.
+ * is_pinned: Boolean flag indicating whether the entry has been pinned
+ * in the cache.
*
- * For very hot entries, the protect / unprotect overhead
- * can become excessive. Thus the cache has been extended
- * to allow an entry to be "pinned" in the cache.
+ * For very hot entries, the protect / unprotect overhead
+ * can become excessive. Thus the cache has been extended
+ * to allow an entry to be "pinned" in the cache.
*
- * Pinning an entry in the cache has several implications:
+ * Pinning an entry in the cache has several implications:
*
- * 1) A pinned entry cannot be evicted. Thus unprotected
- * pinned entries must be stored in the pinned entry
- * list, instead of being managed by the replacement
- * policy code (LRU at present).
+ * 1) A pinned entry cannot be evicted. Thus unprotected
+ * pinned entries must be stored in the pinned entry
+ * list, instead of being managed by the replacement
+ * policy code (LRU at present).
*
- * 2) A pinned entry can be accessed or modified at any time.
- * Therefore, the cache must check with the entry owner
- * before flushing it. If permission is denied, the
- * cache does not flush the entry.
+ * 2) A pinned entry can be accessed or modified at any time.
+ * Therefore, the cache must check with the entry owner
+ * before flushing it. If permission is denied, the
+ * cache does not flush the entry.
*
- * 3) A pinned entry can be marked as dirty (and possibly
- * change size) while it is unprotected.
+ * 3) A pinned entry can be marked as dirty (and possibly
+ * change size) while it is unprotected.
*
- * 4) The flush-destroy code must allow pinned entries to
- * be unpinned (and possibly unprotected) during the
- * flush.
+ * 4) The flush-destroy code must allow pinned entries to
+ * be unpinned (and possibly unprotected) during the
+ * flush.
*
- * JRM -- 3/16/06
+ * JRM -- 3/16/06
*
- * in_slist: Boolean flag indicating whether the entry is in the skip list
- * As a general rule, entries are placed in the list when they
+ * in_slist: Boolean flag indicating whether the entry is in the skip list
+ * As a general rule, entries are placed in the list when they
* are marked dirty. However they may remain in the list after
* being flushed.
*
* Update: Dirty entries are now removed from the skip list
- * when they are flushed.
+ * when they are flushed.
*
* flush_marker: Boolean flag indicating that the entry is to be flushed
- * the next time H5C_flush_cache() is called with the
- * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when
- * the entry is flushed for whatever reason.
+ * the next time H5C_flush_cache() is called with the
+ * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when
+ * the entry is flushed for whatever reason.
*
* clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used
- * to implement the metadata cache In the parallel case, only
- * the cache with mpi rank 0 is allowed to actually write to
- * file -- all other caches must retain dirty entries until they
- * are advised that the entry is clean.
+ * to implement the metadata cache In the parallel case, only
+ * the cache with mpi rank 0 is allowed to actually write to
+ * file -- all other caches must retain dirty entries until they
+ * are advised that the entry is clean.
*
- * This flag is used in the case that such an advisory is
- * received when the entry is protected. If it is set when an
- * entry is unprotected, and the dirtied flag is not set in
- * the unprotect, the entry's is_dirty flag is reset by flushing
- * it with the H5C__FLUSH_CLEAR_ONLY_FLAG.
+ * This flag is used in the case that such an advisory is
+ * received when the entry is protected. If it is set when an
+ * entry is unprotected, and the dirtied flag is not set in
+ * the unprotect, the entry's is_dirty flag is reset by flushing
+ * it with the H5C__FLUSH_CLEAR_ONLY_FLAG.
*
- * flush_immediately: Boolean flag used only in Phdf5 -- and then only
- * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
+ * flush_immediately: Boolean flag used only in Phdf5 -- and then only
+ * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
*
- * When a distributed metadata write is triggered at a
- * sync point, this field is used to mark entries that
- * must be flushed before leaving the sync point. At all
- * other times, this field should be set to FALSE.
+ * When a distributed metadata write is triggered at a
+ * sync point, this field is used to mark entries that
+ * must be flushed before leaving the sync point. At all
+ * 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.
*
* free_file_space_on_destroy: Boolean flag that is set to true iff the entry
- * is in the process of being flushed and destroyed and the file
+ * is in the process of being flushed and destroyed and the file
* space used by the object should be freed by the cache client's
* 'dest' callback routine.
*
@@ -393,15 +393,15 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* If there are multiple entries in any hash bin, they are stored in a doubly
* linked list.
*
- * ht_next: Next pointer used by the hash table to store multiple
- * entries in a single hash bin. This field points to the
- * next entry in the doubly linked list of entries in the
- * hash bin, or NULL if there is no next entry.
+ * ht_next: Next pointer used by the hash table to store multiple
+ * entries in a single hash bin. This field points to the
+ * next entry in the doubly linked list of entries in the
+ * hash bin, or NULL if there is no next entry.
*
* ht_prev: Prev pointer used by the hash table to store multiple
* entries in a single hash bin. This field points to the
* previous entry in the doubly linked list of entries in
- * the hash bin, or NULL if there is no previuos entry.
+ * the hash bin, or NULL if there is no previuos entry.
*
*
* Fields supporting replacement policies:
@@ -438,62 +438,62 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* The use of the replacement policy fields under the Modified LRU policy
* is discussed below:
*
- * next: Next pointer in either the LRU or the protected list,
- * depending on the current value of protected. If there
- * is no next entry on the list, this field should be set
- * to NULL.
- *
- * prev: Prev pointer in either the LRU or the protected list,
- * depending on the current value of protected. If there
- * is no previous entry on the list, this field should be
- * set to NULL.
- *
- * aux_next: Next pointer on either the clean or dirty LRU lists.
- * This entry should be NULL when protected is true. When
- * protected is false, and dirty is true, it should point
- * to the next item on the dirty LRU list. When protected
- * is false, and dirty is false, it should point to the
- * next item on the clean LRU list. In either case, when
- * there is no next item, it should be NULL.
- *
- * aux_prev: Previous pointer on either the clean or dirty LRU lists.
- * This entry should be NULL when protected is true. When
- * protected is false, and dirty is true, it should point
- * to the previous item on the dirty LRU list. When protected
- * is false, and dirty is false, it should point to the
- * previous item on the clean LRU list. In either case, when
- * there is no previous item, it should be NULL.
+ * next: Next pointer in either the LRU or the protected list,
+ * depending on the current value of protected. If there
+ * is no next entry on the list, this field should be set
+ * to NULL.
+ *
+ * prev: Prev pointer in either the LRU or the protected list,
+ * depending on the current value of protected. If there
+ * is no previous entry on the list, this field should be
+ * set to NULL.
+ *
+ * aux_next: Next pointer on either the clean or dirty LRU lists.
+ * This entry should be NULL when protected is true. When
+ * protected is false, and dirty is true, it should point
+ * to the next item on the dirty LRU list. When protected
+ * is false, and dirty is false, it should point to the
+ * next item on the clean LRU list. In either case, when
+ * there is no next item, it should be NULL.
+ *
+ * aux_prev: Previous pointer on either the clean or dirty LRU lists.
+ * This entry should be NULL when protected is true. When
+ * protected is false, and dirty is true, it should point
+ * to the previous item on the dirty LRU list. When protected
+ * is false, and dirty is false, it should point to the
+ * previous item on the clean LRU list. In either case, when
+ * there is no previous item, it should be NULL.
*
*
* Fields supporting metadata journaling:
*
- * last_trans: unit64_t containing the ID of the last transaction in
- * which this entry was dirtied. If journaling is disabled,
- * or if the entry has never been dirtied in a transaction,
- * this field should be set to zero. Once we notice that
- * the specified transaction has made it to disk, we will
- * reset this field to zero as well.
+ * last_trans: unit64_t containing the ID of the last transaction in
+ * which this entry was dirtied. If journaling is disabled,
+ * or if the entry has never been dirtied in a transaction,
+ * this field should be set to zero. Once we notice that
+ * the specified transaction has made it to disk, we will
+ * reset this field to zero as well.
*
- * We must maintain this field, as to avoid messages from
- * the future, we must not flush a dirty entry to disk
- * until the last transaction in which it was dirtied
- * has made it to disk in the journal file.
+ * We must maintain this field, as to avoid messages from
+ * the future, we must not flush a dirty entry to disk
+ * until the last transaction in which it was dirtied
+ * has made it to disk in the journal file.
*
* trans_next: Next pointer in the entries modified in the current
- * transaction list. This field should always be null
- * unless journaling is enabled, the entry is dirty,
- * and last_trans field contains the current transaction
- * number. Even if all these conditions are fulfilled,
- * the field will still be NULL if this is the last
- * entry on the list.
+ * transaction list. This field should always be null
+ * unless journaling is enabled, the entry is dirty,
+ * and last_trans field contains the current transaction
+ * number. Even if all these conditions are fulfilled,
+ * the field will still be NULL if this is the last
+ * entry on the list.
*
* trans_prev: Previous pointer in the entries modified in the current
- * transaction list. This field should always be null
- * unless journaling is enabled, the entry is dirty,
- * and last_trans field contains the current transaction
- * number. Even if all these conditions are fulfilled,
- * the field will still be NULL if this is the first
- * entry on the list.
+ * transaction list. This field should always be null
+ * unless journaling is enabled, the entry is dirty,
+ * and last_trans field contains the current transaction
+ * number. Even if all these conditions are fulfilled,
+ * the field will still be NULL if this is the first
+ * entry on the list.
*
*
* Cache entry stats collection fields:
@@ -502,70 +502,70 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* 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
+ * clears: int32_t containing the number of times this cache entry has
* been cleared in its life time.
*
- * flushes: int32_t containing the number of times this cache entry has
+ * 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.
*
****************************************************************************/
#ifndef NDEBUG
-#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
-#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
+#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
+#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
#endif /* NDEBUG */
typedef struct H5C_cache_entry_t
{
#ifndef NDEBUG
- uint32_t magic;
+ uint32_t magic;
#endif /* NDEBUG */
H5C_t * cache_ptr;
- haddr_t addr;
- size_t size;
- const H5C_class_t * type;
- hbool_t is_dirty;
- hbool_t dirtied;
- hbool_t is_protected;
- hbool_t is_read_only;
- int ro_ref_count;
- hbool_t is_pinned;
- hbool_t in_slist;
- hbool_t flush_marker;
+ haddr_t addr;
+ size_t size;
+ const H5C_class_t * type;
+ hbool_t is_dirty;
+ hbool_t dirtied;
+ hbool_t is_protected;
+ hbool_t is_read_only;
+ int ro_ref_count;
+ hbool_t is_pinned;
+ hbool_t in_slist;
+ hbool_t flush_marker;
#ifdef H5_HAVE_PARALLEL
- hbool_t clear_on_unprotect;
- hbool_t flush_immediately;
+ hbool_t clear_on_unprotect;
+ hbool_t flush_immediately;
#endif /* H5_HAVE_PARALLEL */
- hbool_t flush_in_progress;
- hbool_t destroy_in_progress;
- hbool_t free_file_space_on_destroy;
+ hbool_t flush_in_progress;
+ hbool_t destroy_in_progress;
+ hbool_t free_file_space_on_destroy;
/* fields supporting the hash table: */
- struct H5C_cache_entry_t * ht_next;
- struct H5C_cache_entry_t * ht_prev;
+ struct H5C_cache_entry_t * ht_next;
+ struct H5C_cache_entry_t * ht_prev;
/* fields supporting replacement policies: */
- struct H5C_cache_entry_t * next;
- struct H5C_cache_entry_t * prev;
- struct H5C_cache_entry_t * aux_next;
- struct H5C_cache_entry_t * aux_prev;
+ struct H5C_cache_entry_t * next;
+ struct H5C_cache_entry_t * prev;
+ struct H5C_cache_entry_t * aux_next;
+ struct H5C_cache_entry_t * aux_prev;
#if H5C_COLLECT_CACHE_ENTRY_STATS
/* cache entry stats fields */
- int32_t accesses;
- int32_t clears;
- int32_t flushes;
- int32_t pins;
+ int32_t accesses;
+ int32_t clears;
+ int32_t flushes;
+ int32_t pins;
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -582,95 +582,95 @@ typedef struct H5C_cache_entry_t
* The fields of the structure are discussed individually below:
*
* version: Integer field containing the version number of this version
- * of the H5C_auto_size_ctl_t structure. Any instance of
- * H5C_auto_size_ctl_t passed to the cache must have a known
- * version number, or an error will be flagged.
+ * of the H5C_auto_size_ctl_t structure. Any instance of
+ * H5C_auto_size_ctl_t passed to the cache must have a known
+ * 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
- * field is NULL, no call is made.
+ * field is NULL, no call is made.
*
- * If the field is not NULL, it must contain the address of a function
- * of type H5C_auto_resize_report_fcn.
+ * If the field is not NULL, it must contain the address of a function
+ * of type H5C_auto_resize_report_fcn.
*
* 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
- * the initial_size field. If set_initial_size is FALSE, the
- * initial_size field is ignored.
+ * initial size of the cache is to be set to the value given in
+ * the initial_size field. If set_initial_size is FALSE, the
+ * initial_size field is ignored.
*
* initial_size: If enabled, this field contain the size the cache is
- * to be set to upon receipt of this structure. Needless to say,
- * initial_size must lie in the closed interval [min_size, max_size].
+ * to be set to upon receipt of this structure. Needless to say,
+ * initial_size must lie in the closed interval [min_size, max_size].
*
* min_clean_fraction: double in the range 0 to 1 indicating the fraction
- * of the cache that is to be kept clean. This field is only used
- * in parallel mode. Typical values are 0.1 to 0.5.
+ * of the cache that is to be kept clean. This field is only used
+ * in parallel mode. Typical values are 0.1 to 0.5.
*
* max_size: Maximum 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, max_size must
- * be greater than or equal to min_size.
+ * supplied value must fall in the closed interval
+ * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must
+ * 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
- * be less than or equal to max_size.
+ * 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,
+ * hit rate stats before running the automatic cache resize code,
* 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
- * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH].
+ * At the end of an epoch, we discard prior hit rate data and start
+ * collecting afresh. The epoch_length must lie in the closed
+ * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH].
*
*
* Cache size increase control fields:
*
* incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
- * value indicates how we determine whether the cache size should be
- * increased. At present there are two possible values:
+ * value indicates how we determine whether the cache size should be
+ * increased. At present there are two possible values:
*
- * H5C_incr__off: Don't attempt to increase the size of the cache
- * automatically.
+ * H5C_incr__off: Don't attempt to increase the size of the cache
+ * automatically.
*
- * When this increment mode is selected, the remaining fields
- * in the cache size increase section ar ignored.
+ * When this increment mode is selected, the remaining fields
+ * in the cache size increase section ar ignored.
*
- * H5C_incr__threshold: Attempt to increase the size of the cache
- * whenever the average hit rate over the last epoch drops
- * below the value supplied in the lower_hr_threshold
- * field.
+ * H5C_incr__threshold: Attempt to increase the size of the cache
+ * whenever the average hit rate over the last epoch drops
+ * below the value supplied in the lower_hr_threshold
+ * field.
*
- * Note that this attempt will fail if the cache is already
- * at its maximum size, or if the cache is not already using
- * all available space.
+ * Note that this attempt will fail if the cache is already
+ * at its maximum size, or if the cache is not already using
+ * 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.
+ * 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
@@ -719,96 +719,96 @@ typedef struct H5C_cache_entry_t
* is H5C_flash_incr__add_space.
*
* flash_threshold: Double containing the factor by which current max cache
- * size is multiplied to obtain the size threshold for the add_space
- * flash increment algorithm. The field is ignored unless
- * flash_incr_mode is H5C_flash_incr__add_space.
+ * size is multiplied to obtain the size threshold for the add_space
+ * flash increment algorithm. The field is ignored unless
+ * flash_incr_mode is H5C_flash_incr__add_space.
*
*
* Cache size decrease control fields:
*
* decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
- * value indicates how we determine whether the cache size should be
- * decreased. At present there are four possibilities.
+ * value indicates how we determine whether the cache size should be
+ * decreased. At present there are four possibilities.
*
- * H5C_decr__off: Don't attempt to decrease the size of the cache
- * automatically.
+ * H5C_decr__off: Don't attempt to decrease the size of the cache
+ * automatically.
*
- * When this increment mode is selected, the remaining fields
- * in the cache size decrease section are ignored.
+ * When this increment mode is selected, the remaining fields
+ * in the cache size decrease section are ignored.
*
- * H5C_decr__threshold: Attempt to decrease the size of the cache
- * whenever the average hit rate over the last epoch rises
- * above the value supplied in the upper_hr_threshold
- * field.
+ * H5C_decr__threshold: Attempt to decrease the size of the cache
+ * whenever the average hit rate over the last epoch rises
+ * above the value supplied in the upper_hr_threshold
+ * field.
*
- * H5C_decr__age_out: At the end of each epoch, search the cache for
- * entries that have not been accessed for at least the number
- * of epochs specified in the epochs_before_eviction field, and
- * evict these entries. Conceptually, the maximum cache size
- * is then decreased to match the new actual cache size. However,
- * this reduction may be modified by the min_size, the
- * max_decrement, and/or the empty_reserve.
+ * H5C_decr__age_out: At the end of each epoch, search the cache for
+ * entries that have not been accessed for at least the number
+ * of epochs specified in the epochs_before_eviction field, and
+ * evict these entries. Conceptually, the maximum cache size
+ * is then decreased to match the new actual cache size. However,
+ * this reduction may be modified by the min_size, the
+ * max_decrement, and/or the empty_reserve.
*
- * H5C_decr__age_out_with_threshold: Same as age_out, but we only
- * attempt to reduce the cache size when the hit rate observed
- * over the last epoch exceeds the value provided in the
- * upper_hr_threshold field.
+ * H5C_decr__age_out_with_threshold: Same as age_out, but we only
+ * attempt to reduce the cache size when the hit rate observed
+ * over the last epoch exceeds the value provided in the
+ * upper_hr_threshold field.
*
* upper_hr_threshold: Upper hit rate threshold. The use of this field
- * varies according to the current decr_mode:
+ * varies according to the current decr_mode:
*
- * H5C_decr__off or H5C_decr__age_out: The value of this field is
- * ignored.
+ * H5C_decr__off or H5C_decr__age_out: The value of this field is
+ * ignored.
*
- * H5C_decr__threshold: If the hit rate exceeds this threshold in any
- * epoch, attempt to decrement the cache size by size_decrement.
+ * H5C_decr__threshold: If the hit rate exceeds this threshold in any
+ * epoch, attempt to decrement the cache size by size_decrement.
*
- * Note that cache size may not be decremented below min_size.
+ * Note that cache size may not be decremented below min_size.
*
- * Note also that if the upper_threshold is 1.0, the cache size
- * will never be reduced.
+ * Note also that if the upper_threshold is 1.0, the cache size
+ * will never be reduced.
*
- * H5C_decr__age_out_with_threshold: If the hit rate exceeds this
- * threshold in any epoch, attempt to reduce the cache size
- * by evicting entries that have not been accessed for more
- * than the specified number of epochs.
+ * H5C_decr__age_out_with_threshold: If the hit rate exceeds this
+ * threshold in any epoch, attempt to reduce the cache size
+ * by evicting entries that have not been accessed for more
+ * than the specified number of epochs.
*
* decrement: This field is only used when the decr_mode is
- * H5C_decr__threshold.
+ * H5C_decr__threshold.
*
- * The field is a double containing the multiplier used to derive the
- * new cache size from the old if a cache size decrement is triggered.
- * The decrement must be in the range 0.0 (in which case the cache will
+ * The field is a double containing the multiplier used to derive the
+ * new cache size from the old if a cache size decrement is triggered.
+ * The decrement must be in the range 0.0 (in which case the cache will
* try to contract to its minimum size) to 1.0 (in which case the
* cache will never shrink).
*
* apply_max_decrement: Boolean flag used to determine whether decrements
- * in cache size are to be limited by the max_decrement field.
+ * in cache size are to be limited by the max_decrement field.
*
* max_decrement: Maximum number of bytes by which the cache size can be
- * decreased in a single re-size. Note that decrements may also be
- * restricted by the min_size of the cache, and (in age out modes) by
- * the empty_reserve field.
+ * decreased in a single re-size. Note that decrements may also be
+ * restricted by the min_size of the cache, and (in age out modes) by
+ * the empty_reserve field.
*
* epochs_before_eviction: Integer field used in H5C_decr__age_out and
- * H5C_decr__age_out_with_threshold decrement modes.
+ * H5C_decr__age_out_with_threshold decrement modes.
*
- * This field contains the number of epochs an entry must remain
- * unaccessed before it is evicted in an attempt to reduce the
- * cache size. If applicable, this field must lie in the range
- * [1, H5C__MAX_EPOCH_MARKERS].
+ * This field contains the number of epochs an entry must remain
+ * unaccessed before it is evicted in an attempt to reduce the
+ * cache size. If applicable, this field must lie in the range
+ * [1, H5C__MAX_EPOCH_MARKERS].
*
* apply_empty_reserve: Boolean field controlling whether the empty_reserve
- * field is to be used in computing the new cache size when the
- * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
+ * field is to be used in computing the new cache size when the
+ * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
*
* empty_reserve: To avoid a constant racheting down of cache size by small
- * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
- * modes, this field allows one to require that any cache size
- * reductions leave the specified fraction of unused space in the cache.
+ * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
+ * modes, this field allows one to require that any cache size
+ * reductions leave the specified fraction of unused space in the cache.
*
- * The value of this field must be in the range [0.0, 1.0]. I would
- * expect typical values to be in the range of 0.01 to 0.1.
+ * The value of this field must be in the range [0.0, 1.0]. I would
+ * expect typical values to be in the range of 0.01 to 0.1.
*
****************************************************************************/
@@ -816,6 +816,7 @@ typedef struct H5C_cache_entry_t
#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 | \
@@ -824,28 +825,30 @@ typedef struct H5C_cache_entry_t
H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
)
-#define H5C__CURR_AUTO_SIZE_CTL_VER 1
-#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
+/* clang-format on */
-#define H5C__MAX_EPOCH_MARKERS 10
+#define H5C__CURR_AUTO_SIZE_CTL_VER 1
+#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
-#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
-#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
-#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
-#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
-#define H5C__DEF_AR_INCREMENT 2.0f
-#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
+#define H5C__MAX_EPOCH_MARKERS 10
+
+#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
+#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
+#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
+#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
+#define H5C__DEF_AR_INCREMENT 2.0f
+#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
-#define H5C__DEF_AR_DECREMENT 0.9f
-#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_EPCHS_B4_EVICT 3
-#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
-#define H5C__MIN_AR_EPOCH_LENGTH 100
-#define H5C__DEF_AR_EPOCH_LENGTH 50000
-#define H5C__MAX_AR_EPOCH_LENGTH 1000000
+#define H5C__DEF_AR_DECREMENT 0.9f
+#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_EPCHS_B4_EVICT 3
+#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
+#define H5C__MIN_AR_EPOCH_LENGTH 100
+#define H5C__DEF_AR_EPOCH_LENGTH 50000
+#define H5C__MAX_AR_EPOCH_LENGTH 1000000
enum H5C_resize_status
{
@@ -872,29 +875,29 @@ typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr,
typedef struct H5C_auto_size_ctl_t
{
/* general configuration fields: */
- int32_t version;
- H5C_auto_resize_rpt_fcn rpt_fcn;
+ int32_t version;
+ H5C_auto_resize_rpt_fcn rpt_fcn;
- hbool_t set_initial_size;
- size_t initial_size;
+ hbool_t set_initial_size;
+ size_t initial_size;
- double min_clean_fraction;
+ double min_clean_fraction;
- size_t max_size;
- size_t min_size;
+ size_t max_size;
+ size_t min_size;
- int64_t epoch_length;
+ int64_t epoch_length;
/* size increase control fields: */
- enum H5C_cache_incr_mode incr_mode;
+ enum H5C_cache_incr_mode incr_mode;
- double lower_hr_threshold;
+ double lower_hr_threshold;
- double increment;
+ double increment;
- hbool_t apply_max_increment;
- size_t max_increment;
+ hbool_t apply_max_increment;
+ size_t max_increment;
enum H5C_cache_flash_incr_mode flash_incr_mode;
double flash_multiple;
@@ -902,19 +905,19 @@ typedef struct H5C_auto_size_ctl_t
/* size decrease control fields: */
- enum H5C_cache_decr_mode decr_mode;
+ enum H5C_cache_decr_mode decr_mode;
- double upper_hr_threshold;
+ double upper_hr_threshold;
- double decrement;
+ double decrement;
- hbool_t apply_max_decrement;
- size_t max_decrement;
+ hbool_t apply_max_decrement;
+ size_t max_decrement;
- int32_t epochs_before_eviction;
+ int32_t epochs_before_eviction;
- hbool_t apply_empty_reserve;
- double empty_reserve;
+ hbool_t apply_empty_reserve;
+ double empty_reserve;
} H5C_auto_size_ctl_t;
@@ -930,61 +933,61 @@ typedef struct H5C_auto_size_ctl_t
*
* These flags apply to all function calls:
*
- * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
+ * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
*
*
* 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
*
* These flags apply to H5C_protect()
*
- * H5C__READ_ONLY_FLAG
+ * H5C__READ_ONLY_FLAG
*
* 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__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_flush_cache():
*
- * 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__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)
*
* These flags apply to H5C_flush_single_entry():
*
- * 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__TAKE_OWNERSHIP_FLAG
*/
-#define H5C__NO_FLAGS_SET 0x0000
-#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
-#define H5C__DELETED_FLAG 0x0002
-#define H5C__DIRTIED_FLAG 0x0004
-#define H5C__PIN_ENTRY_FLAG 0x0008
-#define H5C__UNPIN_ENTRY_FLAG 0x0010
-#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
-#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
-#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
-#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
-#define H5C__READ_ONLY_FLAG 0x0200
-#define H5C__FREE_FILE_SPACE_FLAG 0x0800
-#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
+#define H5C__NO_FLAGS_SET 0x0000
+#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
+#define H5C__DELETED_FLAG 0x0002
+#define H5C__DIRTIED_FLAG 0x0004
+#define H5C__PIN_ENTRY_FLAG 0x0008
+#define H5C__UNPIN_ENTRY_FLAG 0x0010
+#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
+#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
+#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
+#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
+#define H5C__READ_ONLY_FLAG 0x0200
+#define H5C__FREE_FILE_SPACE_FLAG 0x0800
+#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f,
@@ -1004,7 +1007,7 @@ H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr);
H5_DLL H5C_t * H5C_create(size_t max_cache_size,
size_t min_clean_size,
int max_type_id,
- const char * (* type_name_table_ptr),
+ const char * (* type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted,
hbool_t write_permitted,
H5C_log_flush_func_t log_flush,
@@ -1024,7 +1027,7 @@ H5_DLL herr_t H5C_dest(H5F_t * f,
hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_expunge_entry(H5F_t * f,
- hid_t primary_dxpl_id,
+ hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
@@ -1057,7 +1060,7 @@ H5_DLL herr_t H5C_get_entry_status(const H5F_t *f,
hbool_t * in_cache_ptr,
hbool_t * is_dirty_ptr,
hbool_t * is_protected_ptr,
- hbool_t * is_pinned_ptr);
+ hbool_t * is_pinned_ptr);
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr,
hbool_t * evictions_enabled_ptr);
@@ -1093,7 +1096,7 @@ H5_DLL herr_t H5C_pin_protected_entry(void *thing);
H5_DLL void * H5C_protect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
- const H5C_class_t * type,
+ const H5C_class_t * type,
haddr_t addr,
void * udata,
unsigned flags);
@@ -1111,7 +1114,7 @@ H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr,
H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix);
H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr,
- FILE * trace_file_ptr);
+ FILE * trace_file_ptr);
H5_DLL herr_t H5C_stats(H5C_t * cache_ptr,
const char * cache_name,
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 730a71f..bcd0dfb 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -15,23 +15,23 @@
/* Module Setup */
/****************/
-#define H5D_PACKAGE /*suppress error about including H5Dpkg */
+#define H5D_PACKAGE /*suppress error about including H5Dpkg */
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5D__init_interface
+#define H5_INTERFACE_INIT_FUNC H5D__init_interface
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lprivate.h" /* Links */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lprivate.h" /* Links */
+#include "H5MMprivate.h" /* Memory management */
/****************/
@@ -106,29 +106,32 @@ H5FL_EXTERN(H5D_chunk_info_t);
/* Declare extern the free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(type_conv);
+/* Disable warning for intentional identical branches here -QAK */
+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=")
/* Dataset ID class */
static const H5I_class_t H5I_DATASET_CLS[1] = {{
- H5I_DATASET, /* ID class value */
- H5I_CLASS_REUSE_IDS, /* Class flags */
- 0, /* # of reserved IDs for class */
+ H5I_DATASET, /* ID class value */
+ H5I_CLASS_REUSE_IDS, /* Class flags */
+ 0, /* # of reserved IDs for class */
(H5I_free_t)H5D_close /* Callback routine for closing objects of this class */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_init
+ * Function: H5D_init
*
- * Purpose: Initialize the interface from some other layer.
+ * Purpose: Initialize the interface from some other layer.
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 4, 2000
*
*-------------------------------------------------------------------------
@@ -145,7 +148,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_init() */
-
+
/*--------------------------------------------------------------------------
NAME
H5D__init_interface -- Initialize interface-specific information
@@ -205,18 +208,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__init_interface() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_term_interface
+ * Function: H5D_term_interface
*
- * Purpose: Terminate this interface.
+ * Purpose: Terminate this interface.
*
- * Return: Success: Positive if anything was done that might
- * affect other interfaces; zero otherwise.
+ * Return: Success: Positive if anything was done that might
+ * affect other interfaces; zero otherwise.
*
- * Failure: Negative.
+ * Failure: Negative.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, November 20, 1998
*
*-------------------------------------------------------------------------
@@ -224,12 +227,12 @@ done:
int
H5D_term_interface(void)
{
- int n = 0;
+ int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_interface_initialize_g) {
- if(H5I_nmembers(H5I_DATASET) > 0) {
+ if(H5I_nmembers(H5I_DATASET) > 0) {
/* The dataset API uses the "force" flag set to true because it
* is using the "file objects" (H5FO) API functions to track open
* objects in the file. Using the H5FO code means that dataset
@@ -252,9 +255,9 @@ H5D_term_interface(void)
*
* QAK - 5/13/03
*/
- (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE);
+ (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE);
n++; /*H5I*/
- } /* end if */
+ } /* end if */
else {
/* Close public interface */
n += H5D__term_pub_interface();
@@ -262,19 +265,19 @@ H5D_term_interface(void)
/* Close deprecated interface */
n += H5D__term_deprec_interface();
- /* Destroy the dataset object id group */
- (void)H5I_dec_type_ref(H5I_DATASET);
+ /* Destroy the dataset object id group */
+ (void)H5I_dec_type_ref(H5I_DATASET);
n++; /*H5I*/
- /* Mark closed */
- H5_interface_initialize_g = 0;
- } /* end else */
+ /* Mark closed */
+ H5_interface_initialize_g = 0;
+ } /* end else */
} /* end if */
FUNC_LEAVE_NOAPI(n)
} /* end H5D_term_interface() */
-
+
/*--------------------------------------------------------------------------
NAME
H5D__get_dxpl_cache_real
@@ -357,7 +360,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_dxpl_cache_real() */
-
+
/*--------------------------------------------------------------------------
NAME
H5D__get_dxpl_cache
@@ -401,18 +404,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_dxpl_cache() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__create_named
+ * Function: H5D__create_named
*
- * Purpose: Internal routine to create a new dataset.
+ * Purpose: Internal routine to create a new dataset.
*
- * Return: Success: Non-NULL, pointer to new dataset object.
+ * Return: Success: Non-NULL, pointer to new dataset object.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * Thursday, April 5, 2007
+ * Programmer: Quincey Koziol
+ * Thursday, April 5, 2007
*
*-------------------------------------------------------------------------
*/
@@ -423,7 +426,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id,
{
H5O_obj_create_t ocrt_info; /* Information for object creation */
H5D_obj_create_t dcrt_info; /* Information for dataset creation */
- H5D_t *ret_value; /* Return value */
+ H5D_t *ret_value; /* Return value */
FUNC_ENTER_PACKAGE
@@ -460,7 +463,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__create_named() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_space_status
*
@@ -528,18 +531,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_space_status() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__new
+ * Function: H5D__new
*
- * Purpose: Creates a new, empty dataset structure
+ * Purpose: Creates a new, empty dataset structure
*
- * Return: Success: Pointer to a new dataset descriptor.
+ * Return: Success: Pointer to a new dataset descriptor.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * Monday, October 12, 1998
+ * Programmer: Quincey Koziol
+ * Monday, October 12, 1998
*
*-------------------------------------------------------------------------
*/
@@ -604,18 +607,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__new() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__init_type
+ * Function: H5D__init_type
*
- * Purpose: Copy a datatype for a dataset's use, performing all the
+ * Purpose: Copy a datatype for a dataset's use, performing all the
* necessary adjustments, etc.
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Thursday, June 24, 2004
+ * Programmer: Quincey Koziol
+ * Thursday, June 24, 2004
*
*-------------------------------------------------------------------------
*/
@@ -651,8 +654,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype")
- /* Convert a datatype (if committed) to a transient type if the committed datatype's file
- location is different from the file location where the dataset will be created */
+ /* Convert a datatype (if committed) to a transient type if the committed datatype's file
+ location is different from the file location where the dataset will be created */
if(H5T_convert_committed_datatype(dset->shared->type, file) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info")
@@ -666,8 +669,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
/* Get a datatype ID for the dataset's datatype */
- if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type")
+ if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type")
} /* end if */
/* Not a custom datatype, just use it directly */
else {
@@ -683,18 +686,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__init_type() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__init_space
+ * Function: H5D__init_space
*
- * Purpose: Copy a dataspace for a dataset's use, performing all the
+ * Purpose: Copy a dataspace for a dataset's use, performing all the
* necessary adjustments, etc.
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Tuesday, July 24, 2007
+ * Programmer: Quincey Koziol
+ * Tuesday, July 24, 2007
*
*-------------------------------------------------------------------------
*/
@@ -731,17 +734,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__init_space() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__update_oh_info
+ * Function: H5D__update_oh_info
*
- * Purpose: Create and fill object header for dataset
+ * Purpose: Create and fill object header for dataset
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*
- * Programmer: Bill Wendling
- * Thursday, October 31, 2002
+ * Programmer: Bill Wendling
+ * Thursday, October 31, 2002
*
*-------------------------------------------------------------------------
*/
@@ -754,8 +757,8 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
H5O_layout_t *layout; /* Dataset's layout information */
H5T_t *type; /* Dataset's datatype */
hbool_t use_latest_format; /* Flag indicating the newest file format should be used */
- H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
- H5D_fill_value_t fill_status; /* Fill value status */
+ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
+ H5D_fill_value_t fill_status; /* Fill value status */
hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
herr_t ret_value = SUCCEED; /* Return value */
@@ -801,9 +804,9 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert fill value to dataset type")
- fill_prop->fill_defined = TRUE;
+ fill_prop->fill_defined = TRUE;
} else if(fill_status == H5D_FILL_VALUE_UNDEFINED) {
- fill_prop->fill_defined = FALSE;
+ fill_prop->fill_defined = FALSE;
} else
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined")
@@ -928,7 +931,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__update_oh_info() */
-
+
/*--------------------------------------------------------------------------
* Function: H5D_build_extfile_prefix
*
@@ -953,7 +956,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
hbool_t free_prefix = FALSE; /* Did the library allocate memory for prefix? */
H5P_genplist_t *plist = NULL; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
-
+
FUNC_ENTER_NOAPI_NOINIT
@@ -993,7 +996,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix
extpath_len = HDstrlen(extpath);
prefix_len = HDstrlen(prefix);
extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1;
-
+
if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer")
HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}"));
@@ -1010,24 +1013,24 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_build_extfile_prefix() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__create
+ * Function: H5D__create
*
- * Purpose: Creates a new dataset with name NAME in file F and associates
- * with it a datatype TYPE for each element as stored in the
- * file, dimensionality information or dataspace SPACE, and
- * other miscellaneous properties CREATE_PARMS. All arguments
- * are deep-copied before being associated with the new dataset,
- * so the caller is free to subsequently modify them without
- * affecting the dataset.
+ * Purpose: Creates a new dataset with name NAME in file F and associates
+ * with it a datatype TYPE for each element as stored in the
+ * file, dimensionality information or dataspace SPACE, and
+ * other miscellaneous properties CREATE_PARMS. All arguments
+ * are deep-copied before being associated with the new dataset,
+ * so the caller is free to subsequently modify them without
+ * affecting the dataset.
*
- * Return: Success: Pointer to a new dataset
+ * Return: Success: Pointer to a new dataset
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * Thursday, December 4, 1997
+ * Programmer: Robb Matzke
+ * Thursday, December 4, 1997
*
*-------------------------------------------------------------------------
*/
@@ -1036,12 +1039,12 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
hid_t dapl_id, hid_t dxpl_id)
{
const H5T_t *type; /* Datatype for dataset */
- H5D_t *new_dset = NULL;
- H5P_genplist_t *dc_plist = NULL; /* New Property list */
+ H5D_t *new_dset = NULL;
+ H5P_genplist_t *dc_plist = NULL; /* New Property list */
hbool_t has_vl_type = FALSE; /* Flag to indicate a VL-type for dataset */
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
H5G_loc_t dset_loc; /* Dataset location */
- H5D_t *ret_value; /* Return value */
+ H5D_t *ret_value; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1227,19 +1230,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__create() */
-
+
/*
*-------------------------------------------------------------------------
- * Function: H5D_open
+ * Function: H5D_open
*
- * Purpose: Checks if dataset is already open, or opens a dataset for
+ * Purpose: Checks if dataset is already open, or opens a dataset for
* access.
*
- * Return: Success: Dataset ID
- * Failure: FAIL
+ * Return: Success: Dataset ID
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Friday, December 20, 2002
+ * Programmer: Quincey Koziol
+ * Friday, December 20, 2002
*
*-------------------------------------------------------------------------
*/
@@ -1349,16 +1352,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_open() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__open_oid
+ * Function: H5D__open_oid
*
- * Purpose: Opens a dataset for access.
+ * Purpose: Opens a dataset for access.
*
- * Return: Dataset pointer on success, NULL on failure
+ * Return: Dataset pointer on success, NULL on failure
*
- * Programmer: Quincey Koziol
- * Monday, October 12, 1998
+ * Programmer: Quincey Koziol
+ * Monday, October 12, 1998
*
*-------------------------------------------------------------------------
*/
@@ -1369,8 +1372,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */
unsigned alloc_time_state; /* Allocation time state */
htri_t msg_exists; /* Whether a particular type of message exists */
- hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
- herr_t ret_value = SUCCEED; /* Return value */
+ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1421,7 +1424,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message")
} /* end if */
else {
- /* For backward compatibility, try to retrieve the old fill value message */
+ /* For backward compatibility, try to retrieve the old fill value message */
if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID, dxpl_id)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists")
if(msg_exists) {
@@ -1485,7 +1488,7 @@ done:
if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc)) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(dataset->shared) {
- if(dataset->shared->layout.type == H5D_CHUNKED && layout_init)
+ if(dataset->shared->layout.type == H5D_CHUNKED && layout_init)
if(H5D__chunk_dest(dataset->oloc.file, dxpl_id, dataset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache")
if(dataset->shared->space && H5S_close(dataset->shared->space) < 0)
@@ -1506,18 +1509,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__open_oid() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_close
+ * Function: H5D_close
*
- * Purpose: Insures that all data has been saved to the file, closes the
- * dataset object header, and frees all resources used by the
- * descriptor.
+ * Purpose: Insures that all data has been saved to the file, closes the
+ * dataset object header, and frees all resources used by the
+ * descriptor.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, December 4, 1997
+ * Programmer: Robb Matzke
+ * Thursday, December 4, 1997
*
*-------------------------------------------------------------------------
*/
@@ -1576,7 +1579,7 @@ H5D_close(H5D_t *dataset)
dataset->shared->cache.chunk.single_chunk_info = NULL;
} /* end if */
- /* Flush and destroy chunks in the cache. Continue to close even if
+ /* Flush and destroy chunks in the cache. Continue to close even if
* it fails. */
if(H5D__chunk_dest(dataset->oloc.file, H5AC_dxpl_id, dataset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache")
@@ -1654,22 +1657,22 @@ H5D_close(H5D_t *dataset)
/* Check if anything failed in the middle... */
if(free_failed)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't free a component of the dataset, but the dataset was freed anyway.")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't free a component of the dataset, but the dataset was freed anyway.")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_close() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_oloc
+ * Function: H5D_oloc
*
- * Purpose: Returns a pointer to the object location for a dataset.
+ * Purpose: Returns a pointer to the object location for a dataset.
*
- * Return: Success: Ptr to location
- * Failure: NULL
+ * Return: Success: Ptr to location
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, April 24, 1998
*
*-------------------------------------------------------------------------
@@ -1683,16 +1686,16 @@ H5D_oloc(H5D_t *dataset)
FUNC_LEAVE_NOAPI(dataset ? &(dataset->oloc) : (H5O_loc_t *)NULL)
} /* end H5D_oloc() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_nameof
+ * Function: H5D_nameof
*
- * Purpose: Returns a pointer to the group hier. path for a dataset.
+ * Purpose: Returns a pointer to the group hier. path for a dataset.
*
- * Return: Success: Ptr to entry
- * Failure: NULL
+ * Return: Success: Ptr to entry
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, September 12, 2005
*
*-------------------------------------------------------------------------
@@ -1706,17 +1709,17 @@ H5D_nameof(H5D_t *dataset)
FUNC_LEAVE_NOAPI(dataset ? &(dataset->path) : (H5G_name_t *)NULL)
} /* end H5D_nameof() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_typeof
+ * Function: H5D_typeof
*
- * Purpose: Returns a pointer to the dataset's datatype. The datatype
- * is not copied.
+ * Purpose: Returns a pointer to the dataset's datatype. The datatype
+ * is not copied.
*
- * Return: Success: Ptr to the dataset's datatype, uncopied.
- * Failure: NULL
+ * Return: Success: Ptr to the dataset's datatype, uncopied.
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 4, 1998
*
*-------------------------------------------------------------------------
@@ -1734,15 +1737,15 @@ H5D_typeof(const H5D_t *dset)
FUNC_LEAVE_NOAPI(dset->shared->type)
} /* end H5D_typeof() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__alloc_storage
+ * Function: H5D__alloc_storage
*
- * Purpose: Allocate storage for the raw data of a dataset.
+ * Purpose: Allocate storage for the raw data of a dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, January 16, 1998
*
*-------------------------------------------------------------------------
@@ -1805,19 +1808,19 @@ H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc
} /* end if */
/* If space allocation is set to 'early' and we are extending
- * the dataset, indicate that space should be allocated, so the
+ * the dataset, indicate that space should be allocated, so the
* B-tree gets expanded. -QAK
*/
- if(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY
+ if(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY
&& time_alloc == H5D_ALLOC_EXTEND)
- must_init_space = TRUE;
+ must_init_space = TRUE;
break;
case H5D_COMPACT:
/* Check if space is already allocated */
if(NULL == layout->storage.u.compact.buf) {
- /* Reserve space in layout header message for the entire array.
- * Starting from the 1.8.7 release, we allow dataspace to have
+ /* Reserve space in layout header message for the entire array.
+ * Starting from the 1.8.7 release, we allow dataspace to have
* zero dimension size. So the storage size can be zero.
* SLU 2011/4/4 */
if(layout->storage.u.compact.size > 0) {
@@ -1862,7 +1865,7 @@ H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value")
} /* end if */
else {
- H5D_fill_value_t fill_status; /* The fill value status */
+ H5D_fill_value_t fill_status; /* The fill value status */
/* Check the dataset's fill-value status */
if(H5P_is_fill_value_defined(&dset->shared->dcpl_cache.fill, &fill_status) < 0)
@@ -1895,17 +1898,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__alloc_storage() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__init_storage
+ * Function: H5D__init_storage
*
- * Purpose: Initialize the data for a new dataset. If a selection is
- * defined for SPACE then initialize only that part of the
- * dataset.
+ * Purpose: Initialize the data for a new dataset. If a selection is
+ * defined for SPACE then initialize only that part of the
+ * dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, October 5, 1998
*
*-------------------------------------------------------------------------
@@ -1914,7 +1917,7 @@ static herr_t
H5D__init_storage(const H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[],
hid_t dxpl_id)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1968,16 +1971,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__init_storage() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__get_storage_size
+ * Function: H5D__get_storage_size
*
- * Purpose: Determines how much space has been reserved to store the raw
- * data of a dataset.
+ * Purpose: Determines how much space has been reserved to store the raw
+ * data of a dataset.
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
*-------------------------------------------------------------------------
@@ -1985,7 +1988,7 @@ done:
herr_t
H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2021,16 +2024,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_storage_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__get_offset
+ * Function: H5D__get_offset
*
- * Purpose: Private function for H5D__get_offset. Returns the address
+ * Purpose: Private function for H5D__get_offset. Returns the address
* of dataset in file.
*
- * Return: Success: the address of dataset
+ * Return: Success: the address of dataset
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
* Programmer: Raymond Lu
* November 6, 2002
@@ -2040,7 +2043,7 @@ done:
haddr_t
H5D__get_offset(const H5D_t *dset)
{
- haddr_t ret_value = HADDR_UNDEF;
+ haddr_t ret_value = HADDR_UNDEF;
FUNC_ENTER_PACKAGE
@@ -2069,18 +2072,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_offset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_vlen_reclaim
+ * Function: H5D_vlen_reclaim
*
- * Purpose: Frees the buffers allocated for storing variable-length data
+ * Purpose: Frees the buffers allocated for storing variable-length data
* in memory. Only frees the VL data in the selection defined in the
* dataspace. The dataset transfer property list is required to find the
* correct allocation/free methods for the VL data in the buffer.
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 22, 2005
*
*-------------------------------------------------------------------------
@@ -2120,18 +2123,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_vlen_reclaim() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__vlen_get_buf_size_alloc
+ * Function: H5D__vlen_get_buf_size_alloc
*
- * Purpose: This routine makes certain there is enough space in the temporary
+ * Purpose: This routine makes certain there is enough space in the temporary
* buffer for the new data to read in. All the VL data read in is actually
* placed in this buffer, overwriting the previous data. Needless to say,
* this data is not actually usable.
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 17, 1999
*
*-------------------------------------------------------------------------
@@ -2154,11 +2157,11 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__vlen_get_buf_size_alloc() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__vlen_get_buf_size
+ * Function: H5D__vlen_get_buf_size
*
- * Purpose: This routine checks the number of bytes required to store a single
+ * Purpose: This routine checks the number of bytes required to store a single
* element from a dataset in memory, creating a selection with just the
* single element selected to read in the element and using a custom memory
* allocator for any VL data encountered.
@@ -2173,9 +2176,9 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info)
* Kinda kludgy, but easier than the other method of trying to figure out
* the sizes without actually reading the data in... - QAK
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 17, 1999
*
*-------------------------------------------------------------------------
@@ -2213,16 +2216,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__vlen_get_buf_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__check_filters
+ * Function: H5D__check_filters
*
- * Purpose: Check if the filters have be initialized for the dataset
+ * Purpose: Check if the filters have be initialized for the dataset
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, October 11, 2007
+ * Programmer: Quincey Koziol
+ * Thursday, October 11, 2007
*
*-------------------------------------------------------------------------
*/
@@ -2267,14 +2270,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__check_filters() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__set_extent
+ * Function: H5D__set_extent
*
- * Purpose: Based on H5D_extend, allows change to a lower dimension,
- * calls H5S_set_extent and H5D__chunk_prune_by_extent instead
+ * Purpose: Based on H5D_extend, allows change to a lower dimension,
+ * calls H5S_set_extent and H5D__chunk_prune_by_extent instead
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
* April 9, 2002
@@ -2375,14 +2378,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__set_extent() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__flush_sieve_buf
*
* Purpose: Flush any dataset sieve buffer info cached in memory
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* July 27, 2009
@@ -2416,14 +2419,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__flush_sieve_buf() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__flush_real
*
* Purpose: Flush any dataset information cached in memory
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* December 6, 2007
@@ -2487,14 +2490,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__flush_real() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__mark
*
* Purpose: Mark some aspect of a dataset as dirty
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* July 4, 2008
@@ -2521,14 +2524,14 @@ H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__mark() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__flush_cb
*
* Purpose: Flush any dataset information cached in memory
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* November 8, 2007
@@ -2558,14 +2561,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__flush_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D_flush
*
* Purpose: Flush any dataset information cached in memory
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Ray Lu
* August 14, 2002
@@ -2595,20 +2598,20 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_flush() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_get_create_plist
+ * Function: H5D_get_create_plist
*
- * Purpose: Private function for H5Dget_create_plist
+ * Purpose: Private function for H5Dget_create_plist
*
- * Return: Success: ID for a copy of the dataset creation
- * property list. The template should be
- * released by calling H5P_close().
+ * Return: Success: ID for a copy of the dataset creation
+ * property list. The template should be
+ * released by calling H5P_close().
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Tuesday, February 3, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, February 3, 1998
*
*-------------------------------------------------------------------------
*/
@@ -2618,8 +2621,8 @@ H5D_get_create_plist(H5D_t *dset)
H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */
H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */
H5O_fill_t copied_fill; /* Fill value to tweak */
- hid_t new_dcpl_id = FAIL;
- hid_t ret_value; /* Return value */
+ hid_t new_dcpl_id = FAIL;
+ hid_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2712,19 +2715,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_get_create_plist() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_get_access_plist
+ * Function: H5D_get_access_plist
*
- * Purpose: Returns a copy of the dataset access property list.
+ * Purpose: Returns a copy of the dataset access property list.
*
- * Return: Success: ID for a copy of the dataset access
- * property list.
+ * Return: Success: ID for a copy of the dataset access
+ * property list.
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Mohamad Chaarawi
- * March, 2012
+ * Programmer: Mohamad Chaarawi
+ * March, 2012
*
*-------------------------------------------------------------------------
*/
@@ -2794,25 +2797,25 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_get_access_plist() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_get_space
+ * Function: H5D_get_space
*
- * Purpose: Returns and ID for the dataspace of the dataset.
+ * Purpose: Returns and ID for the dataspace of the dataset.
*
- * Return: Success: ID for dataspace
+ * Return: Success: ID for dataspace
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Mohamad Chaarawi
- * March, 2012
+ * Programmer: Mohamad Chaarawi
+ * March, 2012
*
*-------------------------------------------------------------------------
*/
hid_t
H5D_get_space(H5D_t *dset)
{
- H5S_t *space = NULL;
+ H5S_t *space = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
@@ -2834,25 +2837,25 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_get_space() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_get_type
+ * Function: H5D_get_type
*
- * Purpose: Returns and ID for the datatype of the dataset.
+ * Purpose: Returns and ID for the datatype of the dataset.
*
- * Return: Success: ID for datatype
+ * Return: Success: ID for datatype
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Mohamad Chaarawi
- * March, 2012
+ * Programmer: Mohamad Chaarawi
+ * March, 2012
*
*-------------------------------------------------------------------------
*/
hid_t
H5D_get_type(H5D_t *dset)
{
- H5T_t *dt = NULL;
+ H5T_t *dt = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index f6d770c..cf7b5bf 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, August 10, 1999
*
* Purpose: A driver which stores the HDF5 data in main memory using
@@ -82,7 +82,7 @@ typedef struct H5FD_core_t {
DWORD nFileIndexLow;
DWORD nFileIndexHigh;
DWORD dwVolumeSerialNumber;
-
+
HANDLE hFile; /* Native windows file handle */
#endif /* H5_HAVE_WIN32_API */
hbool_t dirty; /* changes not saved? */
@@ -177,7 +177,7 @@ static const H5FD_class_t H5FD_core_g = {
/* Define a free list to manage the region type */
H5FL_DEFINE(H5FD_core_region_t);
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_add_dirty_region
*
@@ -308,7 +308,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_add_dirty_region() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_destroy_dirty_list
*
@@ -350,7 +350,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_destroy_dirty_list() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_write_to_bstore
*
@@ -419,7 +419,7 @@ done:
} /* end H5FD_core_write_to_bstore() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_init_interface
*
@@ -438,7 +438,7 @@ H5FD_core_init_interface(void)
FUNC_LEAVE_NOAPI(H5FD_core_init())
} /* H5FD_core_init_interface() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_init
*
@@ -470,7 +470,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*---------------------------------------------------------------------------
* Function: H5FD_core_term
*
@@ -494,7 +494,7 @@ H5FD_core_term(void)
FUNC_LEAVE_NOAPI_VOID
} /* end H5FD_core_term() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_core
*
@@ -532,7 +532,7 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5Pget_fapl_core
*
@@ -571,7 +571,7 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_fapl_get
*
@@ -608,7 +608,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_open
*
@@ -672,9 +672,9 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) {
if(HDopen(name, o_flags, 0666) >= 0)
HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists")
-
+
/* If backing store is requested, create and stat the file
- * Note: We are forcing the O_CREAT flag here, even though this is
+ * Note: We are forcing the O_CREAT flag here, even though this is
* technically an open.
*/
if(fa->backing_store) {
@@ -771,13 +771,13 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
/* Read in existing data, being careful of interrupted system calls,
* partial results, and the end of the file.
*/
-
+
uint8_t *mem = file->mem; /* memory pointer for writes */
-
+
while(size > 0) {
h5_posix_io_t bytes_in = 0; /* # of bytes to read */
h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
-
+
/* Trying to read more bytes than the return type can handle is
* undefined behavior in POSIX.
*/
@@ -785,11 +785,11 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
bytes_in = H5_POSIX_MAX_IO_BYTES;
else
bytes_in = (h5_posix_io_t)size;
-
+
do {
bytes_read = HDread(file->fd, mem, bytes_in);
} while(-1 == bytes_read && EINTR == errno);
-
+
if(-1 == bytes_read) { /* error */
int myerrno = errno;
time_t mytime = HDtime(NULL);
@@ -797,10 +797,10 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)myoffset);
} /* end if */
-
+
HDassert(bytes_read >= 0);
HDassert((size_t)bytes_read <= size);
-
+
mem += bytes_read;
size -= (size_t)bytes_read;
} /* end while */
@@ -827,7 +827,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
* on open (when not read-only).
*/
/* Only use write tracking if the file is open for writing */
- use_write_tracking =
+ use_write_tracking =
TRUE == write_tracking_flag /* user asked for write tracking */
&& !(o_flags & O_RDONLY) /* file is open for writing (i.e. not read-only) */
&& file->bstore_page_size != 0; /* page size is not zero */
@@ -857,7 +857,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_open() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_close
*
@@ -908,7 +908,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_close() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_cmp
*
@@ -987,7 +987,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_cmp() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_query
*
@@ -1008,6 +1008,7 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */)
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* clang-format off */
/* Set the VFL feature flags that this driver supports */
if(flags) {
*flags = 0;
@@ -1022,11 +1023,12 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */)
if(file && file->fd >= 0 && file->backing_store)
*flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */
} /* end if */
+ /* clang-format on */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_core_query() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_get_eoa
*
@@ -1051,7 +1053,7 @@ H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_LEAVE_NOAPI(file->eoa)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_set_eoa
*
@@ -1083,7 +1085,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_set_eoa() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_get_eof
*
@@ -1110,7 +1112,7 @@ H5FD_core_get_eof(const H5FD_t *_file)
FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa))
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_get_handle
*
@@ -1170,7 +1172,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_get_handle() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_read
*
@@ -1233,7 +1235,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_write
*
@@ -1315,7 +1317,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_core_write() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_flush
*
@@ -1363,11 +1365,11 @@ HDfprintf(stderr, "(%llu, %llu : %lu)\n", item->start, item->end, size);
if(H5FD_core_write_to_bstore(file, item->start, size) != SUCCEED)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store")
} /* end if */
-
+
item = H5FL_FREE(H5FD_core_region_t, item);
} /* end while */
-
+
#ifdef DER
HDfprintf(stderr, "EOF: %llu\n", file->eof);
HDfprintf(stderr, "EOA: %llu\n", file->eoa);
@@ -1390,7 +1392,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_core_truncate
*
@@ -1398,24 +1400,24 @@ done:
* than the end-of-address.
*
* Addendum -- 12/2/11
- * For file images opened with the core file driver, it is
+ * For file images opened with the core file driver, it is
* necessary that we avoid reallocating the core file driver's
* buffer uneccessarily.
*
* To this end, I have made the following functional changes
- * to this function.
+ * to this function.
*
- * If we are closing, and there is no backing store, this
+ * If we are closing, and there is no backing store, this
* function becomes a no-op.
*
* If we are closing, and there is backing store, we set the
- * eof to equal the eoa, and truncate the backing store to
+ * eof to equal the eoa, and truncate the backing store to
* the new eof
*
- * 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
+ * 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
* new eof if applicable.
* -- JRM
*
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 269441a..cd07bc2 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -12,62 +12,62 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Monday, November 10, 1997
- *
- * Purpose: Implements a family of files that acts as a single hdf5
- * file. The purpose is to be able to split a huge file on a
- * 64-bit platform, transfer all the <2GB members to a 32-bit
- * platform, and then access the entire huge file on the 32-bit
- * platform.
- *
- * All family members are logically the same size although their
- * physical sizes may vary. The logical member size is
- * determined by looking at the physical size of the first member
- * when the file is opened. When creating a file family, the
- * first member is created with a predefined physical size
- * (actually, this happens when the file family is flushed, and
- * can be quite time consuming on file systems that don't
- * implement holes, like nfs).
+ * Programmer: Robb Matzke
+ * Monday, November 10, 1997
+ *
+ * Purpose: Implements a family of files that acts as a single hdf5
+ * file. The purpose is to be able to split a huge file on a
+ * 64-bit platform, transfer all the <2GB members to a 32-bit
+ * platform, and then access the entire huge file on the 32-bit
+ * platform.
+ *
+ * All family members are logically the same size although their
+ * physical sizes may vary. The logical member size is
+ * determined by looking at the physical size of the first member
+ * when the file is opened. When creating a file family, the
+ * first member is created with a predefined physical size
+ * (actually, this happens when the file family is flushed, and
+ * can be quite time consuming on file systems that don't
+ * implement holes, like nfs).
*
*/
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5FD_family_init_interface
+#define H5_INTERFACE_INIT_FUNC H5FD_family_init_interface
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDfamily.h" /* Family file driver */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDfamily.h" /* Family file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#undef MAX
-#define MAX(X,Y) ((X)>(Y)?(X):(Y))
+#define MAX(X,Y) ((X)>(Y)?(X):(Y))
#undef MIN
-#define MIN(X,Y) ((X)<(Y)?(X):(Y))
+#define MIN(X,Y) ((X)<(Y)?(X):(Y))
/* The driver identification number, initialized at runtime */
static hid_t H5FD_FAMILY_g = 0;
/* The description of a file belonging to this driver. */
typedef struct H5FD_family_t {
- H5FD_t pub; /*public stuff, must be first */
- hid_t memb_fapl_id; /*file access property list for members */
- hsize_t memb_size; /*actual size of each member file */
- hsize_t pmem_size; /*member size passed in from property */
- unsigned nmembs; /*number of family members */
- unsigned amembs; /*number of member slots allocated */
- H5FD_t **memb; /*dynamic array of member pointers */
- haddr_t eoa; /*end of allocated addresses */
- char *name; /*name generator printf format */
- unsigned flags; /*flags for opening additional members */
+ H5FD_t pub; /*public stuff, must be first */
+ hid_t memb_fapl_id; /*file access property list for members */
+ hsize_t memb_size; /*actual size of each member file */
+ hsize_t pmem_size; /*member size passed in from property */
+ unsigned nmembs; /*number of family members */
+ unsigned amembs; /*number of member slots allocated */
+ H5FD_t **memb; /*dynamic array of member pointers */
+ haddr_t eoa; /*end of allocated addresses */
+ char *name; /*name generator printf format */
+ unsigned flags; /*flags for opening additional members */
/* Information from properties set by 'h5repart' tool */
- hsize_t mem_newsize; /*new member size passed in as private
+ hsize_t mem_newsize; /*new member size passed in as private
* property. It's used only by h5repart */
hbool_t repart_members; /* Whether to mark the superblock dirty
* when it is loaded, so that the family
@@ -76,8 +76,8 @@ typedef struct H5FD_family_t {
/* Driver-specific file access properties */
typedef struct H5FD_family_fapl_t {
- hsize_t memb_size; /*size of each member */
- hid_t memb_fapl_id; /*file access property list of each memb*/
+ hsize_t memb_size; /*size of each member */
+ hid_t memb_fapl_id; /*file access property list of each memb*/
} H5FD_family_fapl_t;
/* Callback prototypes */
@@ -86,11 +86,11 @@ static void *H5FD_family_fapl_copy(const void *_old_fa);
static herr_t H5FD_family_fapl_free(void *_fa);
static hsize_t H5FD_family_sb_size(H5FD_t *_file);
static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/,
- unsigned char *buf/*out*/);
+ unsigned char *buf/*out*/);
static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name,
const unsigned char *buf);
static H5FD_t *H5FD_family_open(const char *name, unsigned flags,
- hid_t fapl_id, haddr_t maxaddr);
+ hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_family_close(H5FD_t *_file);
static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags);
@@ -99,48 +99,48 @@ static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa);
static haddr_t H5FD_family_get_eof(const H5FD_t *_file);
static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- size_t size, void *_buf/*out*/);
+ size_t size, void *_buf/*out*/);
static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- size_t size, const void *_buf);
+ size_t size, const void *_buf);
static herr_t H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
static herr_t H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
/* The class struct */
static const H5FD_class_t H5FD_family_g = {
- "family", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /*fc_degree */
- H5FD_family_sb_size, /*sb_size */
- H5FD_family_sb_encode, /*sb_encode */
- H5FD_family_sb_decode, /*sb_decode */
- sizeof(H5FD_family_fapl_t), /*fapl_size */
- H5FD_family_fapl_get, /*fapl_get */
- H5FD_family_fapl_copy, /*fapl_copy */
- H5FD_family_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_family_open, /*open */
- H5FD_family_close, /*close */
- H5FD_family_cmp, /*cmp */
- H5FD_family_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_family_get_eoa, /*get_eoa */
- H5FD_family_set_eoa, /*set_eoa */
- H5FD_family_get_eof, /*get_eof */
+ "family", /*name */
+ HADDR_MAX, /*maxaddr */
+ H5F_CLOSE_WEAK, /*fc_degree */
+ H5FD_family_sb_size, /*sb_size */
+ H5FD_family_sb_encode, /*sb_encode */
+ H5FD_family_sb_decode, /*sb_decode */
+ sizeof(H5FD_family_fapl_t), /*fapl_size */
+ H5FD_family_fapl_get, /*fapl_get */
+ H5FD_family_fapl_copy, /*fapl_copy */
+ H5FD_family_fapl_free, /*fapl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
+ H5FD_family_open, /*open */
+ H5FD_family_close, /*close */
+ H5FD_family_cmp, /*cmp */
+ H5FD_family_query, /*query */
+ NULL, /*get_type_map */
+ NULL, /*alloc */
+ NULL, /*free */
+ H5FD_family_get_eoa, /*get_eoa */
+ H5FD_family_set_eoa, /*set_eoa */
+ H5FD_family_get_eof, /*get_eof */
H5FD_family_get_handle, /*get_handle */
- H5FD_family_read, /*read */
- H5FD_family_write, /*write */
- H5FD_family_flush, /*flush */
- H5FD_family_truncate, /*truncate */
+ H5FD_family_read, /*read */
+ H5FD_family_write, /*write */
+ H5FD_family_flush, /*flush */
+ H5FD_family_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
H5FD_FLMAP_DICHOTOMY /*fl_map */
};
-
+
/*--------------------------------------------------------------------------
NAME
H5FD_family_init_interface -- Initialize interface-specific information
@@ -162,18 +162,18 @@ H5FD_family_init_interface(void)
FUNC_LEAVE_NOAPI(H5FD_family_init())
} /* H5FD_family_init_interface() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_init
+ * Function: H5FD_family_init
*
- * Purpose: Initialize this driver by registering the driver with the
- * library.
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
*
- * Return: Success: The driver ID for the family driver.
+ * Return: Success: The driver ID for the family driver.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -197,13 +197,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_family_init() */
-
+
/*---------------------------------------------------------------------------
- * Function: H5FD_family_term
+ * Function: H5FD_family_term
*
- * Purpose: Shut down the VFD
+ * Purpose: Shut down the VFD
*
- * Return: <none>
+ * Return: <none>
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
@@ -223,29 +223,29 @@ H5FD_family_term(void)
FUNC_LEAVE_NOAPI_VOID
} /* end H5FD_family_term() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_family
+ * Function: H5Pset_fapl_family
*
- * Purpose: Sets the file access property list FAPL_ID to use the family
- * driver. The MEMB_SIZE is the size in bytes of each file
- * member (used only when creating a new file) and the
- * MEMB_FAPL_ID is a file access property list to be used for
- * each family member.
+ * Purpose: Sets the file access property list FAPL_ID to use the family
+ * driver. The MEMB_SIZE is the size in bytes of each file
+ * member (used only when creating a new file) and the
+ * MEMB_FAPL_ID is a file access property list to be used for
+ * each family member.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
@@ -253,7 +253,7 @@ herr_t
H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id)
{
herr_t ret_value;
- H5FD_family_fapl_t fa={0, -1};
+ H5FD_family_fapl_t fa={0, -1};
H5P_genplist_t *plist; /* Property list pointer */
FUNC_ENTER_API(FAIL)
@@ -284,34 +284,34 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_family
+ * Function: H5Pget_fapl_family
*
- * Purpose: Returns information about the family file access property
- * list though the function arguments.
+ * Purpose: Returns information about the family file access property
+ * list though the function arguments.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Raymond Lu
+ * Tuesday, Oct 23, 2001
+ * Changed the file access list to the new generic property
+ * list.
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/,
- hid_t *memb_fapl_id/*out*/)
+ hid_t *memb_fapl_id/*out*/)
{
- H5FD_family_fapl_t *fa;
+ H5FD_family_fapl_t *fa;
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -336,18 +336,18 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_get
+ * Function: H5FD_family_fapl_get
*
- * Purpose: Gets a file access property list which could be used to
- * create an identical file.
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
*
- * Return: Success: Ptr to new file access property list.
+ * Return: Success: Ptr to new file access property list.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
* Modifications:
@@ -357,8 +357,8 @@ done:
static void *
H5FD_family_fapl_get(H5FD_t *_file)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- H5FD_family_fapl_t *fa = NULL;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ H5FD_family_fapl_t *fa = NULL;
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value; /* Return value */
@@ -383,17 +383,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_copy
+ * Function: H5FD_family_fapl_copy
*
- * Purpose: Copies the family-specific file access properties.
+ * Purpose: Copies the family-specific file access properties.
*
- * Return: Success: Ptr to a new property list
+ * Return: Success: Ptr to a new property list
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -438,17 +438,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_free
+ * Function: H5FD_family_fapl_free
*
- * Purpose: Frees the family-specific file access properties.
+ * Purpose: Frees the family-specific file access properties.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -458,7 +458,7 @@ done:
static herr_t
H5FD_family_fapl_free(void *_fa)
{
- H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa;
+ H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -471,18 +471,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_size
+ * Function: H5FD_family_sb_size
*
- * Purpose: Returns the size of the private information to be stored in
- * the superblock.
+ * Purpose: Returns the size of the private information to be stored in
+ * the superblock.
*
- * Return: Success: The super block driver data size.
+ * Return: Success: The super block driver data size.
*
- * Failure: never fails
+ * Failure: never fails
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
* Modifications:
@@ -499,21 +499,21 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
FUNC_LEAVE_NOAPI(8)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_encode
+ * Function: H5FD_family_sb_encode
*
- * Purpose: Encode driver information for the superblock. The NAME
- * argument is a nine-byte buffer which will be initialized with
- * an eight-character name/version number and null termination.
+ * Purpose: Encode driver information for the superblock. The NAME
+ * argument is a nine-byte buffer which will be initialized with
+ * an eight-character name/version number and null termination.
*
- * The encoding is the member file size and name template.
+ * The encoding is the member file size and name template.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
* Modifications:
@@ -523,7 +523,7 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
static herr_t
H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -544,21 +544,21 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_family_sb_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_decode
+ * 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
* information in the superblock.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
*-------------------------------------------------------------------------
@@ -566,7 +566,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
static herr_t
H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
uint64_t msize;
herr_t ret_value = SUCCEED; /* Return value */
@@ -604,19 +604,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_sb_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_open
+ * Function: H5FD_family_open
*
- * Purpose: Creates and/or opens a family of files as an HDF5 file.
+ * Purpose: Creates and/or opens a family of files as an HDF5 file.
*
- * Return: Success: A pointer to a new file dat structure. The
- * public fields will be initialized by the
- * caller, which is always H5FD_open().
+ * Return: Success: A pointer to a new file dat structure. The
+ * public fields will be initialized by the
+ * caller, which is always H5FD_open().
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -638,15 +638,22 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 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")
static H5FD_t *
H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
- haddr_t maxaddr)
+ haddr_t maxaddr)
{
- H5FD_family_t *file=NULL;
- H5FD_t *ret_value=NULL;
- char memb_name[4096], temp[4096];
- hsize_t eof=HADDR_UNDEF;
- unsigned t_flags = flags & ~H5F_ACC_CREAT;
+ H5FD_family_t *file=NULL;
+ H5FD_t *ret_value=NULL;
+ char memb_name[4096], temp[4096];
+ hsize_t eof=HADDR_UNDEF;
+ unsigned t_flags = flags & ~H5F_ACC_CREAT;
FUNC_ENTER_NOAPI_NOINIT
@@ -779,20 +786,21 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_open() */
+H5_GCC_DIAG_ON("format-nonliteral")
+
-
/*-------------------------------------------------------------------------
- * Function: H5FD_family_close
+ * Function: H5FD_family_close
*
- * Purpose: Closes a family of files.
+ * Purpose: Closes a family of files.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative with as many members closed as
- * possible. The only subsequent operation
- * permitted on the file is a close operation.
+ * Failure: Negative with as many members closed as
+ * possible. The only subsequent operation
+ * permitted on the file is a close operation.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -801,8 +809,8 @@ static herr_t
H5FD_family_close(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
- unsigned nerrors = 0; /* Number of errors while closing member files */
- unsigned u; /* Local index variable */
+ unsigned nerrors = 0; /* Number of errors while closing member files */
+ unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -832,19 +840,19 @@ H5FD_family_close(H5FD_t *_file)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_close() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_cmp
+ * Function: H5FD_family_cmp
*
- * Purpose: Compares two file families to see if they are the same. It
- * does this by comparing the first member of the two families.
+ * Purpose: Compares two file families to see if they are the same. It
+ * does this by comparing the first member of the two families.
*
- * Return: Success: like strcmp()
+ * Return: Success: like strcmp()
*
- * Failure: never fails (arguments were checked by the
- * caller).
+ * Failure: never fails (arguments were checked by the
+ * caller).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -854,8 +862,8 @@ H5FD_family_close(H5FD_t *_file)
static int
H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
- const H5FD_family_t *f1 = (const H5FD_family_t*)_f1;
- const H5FD_family_t *f2 = (const H5FD_family_t*)_f2;
+ const H5FD_family_t *f1 = (const H5FD_family_t*)_f1;
+ const H5FD_family_t *f2 = (const H5FD_family_t*)_f2;
int ret_value=(H5FD_VFD_DEFAULT);
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -869,17 +877,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_query
+ * Function: H5FD_family_query
*
- * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 25, 2000
*
*-------------------------------------------------------------------------
@@ -888,7 +896,7 @@ done:
static herr_t
H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
{
- const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */
+ const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -908,19 +916,19 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_family_query() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eoa
+ * Function: H5FD_family_get_eoa
*
- * Purpose: Returns the end-of-address marker for the file. The EOA
- * marker is the first address past the last byte allocated in
- * the format address space.
+ * Purpose: Returns the end-of-address marker for the file. The EOA
+ * marker is the first address past the last byte allocated in
+ * the format address space.
*
- * Return: Success: The end-of-address-marker
+ * Return: Success: The end-of-address-marker
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -933,24 +941,24 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
static haddr_t
H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
- const H5FD_family_t *file = (const H5FD_family_t*)_file;
+ const H5FD_family_t *file = (const H5FD_family_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_set_eoa
+ * Function: H5FD_family_set_eoa
*
- * Purpose: Set the end-of-address marker for the file.
+ * Purpose: Set the end-of-address marker for the file.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -960,13 +968,20 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() call with
+ * 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")
static herr_t
H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- haddr_t addr = abs_eoa;
- char memb_name[4096];
- unsigned u; /* Local index variable */
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ haddr_t addr = abs_eoa;
+ char memb_name[4096];
+ unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1018,21 +1033,22 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
done:
FUNC_LEAVE_NOAPI(ret_value)
}
+H5_GCC_DIAG_ON("format-nonliteral")
+
-
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eof
+ * Function: H5FD_family_get_eof
*
- * Purpose: Returns the end-of-file marker, which is the greater of
- * either the total family size or the current EOA marker.
+ * Purpose: Returns the end-of-file marker, which is the greater of
+ * either the total family size or the current EOA marker.
*
- * Return: Success: End of file address, the first address past
- * the end of the family of files or the current
- * EOA, whichever is larger.
+ * Return: Success: End of file address, the first address past
+ * the end of the family of files or the current
+ * EOA, whichever is larger.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -1042,9 +1058,9 @@ done:
static haddr_t
H5FD_family_get_eof(const H5FD_t *_file)
{
- const H5FD_family_t *file = (const H5FD_family_t*)_file;
- haddr_t eof=0;
- int i; /* Local index variable */
+ const H5FD_family_t *file = (const H5FD_family_t*)_file;
+ haddr_t eof=0;
+ int i; /* Local index variable */
haddr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1077,7 +1093,7 @@ H5FD_family_get_eof(const H5FD_t *_file)
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_family_get_handle
*
@@ -1119,20 +1135,20 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_read
+ * Function: H5FD_family_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero. Result is stored in caller-supplied
- * buffer BUF.
+ * 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
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -1141,14 +1157,14 @@ done:
*/
static herr_t
H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *_buf/*out*/)
+ void *_buf/*out*/)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- unsigned char *buf = (unsigned char*)_buf;
- haddr_t sub;
- size_t req;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ unsigned char *buf = (unsigned char*)_buf;
+ haddr_t sub;
+ size_t req;
hsize_t tempreq;
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -1167,12 +1183,12 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
sub = addr % file->memb_size;
- /* This check is for mainly for IA32 architecture whose size_t's size
- * is 4 bytes, to prevent overflow when user application is trying to
- * write files bigger than 4GB. */
+ /* This check is for mainly for IA32 architecture whose size_t's size
+ * is 4 bytes, to prevent overflow when user application is trying to
+ * write files bigger than 4GB. */
tempreq = file->memb_size-sub;
- if(tempreq > SIZET_MAX)
- tempreq = SIZET_MAX;
+ if(tempreq > SIZET_MAX)
+ tempreq = SIZET_MAX;
req = MIN(size, (size_t)tempreq);
HDassert(u<file->nmembs);
@@ -1189,19 +1205,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_write
+ * Function: H5FD_family_write
*
- * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
- * from buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
+ * from buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero
+ * Return: Success: Zero
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -1210,14 +1226,14 @@ done:
*/
static herr_t
H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *_buf)
+ const void *_buf)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- const unsigned char *buf = (const unsigned char*)_buf;
- haddr_t sub;
- size_t req;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ const unsigned char *buf = (const unsigned char*)_buf;
+ haddr_t sub;
+ size_t req;
hsize_t tempreq;
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1240,8 +1256,8 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
* is 4 bytes, to prevent overflow when user application is trying to
* write files bigger than 4GB. */
tempreq = file->memb_size-sub;
- if(tempreq > SIZET_MAX)
- tempreq = SIZET_MAX;
+ if(tempreq > SIZET_MAX)
+ tempreq = SIZET_MAX;
req = MIN(size, (size_t)tempreq);
HDassert(u<file->nmembs);
@@ -1258,16 +1274,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_flush
+ * Function: H5FD_family_flush
*
- * Purpose: Flushes all family members.
+ * Purpose: Flushes all family members.
*
- * Return: Success: 0
- * Failure: -1, as many files flushed as possible.
+ * Return: Success: 0
+ * Failure: -1, as many files flushed as possible.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1275,8 +1291,8 @@ done:
static herr_t
H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- unsigned u, nerrors = 0;
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ unsigned u, nerrors = 0;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1292,17 +1308,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_flush() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_family_truncate
+ * Function: H5FD_family_truncate
*
- * Purpose: Truncates all family members.
+ * Purpose: Truncates all family members.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1, as many files truncated as possible.
+ * Failure: -1, as many files truncated as possible.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 23, 2008
*
*-------------------------------------------------------------------------
@@ -1310,9 +1326,9 @@ done:
static herr_t
H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
{
- H5FD_family_t *file = (H5FD_family_t*)_file;
- unsigned u, nerrors = 0;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ unsigned u, nerrors = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 0c48466..41af084 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -12,15 +12,15 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Monday, November 10, 1997
- *
- * Purpose: Implements a file driver which dispatches I/O requests to
- * other file drivers depending on the purpose of the address
- * region being accessed. For instance, all meta-data could be
- * place in one file while all raw data goes to some other file.
- * This also serves as an example of coding a complex file driver,
- * therefore, it should not use any non-public definitions.
+ * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Monday, November 10, 1997
+ *
+ * Purpose: Implements a file driver which dispatches I/O requests to
+ * other file drivers depending on the purpose of the address
+ * region being accessed. For instance, all meta-data could be
+ * place in one file while all raw data goes to some other file.
+ * This also serves as an example of coding a complex file driver,
+ * therefore, it should not use any non-public definitions.
*/
#include <assert.h>
#include <stdlib.h>
@@ -36,26 +36,26 @@
/* Our version of MAX */
#undef MAX
-#define MAX(X,Y) ((X)>(Y)?(X):(Y))
+#define MAX(X,Y) ((X)>(Y)?(X):(Y))
#ifndef FALSE
-#define FALSE 0
+#define FALSE 0
#endif
#ifndef TRUE
-#define TRUE 1
+#define TRUE 1
#endif
/* Loop through all mapped files */
-#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \
- H5FD_mem_t ITER, LOOPVAR; \
- unsigned SEEN[H5FD_MEM_NTYPES]; \
- \
- memset(SEEN, 0, sizeof SEEN); \
+#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \
+ H5FD_mem_t ITER, LOOPVAR; \
+ unsigned SEEN[H5FD_MEM_NTYPES]; \
+ \
+ memset(SEEN, 0, sizeof SEEN); \
for (ITER=H5FD_MEM_SUPER; ITER<H5FD_MEM_NTYPES; ITER=(H5FD_mem_t)(ITER+1)) { \
- LOOPVAR = MAP[ITER]; \
- if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=ITER; \
- assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \
- if (SEEN[LOOPVAR]++) continue; \
+ LOOPVAR = MAP[ITER]; \
+ if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=ITER; \
+ assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \
+ if (SEEN[LOOPVAR]++) continue; \
/* Need two front-ends, since they are nested sometimes */
#define UNIQUE_MEMBERS(MAP, LOOPVAR) \
@@ -63,12 +63,12 @@
#define UNIQUE_MEMBERS2(MAP, LOOPVAR) \
UNIQUE_MEMBERS_CORE(MAP, _unmapped2, _seen2, LOOPVAR)
-#define ALL_MEMBERS(LOOPVAR) { \
- H5FD_mem_t LOOPVAR; \
+#define ALL_MEMBERS(LOOPVAR) { \
+ H5FD_mem_t LOOPVAR; \
for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR=(H5FD_mem_t)(LOOPVAR+1)) {
-#define END_MEMBERS }}
+#define END_MEMBERS }}
#define H5FD_MULT_MAX_FILE_NAME_LEN 1024
@@ -81,7 +81,7 @@ typedef struct H5FD_multi_fapl_t {
hid_t memb_fapl[H5FD_MEM_NTYPES]; /*member access properties */
char *memb_name[H5FD_MEM_NTYPES]; /*name generators */
haddr_t memb_addr[H5FD_MEM_NTYPES]; /*starting addr per member */
- hbool_t relax; /*less stringent error checking */
+ hbool_t relax; /*less stringent error checking */
} H5FD_multi_fapl_t;
/*
@@ -96,7 +96,7 @@ typedef struct H5FD_multi_t {
haddr_t memb_next[H5FD_MEM_NTYPES]; /*addr of next member */
H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */
haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files,
- *end of allocated addresses. v1.6 library
+ *end of allocated addresses. v1.6 library
*have the EOA for the entire file. But it's
*meaningless for MULTI file. We replaced it
*with the EOAs for individual files */
@@ -106,7 +106,7 @@ typedef struct H5FD_multi_t {
/* Driver specific data transfer properties */
typedef struct H5FD_multi_dxpl_t {
- hid_t memb_dxpl[H5FD_MEM_NTYPES];/*member data xfer properties*/
+ hid_t memb_dxpl[H5FD_MEM_NTYPES];/*member data xfer properties*/
} H5FD_multi_dxpl_t;
/* Private functions */
@@ -117,14 +117,14 @@ static int open_members(H5FD_multi_t *file);
/* Callback prototypes */
static hsize_t H5FD_multi_sb_size(H5FD_t *file);
static herr_t H5FD_multi_sb_encode(H5FD_t *file, char *name/*out*/,
- unsigned char *buf/*out*/);
+ unsigned char *buf/*out*/);
static herr_t H5FD_multi_sb_decode(H5FD_t *file, const char *name,
- const unsigned char *buf);
+ const unsigned char *buf);
static void *H5FD_multi_fapl_get(H5FD_t *file);
static void *H5FD_multi_fapl_copy(const void *_old_fa);
static herr_t H5FD_multi_fapl_free(void *_fa);
static H5FD_t *H5FD_multi_open(const char *name, unsigned flags,
- hid_t fapl_id, haddr_t maxaddr);
+ hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_multi_close(H5FD_t *_file);
static int H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
static herr_t H5FD_multi_query(const H5FD_t *_f1, unsigned long *flags);
@@ -135,60 +135,60 @@ static haddr_t H5FD_multi_get_eof(const H5FD_t *_file);
static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- hsize_t size);
+ hsize_t size);
static herr_t H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- size_t size, void *_buf/*out*/);
+ size_t size, void *_buf/*out*/);
static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- size_t size, const void *_buf);
+ size_t size, const void *_buf);
static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
/* The class struct */
static const H5FD_class_t H5FD_multi_g = {
- "multi", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_multi_sb_size, /*sb_size */
- H5FD_multi_sb_encode, /*sb_encode */
- H5FD_multi_sb_decode, /*sb_decode */
- sizeof(H5FD_multi_fapl_t), /*fapl_size */
- H5FD_multi_fapl_get, /*fapl_get */
- H5FD_multi_fapl_copy, /*fapl_copy */
- H5FD_multi_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_multi_open, /*open */
- H5FD_multi_close, /*close */
- H5FD_multi_cmp, /*cmp */
- H5FD_multi_query, /*query */
- H5FD_multi_get_type_map, /*get_type_map */
- H5FD_multi_alloc, /*alloc */
- H5FD_multi_free, /*free */
- H5FD_multi_get_eoa, /*get_eoa */
- H5FD_multi_set_eoa, /*set_eoa */
- H5FD_multi_get_eof, /*get_eof */
+ "multi", /*name */
+ HADDR_MAX, /*maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_multi_sb_size, /*sb_size */
+ H5FD_multi_sb_encode, /*sb_encode */
+ H5FD_multi_sb_decode, /*sb_decode */
+ sizeof(H5FD_multi_fapl_t), /*fapl_size */
+ H5FD_multi_fapl_get, /*fapl_get */
+ H5FD_multi_fapl_copy, /*fapl_copy */
+ H5FD_multi_fapl_free, /*fapl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
+ H5FD_multi_open, /*open */
+ H5FD_multi_close, /*close */
+ H5FD_multi_cmp, /*cmp */
+ H5FD_multi_query, /*query */
+ H5FD_multi_get_type_map, /*get_type_map */
+ H5FD_multi_alloc, /*alloc */
+ H5FD_multi_free, /*free */
+ H5FD_multi_get_eoa, /*get_eoa */
+ H5FD_multi_set_eoa, /*set_eoa */
+ H5FD_multi_get_eof, /*get_eof */
H5FD_multi_get_handle, /*get_handle */
- H5FD_multi_read, /*read */
- H5FD_multi_write, /*write */
- H5FD_multi_flush, /*flush */
- H5FD_multi_truncate, /*truncate */
+ H5FD_multi_read, /*read */
+ H5FD_multi_write, /*write */
+ H5FD_multi_flush, /*flush */
+ H5FD_multi_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_DEFAULT /*fl_map */
+ H5FD_FLMAP_DEFAULT /*fl_map */
};
-
+
/*-------------------------------------------------------------------------
- * Function: my_strdup
+ * Function: my_strdup
*
- * Purpose: Private version of strdup()
+ * Purpose: Private version of strdup()
*
- * Return: Success: Ptr to new copy of string
+ * Return: Success: Ptr to new copy of string
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
@@ -209,18 +209,18 @@ my_strdup(const char *s)
return x;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_init
+ * Function: H5FD_multi_init
*
- * Purpose: Initialize this driver by registering the driver with the
- * library.
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
*
- * Return: Success: The driver ID for the multi driver.
+ * Return: Success: The driver ID for the multi driver.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -237,13 +237,13 @@ H5FD_multi_init(void)
return H5FD_MULTI_g;
}
-
+
/*---------------------------------------------------------------------------
- * Function: H5FD_multi_term
+ * Function: H5FD_multi_term
*
- * Purpose: Shut down the VFD
+ * Purpose: Shut down the VFD
*
- * Return: <none>
+ * Return: <none>
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
@@ -258,33 +258,33 @@ H5FD_multi_term(void)
} /* end H5FD_multi_term() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_split
+ * Function: H5Pset_fapl_split
*
- * Purpose: Compatibility function. Makes the multi driver act like the
- * old split driver which stored meta data in one file and raw
- * data in another file.
+ * Purpose: Compatibility function. Makes the multi driver act like the
+ * old split driver which stored meta data in one file and raw
+ * data in another file.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 11, 1999
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
- const char *raw_ext, hid_t raw_plist_id)
+ const char *raw_ext, hid_t raw_plist_id)
{
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN];
- char raw_name[H5FD_MULT_MAX_FILE_NAME_LEN];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
+ H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
+ hid_t memb_fapl[H5FD_MEM_NTYPES];
+ const char *memb_name[H5FD_MEM_NTYPES];
+ char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN];
+ char raw_name[H5FD_MULT_MAX_FILE_NAME_LEN];
+ haddr_t memb_addr[H5FD_MEM_NTYPES];
/*NO TRACE*/
@@ -293,11 +293,11 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
/* Initialize */
ALL_MEMBERS(mt) {
- /* Treat global heap as raw data, not metadata */
- memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER);
- memb_fapl[mt] = -1;
- memb_name[mt] = NULL;
- memb_addr[mt] = HADDR_UNDEF;
+ /* Treat global heap as raw data, not metadata */
+ memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER);
+ memb_fapl[mt] = -1;
+ memb_name[mt] = NULL;
+ memb_addr[mt] = HADDR_UNDEF;
} END_MEMBERS;
/* The file access properties */
@@ -307,36 +307,36 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
/* The names */
/* process meta filename */
if(meta_ext) {
- if(strstr(meta_ext, "%s")) {
+ if(strstr(meta_ext, "%s")) {
/* Note: this doesn't accommodate for when the '%s' in the user's
* string is at a position >sizeof(meta_name) - QK & JK - 2013/01/17
*/
- strncpy(meta_name, meta_ext, sizeof(meta_name));
+ strncpy(meta_name, meta_ext, sizeof(meta_name));
meta_name[sizeof(meta_name) - 1] = '\0';
}
- else
- sprintf(meta_name, "%%s%s", meta_ext);
+ else
+ sprintf(meta_name, "%%s%s", meta_ext);
}
else {
- strncpy(meta_name, "%s.meta", sizeof(meta_name));
+ strncpy(meta_name, "%s.meta", sizeof(meta_name));
meta_name[sizeof(meta_name) - 1] = '\0';
}
memb_name[H5FD_MEM_SUPER] = meta_name;
/* process raw filename */
if(raw_ext) {
- if(strstr(raw_ext, "%s")) {
+ if(strstr(raw_ext, "%s")) {
/* Note: this doesn't accommodate for when the '%s' in the user's
* string is at a position >sizeof(raw_name) - QK & JK - 2013/01/17
*/
- strncpy(raw_name, raw_ext, sizeof(raw_name));
+ strncpy(raw_name, raw_ext, sizeof(raw_name));
raw_name[sizeof(raw_name) - 1] = '\0';
}
- else
- sprintf(raw_name, "%%s%s", raw_ext);
+ else
+ sprintf(raw_name, "%%s%s", raw_ext);
}
else {
- strncpy(raw_name, "%s.raw", sizeof(raw_name));
+ strncpy(raw_name, "%s.raw", sizeof(raw_name));
raw_name[sizeof(raw_name) - 1] = '\0';
}
memb_name[H5FD_MEM_DRAW] = raw_name;
@@ -348,96 +348,96 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
return H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_multi
+ * Function: H5Pset_fapl_multi
*
- * Purpose: Sets the file access property list FAPL_ID to use the multi
- * driver. The MEMB_MAP array maps memory usage types to other
- * memory usage types and is the mechanism which allows the
- * caller to specify how many files are created. The array
- * contains H5FD_MEM_NTYPES entries which are either the value
- * H5FD_MEM_DEFAULT or a memory usage type and the number of
- * unique values determines the number of files which are
- * opened. For each memory usage type which will be associated
- * with a file the MEMB_FAPL array should have a property list
- * and the MEMB_NAME array should be a name generator (a
- * printf-style format with a %s which will be replaced with the
- * name passed to H5FDopen(), usually from H5Fcreate() or
- * H5Fopen()).
+ * Purpose: Sets the file access property list FAPL_ID to use the multi
+ * driver. The MEMB_MAP array maps memory usage types to other
+ * memory usage types and is the mechanism which allows the
+ * caller to specify how many files are created. The array
+ * contains H5FD_MEM_NTYPES entries which are either the value
+ * H5FD_MEM_DEFAULT or a memory usage type and the number of
+ * unique values determines the number of files which are
+ * opened. For each memory usage type which will be associated
+ * with a file the MEMB_FAPL array should have a property list
+ * and the MEMB_NAME array should be a name generator (a
+ * printf-style format with a %s which will be replaced with the
+ * name passed to H5FDopen(), usually from H5Fcreate() or
+ * H5Fopen()).
*
- * If RELAX is set then opening an existing file for read-only
- * access will not fail if some file members are missing. This
- * allows a file to be accessed in a limited sense if just the
- * meta data is available.
+ * If RELAX is set then opening an existing file for read-only
+ * access will not fail if some file members are missing. This
+ * allows a file to be accessed in a limited sense if just the
+ * meta data is available.
*
- * Defaults: Default values for each of the optional arguments are:
+ * Defaults: Default values for each of the optional arguments are:
*
- * memb_map: The default member map has the value
- * H5FD_MEM_DEFAULT for each element.
+ * memb_map: The default member map has the value
+ * H5FD_MEM_DEFAULT for each element.
*
- * memb_fapl: The value H5P_DEFAULT for each element.
+ * memb_fapl: The value H5P_DEFAULT for each element.
*
- * memb_name: The string `%s-X.h5' where `X' is one of the
- * letters `s' (H5FD_MEM_SUPER),
- * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW),
- * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP),
- * `o' (H5FD_MEM_OHDR).
+ * memb_name: The string `%s-X.h5' where `X' is one of the
+ * letters `s' (H5FD_MEM_SUPER),
+ * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW),
+ * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP),
+ * `o' (H5FD_MEM_OHDR).
*
- * memb_addr: The value HADDR_UNDEF for each element.
+ * memb_addr: The value HADDR_UNDEF for each element.
*
*
- * Example: To set up a multi file access property list which partitions
- * data into meta and raw files each being 1/2 of the address
- * space one would say:
+ * Example: To set up a multi file access property list which partitions
+ * data into meta and raw files each being 1/2 of the address
+ * space one would say:
*
- * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
- * hid_t memb_fapl[H5FD_MEM_NTYPES];
- * const char *memb[H5FD_MEM_NTYPES];
- * haddr_t memb_addr[H5FD_MEM_NTYPES];
+ * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
+ * hid_t memb_fapl[H5FD_MEM_NTYPES];
+ * const char *memb[H5FD_MEM_NTYPES];
+ * haddr_t memb_addr[H5FD_MEM_NTYPES];
*
- * // The mapping...
- * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
- * memb_map[mt] = H5FD_MEM_SUPER;
- * }
- * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
+ * // The mapping...
+ * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ * memb_map[mt] = H5FD_MEM_SUPER;
+ * }
+ * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
*
- * // Member information
- * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- * memb_name[H5FD_MEM_SUPER] = "%s.meta";
- * memb_addr[H5FD_MEM_SUPER] = 0;
+ * // Member information
+ * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_SUPER] = "%s.meta";
+ * memb_addr[H5FD_MEM_SUPER] = 0;
*
- * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- * memb_name[H5FD_MEM_DRAW] = "%s.raw";
- * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
+ * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_DRAW] = "%s.raw";
+ * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
*
- * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
- * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
- * memb_name, memb_addr, TRUE);
+ * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
+ * memb_name, memb_addr, TRUE);
*
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
- const hid_t *memb_fapl, const char * const *memb_name,
- const haddr_t *memb_addr, hbool_t relax)
+ const hid_t *memb_fapl, const char * const *memb_name,
+ const haddr_t *memb_addr, hbool_t relax)
{
- H5FD_multi_fapl_t fa;
- H5FD_mem_t mt, mmt;
- H5FD_mem_t _memb_map[H5FD_MEM_NTYPES];
- hid_t _memb_fapl[H5FD_MEM_NTYPES];
- char _memb_name[H5FD_MEM_NTYPES][16];
- const char *_memb_name_ptrs[H5FD_MEM_NTYPES];
- haddr_t _memb_addr[H5FD_MEM_NTYPES];
- static const char *letters = "Xsbrglo";
+ H5FD_multi_fapl_t fa;
+ H5FD_mem_t mt, mmt;
+ H5FD_mem_t _memb_map[H5FD_MEM_NTYPES];
+ hid_t _memb_fapl[H5FD_MEM_NTYPES];
+ char _memb_name[H5FD_MEM_NTYPES][16];
+ const char *_memb_name_ptrs[H5FD_MEM_NTYPES];
+ haddr_t _memb_addr[H5FD_MEM_NTYPES];
+ static const char *letters = "Xsbrglo";
static const char *func="H5FDset_fapl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
@@ -450,45 +450,45 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1)
if (!memb_map) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
- _memb_map[mt] = H5FD_MEM_DEFAULT;
- memb_map = _memb_map;
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
+ _memb_map[mt] = H5FD_MEM_DEFAULT;
+ memb_map = _memb_map;
}
if (!memb_fapl) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
- _memb_fapl[mt] = H5Pcreate(H5P_FILE_ACCESS);
- memb_fapl = _memb_fapl;
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
+ _memb_fapl[mt] = H5Pcreate(H5P_FILE_ACCESS);
+ memb_fapl = _memb_fapl;
}
if (!memb_name) {
- assert(strlen(letters)==H5FD_MEM_NTYPES);
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- sprintf(_memb_name[mt], "%%s-%c.h5", letters[mt]);
- _memb_name_ptrs[mt] = _memb_name[mt];
- }
- memb_name = _memb_name_ptrs;
+ assert(strlen(letters)==H5FD_MEM_NTYPES);
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
+ sprintf(_memb_name[mt], "%%s-%c.h5", letters[mt]);
+ _memb_name_ptrs[mt] = _memb_name[mt];
+ }
+ memb_name = _memb_name_ptrs;
}
if (!memb_addr) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
- _memb_addr[mt] = (hsize_t)(mt ? (mt - 1) : 0) * (HADDR_MAX / (H5FD_MEM_NTYPES-1));
- memb_addr = _memb_addr;
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
+ _memb_addr[mt] = (hsize_t)(mt ? (mt - 1) : 0) * (HADDR_MAX / (H5FD_MEM_NTYPES-1));
+ memb_addr = _memb_addr;
}
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- /* Map usage type */
- mmt = memb_map[mt];
- if (mmt<0 || mmt>=H5FD_MEM_NTYPES)
+ /* Map usage type */
+ mmt = memb_map[mt];
+ if (mmt<0 || mmt>=H5FD_MEM_NTYPES)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1)
- if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
+ if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
- /*
- * All members of MEMB_FAPL must be either defaults or actual file
- * access property lists.
- */
- if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
+ /*
+ * All members of MEMB_FAPL must be either defaults or actual file
+ * access property lists.
+ */
+ if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1)
- /* All names must be defined */
- if (!memb_name[mmt] || !memb_name[mmt][0])
+ /* All names must be defined */
+ if (!memb_name[mmt] || !memb_name[mmt][0])
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1)
}
@@ -510,30 +510,30 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
return H5Pset_driver(fapl_id, H5FD_MULTI, &fa);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_multi
+ * Function: H5Pget_fapl_multi
*
- * Purpose: Returns information about the multi file access property
- * list though the function arguments which are the same as for
- * H5Pset_fapl_multi() above.
+ * Purpose: Returns information about the multi file access property
+ * list though the function arguments which are the same as for
+ * H5Pset_fapl_multi() above.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
- hid_t *memb_fapl/*out*/, char **memb_name/*out*/,
- haddr_t *memb_addr/*out*/, hbool_t *relax)
+ hid_t *memb_fapl/*out*/, char **memb_name/*out*/,
+ haddr_t *memb_addr/*out*/, hbool_t *relax)
{
- H5FD_multi_fapl_t *fa;
- H5FD_mem_t mt;
+ H5FD_multi_fapl_t *fa;
+ H5FD_mem_t mt;
static const char *func="H5FDget_fapl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
@@ -552,41 +552,41 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
if (memb_map)
memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t));
if (memb_fapl) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (fa->memb_fapl[mt]>=0)
- memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]);
- else
- memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/
- }
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
+ if (fa->memb_fapl[mt]>=0)
+ memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]);
+ else
+ memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/
+ }
}
if(memb_name) {
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
- if(fa->memb_name[mt])
- memb_name[mt] = my_strdup(fa->memb_name[mt]);
- else
- memb_name[mt] = NULL;
- }
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(fa->memb_name[mt])
+ memb_name[mt] = my_strdup(fa->memb_name[mt]);
+ else
+ memb_name[mt] = NULL;
+ }
}
if (memb_addr)
- memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t));
+ memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t));
if (relax)
- *relax = fa->relax;
+ *relax = fa->relax;
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_size
+ * Function: H5FD_multi_sb_size
*
- * Purpose: Returns the size of the private information to be stored in
- * the superblock.
+ * Purpose: Returns the size of the private information to be stored in
+ * the superblock.
*
- * Return: Success: The super block driver data size.
+ * Return: Success: The super block driver data size.
*
- * Failure: never fails
+ * Failure: never fails
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
@@ -594,16 +594,16 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
static hsize_t
H5FD_multi_sb_size(H5FD_t *_file)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- unsigned nseen = 0;
- hsize_t nbytes = 8; /*size of header*/
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ unsigned nseen = 0;
+ hsize_t nbytes = 8; /*size of header*/
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* How many unique files? */
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
- nseen++;
+ nseen++;
} END_MEMBERS;
/* Addresses and EOA markers */
@@ -618,40 +618,40 @@ H5FD_multi_sb_size(H5FD_t *_file)
return nbytes;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_encode
+ * Function: H5FD_multi_sb_encode
*
- * Purpose: Encode driver information for the superblock. The NAME
- * argument is a nine-byte buffer which will be initialized with
- * an eight-character name/version number and null termination.
+ * Purpose: Encode driver information for the superblock. The NAME
+ * argument is a nine-byte buffer which will be initialized with
+ * an eight-character name/version number and null termination.
*
- * The encoding is a six-byte member mapping followed two bytes
- * which are unused. For each unique file in usage-type order
- * encode all the starting addresses as unsigned 64-bit integers,
- * then all the EOA values as unsigned 64-bit integers, then all
- * the template names as null terminated strings which are
- * multiples of 8 characters.
+ * The encoding is a six-byte member mapping followed two bytes
+ * which are unused. For each unique file in usage-type order
+ * encode all the starting addresses as unsigned 64-bit integers,
+ * then all the EOA values as unsigned 64-bit integers, then all
+ * the template names as null terminated strings which are
+ * multiples of 8 characters.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
- unsigned char *buf/*out*/)
+ unsigned char *buf/*out*/)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- haddr_t memb_eoa;
- unsigned char *p;
- size_t nseen;
- size_t i;
- H5FD_mem_t m;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ haddr_t memb_eoa;
+ unsigned char *p;
+ size_t nseen;
+ size_t i;
+ H5FD_mem_t m;
static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -702,23 +702,23 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
return 0;
} /* end H5FD_multi_sb_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_decode
+ * Function: H5FD_multi_sb_decode
*
- * Purpose: Decodes the superblock information for this driver. The NAME
- * argument is the eight-character (plus null termination) name
- * stored in the file.
+ * Purpose: Decodes the superblock information for this driver. The NAME
+ * argument is the eight-character (plus null termination) name
+ * stored in the file.
*
- * The FILE argument is updated according to the information in
- * the superblock. This may mean that some member files are
- * closed and others are opened.
+ * The FILE argument is updated according to the information in
+ * the superblock. This may mean that some member files are
+ * closed and others are opened.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
@@ -726,17 +726,17 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
static herr_t
H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- char x[2*H5FD_MEM_NTYPES*8];
- H5FD_mem_t map[H5FD_MEM_NTYPES];
- int i;
- size_t nseen=0;
- hbool_t map_changed=FALSE;
- hbool_t in_use[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
- haddr_t memb_eoa[H5FD_MEM_NTYPES];
- haddr_t *ap;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ char x[2*H5FD_MEM_NTYPES*8];
+ H5FD_mem_t map[H5FD_MEM_NTYPES];
+ int i;
+ size_t nseen=0;
+ hbool_t map_changed=FALSE;
+ hbool_t in_use[H5FD_MEM_NTYPES];
+ const char *memb_name[H5FD_MEM_NTYPES];
+ haddr_t memb_addr[H5FD_MEM_NTYPES];
+ haddr_t memb_eoa[H5FD_MEM_NTYPES];
+ haddr_t *ap;
static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -835,28 +835,28 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
if (file->memb[mt])
if(H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt])<0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1)
-
- /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */
- file->memb_eoa[mt] = memb_eoa[mt];
+
+ /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */
+ file->memb_eoa[mt] = memb_eoa[mt];
} END_MEMBERS;
return 0;
} /* end H5FD_multi_sb_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_get
+ * Function: H5FD_multi_fapl_get
*
- * Purpose: Returns a file access property list which indicates how the
- * specified file is being accessed. The return list could be
- * used to access another file the same way.
+ * Purpose: Returns a file access property list which indicates how the
+ * specified file is being accessed. The return list could be
+ * used to access another file the same way.
*
- * Return: Success: Ptr to new file access property list with all
- * members copied from the file struct.
+ * Return: Success: Ptr to new file access property list with all
+ * members copied from the file struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
@@ -864,7 +864,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
static void *
H5FD_multi_fapl_get(H5FD_t *_file)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
@@ -872,17 +872,17 @@ H5FD_multi_fapl_get(H5FD_t *_file)
return H5FD_multi_fapl_copy(&(file->fa));
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_copy
+ * Function: H5FD_multi_fapl_copy
*
- * Purpose: Copies the multi-specific file access properties.
+ * Purpose: Copies the multi-specific file access properties.
*
- * Return: Success: Ptr to a new property list
+ * Return: Success: Ptr to a new property list
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -902,15 +902,15 @@ H5FD_multi_fapl_copy(const void *_old_fa)
memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t));
ALL_MEMBERS(mt) {
- if (old_fa->memb_fapl[mt]>=0) {
- new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]);
- if(new_fa->memb_fapl[mt]<0)
+ if (old_fa->memb_fapl[mt]>=0) {
+ new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]);
+ if(new_fa->memb_fapl[mt]<0)
nerrors++;
- }
- if (old_fa->memb_name[mt]) {
- new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]);
- assert(new_fa->memb_name[mt]);
- }
+ }
+ if (old_fa->memb_name[mt]) {
+ new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]);
+ assert(new_fa->memb_name[mt]);
+ }
} END_MEMBERS;
if (nerrors) {
@@ -926,17 +926,17 @@ H5FD_multi_fapl_copy(const void *_old_fa)
return new_fa;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_free
+ * Function: H5FD_multi_fapl_free
*
- * Purpose: Frees the multi-specific file access properties.
+ * Purpose: Frees the multi-specific file access properties.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -944,17 +944,17 @@ H5FD_multi_fapl_copy(const void *_old_fa)
static herr_t
H5FD_multi_fapl_free(void *_fa)
{
- H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa;
+ H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa;
static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
ALL_MEMBERS(mt) {
- if (fa->memb_fapl[mt]>=0)
+ if (fa->memb_fapl[mt]>=0)
if(H5Pclose(fa->memb_fapl[mt])<0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1)
- if (fa->memb_name[mt])
+ if (fa->memb_name[mt])
free(fa->memb_name[mt]);
} END_MEMBERS;
free(fa);
@@ -962,31 +962,31 @@ H5FD_multi_fapl_free(void *_fa)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_open
+ * Function: H5FD_multi_open
*
- * Purpose: Creates and/or opens a multi HDF5 file.
+ * Purpose: Creates and/or opens a multi HDF5 file.
*
- * Return: Success: A pointer to a new file data structure. The
- * public fields will be initialized by the
- * caller, which is always H5FD_open().
+ * Return: Success: A pointer to a new file data structure. The
+ * public fields will be initialized by the
+ * caller, which is always H5FD_open().
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static H5FD_t *
H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
- haddr_t maxaddr)
+ haddr_t maxaddr)
{
- H5FD_multi_t *file=NULL;
- hid_t close_fapl=-1;
- H5FD_multi_fapl_t *fa;
- H5FD_mem_t m;
+ H5FD_multi_t *file=NULL;
+ hid_t close_fapl=-1;
+ H5FD_multi_fapl_t *fa;
+ H5FD_mem_t m;
static const char *func="H5FD_multi_open"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -1001,7 +1001,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
/*
* Initialize the file from the file access properties, using default
* values if necessary. Make sure to use CALLOC here because the code
- * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
+ * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
* in H5FD_multi_t.
*/
if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t))))
@@ -1014,16 +1014,16 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
fa = (H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
assert(fa);
ALL_MEMBERS(mt) {
- file->fa.memb_map[mt] = fa->memb_map[mt];
- file->fa.memb_addr[mt] = fa->memb_addr[mt];
- if (fa->memb_fapl[mt]>=0)
- file->fa.memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]);
- else
- file->fa.memb_fapl[mt] = fa->memb_fapl[mt];
- if (fa->memb_name[mt])
- file->fa.memb_name[mt] = my_strdup(fa->memb_name[mt]);
- else
- file->fa.memb_name[mt] = NULL;
+ file->fa.memb_map[mt] = fa->memb_map[mt];
+ file->fa.memb_addr[mt] = fa->memb_addr[mt];
+ if (fa->memb_fapl[mt]>=0)
+ file->fa.memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]);
+ else
+ file->fa.memb_fapl[mt] = fa->memb_fapl[mt];
+ if (fa->memb_name[mt])
+ file->fa.memb_name[mt] = my_strdup(fa->memb_name[mt]);
+ else
+ file->fa.memb_name[mt] = NULL;
} END_MEMBERS;
file->fa.relax = fa->relax;
file->flags = flags;
@@ -1049,30 +1049,30 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
error:
/* Cleanup and fail */
if (file) {
- ALL_MEMBERS(mt) {
- if (file->memb[mt]) (void)H5FDclose(file->memb[mt]);
- if (file->fa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]);
- if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]);
- } END_MEMBERS;
- if (file->name) free(file->name);
- free(file);
+ ALL_MEMBERS(mt) {
+ if (file->memb[mt]) (void)H5FDclose(file->memb[mt]);
+ if (file->fa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]);
+ if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]);
+ } END_MEMBERS;
+ if (file->name) free(file->name);
+ free(file);
}
return NULL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_close
+ * Function: H5FD_multi_close
*
- * Purpose: Closes a multi file.
+ * Purpose: Closes a multi file.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative with as many members closed as
- * possible. The only subsequent operation
- * permitted on the file is a close operation.
+ * Failure: Negative with as many members closed as
+ * possible. The only subsequent operation
+ * permitted on the file is a close operation.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1080,8 +1080,8 @@ error:
static herr_t
H5FD_multi_close(H5FD_t *_file)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- int nerrors=0;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ int nerrors=0;
static const char *func="H5FD_multi_close"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -1089,21 +1089,21 @@ H5FD_multi_close(H5FD_t *_file)
/* Close as many members as possible */
ALL_MEMBERS(mt) {
- if (file->memb[mt]) {
- if (H5FDclose(file->memb[mt])<0) {
+ if (file->memb[mt]) {
+ if (H5FDclose(file->memb[mt])<0) {
nerrors++;
- } else {
+ } else {
file->memb[mt] = NULL;
- }
- }
+ }
+ }
} END_MEMBERS;
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1)
/* Clean up other stuff */
ALL_MEMBERS(mt) {
- if (file->fa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]);
- if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]);
+ if (file->fa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]);
+ if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]);
} END_MEMBERS;
free(file->name);
@@ -1111,22 +1111,22 @@ H5FD_multi_close(H5FD_t *_file)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_cmp
+ * Function: H5FD_multi_cmp
*
- * Purpose: Compares two file families to see if they are the same. It
- * does this by comparing the first common member of the two
- * families. If the families have no members in common then the
- * file with the earliest member is smaller than the other file.
- * We abort if neither file has any members.
+ * Purpose: Compares two file families to see if they are the same. It
+ * does this by comparing the first common member of the two
+ * families. If the families have no members in common then the
+ * file with the earliest member is smaller than the other file.
+ * We abort if neither file has any members.
*
- * Return: Success: like strcmp()
+ * Return: Success: like strcmp()
*
- * Failure: never fails (arguments were checked by the
- * caller).
+ * Failure: never fails (arguments were checked by the
+ * caller).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1134,24 +1134,24 @@ H5FD_multi_close(H5FD_t *_file)
static int
H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
- const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1;
- const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2;
- H5FD_mem_t out_mt = H5FD_MEM_DEFAULT;
- int cmp=0;
+ const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1;
+ const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2;
+ H5FD_mem_t out_mt = H5FD_MEM_DEFAULT;
+ int cmp=0;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
ALL_MEMBERS(mt) {
out_mt = mt;
- if(f1->memb[mt] && f2->memb[mt])
+ if(f1->memb[mt] && f2->memb[mt])
break;
- if(!cmp) {
- if(f1->memb[mt])
+ if(!cmp) {
+ if(f1->memb[mt])
cmp = -1;
- else if(f2->memb[mt])
+ else if(f2->memb[mt])
cmp = 1;
- }
+ }
} END_MEMBERS;
assert(cmp || out_mt<H5FD_MEM_NTYPES);
if(out_mt>=H5FD_MEM_NTYPES)
@@ -1160,18 +1160,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_query
+ * Function: H5FD_multi_query
*
- * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, September 26, 2000
*
*-------------------------------------------------------------------------
@@ -1192,16 +1192,16 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
return(0);
} /* end H5FD_multi_query() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_type_map
+ * Function: H5FD_multi_get_type_map
*
- * Purpose: Retrieve the memory type mapping for this file
+ * Purpose: Retrieve the memory type mapping for this file
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, October 9, 2008
*
*-------------------------------------------------------------------------
@@ -1209,7 +1209,7 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
static herr_t
H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
{
- const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
+ const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
/* Copy file's free space type mapping */
memcpy(type_map, file->fa.memb_map, sizeof(file->fa.memb_map));
@@ -1217,19 +1217,19 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
return(0);
} /* end H5FD_multi_get_type_map() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_eoa
+ * Function: H5FD_multi_get_eoa
*
- * Purpose: Returns the end-of-address marker for the file. The EOA
- * marker is the first address past the last byte allocated in
- * the format address space.
+ * Purpose: Returns the end-of-address marker for the file. The EOA
+ * marker is the first address past the last byte allocated in
+ * the format address space.
*
- * Return: Success: The end-of-address-marker
+ * Return: Success: The end-of-address-marker
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -1245,7 +1245,7 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
static haddr_t
H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
{
- const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
+ const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
haddr_t eoa = 0;
haddr_t memb_eoa = 0;
static const char *func="H5FD_multi_get_eoa"; /* Function Name for error reporting */
@@ -1261,24 +1261,24 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
*/
if(H5FD_MEM_DEFAULT == type) {
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
- if (file->memb[mt]) {
+ if (file->memb[mt]) {
/* Retrieve EOA */
- H5E_BEGIN_TRY {
+ H5E_BEGIN_TRY {
memb_eoa = H5FDget_eoa(file->memb[mt], mt);
- } H5E_END_TRY;
+ } H5E_END_TRY;
- if(HADDR_UNDEF == memb_eoa)
+ if(HADDR_UNDEF == memb_eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF)
- } else if (file->fa.relax) {
- /*
- * The member is not open yet (maybe it doesn't exist). Make the
- * best guess about the end-of-file.
- */
- memb_eoa = file->memb_next[mt];
- assert(HADDR_UNDEF != memb_eoa);
- } else {
+ } else if (file->fa.relax) {
+ /*
+ * The member is not open yet (maybe it doesn't exist). Make the
+ * best guess about the end-of-file.
+ */
+ memb_eoa = file->memb_next[mt];
+ assert(HADDR_UNDEF != memb_eoa);
+ } else {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
- }
+ }
if(memb_eoa > eoa)
eoa = memb_eoa;
@@ -1289,44 +1289,44 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
if(H5FD_MEM_DEFAULT == mmt)
mmt = type;
- if(file->memb[mmt]) {
+ if(file->memb[mmt]) {
H5E_BEGIN_TRY {
- eoa = H5FDget_eoa(file->memb[mmt], mmt);
+ eoa = H5FDget_eoa(file->memb[mmt], mmt);
} H5E_END_TRY;
- if(HADDR_UNDEF == eoa)
+ if(HADDR_UNDEF == eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF)
- if(eoa > 0)
+ if(eoa > 0)
eoa += file->fa.memb_addr[mmt];
- } else if(file->fa.relax) {
- /*
- * The member is not open yet (maybe it doesn't exist). Make the
- * best guess about the end-of-file.
- */
- eoa = file->memb_next[mmt];
- assert(HADDR_UNDEF != eoa);
- } else {
+ } else if(file->fa.relax) {
+ /*
+ * The member is not open yet (maybe it doesn't exist). Make the
+ * best guess about the end-of-file.
+ */
+ eoa = file->memb_next[mmt];
+ assert(HADDR_UNDEF != eoa);
+ } else {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
- }
+ }
}
return eoa;
} /* end H5FD_multi_get_eoa() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_set_eoa
+ * Function: H5FD_multi_set_eoa
*
- * Purpose: Set the end-of-address marker for the file by savig the new
- * EOA value in the file struct. Also set the EOA marker for the
- * subfile in which the new EOA value falls. We don't set the
- * EOA values of any other subfiles.
+ * Purpose: Set the end-of-address marker for the file by savig the new
+ * EOA value in the file struct. Also set the EOA marker for the
+ * subfile in which the new EOA value falls. We don't set the
+ * EOA values of any other subfiles.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
@@ -1345,9 +1345,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
static herr_t
H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_mem_t mmt;
- herr_t status;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_mem_t mmt;
+ herr_t status;
static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -1374,7 +1374,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
assert(eoa < file->memb_next[mmt]);
H5E_BEGIN_TRY {
- status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt]));
+ status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt]));
} H5E_END_TRY;
if(status < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1)
@@ -1382,20 +1382,20 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
return 0;
} /* end H5FD_multi_set_eoa() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_eof
+ * Function: H5FD_multi_get_eof
*
- * Purpose: Returns the end-of-file marker, which is the greater of
- * either the total multi size or the current EOA marker.
+ * Purpose: Returns the end-of-file marker, which is the greater of
+ * either the total multi size or the current EOA marker.
*
- * Return: Success: End of file address, the first address past
- * the end of the multi of files or the current
- * EOA, whichever is larger.
+ * Return: Success: End of file address, the first address past
+ * the end of the multi of files or the current
+ * EOA, whichever is larger.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1403,55 +1403,55 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
static haddr_t
H5FD_multi_get_eof(const H5FD_t *_file)
{
- const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
- haddr_t eof=0, tmp_eof;
- haddr_t eoa=0, tmp_eoa;
+ const H5FD_multi_t *file = (const H5FD_multi_t*)_file;
+ haddr_t eof=0, tmp_eof;
+ haddr_t eoa=0, tmp_eoa;
static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
- if (file->memb[mt]) {
+ if (file->memb[mt]) {
/* Retrieve EOF */
- H5E_BEGIN_TRY {
- tmp_eof = H5FDget_eof(file->memb[mt]);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY {
+ tmp_eof = H5FDget_eof(file->memb[mt]);
+ } H5E_END_TRY;
- if (HADDR_UNDEF==tmp_eof)
+ if (HADDR_UNDEF==tmp_eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF)
- if (tmp_eof>0) tmp_eof += file->fa.memb_addr[mt];
+ if (tmp_eof>0) tmp_eof += file->fa.memb_addr[mt];
/* Retrieve EOA */
- H5E_BEGIN_TRY {
- tmp_eoa = H5FDget_eoa(file->memb[mt], mt);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY {
+ tmp_eoa = H5FDget_eoa(file->memb[mt], mt);
+ } H5E_END_TRY;
- if (HADDR_UNDEF==tmp_eoa)
+ if (HADDR_UNDEF==tmp_eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF)
- if (tmp_eoa>0) tmp_eoa += file->fa.memb_addr[mt];
- } else if (file->fa.relax) {
- /*
- * The member is not open yet (maybe it doesn't exist). Make the
- * best guess about the end-of-file.
- */
- tmp_eof = file->memb_next[mt];
- assert(HADDR_UNDEF!=tmp_eof);
-
- tmp_eoa = file->memb_next[mt];
- assert(HADDR_UNDEF!=tmp_eoa);
- } else {
+ if (tmp_eoa>0) tmp_eoa += file->fa.memb_addr[mt];
+ } else if (file->fa.relax) {
+ /*
+ * The member is not open yet (maybe it doesn't exist). Make the
+ * best guess about the end-of-file.
+ */
+ tmp_eof = file->memb_next[mt];
+ assert(HADDR_UNDEF!=tmp_eof);
+
+ tmp_eoa = file->memb_next[mt];
+ assert(HADDR_UNDEF!=tmp_eoa);
+ } else {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
- }
+ }
- if (tmp_eof>eof) eof = tmp_eof;
- if (tmp_eoa>eoa) eoa = tmp_eoa;
+ if (tmp_eof>eof) eof = tmp_eof;
+ if (tmp_eoa>eoa) eoa = tmp_eoa;
} END_MEMBERS;
return MAX(eoa, eof);
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_multi_get_handle
*
@@ -1482,17 +1482,17 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle));
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_alloc
+ * Function: H5FD_multi_alloc
*
- * Purpose: Allocate file memory.
+ * Purpose: Allocate file memory.
*
- * Return: Success: Address of new memory
+ * Return: Success: Address of new memory
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, August 12, 1999
*
*-------------------------------------------------------------------------
@@ -1500,9 +1500,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
static haddr_t
H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_mem_t mmt;
- haddr_t addr;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_mem_t mmt;
+ haddr_t addr;
static const char *func="H5FD_multi_alloc"; /* Function Name for error reporting */
mmt = file->fa.memb_map[type];
@@ -1515,31 +1515,31 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/*#ifdef TMP
if ( addr + size > file->eoa ) {
- if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) {
+ if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \
- "can't set eoa", HADDR_UNDEF)
- }
+ "can't set eoa", HADDR_UNDEF)
+ }
}
#else
if ( addr + size > file->eoa )
- file->eoa = addr + size;
+ file->eoa = addr + size;
#endif */
return addr;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_free
+ * Function: H5FD_multi_free
*
- * Purpose: Frees memory
+ * Purpose: Frees memory
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, August 12, 1999
*
*-------------------------------------------------------------------------
@@ -1547,8 +1547,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
static herr_t
H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_mem_t mmt;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_mem_t mmt;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
@@ -1561,20 +1561,20 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi
return H5FDfree(file->memb[mmt], mmt, dxpl_id, addr-file->fa.memb_addr[mmt], size);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_read
+ * Function: H5FD_multi_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero. Result is stored in caller-supplied
- * buffer BUF.
+ * 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
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1583,28 +1583,28 @@ static herr_t
H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
size_t size, void *_buf/*out*/)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t dx;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_multi_dxpl_t dx;
htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
- H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
- haddr_t start_addr = 0;
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
- mmt = file->fa.memb_map[mt];
- if(H5FD_MEM_DEFAULT == mmt)
+ mmt = file->fa.memb_map[mt];
+ if(H5FD_MEM_DEFAULT == mmt)
mmt = mt;
- assert(mmt > 0 && mmt < H5FD_MEM_NTYPES);
+ assert(mmt > 0 && mmt < H5FD_MEM_NTYPES);
- if(file->fa.memb_addr[mmt] > addr)
+ if(file->fa.memb_addr[mmt] > addr)
continue;
- if(file->fa.memb_addr[mmt] >= start_addr) {
- start_addr = file->fa.memb_addr[mmt];
- hi = mmt;
- } /* end if */
+ if(file->fa.memb_addr[mmt] >= start_addr) {
+ start_addr = file->fa.memb_addr[mmt];
+ hi = mmt;
+ } /* end if */
} /* end for */
assert(hi > 0);
@@ -1613,19 +1613,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
addr - start_addr, size, _buf);
} /* end H5FD_multi_read() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_write
+ * Function: H5FD_multi_write
*
- * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
- * from buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
+ * from buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero
+ * Return: Success: Zero
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1634,28 +1634,28 @@ static herr_t
H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
size_t size, const void *_buf)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t dx;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_multi_dxpl_t dx;
htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
- H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
- haddr_t start_addr = 0;
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
- mmt = file->fa.memb_map[mt];
- if(H5FD_MEM_DEFAULT == mmt)
+ mmt = file->fa.memb_map[mt];
+ if(H5FD_MEM_DEFAULT == mmt)
mmt = mt;
- assert(mmt > 0 && mmt<H5FD_MEM_NTYPES);
+ assert(mmt > 0 && mmt<H5FD_MEM_NTYPES);
- if(file->fa.memb_addr[mmt] > addr)
+ if(file->fa.memb_addr[mmt] > addr)
continue;
- if(file->fa.memb_addr[mmt] >= start_addr) {
- start_addr = file->fa.memb_addr[mmt];
- hi = mmt;
- } /* end if */
+ if(file->fa.memb_addr[mmt] >= start_addr) {
+ start_addr = file->fa.memb_addr[mmt];
+ hi = mmt;
+ } /* end if */
} /* end for */
assert(hi > 0);
@@ -1664,17 +1664,17 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
addr - start_addr, size, _buf);
} /* end H5FD_multi_write() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_flush
+ * Function: H5FD_multi_flush
*
- * Purpose: Flushes all multi members.
+ * Purpose: Flushes all multi members.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1, as many files flushed as possible.
+ * Failure: -1, as many files flushed as possible.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1682,13 +1682,13 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
static herr_t
H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_mem_t mt;
- int nerrors=0;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_mem_t mt;
+ int nerrors=0;
static const char *func="H5FD_multi_flush"; /* Function Name for error reporting */
#if 0
- H5FD_mem_t mmt;
+ H5FD_mem_t mmt;
/* Debugging stuff... */
HDfprintf(stderr, "multifile access information:\n");
@@ -1696,9 +1696,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
/* print the map */
HDfprintf(stderr, " map=");
for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
- mmt = file->memb_map[mt];
- if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
- HDfprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt);
+ mmt = file->memb_map[mt];
+ if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
+ HDfprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt);
}
HDfprintf(stderr, "\n");
@@ -1708,14 +1708,14 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
HDfprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n");
for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
- if (HADDR_UNDEF!=file->memb_addr[mt]) {
- haddr_t eoa = H5FDget_eoa(file->memb[mt], mt);
- HDfprintf(stderr, " %6d %20llu %20llu %20llu %s\n",
- (int)mt, (unsigned long long)(file->memb_addr[mt]),
- (unsigned long long)eoa,
- (unsigned long long)(file->memb_next[mt]),
- file->memb_name[mt]);
- }
+ if (HADDR_UNDEF!=file->memb_addr[mt]) {
+ haddr_t eoa = H5FDget_eoa(file->memb[mt], mt);
+ HDfprintf(stderr, " %6d %20llu %20llu %20llu %s\n",
+ (int)mt, (unsigned long long)(file->memb_addr[mt]),
+ (unsigned long long)eoa,
+ (unsigned long long)(file->memb_next[mt]),
+ file->memb_name[mt]);
+ }
}
#endif
@@ -1724,11 +1724,11 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
/* Flush each file */
for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (file->memb[mt]) {
- H5E_BEGIN_TRY {
- if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++;
- } H5E_END_TRY;
- }
+ if (file->memb[mt]) {
+ H5E_BEGIN_TRY {
+ if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++;
+ } H5E_END_TRY;
+ }
}
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1)
@@ -1736,16 +1736,16 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_truncate
+ * Function: H5FD_multi_truncate
*
- * Purpose: Truncates all multi members.
+ * Purpose: Truncates all multi members.
*
- * Return: Success: 0
- * Failure: -1, as many files truncated as possible.
+ * Return: Success: 0
+ * Failure: -1, as many files truncated as possible.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 31, 2008
*
*-------------------------------------------------------------------------
@@ -1753,9 +1753,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
static herr_t
H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
{
- H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_mem_t mt;
- int nerrors=0;
+ H5FD_multi_t *file = (H5FD_multi_t*)_file;
+ H5FD_mem_t mt;
+ int nerrors=0;
static const char *func="H5FD_multi_truncate"; /* Function Name for error reporting */
/* Clear the error stack */
@@ -1763,12 +1763,12 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
/* Truncate each file */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
- if(file->memb[mt]) {
- H5E_BEGIN_TRY {
- if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0)
+ if(file->memb[mt]) {
+ H5E_BEGIN_TRY {
+ if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0)
nerrors++;
- } H5E_END_TRY;
- }
+ } H5E_END_TRY;
+ }
}
if(nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1)
@@ -1776,18 +1776,18 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
return 0;
} /* end H5FD_multi_truncate() */
-
+
/*-------------------------------------------------------------------------
- * Function: compute_next
+ * Function: compute_next
*
- * Purpose: Compute the memb_next[] values of the file based on the
- * file's member map and the member starting addresses.
+ * Purpose: Compute the memb_next[] values of the file based on the
+ * file's member map and the member starting addresses.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 23, 1999
*
*-------------------------------------------------------------------------
@@ -1799,74 +1799,82 @@ compute_next(H5FD_multi_t *file)
H5Eclear2(H5E_DEFAULT);
ALL_MEMBERS(mt) {
- file->memb_next[mt] = HADDR_UNDEF;
+ file->memb_next[mt] = HADDR_UNDEF;
} END_MEMBERS;
UNIQUE_MEMBERS(file->fa.memb_map, mt1) {
- UNIQUE_MEMBERS2(file->fa.memb_map, mt2) {
- if (file->fa.memb_addr[mt1]<file->fa.memb_addr[mt2] &&
- (HADDR_UNDEF==file->memb_next[mt1] ||
- file->memb_next[mt1]>file->fa.memb_addr[mt2])) {
- file->memb_next[mt1] = file->fa.memb_addr[mt2];
- }
- } END_MEMBERS;
- if (HADDR_UNDEF==file->memb_next[mt1]) {
- file->memb_next[mt1] = HADDR_MAX; /*last member*/
- }
+ UNIQUE_MEMBERS2(file->fa.memb_map, mt2) {
+ if (file->fa.memb_addr[mt1]<file->fa.memb_addr[mt2] &&
+ (HADDR_UNDEF==file->memb_next[mt1] ||
+ file->memb_next[mt1]>file->fa.memb_addr[mt2])) {
+ file->memb_next[mt1] = file->fa.memb_addr[mt2];
+ }
+ } END_MEMBERS;
+ if (HADDR_UNDEF==file->memb_next[mt1]) {
+ file->memb_next[mt1] = HADDR_MAX; /*last member*/
+ }
} END_MEMBERS;
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: open_members
+ * Function: open_members
*
- * Purpose: Opens all members which are not opened yet.
+ * Purpose: Opens all members which are not opened yet.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 23, 1999
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() call with
+ * tmp 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")
static int
open_members(H5FD_multi_t *file)
{
- char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
- int nerrors=0;
+ char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
+ int nerrors=0;
static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
- if(file->memb[mt])
+ if(file->memb[mt])
continue; /*already open*/
- assert(file->fa.memb_name[mt]);
+ assert(file->fa.memb_name[mt]);
/* Note: This truncates the user's filename down to only sizeof(tmp)
* characters. -QK & JK, 2013/01/17
*/
- sprintf(tmp, file->fa.memb_name[mt], file->name);
-
- H5E_BEGIN_TRY {
- file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
- } H5E_END_TRY;
- if(!file->memb[mt]) {
- if(!file->fa.relax || (file->flags & H5F_ACC_RDWR))
- nerrors++;
- }
+ sprintf(tmp, file->fa.memb_name[mt], file->name);
+
+ H5E_BEGIN_TRY {
+ file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
+ } H5E_END_TRY;
+ if(!file->memb[mt]) {
+ if(!file->fa.relax || (file->flags & H5F_ACC_RDWR))
+ nerrors++;
+ }
} END_MEMBERS;
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1)
return 0;
}
+H5_GCC_DIAG_ON("format-nonliteral")
+
-
#ifdef _H5private_H
/*
* This is not related to the functionality of the driver code.
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 8c7f414..75cb145 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, July 26, 1999
*/
#ifndef _H5FDprivate_H
@@ -75,16 +75,16 @@ typedef struct {
/* Define default file image info */
#define H5FD_DEFAULT_FILE_IMAGE_INFO { \
- /* file image buffer */ NULL, \
- /* buffer size */ 0, \
+ NULL, /* file image buffer */ \
+ 0, /* buffer size */ \
{ /* Callbacks */ \
- /* image_malloc */ NULL, \
- /* image_memcpy */ NULL, \
- /* image_realloc */ NULL, \
- /* image_free */ NULL, \
- /* udata_copy */ NULL, \
- /* udata_free */ NULL, \
- /* udata */ NULL, \
+ NULL, /* image_malloc */ \
+ NULL, /* image_memcpy */ \
+ NULL, /* image_realloc */ \
+ NULL, /* image_free */ \
+ NULL, /* udata_copy */ \
+ NULL, /* udata_free */ \
+ NULL, /* udata */ \
} \
}
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 41eecf3..4477753 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -22,7 +22,7 @@
#include "H5Fpublic.h"
/* Public headers needed by this file */
-#include "H5FDpublic.h" /* File drivers */
+#include "H5FDpublic.h" /* File drivers */
/* Private headers needed by this file */
@@ -36,68 +36,68 @@
* Currently, all file meta-data is little-endian.
*/
-# define INT16ENCODE(p, i) { \
- *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
+# define INT16ENCODE(p, i) { \
+ *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
}
-# define UINT16ENCODE(p, i) { \
- *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
+# define UINT16ENCODE(p, i) { \
+ *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \
}
-# define INT32ENCODE(p, i) { \
- *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
- *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
+# define INT32ENCODE(p, i) { \
+ *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \
}
-# define UINT32ENCODE(p, i) { \
- *(p) = (uint8_t)( (i) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
- *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
+# define UINT32ENCODE(p, i) { \
+ *(p) = (uint8_t)( (i) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \
+ *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
}
/* Encode an unsigned integer into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
-# define ENCODE_VAR(p, typ, n, l) { \
- typ _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for(_i = 0; _i < l; _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- (p) = (uint8_t*)(p) + l; \
+# define ENCODE_VAR(p, typ, n, l) { \
+ typ _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for(_i = 0; _i < l; _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ (p) = (uint8_t*)(p) + l; \
}
/* Encode a 32-bit unsigned integer into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
# define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l)
-# define INT64ENCODE(p, n) { \
- int64_t _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- for (/*void*/; _i < 8; _i++) \
- *_p++ = (n) < 0 ? 0xff : 0; \
- (p) = (uint8_t*)(p)+8; \
+# define INT64ENCODE(p, n) { \
+ int64_t _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ for (/*void*/; _i < 8; _i++) \
+ *_p++ = (n) < 0 ? 0xff : 0; \
+ (p) = (uint8_t*)(p)+8; \
}
-# define UINT64ENCODE(p, n) { \
- uint64_t _n = (n); \
- size_t _i; \
- uint8_t *_p = (uint8_t*)(p); \
- \
- for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
- *_p++ = (uint8_t)(_n & 0xff); \
- for (/*void*/; _i < 8; _i++) \
- *_p++ = 0; \
- (p) = (uint8_t*)(p) + 8; \
+# define UINT64ENCODE(p, n) { \
+ uint64_t _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ for (/*void*/; _i < 8; _i++) \
+ *_p++ = 0; \
+ (p) = (uint8_t*)(p) + 8; \
}
/* Encode a 64-bit unsigned integer into a variable-sized buffer */
@@ -112,103 +112,105 @@
* correctly even if i is actually a 64bit int like in a Cray.
*/
-# define INT16DECODE(p, i) { \
- (i) = (int16_t)((*(p) & 0xff)); (p)++; \
+# define INT16DECODE(p, i) { \
+ (i) = (int16_t)((*(p) & 0xff)); (p)++; \
(i) |= (int16_t)(((*(p) & 0xff) << 8) | \
- ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
+ ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
}
-# define UINT16DECODE(p, i) { \
- (i) = (uint16_t) (*(p) & 0xff); (p)++; \
- (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
+# define UINT16DECODE(p, i) { \
+ (i) = (uint16_t) (*(p) & 0xff); (p)++; \
+ (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \
}
-# define INT32DECODE(p, i) { \
- (i) = ( *(p) & 0xff); (p)++; \
- (i) |= ((int32_t)(*(p) & 0xff) << 8); (p)++; \
- (i) |= ((int32_t)(*(p) & 0xff) << 16); (p)++; \
+# define INT32DECODE(p, i) { \
+ (i) = ( *(p) & 0xff); (p)++; \
+ (i) |= ((int32_t)(*(p) & 0xff) << 8); (p)++; \
+ (i) |= ((int32_t)(*(p) & 0xff) << 16); (p)++; \
(i) |= ((int32_t)(((*(p) & 0xff) << 24) | \
- ((*(p) & 0x80) ? ~0xffffffff : 0x0))); (p)++; \
+ ((*(p) & 0x80) ? ~0xffffffff : 0x0))); (p)++; \
}
-# define UINT32DECODE(p, i) { \
- (i) = (uint32_t)(*(p) & 0xff); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
- (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
+# define UINT32DECODE(p, i) { \
+ (i) = (uint32_t)(*(p) & 0xff); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \
+ (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
}
/* Decode a variable-sized buffer */
/* (Assumes that the high bits of the integer will be zero) */
-# define DECODE_VAR(p, n, l) { \
- size_t _i; \
- \
- n = 0; \
- (p) += l; \
- for (_i = 0; _i < l; _i++) \
- n = (n << 8) | *(--p); \
- (p) += l; \
+# define DECODE_VAR(p, n, l) { \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += l; \
+ for (_i = 0; _i < l; _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += l; \
}
/* Decode a variable-sized buffer into a 32-bit unsigned integer */
/* (Assumes that the high bits of the integer will be zero) */
# define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l)
-# define INT64DECODE(p, n) { \
- /* WE DON'T CHECK FOR OVERFLOW! */ \
- size_t _i; \
- \
- n = 0; \
- (p) += 8; \
- for (_i = 0; _i < sizeof(int64_t); _i++) \
- n = (n << 8) | *(--p); \
- (p) += 8; \
+# define INT64DECODE(p, n) { \
+ /* WE DON'T CHECK FOR OVERFLOW! */ \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += 8; \
+ for (_i = 0; _i < sizeof(int64_t); _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += 8; \
}
-# define UINT64DECODE(p, n) { \
- /* WE DON'T CHECK FOR OVERFLOW! */ \
- size_t _i; \
- \
- n = 0; \
- (p) += 8; \
- for (_i = 0; _i < sizeof(uint64_t); _i++) \
- n = (n << 8) | *(--p); \
- (p) += 8; \
+# define UINT64DECODE(p, n) { \
+ /* WE DON'T CHECK FOR OVERFLOW! */ \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += 8; \
+ for (_i = 0; _i < sizeof(uint64_t); _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += 8; \
}
/* Decode a variable-sized buffer into a 64-bit unsigned integer */
/* (Assumes that the high bits of the integer will be zero) */
# define UINT64DECODE_VAR(p, n, l) DECODE_VAR(p, n, l)
+/* clang-format off */
/* Address-related macros */
-#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
- HADDR_UNDEF==(X)+(haddr_t)(Z) || \
- (X)+(haddr_t)(Z)<(X))
-#define H5F_addr_hash(X,M) ((unsigned)((X)%(M)))
-#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
+#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
+ HADDR_UNDEF==(X)+(haddr_t)(Z) || \
+ (X)+(haddr_t)(Z)<(X))
+#define H5F_addr_hash(X,M) ((unsigned)((X)%(M)))
+#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
/* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
* certain that X is not HADDR_UNDEF and then checking that X equals Y
*/
-#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
- (X)==(Y))
-#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
-#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)<(Y))
-#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)<=(Y))
-#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)>(Y))
-#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
- (X)>=(Y))
-#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
- (H5F_addr_lt((X), (Y)) ? -1 : 1))
-#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
+#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
+ (X)==(Y))
+#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
+#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)<(Y))
+#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)<=(Y))
+#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)>(Y))
+#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
+ (X)>=(Y))
+#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
+ (H5F_addr_lt((X), (Y)) ? -1 : 1))
+#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
#define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \
((O1) >= (O2) && (O1) < ((O2) + (L2))))
+/* clang-format on */
/* If the module using this macro is allowed access to the private variables, access them directly */
#ifdef H5F_PACKAGE
@@ -230,7 +232,7 @@
#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr)
#define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k)
#define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id])
-#define H5F_NREFS(F) ((F)->shared->nrefs)
+#define H5F_NREFS(F) ((F)->shared->nrefs)
#define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr)
#define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size)
#define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr)
@@ -272,7 +274,7 @@
#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F))
#define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F))
#define H5F_KVALUE(F,T) (H5F_Kvalue(F,T))
-#define H5F_NREFS(F) (H5F_get_nrefs(F))
+#define H5F_NREFS(F) (H5F_get_nrefs(F))
#define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F))
#define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F))
#define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F))
@@ -299,32 +301,32 @@
/* Macros to encode/decode offset/length's for storing in the file */
-#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
- case 4: UINT32ENCODE(p,o); break; \
- case 8: UINT64ENCODE(p,o); break; \
- case 2: UINT16ENCODE(p,o); break; \
+#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \
+ case 4: UINT32ENCODE(p,o); break; \
+ case 8: UINT64ENCODE(p,o); break; \
+ case 2: UINT16ENCODE(p,o); break; \
}
-#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
- case 4: UINT32DECODE(p, o); break; \
- case 8: UINT64DECODE(p, o); break; \
- case 2: UINT16DECODE(p, o); break; \
+#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \
+ case 4: UINT32DECODE(p, o); break; \
+ case 8: UINT64DECODE(p, o); break; \
+ case 2: UINT16DECODE(p, o); break; \
}
-#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
- case 4: UINT32ENCODE(p,l); break; \
- case 8: UINT64ENCODE(p,l); break; \
- case 2: UINT16ENCODE(p,l); break; \
- default: HDassert("bad sizeof size" && 0); \
+#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \
+ case 4: UINT32ENCODE(p,l); break; \
+ case 8: UINT64ENCODE(p,l); break; \
+ case 2: UINT16ENCODE(p,l); break; \
+ default: HDassert("bad sizeof size" && 0); \
}
#define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
-#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
- case 4: UINT32DECODE(p,l); break; \
- case 8: UINT64DECODE(p,l); break; \
- case 2: UINT16DECODE(p,l); break; \
- default: HDassert("bad sizeof size" && 0); \
+#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \
+ case 4: UINT32DECODE(p,l); break; \
+ case 8: UINT64DECODE(p,l); break; \
+ case 2: UINT16DECODE(p,l); break; \
+ default: HDassert("bad sizeof size" && 0); \
}
#define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f))
@@ -334,13 +336,13 @@
* with.
*/
#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
-# define H5F_OVERFLOW_SIZET2OFFT(X) \
+# define H5F_OVERFLOW_SIZET2OFFT(X) \
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1)))
#else
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
#endif
#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
-# define H5F_OVERFLOW_HSIZET2OFFT(X) \
+# define H5F_OVERFLOW_HSIZET2OFFT(X) \
((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1)))
#else
# define H5F_OVERFLOW_HSIZET2OFFT(X) 0
@@ -362,16 +364,18 @@
#define H5F_CRT_ADDR_BYTE_NUM_NAME "addr_byte_num" /* Byte number in an address */
#define H5F_CRT_OBJ_BYTE_NUM_NAME "obj_byte_num" /* Byte number for object size */
#define H5F_CRT_SUPER_VERS_NAME "super_version" /* Version number of the superblock */
-#define H5F_CRT_SHMSG_NINDEXES_NAME "num_shmsg_indexes" /* Number of shared object header message indexes */
+/* Number of shared object header message indexes */
+#define H5F_CRT_SHMSG_NINDEXES_NAME "num_shmsg_indexes"
#define H5F_CRT_SHMSG_INDEX_TYPES_NAME "shmsg_message_types" /* Types of message in each index */
-#define H5F_CRT_SHMSG_INDEX_MINSIZE_NAME "shmsg_message_minsize" /* Minimum size of messages in each index */
+/* Minimum size of messages in each index */
+#define H5F_CRT_SHMSG_INDEX_MINSIZE_NAME "shmsg_message_minsize"
#define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */
#define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */
/* ========= File Access properties ============ */
-#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
+#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */
#define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
#define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */
@@ -383,7 +387,7 @@
#define H5F_ACS_GARBG_COLCT_REF_NAME "gc_ref" /* Garbage-collect references */
#define H5F_ACS_FILE_DRV_ID_NAME "driver_id" /* File driver ID */
#define H5F_ACS_FILE_DRV_INFO_NAME "driver_info" /* File driver info */
-#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */
+#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */
#define H5F_ACS_FAMILY_OFFSET_NAME "family_offset" /* Offset position in file for family file driver */
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */
#define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */
@@ -396,7 +400,7 @@
#define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME "core_write_tracking_page_size" /* The page size in kiB when core VFD write tracking is enabled */
/* ======================== File Mount properties ====================*/
-#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
+#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */
#ifdef H5_HAVE_PARALLEL
@@ -405,18 +409,18 @@
#endif /* H5_HAVE_PARALLEL */
/* Define the HDF5 file signature */
-#define H5F_SIGNATURE "\211HDF\r\n\032\n"
+#define H5F_SIGNATURE "\211HDF\r\n\032\n"
#define H5F_SIGNATURE_LEN 8
/* Version #'s of the major components of the file format */
-#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
-#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
-#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
-#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The maximum super block format */
-#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
-#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
-#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
-#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
+#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */
+#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */
+#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */
+#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The maximum super block format */
+#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */
+#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */
+#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */
+#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/
/* B-tree internal 'K' values */
#define HDF5_BTREE_SNODE_IK_DEF 16
@@ -426,8 +430,8 @@
if it is changed, the code
must compensate. -QAK
*/
-#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
- /* See format specification on version 1 B-trees */
+#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */
+ /* See format specification on version 1 B-trees */
/* Macros to define signatures of all objects in the file */
@@ -436,7 +440,7 @@
#define H5_SIZEOF_MAGIC 4
/* v1 B-tree node signature */
-#define H5B_MAGIC "TREE"
+#define H5B_MAGIC "TREE"
/* v2 B-tree signatures */
#define H5B2_HDR_MAGIC "BTHD" /* Header */
@@ -461,7 +465,7 @@
#define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */
/* Global heap signature */
-#define H5HG_MAGIC "GCOL"
+#define H5HG_MAGIC "GCOL"
/* Local heap signature */
#define H5HL_MAGIC "HEAP"
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index f49ef26..584811e 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -30,12 +30,12 @@
#include "H5Gprivate.h"
/* Other private headers needed by this file */
-#include "H5B2private.h" /* v2 B-trees */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5HFprivate.h" /* Fractal heaps */
-#include "H5HLprivate.h" /* Local Heaps */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5SLprivate.h" /* Skip lists */
+#include "H5B2private.h" /* v2 B-trees */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5HFprivate.h" /* Fractal heaps */
+#include "H5HLprivate.h" /* Local Heaps */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5SLprivate.h" /* Skip lists */
/**************************/
/* Package Private Macros */
@@ -47,7 +47,7 @@
/* Size of a symbol table node on disk */
#define H5G_NODE_SIZE(f) ( \
/* General metadata fields */ \
- H5_SIZEOF_MAGIC \
+ H5_SIZEOF_MAGIC /*magic number */ \
+ 1 /* Version */ \
+ 1 /* Reserved */ \
+ 2 /* Number of symbols */ \
@@ -68,10 +68,10 @@
* symbol table entry.
*/
typedef enum H5G_cache_type_t {
- H5G_CACHED_ERROR = -1, /*force enum to be signed */
+ H5G_CACHED_ERROR = -1, /*force enum to be signed */
H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */
H5G_CACHED_STAB = 1, /*symbol table, `stab' */
- H5G_CACHED_SLINK = 2, /*symbolic link */
+ H5G_CACHED_SLINK = 2, /*symbolic link */
H5G_NCACHED /*THIS MUST BE LAST */
} H5G_cache_type_t;
@@ -90,7 +90,7 @@ typedef union H5G_cache_t {
} stab;
struct {
- size_t lval_offset; /*link value offset */
+ size_t lval_offset; /*link value offset */
} slink;
} H5G_cache_t;
@@ -159,7 +159,7 @@ typedef struct {
typedef struct H5G_bt_common_t {
/* downward */
const char *name; /*points to temporary memory */
- H5HL_t *heap; /*symbol table heap */
+ H5HL_t *heap; /*symbol table heap */
} H5G_bt_common_t;
/*
@@ -206,13 +206,13 @@ typedef struct H5G_bt_lkp_t {
*/
typedef struct H5G_bt_it_it_t {
/* downward */
- H5HL_t *heap; /*symbol table heap */
- hsize_t skip; /*initial entries to skip */
- H5G_lib_iterate_t op; /*iteration operator */
- void *op_data; /*user-defined operator data */
+ H5HL_t *heap; /*symbol table heap */
+ hsize_t skip; /*initial entries to skip */
+ H5G_lib_iterate_t op; /*iteration operator */
+ void *op_data; /*user-defined operator data */
/* upward */
- hsize_t *final_ent; /*final entry looked at */
+ hsize_t *final_ent; /*final entry looked at */
} H5G_bt_it_it_t;
/* Data passed through B-tree iteration for copying copy symbol table content */
@@ -400,7 +400,7 @@ H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src,
H5_copy_depth_t depth);
H5_DLL void H5G__ent_reset(H5G_entry_t *ent);
H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp,
- const uint8_t *p_end, H5G_entry_t *ent, unsigned n);
+ const uint8_t *p_end, H5G_entry_t *ent, unsigned n);
H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp,
const H5G_entry_t *ent, unsigned n);
H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap,
@@ -412,15 +412,15 @@ H5_DLL herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE * stream, int indent,
/* Functions that understand symbol table nodes */
H5_DLL herr_t H5G__node_init(H5F_t *f);
H5_DLL int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
- const void *_rt_key, void *_udata);
+ const void *_rt_key, void *_udata);
H5_DLL int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
- const void *_rt_key, void *_udata);
+ const void *_rt_key, void *_udata);
H5_DLL int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
- const void *_rt_key, void *_udata);
+ const void *_rt_key, void *_udata);
H5_DLL int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
- const void *_rt_key, void *_udata);
+ const void *_rt_key, void *_udata);
H5_DLL int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
- const void *_rt_key, void *_udata);
+ const void *_rt_key, void *_udata);
H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
const void *_rt_key, void *_udata);
H5_DLL herr_t H5G__node_free(H5G_node_t *sym);
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index c37721a..25252bd 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5Gprivate.h
* Jul 11 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Library-visible declarations.
*
@@ -29,9 +29,9 @@
#include "H5Gpublic.h"
/* Private headers needed by this file */
-#include "H5private.h" /* Generic Functions */
-#include "H5Bprivate.h" /* B-trees */
-#include "H5Fprivate.h" /* File access */
+#include "H5private.h" /* Generic Functions */
+#include "H5Bprivate.h" /* B-trees */
+#include "H5Fprivate.h" /* File access */
#include "H5RSprivate.h" /* Reference-counted strings */
/*
@@ -49,7 +49,7 @@
(H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \
H5F_SIZEOF_ADDR(F) + /*address of object header */ \
4 + /*entry type */ \
- 4 + /*reserved */ \
+ 4 + /*reserved */ \
H5G_SIZEOF_SCRATCH) /*scratch pad space */
/* ========= Group Creation properties ============ */
@@ -66,6 +66,7 @@
/* Definitions for link info settings */
#define H5G_CRT_LINK_INFO_NAME "link info"
#define H5G_CRT_LINK_INFO_SIZE sizeof(H5O_linfo_t)
+/* clang-format off */
#define H5G_CRT_LINK_INFO_DEF {H5G_CRT_LINFO_TRACK_CORDER, \
H5G_CRT_LINFO_INDEX_CORDER, \
H5G_CRT_LINFO_MAX_CORDER, \
@@ -74,6 +75,7 @@
H5G_CRT_LINFO_LINK_FHEAP_ADDR, \
H5G_CRT_LINFO_NAME_BT2_ADDR \
}
+/* clang-format on */
/* Defaults for group info values */
#define H5G_CRT_GINFO_LHEAP_SIZE_HINT 0
@@ -87,6 +89,7 @@
/* Definitions for group info settings */
#define H5G_CRT_GROUP_INFO_NAME "group info"
#define H5G_CRT_GROUP_INFO_SIZE sizeof(H5O_ginfo_t)
+/* clang-format off */
#define H5G_CRT_GROUP_INFO_DEF {H5G_CRT_GINFO_LHEAP_SIZE_HINT, \
H5G_CRT_GINFO_STORE_LINK_PHASE_CHANGE, \
H5G_CRT_GINFO_MAX_COMPACT, \
@@ -95,6 +98,7 @@
H5G_CRT_GINFO_EST_NUM_ENTRIES, \
H5G_CRT_GINFO_EST_NAME_LEN \
}
+/* clang-format on */
/* If the module using this macro is allowed access to the private variables, access them directly */
#ifdef H5G_PACKAGE
@@ -108,12 +112,12 @@
* a symbolic link or a mount point. The normal operation is to follow the
* symbolic link or mount point and return information about its target.
*/
-#define H5G_TARGET_NORMAL 0x0000
-#define H5G_TARGET_SLINK 0x0001
-#define H5G_TARGET_MOUNT 0x0002
-#define H5G_TARGET_UDLINK 0x0004
-#define H5G_TARGET_EXISTS 0x0008
-#define H5G_CRT_INTMD_GROUP 0x0010
+#define H5G_TARGET_NORMAL 0x0000
+#define H5G_TARGET_SLINK 0x0001
+#define H5G_TARGET_MOUNT 0x0002
+#define H5G_TARGET_UDLINK 0x0004
+#define H5G_TARGET_EXISTS 0x0008
+#define H5G_CRT_INTMD_GROUP 0x0010
/* Type of operation being performed for call to H5G_name_replace() */
typedef enum {
@@ -222,7 +226,7 @@ H5_DLL herr_t H5G_visit(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data,
hid_t lapl_id, hid_t dxpl_id);
-/*
+/*
* Functions that understand links in groups
*/
H5_DLL herr_t H5G_link_to_info(const struct H5O_link_t *lnk, H5L_info_t *linfo);
@@ -248,7 +252,7 @@ H5_DLL hid_t H5G_get_create_plist(H5G_t *grp);
*/
H5_DLL herr_t H5G_node_close(const H5F_t *f);
H5_DLL herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream,
- int indent, int fwidth, haddr_t heap);
+ int indent, int fwidth, haddr_t heap);
/*
* These functions operate on group object locations.
diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h
index 23243eb..3052de4 100644
--- a/src/H5Lprivate.h
+++ b/src/H5Lprivate.h
@@ -22,8 +22,8 @@
#include "H5Lpublic.h"
/* Private headers needed by this file */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Oprivate.h" /* Object headers */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Oprivate.h" /* Object headers */
/**************************/
@@ -37,11 +37,16 @@
#define H5L_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group" /* Create intermediate groups flag */
/* ======== Link access property names ======== */
-#define H5L_ACS_NLINKS_NAME "max soft links" /* Number of soft links to traverse */
-#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix" /* External link prefix */
-#define H5L_ACS_ELINK_FAPL_NAME "external link fapl" /* file access property list for external link access */
-#define H5L_ACS_ELINK_FLAGS_NAME "external link flags" /* file access flags for external link traversal */
-#define H5L_ACS_ELINK_CB_NAME "external link callback" /* callback function for external link traversal */
+/* Number of soft links to traverse */
+#define H5L_ACS_NLINKS_NAME "max soft links"
+/* External link prefix */
+#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix"
+/* file access property list for external link access */
+#define H5L_ACS_ELINK_FAPL_NAME "external link fapl"
+/* file access flags for external link traversal */
+#define H5L_ACS_ELINK_FLAGS_NAME "external link flags"
+/* callback function for external link traversal */
+#define H5L_ACS_ELINK_CB_NAME "external link callback"
/****************************/
diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h
index 9d1643e..4ed89b2 100644
--- a/src/H5Lpublic.h
+++ b/src/H5Lpublic.h
@@ -25,9 +25,9 @@
#define _H5Lpublic_H
/* Public headers needed by this file */
-#include "H5public.h" /* Generic Functions */
-#include "H5Ipublic.h" /* IDs */
-#include "H5Tpublic.h" /* Datatypes */
+#include "H5public.h" /* Generic Functions */
+#include "H5Ipublic.h" /* IDs */
+#include "H5Tpublic.h" /* Datatypes */
/*****************/
/* Public Macros */
@@ -56,7 +56,7 @@ extern "C" {
* Values 64 to 255 are for "user-defined" link class types; these types are
* defined by HDF5 but their behavior can be overridden by users.
* Users who want to create new classes of links should contact the HDF5
- * development team at hdfhelp@ncsa.uiuc.edu .
+ * development team at help@hdfgroup.org.
* These values can never change because they appear in HDF5 files.
*/
typedef enum {
@@ -64,10 +64,12 @@ typedef enum {
H5L_TYPE_HARD = 0, /* Hard link id */
H5L_TYPE_SOFT = 1, /* Soft link id */
H5L_TYPE_EXTERNAL = 64, /* External link id */
- H5L_TYPE_MAX = 255 /* Maximum link type id */
+ H5L_TYPE_MAX = 255 /* Maximum link type id */
} H5L_type_t;
-#define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT /* Maximum value link value for "built-in" link types */
-#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL /* Link ids at or above this value are "user-defined" link types. */
+/* Maximum value link value for "built-in" link types */
+#define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT
+/* Link ids at or above this value are "user-defined" link types. */
+#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL
/* Information struct for link (for H5Lget_info/H5Lget_info_by_idx) */
typedef struct {
diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h
index 61b8c20..6ecdc8a 100644
--- a/src/H5MFpkg.h
+++ b/src/H5MFpkg.h
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Tuesday, January 8, 2008
+ * Programmer: Quincey Koziol
+ * Tuesday, January 8, 2008
*
- * Purpose: This file contains declarations which are visible only within
- * the H5MF package. Source files outside the H5MF package should
- * include H5MFprivate.h instead.
+ * Purpose: This file contains declarations which are visible only within
+ * the H5MF package. Source files outside the H5MF package should
+ * include H5MFprivate.h instead.
*/
#ifndef H5MF_PACKAGE
#error "Do not include this file outside the H5MF package!"
@@ -30,7 +30,7 @@
#include "H5MFprivate.h"
/* Other private headers needed by this file */
-#include "H5FSprivate.h" /* File free space */
+#include "H5FSprivate.h" /* File free space */
/**************************/
diff --git a/src/H5PL.c b/src/H5PL.c
index c383cfb..950b527 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -855,6 +855,16 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting
+ * object pointers to function pointers, which is undefined in ANSI C.
+ * This is basically unavoidable due to the nature of dlsym() and *is*
+ * defined in POSIX, so it's fine.
+ *
+ * This pragma only needs to surround the assignment of the
+ * get_plugin_info function pointer, but early (4.4.7, at least) gcc
+ * only allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF("pedantic")
static htri_t
H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info)
{
@@ -973,6 +983,7 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__search_table() */
+H5_GCC_DIAG_ON("pedantic")
/*-------------------------------------------------------------------------
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 90391aa..cf131a7 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -12,31 +12,31 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Module Info: Datatype conversions for the H5T interface.
+ * Module Info: Datatype conversions for the H5T interface.
*/
/****************/
/* Module Setup */
/****************/
-#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+#define H5T_PACKAGE /*suppress error about including H5Tpkg */
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5T_init_conv_interface
+#define H5_INTERFACE_INIT_FUNC H5T_init_conv_interface
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5HGprivate.h" /* Global Heaps */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5HGprivate.h" /* Global Heaps */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tpkg.h" /* Datatypes */
/****************/
@@ -59,57 +59,57 @@
* source value has a magnitude that cannot be represented by the destination
* type.
*
- * Suffix Description
- * ------ -----------
- * sS: Signed integers to signed integers where the destination is
- * at least as wide as the source. This case cannot generate
- * overflows.
+ * Suffix Description
+ * ------ -----------
+ * sS: Signed integers to signed integers where the destination is
+ * at least as wide as the source. This case cannot generate
+ * overflows.
*
- * sU: Signed integers to unsigned integers where the destination is
- * at least as wide as the source. This case experiences
- * overflows when the source value is negative.
+ * sU: Signed integers to unsigned integers where the destination is
+ * at least as wide as the source. This case experiences
+ * overflows when the source value is negative.
*
- * uS: Unsigned integers to signed integers where the destination is
- * at least as wide as the source. This case can experience
- * overflows when the source and destination are the same size.
+ * uS: Unsigned integers to signed integers where the destination is
+ * at least as wide as the source. This case can experience
+ * overflows when the source and destination are the same size.
*
- * uU: Unsigned integers to unsigned integers where the destination
- * is at least as wide as the source. Overflows are not
- * possible in this case.
+ * uU: Unsigned integers to unsigned integers where the destination
+ * is at least as wide as the source. Overflows are not
+ * possible in this case.
*
- * Ss: Signed integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ss: Signed integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
- * Su: Signed integers to unsigned integers where the source is at
- * least as large as the destination. Overflows occur when the
- * source value is negative and can also occur if the
- * destination is narrower than the source.
+ * Su: Signed integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows occur when the
+ * source value is negative and can also occur if the
+ * destination is narrower than the source.
*
- * Us: Unsigned integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur for
- * all sizes.
+ * Us: Unsigned integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur for
+ * all sizes.
*
- * Uu: Unsigned integers to unsigned integers where the source is at
- * least as large as the destination. Overflows can occur if the
- * destination is narrower than the source.
+ * Uu: Unsigned integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows can occur if the
+ * destination is narrower than the source.
*
- * su: Conversion from signed integers to unsigned integers where
- * the source and destination are the same size. Overflow occurs
- * when the source value is negative.
+ * su: Conversion from signed integers to unsigned integers where
+ * the source and destination are the same size. Overflow occurs
+ * when the source value is negative.
*
- * us: Conversion from unsigned integers to signed integers where
- * the source and destination are the same size. Overflow
- * occurs when the source magnitude is too large for the
- * destination.
+ * us: Conversion from unsigned integers to signed integers where
+ * the source and destination are the same size. Overflow
+ * occurs when the source magnitude is too large for the
+ * destination.
*
- * fF: Floating-point values to floating-point values where the
- * destination is at least as wide as the source. This case
+ * fF: Floating-point values to floating-point values where the
+ * destination is at least as wide as the source. This case
* cannot generate overflows.
*
- * Ff: Floating-point values to floating-point values the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ff: Floating-point values to floating-point values the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
* xF: Integers to float-point(float or double) values where the desination
* is at least as wide as the source. This case cannot generate
@@ -121,29 +121,29 @@
*
* The macros take a subset of these arguments in the order listed here:
*
- * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
- * conversion function.
+ * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
+ * conversion function.
*
- * STYPE: The hid_t value for the source datatype.
+ * STYPE: The hid_t value for the source datatype.
*
- * DTYPE: The hid_t value for the destination datatype.
+ * DTYPE: The hid_t value for the destination datatype.
*
- * BUF: A pointer to the conversion buffer.
+ * BUF: A pointer to the conversion buffer.
*
- * NELMTS: The number of values to be converted.
+ * NELMTS: The number of values to be converted.
*
- * ST: The C name for source datatype (e.g., int)
+ * ST: The C name for source datatype (e.g., int)
*
- * DT: The C name for the destination datatype (e.g., signed char)
+ * DT: The C name for the destination datatype (e.g., signed char)
*
- * D_MIN: The minimum possible destination value. For unsigned
- * destination types this should be zero. For signed
- * destination types it's a negative value with a magnitude that
- * is usually one greater than D_MAX. Source values which are
- * smaller than D_MIN generate overflows.
+ * D_MIN: The minimum possible destination value. For unsigned
+ * destination types this should be zero. For signed
+ * destination types it's a negative value with a magnitude that
+ * is usually one greater than D_MAX. Source values which are
+ * smaller than D_MIN generate overflows.
*
- * D_MAX: The maximum possible destination value. Source values which
- * are larger than D_MAX generate overflows.
+ * D_MAX: The maximum possible destination value. Source values which
+ * are larger than D_MAX generate overflows.
*
* The macros are implemented with a generic programming technique, similar
* to templates in C++. The macro which defines the "core" part of the
@@ -158,25 +158,25 @@
*
* The generic "core" macros are: (others are specific to particular conversion)
*
- * Suffix Description
- * ------ -----------
- * xX: Generic Conversion where the destination is at least as
+ * Suffix Description
+ * ------ -----------
+ * xX: Generic Conversion where the destination is at least as
* wide as the source. This case cannot generate overflows.
*
- * Xx: Generic signed conversion where the source is at least as large
+ * Xx: Generic signed conversion where the source is at least as large
* as the destination. Overflows can occur when the destination is
* narrower than the source.
*
- * Ux: Generic conversion for the `Us', `Uu' & `us' cases
- * Overflow occurs when the source magnitude is too large for the
- * destination.
+ * Ux: Generic conversion for the `Us', `Uu' & `us' cases
+ * Overflow occurs when the source magnitude is too large for the
+ * destination.
*
*/
-#define H5T_CONV_xX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xX_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xX_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
/* Added a condition branch(else if (*(S) == (DT)(D_MAX))) which seems redundant.
@@ -186,13 +186,13 @@
* equal. In this case, do not return exception but make sure the maximum is assigned
* to the destination. SLU - 2005/06/29
*/
-#define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -201,114 +201,114 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
} else if (*(S) < (ST)(D_MIN)) { \
- *(D) = (DT)(D_MIN); \
- } else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MIN); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
- *(D) = (DT)(D_MAX); \
- } else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sU_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_sU_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) \
- *(D) = 0; \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = 0; \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(sizeof(ST) == sizeof(DT) && *(S) > (DT)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \
- *(D) = (D_MAX); \
- } else \
- *(D) = (DT)(*(S)); \
+ *(D) = (D_MAX); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -317,106 +317,106 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) \
- *(D) = 0; \
+ *(D) = 0; \
else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) < 0) \
- *(D) = 0; \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = 0; \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)==sizeof(DT)); \
+#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)==sizeof(DT)); \
H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)==sizeof(DT)); \
+#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)==sizeof(DT)); \
H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
/* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN
* when an overflow occurs, use the 'float' infinity values.
*/
-#define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -425,24 +425,24 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
else if (*(S) < (ST)(D_MIN)) \
- *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
@@ -505,35 +505,35 @@
LO = count; \
}
-#define H5T_CONV_xF_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (sprec > dprec) { \
+#define H5T_CONV_xF_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ if (sprec > dprec) { \
unsigned low_bit_pos, high_bit_pos; \
\
/* Detect high & low bits set in source */ \
H5T_HI_LO_BIT_SET(ST, *(S), low_bit_pos, high_bit_pos) \
\
/* Check for more bits of precision in src than available in dst */ \
- if((high_bit_pos - low_bit_pos) >= dprec) { \
+ if((high_bit_pos - low_bit_pos) >= dprec) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } \
+ } \
else \
- *(D) = (DT)(*(S)); \
- } \
+ *(D) = (DT)(*(S)); \
+ } \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xF_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xF_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
@@ -545,13 +545,13 @@
* (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under
* the same situation the "int" doesn't overflow. SLU - 2005/9/12
*/
-#define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -560,7 +560,7 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -569,24 +569,24 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } \
+ } \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(*(S) < (ST)(D_MIN)) \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
@@ -595,77 +595,77 @@
* to do them all.
*/
#ifndef H5_WANT_DCONV_EXCEPTION
-#define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
#endif /* H5_WANT_DCONV_EXCEPTION */
/* The main part of every integer hardware conversion macro */
-#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \
+#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \
{ \
herr_t ret_value=SUCCEED; /* Return value */ \
\
FUNC_ENTER_PACKAGE \
\
{ \
- size_t elmtno; /*element number */ \
+ size_t elmtno; /*element number */ \
H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \
- uint8_t *src_buf; /*'raw' source buffer */ \
- uint8_t *dst_buf; /*'raw' destination buffer */ \
- ST *src, *s; /*source buffer */ \
- DT *dst, *d; /*destination buffer */ \
- H5T_t *st, *dt; /*datatype descriptors */ \
- ST src_aligned; /*source aligned type */ \
- DT dst_aligned; /*destination aligned type */ \
- hbool_t s_mv, d_mv; /*move data to align it? */ \
- ssize_t s_stride, d_stride; /*src and dst strides */ \
+ uint8_t *src_buf; /*'raw' source buffer */ \
+ uint8_t *dst_buf; /*'raw' destination buffer */ \
+ ST *src, *s; /*source buffer */ \
+ DT *dst, *d; /*destination buffer */ \
+ H5T_t *st, *dt; /*datatype descriptors */ \
+ ST src_aligned; /*source aligned type */ \
+ DT dst_aligned; /*destination aligned type */ \
+ hbool_t s_mv, d_mv; /*move data to align it? */ \
+ ssize_t s_stride, d_stride; /*src and dst strides */ \
size_t safe; /*how many elements are safe to process in each pass */ \
H5P_genplist_t *plist; /*Property list pointer */ \
H5T_conv_cb_t cb_struct; /*conversion callback structure */ \
\
- switch (cdata->command) { \
- case H5T_CONV_INIT: \
- /* Sanity check and initialize statistics */ \
- cdata->need_bkg = H5T_BKG_NO; \
+ switch (cdata->command) { \
+ case H5T_CONV_INIT: \
+ /* Sanity check and initialize statistics */ \
+ cdata->need_bkg = H5T_BKG_NO; \
if (NULL==(st=(H5T_t*)H5I_object(src_id)) || NULL==(dt=(H5T_t*)H5I_object(dst_id))) \
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
- "unable to dereference datatype object ID") \
- if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
- "disagreement about datatype size") \
- CI_ALLOC_PRIV \
- break; \
- \
- case H5T_CONV_FREE: \
- /* Print and free statistics */ \
- CI_PRINT_STATS(STYPE,DTYPE); \
- CI_FREE_PRIV \
- break; \
- \
- case H5T_CONV_CONV: \
- /* Initialize source & destination strides */ \
- if (buf_stride) { \
- HDassert(buf_stride >= sizeof(ST)); \
- HDassert(buf_stride >= sizeof(DT)); \
- s_stride = d_stride = (ssize_t)buf_stride; \
- } else { \
- s_stride = sizeof(ST); \
- d_stride = sizeof(DT); \
- } \
- \
- /* Is alignment required for source or dest? */ \
- s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \
- ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \
- /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \
- (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
- d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \
- ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \
- /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \
- (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
- CI_INC_SRC(s_mv) \
- CI_INC_DST(d_mv) \
- \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
+ "unable to dereference datatype object ID") \
+ if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
+ "disagreement about datatype size") \
+ CI_ALLOC_PRIV \
+ break; \
+ \
+ case H5T_CONV_FREE: \
+ /* Print and free statistics */ \
+ CI_PRINT_STATS(STYPE,DTYPE); \
+ CI_FREE_PRIV \
+ break; \
+ \
+ case H5T_CONV_CONV: \
+ /* Initialize source & destination strides */ \
+ if (buf_stride) { \
+ HDassert(buf_stride >= sizeof(ST)); \
+ HDassert(buf_stride >= sizeof(DT)); \
+ s_stride = d_stride = (ssize_t)buf_stride; \
+ } else { \
+ s_stride = sizeof(ST); \
+ d_stride = sizeof(DT); \
+ } \
+ \
+ /* Is alignment required for source or dest? */ \
+ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \
+ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \
+ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \
+ (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
+ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \
+ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \
+ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \
+ (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ CI_INC_SRC(s_mv) \
+ CI_INC_DST(d_mv) \
+ \
/* Get the plist structure */ \
if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) \
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") \
@@ -674,72 +674,72 @@
if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) \
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \
\
- /* Get source and destination datatypes */ \
+ /* Get source and destination datatypes */ \
if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \
- \
+ \
H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \
\
/* The outer loop of the type conversion macro, controlling which */ \
- /* direction the buffer is walked */ \
- while (nelmts>0) { \
- /* Check if we need to go backwards through the buffer */ \
- if(d_stride>s_stride) { \
+ /* direction the buffer is walked */ \
+ while (nelmts>0) { \
+ /* Check if we need to go backwards through the buffer */ \
+ if(d_stride>s_stride) { \
/* Compute the number of "safe" destination elements at */ \
/* the end of the buffer (Those which don't overlap with */ \
/* any source elements at the beginning of the buffer) */ \
safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \
- \
+ \
/* If we're down to the last few elements, just wrap up */ \
- /* with a "real" reverse copy */ \
- if(safe<2) { \
+ /* with a "real" reverse copy */ \
+ if(safe<2) { \
src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \
dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \
- s_stride = -s_stride; \
- d_stride = -d_stride; \
- \
- safe=nelmts; \
- } /* end if */ \
- else { \
+ s_stride = -s_stride; \
+ d_stride = -d_stride; \
+ \
+ safe=nelmts; \
+ } /* end if */ \
+ else { \
src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \
dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \
- } /* end else */ \
- } /* end if */ \
- else { \
- /* Single forward pass over all data */ \
- src = (ST *)(src_buf = (uint8_t*)buf); \
- dst = (DT *)(dst_buf = (uint8_t*)buf); \
- safe=nelmts; \
- } /* end else */ \
+ } /* end else */ \
+ } /* end if */ \
+ else { \
+ /* Single forward pass over all data */ \
+ src = (ST *)(src_buf = (uint8_t*)buf); \
+ dst = (DT *)(dst_buf = (uint8_t*)buf); \
+ safe=nelmts; \
+ } /* end else */ \
\
- /* Perform loop over elements to convert */ \
- if (s_mv && d_mv) { \
- /* Alignment is required for both source and dest */ \
- s = &src_aligned; \
+ /* Perform loop over elements to convert */ \
+ if (s_mv && d_mv) { \
+ /* Alignment is required for both source and dest */ \
+ s = &src_aligned; \
H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DALIGN,POST_SALIGN,POST_DALIGN,GUTS,s,d,ST,DT,D_MIN,D_MAX) \
- } else if(s_mv) { \
- /* Alignment is required only for source */ \
- s = &src_aligned; \
+ } else if(s_mv) { \
+ /* Alignment is required only for source */ \
+ s = &src_aligned; \
H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DNOALIGN,POST_SALIGN,POST_DNOALIGN,GUTS,s,dst,ST,DT,D_MIN,D_MAX) \
- } else if(d_mv) { \
- /* Alignment is required only for destination */ \
+ } else if(d_mv) { \
+ /* Alignment is required only for destination */ \
H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DALIGN,POST_SNOALIGN,POST_DALIGN,GUTS,src,d,ST,DT,D_MIN,D_MAX) \
- } else { \
+ } else { \
/* Alignment is not required for both source and destination */ \
H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DNOALIGN,POST_SNOALIGN,POST_DNOALIGN,GUTS,src,dst,ST,DT,D_MIN,D_MAX) \
- } \
- \
- /* Decrement number of elements left to convert */ \
- nelmts-=safe; \
- } /* end while */ \
- break; \
- \
- default: \
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, \
- "unknown conversion command"); \
- } \
+ } \
+ \
+ /* Decrement number of elements left to convert */ \
+ nelmts-=safe; \
+ } /* end while */ \
+ break; \
+ \
+ default: \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, \
+ "unknown conversion command"); \
+ } \
} \
- \
+ \
done: \
FUNC_LEAVE_NOAPI(ret_value) \
}
@@ -748,9 +748,9 @@ done: \
#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC)
#define H5T_CONV_DECL_PREC_Y \
- size_t sprec; /*source precision */ \
- size_t dprec; /*destination precision */ \
- H5T_class_t tclass; /*datatype's class */
+ size_t sprec; /*source precision */ \
+ size_t dprec; /*destination precision */ \
+ H5T_class_t tclass; /*datatype's class */
#define H5T_CONV_DECL_PREC_N /*no precision variables */
@@ -758,60 +758,60 @@ done: \
#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC)
#define H5T_CONV_SET_PREC_Y \
- /* Get source & destination precisions into a variable */ \
- tclass = st->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- sprec = st->shared->u.atomic.prec; \
- else \
- sprec = 1 + st->shared->u.atomic.u.f.msize; \
- tclass = dt->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- dprec = dt->shared->u.atomic.prec; \
- else \
+ /* Get source & destination precisions into a variable */ \
+ tclass = st->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ sprec = st->shared->u.atomic.prec; \
+ else \
+ sprec = 1 + st->shared->u.atomic.u.f.msize; \
+ tclass = dt->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ dprec = dt->shared->u.atomic.prec; \
+ else \
dprec = 1 + dt->shared->u.atomic.u.f.msize;
#define H5T_CONV_SET_PREC_N /*don't init precision variables */
/* Macro defining action on source data which needs to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_SALIGN(ST) { \
- HDmemcpy(&src_aligned, src, sizeof(ST)); \
+#define H5T_CONV_LOOP_PRE_SALIGN(ST) { \
+ HDmemcpy(&src_aligned, src, sizeof(ST)); \
}
/* Macro defining action on source data which doesn't need to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_SNOALIGN(ST) { \
+#define H5T_CONV_LOOP_PRE_SNOALIGN(ST) { \
}
/* Macro defining action on destination data which needs to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_DALIGN(DT) { \
- d = &dst_aligned; \
+#define H5T_CONV_LOOP_PRE_DALIGN(DT) { \
+ d = &dst_aligned; \
}
/* Macro defining action on destination data which doesn't need to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_DNOALIGN(DT) { \
+#define H5T_CONV_LOOP_PRE_DNOALIGN(DT) { \
}
/* Macro defining action on source data which needs to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_SALIGN(ST) { \
+#define H5T_CONV_LOOP_POST_SALIGN(ST) { \
}
/* Macro defining action on source data which doesn't need to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_SNOALIGN(ST) { \
+#define H5T_CONV_LOOP_POST_SNOALIGN(ST) { \
}
/* Macro defining action on destination data which needs to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_DALIGN(DT) { \
- HDmemcpy(dst, &dst_aligned, sizeof(DT)); \
+#define H5T_CONV_LOOP_POST_DALIGN(DT) { \
+ HDmemcpy(dst, &dst_aligned, sizeof(DT)); \
}
/* Macro defining action on destination data which doesn't need to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_DNOALIGN(DT) { \
+#define H5T_CONV_LOOP_POST_DNOALIGN(DT) { \
}
/* The outer wrapper for the type conversion loop, to check for an exception handling routine */
#define H5T_CONV_LOOP_OUTER(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \
- if(cb_struct.func) { \
+ if(cb_struct.func) { \
H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \
} \
else { \
@@ -820,36 +820,36 @@ done: \
/* The inner loop of the type conversion macro, actually converting the elements */
#define H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \
- for (elmtno=0; elmtno<safe; elmtno++) { \
- /* Handle source pre-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,PRE_SALIGN_GUTS)(ST) \
+ for (elmtno=0; elmtno<safe; elmtno++) { \
+ /* Handle source pre-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,PRE_SALIGN_GUTS)(ST) \
\
- /* Handle destination pre-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,PRE_DALIGN_GUTS)(DT) \
+ /* Handle destination pre-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,PRE_DALIGN_GUTS)(DT) \
\
- /* ... user-defined stuff here -- the conversion ... */ \
- H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
+ /* ... user-defined stuff here -- the conversion ... */ \
+ H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
\
- /* Handle source post-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,POST_SALIGN_GUTS)(ST) \
+ /* Handle source post-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,POST_SALIGN_GUTS)(ST) \
\
- /* Handle destination post-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,POST_DALIGN_GUTS)(DT) \
+ /* Handle destination post-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,POST_DALIGN_GUTS)(DT) \
\
- /* Advance pointers */ \
- src_buf += s_stride; \
- src = (ST *)src_buf; \
- dst_buf += d_stride; \
- dst = (DT *)dst_buf; \
+ /* Advance pointers */ \
+ src_buf += s_stride; \
+ src = (ST *)src_buf; \
+ dst_buf += d_stride; \
+ dst = (DT *)dst_buf; \
}
/* Macro to call the actual "guts" of the type conversion, or call the "no exception" guts */
#ifdef H5_WANT_DCONV_EXCEPTION
-#define H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
- /* ... user-defined stuff here -- the conversion ... */ \
+#define H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
+ /* ... user-defined stuff here -- the conversion ... */ \
H5_GLUE(GUTS,_CORE)(S,D,ST,DT,D_MIN,D_MAX)
#else /* H5_WANT_DCONV_EXCEPTION */
-#define H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
+#define H5T_CONV_LOOP_GUTS(GUTS,S,D,ST,DT,D_MIN,D_MAX) \
H5_GLUE(H5T_CONV_NO_EXCEPT,_CORE)(S,D,ST,DT,D_MIN,D_MAX)
#endif /* H5_WANT_DCONV_EXCEPTION */
@@ -857,27 +857,27 @@ done: \
#ifdef H5T_DEBUG
/* Print alignment statistics */
-# define CI_PRINT_STATS(STYPE,DTYPE) { \
- if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \
- HDfprintf(H5DEBUG(T), \
- " %Hu src elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \
- (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \
- } \
- if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \
- HDfprintf(H5DEBUG(T), \
- " %Hu dst elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \
- (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \
- } \
+# define CI_PRINT_STATS(STYPE,DTYPE) { \
+ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \
+ HDfprintf(H5DEBUG(T), \
+ " %Hu src elements aligned on %lu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \
+ (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \
+ } \
+ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \
+ HDfprintf(H5DEBUG(T), \
+ " %Hu dst elements aligned on %lu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \
+ (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ } \
}
/* Allocate private alignment structure for atomic types */
# define CI_ALLOC_PRIV \
- if (NULL==(cdata->priv=H5MM_calloc(sizeof(H5T_conv_hw_t)))) { \
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "memory allocation failed"); \
- }
+ if (NULL==(cdata->priv=H5MM_calloc(sizeof(H5T_conv_hw_t)))) { \
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
+ "memory allocation failed"); \
+ }
/* Free private alignment structure for atomic types */
# define CI_FREE_PRIV \
@@ -909,25 +909,25 @@ done: \
/* Conversion data for H5T__conv_struct() */
typedef struct H5T_conv_struct_t {
- int *src2dst; /*mapping from src to dst member num */
- hid_t *src_memb_id; /*source member type ID's */
- hid_t *dst_memb_id; /*destination member type ID's */
- H5T_path_t **memb_path; /*conversion path for each member */
+ int *src2dst; /*mapping from src to dst member num */
+ hid_t *src_memb_id; /*source member type ID's */
+ hid_t *dst_memb_id; /*destination member type ID's */
+ H5T_path_t **memb_path; /*conversion path for each member */
H5T_subset_info_t subset_info; /*info related to compound subsets */
unsigned src_nmembs; /*needed by free function */
} H5T_conv_struct_t;
/* Conversion data for H5T__conv_enum() */
typedef struct H5T_enum_struct_t {
- int base; /*lowest `in' value */
- unsigned length; /*num elements in arrays */
- int *src2dst; /*map from src to dst index */
+ int base; /*lowest `in' value */
+ unsigned length; /*num elements in arrays */
+ int *src2dst; /*map from src to dst index */
} H5T_enum_struct_t;
/* Conversion data for the hardware conversion functions */
typedef struct H5T_conv_hw_t {
- size_t s_aligned; /*number source elements aligned */
- size_t d_aligned; /*number destination elements aligned*/
+ size_t s_aligned; /*number source elements aligned */
+ size_t d_aligned; /*number destination elements aligned*/
} H5T_conv_hw_t;
/********************/
@@ -941,7 +941,7 @@ typedef struct H5T_conv_hw_t {
static herr_t H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order);
-
+
/*********************/
/* Public Variables */
/*********************/
@@ -967,7 +967,7 @@ H5FL_BLK_DEFINE_STATIC(vlen_seq);
/* Declare a free list to manage pieces of array data */
H5FL_BLK_DEFINE_STATIC(array_seq);
-
+
/*--------------------------------------------------------------------------
NAME
H5T_init_conv_interface -- Initialize interface-specific information
@@ -989,23 +989,23 @@ H5T_init_conv_interface(void)
/*-------------------------------------------------------------------------
- * Function: H5T__conv_noop
+ * Function: H5T__conv_noop
*
- * Purpose: The no-op conversion. The library knows about this
- * conversion without it being registered.
+ * Purpose: The no-op conversion. The library knows about this
+ * conversion without it being registered.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Wednesday, January 14, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, January 14, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cdata_t *cdata,
- size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride,
+ size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf,
- void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id)
+ void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1031,20 +1031,20 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_noop() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_order_opt
+ * Function: H5T__conv_order_opt
*
- * Purpose: Convert one type to another when byte order is the only
- * difference. This is the optimized version of H5T__conv_order()
+ * Purpose: Convert one type to another when byte order is the only
+ * difference. This is the optimized version of H5T__conv_order()
* for a handful of different sizes.
*
- * Note: This is a soft conversion function.
+ * Note: This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, January 25, 2002
+ * Programmer: Robb Matzke
+ * Friday, January 25, 2002
*
* Modifications:
*
@@ -1056,9 +1056,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL;
- H5T_t *dst = NULL;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL;
+ H5T_t *dst = NULL;
size_t i;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1448,38 +1448,38 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T__conv_order
+ * Function: H5T__conv_order
*
- * Purpose: Convert one type to another when byte order is the only
- * difference.
+ * Purpose: Convert one type to another when byte order is the only
+ * difference.
*
- * Note: This is a soft conversion function.
+ * Note: This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, January 13, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, January 13, 1998
*
* Modifications:
- * Robb Matzke, 1999-06-16
- * Added the `stride' argument. If its value is non-zero then we
- * stride through memory converting one value at each location;
- * otherwise we assume that the values should be packed.
+ * Robb Matzke, 1999-06-16
+ * Added the `stride' argument. If its value is non-zero then we
+ * stride through memory converting one value at each location;
+ * otherwise we assume that the values should be packed.
*
- * Robb Matzke, 1999-06-16
- * Added support for bitfields.
+ * Robb Matzke, 1999-06-16
+ * Added support for bitfields.
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL;
- H5T_t *dst = NULL;
- size_t i;
- size_t j, md;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL;
+ H5T_t *dst = NULL;
+ size_t i;
+ size_t j, md;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1556,40 +1556,40 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_order() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_b_b
+ * Function: H5T__conv_b_b
*
- * Purpose: Convert from one bitfield to any other bitfield.
+ * Purpose: Convert from one bitfield to any other bitfield.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, May 20, 1999
+ * Programmer: Robb Matzke
+ * Thursday, May 20, 1999
*
* Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background, hid_t dxpl_id)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */
- ssize_t direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t olap; /*num overlapping elements */
- size_t half_size; /*1/2 of total size for swapping*/
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t dbuf[256]; /*temp destination buffer */
- size_t msb_pad_offset; /*offset for dest MSB padding */
- size_t i;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */
+ ssize_t direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t olap; /*num overlapping elements */
+ size_t half_size; /*1/2 of total size for swapping*/
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ uint8_t dbuf[256]; /*temp destination buffer */
+ size_t msb_pad_offset; /*offset for dest MSB padding */
+ size_t i;
uint8_t *src_rev=NULL; /*order-reversed source buffer */
H5P_genplist_t *plist; /*property list pointer */
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
@@ -1809,17 +1809,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_b_b() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_struct_free
+ * Function: H5T_conv_struct_free
*
- * Purpose: Free the private data structure used by the compound
+ * Purpose: Free the private data structure used by the compound
* conversion functions.
*
- * Return: The result of H5MM_xfree(priv) (NULL)
+ * Return: The result of H5MM_xfree(priv) (NULL)
*
- * Programmer: Neil Fortner
- * Wednesday, October 1, 2008
+ * Programmer: Neil Fortner
+ * Wednesday, October 1, 2008
*
* Modifications:
*
@@ -1853,29 +1853,29 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv))
} /* end H5T_conv_struct_free() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_struct_init
+ * Function: H5T_conv_struct_init
*
- * Purpose: Initialize the `priv' field of `cdata' with conversion
- * information that is relatively constant. If `priv' is
- * already initialized then the member conversion functions
- * are recalculated.
+ * Purpose: Initialize the `priv' field of `cdata' with conversion
+ * information that is relatively constant. If `priv' is
+ * already initialized then the member conversion functions
+ * are recalculated.
*
- * Priv fields are indexed by source member number or
- * destination member number depending on whether the field
- * contains information about the source datatype or the
- * destination datatype (fields that contains the same
- * information for both source and destination are indexed by
- * source member number). The src2dst[] priv array maps source
- * member numbers to destination member numbers, but if the
- * source member doesn't have a corresponding destination member
- * then the src2dst[i]=-1.
+ * Priv fields are indexed by source member number or
+ * destination member number depending on whether the field
+ * contains information about the source datatype or the
+ * destination datatype (fields that contains the same
+ * information for both source and destination are indexed by
+ * source member number). The src2dst[] priv array maps source
+ * member numbers to destination member numbers, but if the
+ * source member doesn't have a corresponding destination member
+ * then the src2dst[i]=-1.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Monday, January 26, 1998
+ * Programmer: Robb Matzke
+ * Monday, January 26, 1998
*
* Modifications:
* Raymond Lu, 3 May 2007
@@ -1905,10 +1905,10 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
static herr_t
H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id)
{
- H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv);
- int *src2dst = NULL;
+ H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv);
+ int *src2dst = NULL;
unsigned src_nmembs, dst_nmembs;
- unsigned i, j;
+ unsigned i, j;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1955,8 +1955,8 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id)
} /* end if */
} /* end for */
if(src2dst[i] >= 0) {
- hid_t tid;
- H5T_t *type;
+ hid_t tid;
+ H5T_t *type;
type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL);
tid = H5I_register(H5I_DATATYPE, type, FALSE);
@@ -2046,9 +2046,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_conv_struct_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct_subset
+ * Function: H5T__conv_struct_subset
*
* Purpose: A quick way to return a field in a struct private in this
* file. The flag SMEMBS_SUBSET indicates whether the source
@@ -2066,15 +2066,15 @@ done:
* Return: A pointer to the subset info struct in p. Points directly
* into the structure.
*
- * Programmer: Raymond Lu
- * 8 June 2007
+ * Programmer: Raymond Lu
+ * 8 June 2007
*
*-------------------------------------------------------------------------
*/
H5T_subset_info_t *
H5T__conv_struct_subset(const H5T_cdata_t *cdata)
{
- H5T_conv_struct_t *priv;
+ H5T_conv_struct_t *priv;
FUNC_ENTER_PACKAGE_NOERR
@@ -2086,30 +2086,30 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata)
FUNC_LEAVE_NOAPI((H5T_subset_info_t *) &priv->subset_info)
} /* end H5T__conv_struct_subset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct
+ * Function: H5T__conv_struct
*
- * Purpose: Converts between compound datatypes. This is a soft
- * conversion function. The algorithm is basically:
+ * Purpose: Converts between compound datatypes. This is a soft
+ * conversion function. The algorithm is basically:
*
- * For each element do
- * For I=1..NELMTS do
- * If sizeof detination type <= sizeof source type then
- * Convert member to destination type;
- * Move member as far left as possible;
+ * For each element do
+ * For I=1..NELMTS do
+ * If sizeof destination type <= sizeof source type then
+ * Convert member to destination type;
+ * Move member as far left as possible;
*
- * For I=NELMTS..1 do
- * If not destination type then
- * Convert member to destination type;
- * Move member to correct position in BKG
+ * For I=NELMTS..1 do
+ * If not destination type then
+ * Convert member to destination type;
+ * Move member to correct position in BKG
*
- * Copy BKG to BUF
+ * Copy BKG to BUF
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, January 22, 1998
+ * Programmer: Robb Matzke
+ * Thursday, January 22, 1998
*
*-------------------------------------------------------------------------
*/
@@ -2117,20 +2117,20 @@ herr_t
H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg, hid_t dxpl_id)
{
- uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
- uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
+ uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
+ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
uint8_t *xbuf = buf, *xbkg = bkg; /*temp pointers into buf and bkg*/
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- int *src2dst = NULL; /*maps src member to dst member */
- H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
- H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
- size_t offset; /*byte offset wrt struct */
- ssize_t src_delta; /*source stride */
- ssize_t bkg_delta; /*background stride */
- size_t elmtno;
- unsigned u; /*counters */
- int i; /*counters */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ int *src2dst = NULL; /*maps src member to dst member */
+ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
+ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
+ size_t offset; /*byte offset wrt struct */
+ ssize_t src_delta; /*source stride */
+ ssize_t bkg_delta; /*background stride */
+ size_t elmtno;
+ unsigned u; /*counters */
+ int i; /*counters */
H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv);
herr_t ret_value = SUCCEED; /* Return value */
@@ -2148,7 +2148,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_COMPOUND != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
- if(H5T_COMPOUND != dst->shared->type)
+ if(H5T_COMPOUND != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
if(H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0)
@@ -2298,50 +2298,50 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_struct() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct_opt
+ * Function: H5T__conv_struct_opt
*
- * Purpose: Converts between compound datatypes in a manner more
- * efficient than the general-purpose H5T__conv_struct()
- * function. This function isn't applicable if the destination
- * is larger than the source type. This is a soft conversion
- * function. The algorithm is basically:
+ * Purpose: Converts between compound datatypes in a manner more
+ * efficient than the general-purpose H5T__conv_struct()
+ * function. This function isn't applicable if the destination
+ * is larger than the source type. This is a soft conversion
+ * function. The algorithm is basically:
*
- * For each member of the struct
- * If sizeof detination type <= sizeof source type then
- * Convert member to destination type for all elements
- * Move memb to BKG buffer for all elements
- * Else
- * Move member as far left as possible for all elements
+ * For each member of the struct
+ * If sizeof destination type <= sizeof source type then
+ * Convert member to destination type for all elements
+ * Move memb to BKG buffer for all elements
+ * Else
+ * Move member as far left as possible for all elements
*
- * For each member of the struct (in reverse order)
- * If not destination type then
- * Convert member to destination type for all elements
- * Move member to correct position in BKG for all elements
+ * For each member of the struct (in reverse order)
+ * If not destination type then
+ * Convert member to destination type for all elements
+ * Move member to correct position in BKG for all elements
*
- * Copy BKG to BUF for all elements
+ * Copy BKG to BUF for all elements
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, January 22, 1998
+ * Programmer: Robb Matzke
+ * Thursday, January 22, 1998
*
* Modifications:
- * Robb Matzke, 1999-06-16
+ * Robb Matzke, 1999-06-16
* Added support for non-zero strides. If BUF_STRIDE is
* non-zero then convert one value at each memory location
* advancing BUF_STRIDE bytes each time; otherwise assume both
* source and destination values are packed.
*
- * Robb Matzke, 1999-06-16
- * If the source and destination data structs are the same size
- * then we can convert on a field-by-field basis instead of an
- * element by element basis. In other words, for all struct
- * elements being converted by this function call, first convert
- * all of the field1's, then all field2's, etc. This can
- * drastically reduce the number of calls to H5T_convert() and
- * thereby eliminate most of the conversion constant overhead.
+ * Robb Matzke, 1999-06-16
+ * If the source and destination data structs are the same size
+ * then we can convert on a field-by-field basis instead of an
+ * element by element basis. In other words, for all struct
+ * elements being converted by this function call, first convert
+ * all of the field1's, then all field2's, etc. This can
+ * drastically reduce the number of calls to H5T_convert() and
+ * thereby eliminate most of the conversion constant overhead.
*
* Robb Matzke, 2000-05-17
* Added the BKG_STRIDE argument to fix a design bug. If
@@ -2372,22 +2372,22 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf,
void *_bkg, hid_t dxpl_id)
{
- uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
- uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
- uint8_t *xbuf = NULL; /*temporary pointer into `buf' */
- uint8_t *xbkg = NULL; /*temporary pointer into `bkg' */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- int *src2dst = NULL; /*maps src member to dst member */
- H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
- H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
- size_t offset; /*byte offset wrt struct */
- size_t elmtno; /*element counter */
+ uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
+ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
+ uint8_t *xbuf = NULL; /*temporary pointer into `buf' */
+ uint8_t *xbkg = NULL; /*temporary pointer into `bkg' */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ int *src2dst = NULL; /*maps src member to dst member */
+ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
+ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
+ size_t offset; /*byte offset wrt struct */
+ size_t elmtno; /*element counter */
size_t copy_size; /*size of element for copying */
- H5T_conv_struct_t *priv = NULL; /*private data */
+ H5T_conv_struct_t *priv = NULL; /*private data */
hbool_t no_stride = FALSE; /*flag to indicate no stride */
- unsigned u; /*counters */
- int i; /*counters */
+ unsigned u; /*counters */
+ int i; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2404,7 +2404,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_COMPOUND != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
- if(H5T_COMPOUND != dst->shared->type)
+ if(H5T_COMPOUND != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
/* Initialize data which is relatively constant */
@@ -2596,17 +2596,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_struct_opt() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_enum_init
+ * Function: H5T_conv_enum_init
*
- * Purpose: Initialize information for H5T__conv_enum().
+ * Purpose: Initialize information for H5T__conv_enum().
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, January 4, 1999
*
* Modifications:
@@ -2616,21 +2616,21 @@ done:
static herr_t
H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
{
- H5T_enum_struct_t *priv = NULL; /*private conversion data */
- int n; /*src value cast as native int */
- int domain[2] = {0, 0}; /*min and max source values */
- int *map = NULL; /*map from src value to dst idx */
- unsigned length; /*nelmts in map array */
- unsigned i, j; /*counters */
+ H5T_enum_struct_t *priv = NULL; /*private conversion data */
+ int n; /*src value cast as native int */
+ int domain[2] = {0, 0}; /*min and max source values */
+ int *map = NULL; /*map from src value to dst idx */
+ unsigned length; /*nelmts in map array */
+ unsigned i, j; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
cdata->need_bkg = H5T_BKG_NO;
if(NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv)))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
if(0 == src->shared->u.enumer.nmembs)
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED);
/*
* Check that the source symbol names are a subset of the destination
@@ -2640,16 +2640,16 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
H5T__sort_name(src, NULL);
H5T__sort_name(dst, NULL);
if(NULL == (priv->src2dst = (int *)H5MM_malloc(src->shared->u.enumer.nmembs * sizeof(int))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
for(i = 0, j = 0;
i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs;
i++, j++) {
- while(j < dst->shared->u.enumer.nmembs &&
- HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
+ while(j < dst->shared->u.enumer.nmembs &&
+ HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
j++;
- if(j >= dst->shared->u.enumer.nmembs)
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type")
- priv->src2dst[i] = (int)j;
+ if(j >= dst->shared->u.enumer.nmembs)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type")
+ priv->src2dst[i] = (int)j;
} /* end for */
/*
@@ -2657,75 +2657,75 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
* value converted. However, if all of the following constraints are met
* then we can build a perfect hash table and use an O(1) lookup method.
*
- * A: The source datatype size matches one of our native datatype
- * sizes.
+ * A: The source datatype size matches one of our native datatype
+ * sizes.
*
- * B: After casting the source value bit pattern to a native type
- * the size of the range of values is less than 20% larger than
- * the number of values.
+ * B: After casting the source value bit pattern to a native type
+ * the size of the range of values is less than 20% larger than
+ * the number of values.
*
* If this special case is met then we use the source bit pattern cast as
* a native integer type as an index into the `val2dst'. The values of
* that array are the index numbers in the destination type or negative
* if the entry is unused.
*
- * (This optimized algorithm doesn't work when the byte orders are different.
+ * (This optimized algorithm doesn't work when the byte orders are different.
* The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));"
* can change the value significantly. i.g. if the source value is big-endian 0x0000000f,
* executing the casting on little-endian machine will get a big number 0x0f000000.
- * Then it can't meet the condition
+ * Then it can't meet the condition
* "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)"
- * Because this is the optimized code, we won't fix it. It should still work in some
- * situations. SLU - 2011/5/24)
+ * Because this is the optimized code, we won't fix it. It should still work in some
+ * situations. SLU - 2011/5/24)
*/
if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) {
- for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
- if(1 == src->shared->size)
- n = *((signed char *)(src->shared->u.enumer.value + i));
- else if (sizeof(short) == src->shared->size)
- n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
- else
- n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
- if(0 == i) {
- domain[0] = domain[1] = n;
- } else {
- domain[0] = MIN(domain[0], n);
- domain[1] = MAX(domain[1], n);
- }
- } /* end for */
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if (sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
+ if(0 == i) {
+ domain[0] = domain[1] = n;
+ } else {
+ domain[0] = MIN(domain[0], n);
+ domain[1] = MAX(domain[1], n);
+ }
+ } /* end for */
HDassert(domain[1] >= domain[0]);
- length = (unsigned)(domain[1] - domain[0]) + 1;
- if(src->shared->u.enumer.nmembs < 2 ||
+ length = (unsigned)(domain[1] - domain[0]) + 1;
+ if(src->shared->u.enumer.nmembs < 2 ||
(double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) {
- priv->base = domain[0];
- priv->length = length;
- if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- for(i = 0; i < length; i++)
+ priv->base = domain[0];
+ priv->length = length;
+ if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ for(i = 0; i < length; i++)
map[i] = -1; /*entry unused*/
- for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
- if(1 == src->shared->size)
- n = *((signed char *)(src->shared->u.enumer.value + i));
- else if(sizeof(short) == src->shared->size)
- n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
- else
- n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
- n -= priv->base;
- HDassert(n >= 0 && (unsigned)n < priv->length);
- HDassert(map[n] < 0);
- map[n] = priv->src2dst[i];
- } /* end for */
-
- /*
- * Replace original src2dst array with our new one. The original
- * was indexed by source member number while the new one is
- * indexed by source values.
- */
- H5MM_xfree(priv->src2dst);
- priv->src2dst = map;
- HGOTO_DONE(SUCCEED);
- }
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if(sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
+ n -= priv->base;
+ HDassert(n >= 0 && (unsigned)n < priv->length);
+ HDassert(map[n] < 0);
+ map[n] = priv->src2dst[i];
+ } /* end for */
+
+ /*
+ * Replace original src2dst array with our new one. The original
+ * was indexed by source member number while the new one is
+ * indexed by source values.
+ */
+ H5MM_xfree(priv->src2dst);
+ priv->src2dst = map;
+ HGOTO_DONE(SUCCEED);
+ }
}
/* Sort source type by value and adjust src2dst[] appropriately */
@@ -2733,42 +2733,42 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
done:
if (ret_value<0 && priv) {
- H5MM_xfree(priv->src2dst);
- H5MM_xfree(priv);
- cdata->priv = NULL;
+ H5MM_xfree(priv->src2dst);
+ H5MM_xfree(priv);
+ cdata->priv = NULL;
}
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_enum
+ * Function: H5T__conv_enum
*
- * Purpose: Converts one type of enumerated data to another.
+ * Purpose: Converts one type of enumerated data to another.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, January 4, 1999
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
- uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */
- H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
- uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */
- ssize_t src_delta, dst_delta; /*conversion strides */
- int n; /*src value cast as native int */
+ uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */
+ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
+ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */
+ ssize_t src_delta, dst_delta; /*conversion strides */
+ int n; /*src value cast as native int */
H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv);
H5P_genplist_t *plist; /*property list pointer */
H5T_conv_cb_t cb_struct; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
- size_t i; /*counters */
+ size_t i; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2785,7 +2785,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_ENUM != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
- if(H5T_ENUM != dst->shared->type)
+ if(H5T_ENUM != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
if(H5T_conv_enum_init(src, dst, cdata) < 0)
@@ -2812,7 +2812,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_ENUM != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
- if(H5T_ENUM != dst->shared->type)
+ if(H5T_ENUM != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
/* priv->src2dst map was computed for certain sort keys. Make sure those same
@@ -2856,7 +2856,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Use O(1) lookup */
/* (The casting won't work when the byte orders are different. i.g. if the source value
* is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big
- * number 0x0f000000 on little-endian machine. But we won't fix it because it's an
+ * number 0x0f000000 on little-endian machine. But we won't fix it because it's an
* optimization code. Please also see the comment in the H5T_conv_enum_init() function.
* SLU - 2011/5/24)
*/
@@ -2934,30 +2934,30 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_enum() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_enum_numeric
+ * Function: H5T__conv_enum_numeric
*
- * Purpose: Converts enumerated data to a numeric type (integer or
- * floating-point number). This function is registered into
- * the conversion table twice in H5T_init_interface in H5T.c.
+ * Purpose: Converts enumerated data to a numeric type (integer or
+ * floating-point number). This function is registered into
+ * the conversion table twice in H5T_init_interface in H5T.c.
* Once for enum-integer conversion. Once for enum-float conversion.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 12 October 2012
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
- H5T_t *src, *dst; /*src and dst datatypes */
- H5T_t *src_parent; /*parent type for src */
+ H5T_t *src, *dst; /*src and dst datatypes */
+ H5T_t *src_parent; /*parent type for src */
hid_t src_parent_id = -1; /*ID for parent of the source */
H5T_path_t *tpath; /* Conversion information */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2990,9 +2990,9 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
src_parent = src->shared->parent;
if(NULL == (tpath = H5T_path_find(src_parent, dst, NULL, NULL, dxpl_id, FALSE))) {
- HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype")
+ HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype")
} else if(!H5T_path_noop(tpath)) {
- if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0)
+ if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
/* Convert the data */
@@ -3014,41 +3014,41 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_enum_numeric() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_vlen
+ * Function: H5T__conv_vlen
*
- * Purpose: Converts between VL datatypes in memory and on disk.
- * This is a soft conversion function. The algorithm is
- * basically:
+ * Purpose: Converts between VL datatypes in memory and on disk.
+ * This is a soft conversion function. The algorithm is
+ * basically:
*
- * For every VL struct in the main buffer:
- * 1. Allocate space for temporary dst VL data (reuse buffer
- * if possible)
+ * For every VL struct in the main buffer:
+ * 1. Allocate space for temporary dst VL data (reuse buffer
+ * if possible)
* 2. Copy VL data from src buffer into dst buffer
* 3. Convert VL data into dst representation
* 4. Allocate buffer in dst heap
- * 5. Free heap objects storing old data
+ * 5. Free heap objects storing old data
* 6. Write dst VL data into dst heap
* 7. Store (heap ID or pointer) and length in main dst buffer
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Wednesday, May 26, 1999
+ * Programmer: Quincey Koziol
+ * Wednesday, May 26, 1999
*
* Modifications:
*
- * Quincey Koziol, 2 July, 1999
- * Enabled support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Quincey Koziol, 2 July, 1999
+ * Enabled support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*
- * Raymond Lu, 26 June, 2002
- * Background buffer is used for freeing heap objects storing
- * old data. At this moment, it only frees the first level of
- * VL datatype. It doesn't handle nested VL datatypes.
+ * Raymond Lu, 26 June, 2002
+ * Background buffer is used for freeing heap objects storing
+ * old data. At this moment, it only frees the first level of
+ * VL datatype. It doesn't handle nested VL datatypes.
*
* Raymond Lu, 8 November 2011
* I put a condition check to prevent the conversion of VL strings
@@ -3061,28 +3061,28 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
{
H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */
H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */
- H5T_path_t *tpath = NULL; /* Type conversion path */
+ H5T_path_t *tpath = NULL; /* Type conversion path */
hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */
hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */
htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */
- hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- H5HG_t bg_hobjid, parent_hobjid;
- uint8_t *s = NULL; /*source buffer */
- uint8_t *d = NULL; /*destination buffer */
- uint8_t *b = NULL; /*background buffer */
- ssize_t s_stride, d_stride; /*src and dst strides */
- ssize_t b_stride; /*bkg stride */
+ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ H5HG_t bg_hobjid, parent_hobjid;
+ uint8_t *s = NULL; /*source buffer */
+ uint8_t *d = NULL; /*destination buffer */
+ uint8_t *b = NULL; /*background buffer */
+ ssize_t s_stride, d_stride; /*src and dst strides */
+ ssize_t b_stride; /*bkg stride */
size_t safe; /*how many elements are safe to process in each pass */
- size_t bg_seq_len = 0;
- size_t src_base_size, dst_base_size;/*source & destination base size*/
- void *conv_buf = NULL; /*temporary conversion buffer */
- size_t conv_buf_size = 0; /*size of conversion buffer in bytes */
- void *tmp_buf = NULL; /*temporary background buffer */
- size_t tmp_buf_size = 0; /*size of temporary bkg buffer */
+ size_t bg_seq_len = 0;
+ size_t src_base_size, dst_base_size;/*source & destination base size*/
+ void *conv_buf = NULL; /*temporary conversion buffer */
+ size_t conv_buf_size = 0; /*size of conversion buffer in bytes */
+ void *tmp_buf = NULL; /*temporary background buffer */
+ size_t tmp_buf_size = 0; /*size of temporary bkg buffer */
hbool_t nested = FALSE; /*flag of nested VL case */
- size_t elmtno; /*element number counter */
+ size_t elmtno; /*element number counter */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -3100,10 +3100,10 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_VLEN != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype")
- if(H5T_VLEN != dst->shared->type)
+ if(H5T_VLEN != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype")
if(H5T_VLEN_STRING == src->shared->u.vlen.type && H5T_VLEN_STRING == dst->shared->u.vlen.type) {
- if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset)
+ if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset)
|| (H5T_CSET_ASCII == dst->shared->u.vlen.cset && H5T_CSET_UTF8 == src->shared->u.vlen.cset))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF")
}
@@ -3232,7 +3232,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} /* end if */
else {
ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/
- size_t seq_len; /* The number of elements in the current sequence*/
+ size_t seq_len; /* The number of elements in the current sequence*/
/* Get length of element sequences */
if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0)
@@ -3246,7 +3246,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid source pointer")
} /* end if */
else {
- size_t src_size, dst_size; /*source & destination total size in bytes*/
+ size_t src_size, dst_size; /*source & destination total size in bytes*/
src_size = seq_len * src_base_size;
dst_size = seq_len * dst_base_size;
@@ -3254,11 +3254,11 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if conversion buffer is large enough, resize if
* necessary. If the SEQ_LEN is 0, allocate a minimal size buffer.
*/
- if(!seq_len && !conv_buf) {
+ if(!seq_len && !conv_buf) {
conv_buf_size = ((1 / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE;
if(NULL == (conv_buf = H5FL_BLK_CALLOC(vlen_seq, conv_buf_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion")
- }
+ }
else if(conv_buf_size < MAX(src_size, dst_size)) {
/* Only allocate conversion buffer in H5T_VLEN_MIN_CONF_BUF_SIZE increments */
conv_buf_size = ((MAX(src_size, dst_size) / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE;
@@ -3373,17 +3373,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_vlen() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_array
+ * Function: H5T__conv_array
*
- * Purpose: Converts between array datatypes in memory and on disk.
- * This is a soft conversion function.
+ * Purpose: Converts between array datatypes in memory and on disk.
+ * This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Monday, November 6, 2000
+ * Programmer: Quincey Koziol
+ * Monday, November 6, 2000
*
* Modifications:
*
@@ -3391,19 +3391,19 @@ done:
*/
herr_t
H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t bkg_stride, void *_buf,
+ size_t buf_stride, size_t bkg_stride, void *_buf,
void H5_ATTR_UNUSED *_bkg, hid_t dxpl_id)
{
- H5T_path_t *tpath; /* Type conversion path */
- hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- uint8_t *sp, *dp; /*source and dest traversal ptrs */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number counter */
+ H5T_path_t *tpath; /* Type conversion path */
+ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ uint8_t *sp, *dp; /*source and dest traversal ptrs */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number counter */
unsigned u; /* local index variable */
- void *bkg_buf = NULL; /*temporary background buffer */
+ void *bkg_buf = NULL; /*temporary background buffer */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -3481,7 +3481,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if we need a background buffer for this conversion */
if(tpath->cdata.need_bkg) {
- size_t bkg_buf_size; /*size of background buffer in bytes */
+ size_t bkg_buf_size; /*size of background buffer in bytes */
/* Allocate background buffer */
bkg_buf_size = src->shared->u.array.nelem * MAX(src->shared->size, dst->shared->size);
@@ -3522,28 +3522,28 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_array() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_i_i
+ * Function: H5T__conv_i_i
*
- * Purpose: Convert one integer type to another. This is the catch-all
- * function for integer conversions and is probably not
- * particularly fast.
+ * Purpose: Convert one integer type to another. This is the catch-all
+ * function for integer conversions and is probably not
+ * particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Wednesday, June 10, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, June 10, 1998
*
* Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
+ * Robb Matzke, 7 Jul 1998
+ * Added overflow handling.
*
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*
* Raymond Lu
* Wednesday, April 21, 2004
@@ -3556,19 +3556,19 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t dxpl_id)
{
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev=NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
- size_t first;
- ssize_t sfirst; /*a signed version of `first' */
- size_t i; /*Local index variables */
+ uint8_t dbuf[64]; /*temp destination buffer */
+ size_t first;
+ ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*Local index variables */
H5P_genplist_t *plist; /*property list pointer */
H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
@@ -3933,28 +3933,28 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_i_i() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_f_f
+ * Function: H5T__conv_f_f
*
- * Purpose: Convert one floating point type to another. This is a catch
- * all for floating point conversions and is probably not
- * particularly fast!
+ * Purpose: Convert one floating point type to another. This is a catch
+ * all for floating point conversions and is probably not
+ * particularly fast!
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
* Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
+ * Robb Matzke, 7 Jul 1998
+ * Added overflow handling.
*
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*
* Robb Matzke, 2001-02-02
* Oops, forgot to increment the exponent when rounding the
@@ -3971,32 +3971,32 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
hid_t dxpl_id)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- ssize_t bitno = 0; /*bit number */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ ssize_t bitno = 0; /*bit number */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- int64_t expo; /*exponent */
- hssize_t expo_max; /*maximum possible dst exponent */
- size_t msize = 0; /*useful size of mantissa in src*/
- size_t mpos; /*offset to useful mant is src */
+ int64_t expo; /*exponent */
+ hssize_t expo_max; /*maximum possible dst exponent */
+ size_t msize = 0; /*useful size of mantissa in src*/
+ size_t mpos; /*offset to useful mant is src */
uint64_t sign; /*source sign bit value */
- size_t mrsh; /*amount to right shift mantissa*/
- hbool_t carry = 0; /*carry after rounding mantissa */
- size_t i; /*miscellaneous counters */
- size_t implied; /*destination implied bits */
+ size_t mrsh; /*amount to right shift mantissa*/
+ hbool_t carry = 0; /*carry after rounding mantissa */
+ size_t i; /*miscellaneous counters */
+ size_t implied; /*destination implied bits */
hbool_t denormalized = FALSE; /*is either source or destination denormalized?*/
H5P_genplist_t *plist; /*property list pointer */
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
@@ -4251,7 +4251,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/*
* Get the exponent as an unsigned quantity from the section of
- * the source bit field where it's located. Don't worry about
+ * the source bit field where it's located. Don't worry about
* the exponent bias yet.
*/
expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize);
@@ -4321,7 +4321,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/*
* The exponent is too small to fit in the exponent field,
* but by shifting the mantissa to the right we can
- * accomodate that value. The mantissa of course is no
+ * accommodate that value. The mantissa of course is no
* longer normalized.
*/
mrsh += (size_t)(1 - expo);
@@ -4330,7 +4330,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} else if (expo>=expo_max) {
/*
* The exponent is too large to fit in the available region
- * or it results in the maximum possible value. Use positive
+ * or it results in the maximum possible value. Use positive
* or negative infinity instead unless the application
* specifies something else. Before calling the overflow
* handler make sure the source buffer we hand it is in the
@@ -4515,23 +4515,23 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_f_f() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_s_s
+ * Function: H5T__conv_s_s
*
- * Purpose: Convert one fixed-length string type to another.
+ * Purpose: Convert one fixed-length string type to another.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, August 7, 1998
+ * Programmer: Robb Matzke
+ * Friday, August 7, 1998
*
* Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*
* Raymond Lu, 8 November 2011
* I put a condition check to prevent the conversion of strings
@@ -4540,18 +4540,18 @@ done:
*/
herr_t
H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf,
void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
- H5T_t *src=NULL; /*source datatype */
- H5T_t *dst=NULL; /*destination datatype */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t olap; /*num overlapping elements */
- size_t nchars=0; /*number of characters copied */
- uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/
- uint8_t *dbuf=NULL; /*temp buf for overlap convers. */
+ H5T_t *src=NULL; /*source datatype */
+ H5T_t *dst=NULL; /*destination datatype */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t olap; /*num overlapping elements */
+ size_t nchars=0; /*number of characters copied */
+ uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/
+ uint8_t *dbuf=NULL; /*temp buf for overlap convers. */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -4568,7 +4568,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set")
if(H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set")
- if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset)
+ if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset)
|| (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF")
if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR ||
@@ -4757,18 +4757,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_s_s() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_uchar
+ * Function: H5T__conv_schar_uchar
*
- * Purpose: Converts `signed char' to `unsigned char'
+ * Purpose: Converts `signed char' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -4776,25 +4776,25 @@ done:
*/
herr_t
H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_schar
+ * Function: H5T__conv_uchar_schar
*
- * Purpose: Converts `unsigned char' to `signed char'
+ * Purpose: Converts `unsigned char' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -4802,25 +4802,25 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_short
+ * Function: H5T__conv_schar_short
*
- * Purpose: Converts `signed char' to `short'
+ * Purpose: Converts `signed char' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4828,25 +4828,25 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ushort
+ * Function: H5T__conv_schar_ushort
*
- * Purpose: Converts `signed char' to `unsigned short'
+ * Purpose: Converts `signed char' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4854,25 +4854,25 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_short
+ * Function: H5T__conv_uchar_short
*
- * Purpose: Converts `unsigned char' to `short'
+ * Purpose: Converts `unsigned char' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4880,25 +4880,25 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ushort
+ * Function: H5T__conv_uchar_ushort
*
- * Purpose: Converts `unsigned char' to `unsigned short'
+ * Purpose: Converts `unsigned char' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4906,25 +4906,25 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_int
+ * Function: H5T__conv_schar_int
*
- * Purpose: Converts `signed char' to `int'
+ * Purpose: Converts `signed char' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4932,24 +4932,24 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SCHAR, INT, signed char, int, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_uint
+ * Function: H5T__conv_schar_uint
*
- * Purpose: Converts `signed char' to `unsigned int'
+ * Purpose: Converts `signed char' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4957,24 +4957,24 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_int
+ * Function: H5T__conv_uchar_int
*
- * Purpose: Converts `unsigned char' to `int'
+ * Purpose: Converts `unsigned char' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -4982,24 +4982,24 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_uint
+ * Function: H5T__conv_uchar_uint
*
- * Purpose: Converts `unsigned char' to `unsigned int'
+ * Purpose: Converts `unsigned char' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5007,24 +5007,24 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_long
+ * Function: H5T__conv_schar_long
*
- * Purpose: Converts `signed char' to `long'
+ * Purpose: Converts `signed char' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5032,24 +5032,24 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ulong
+ * Function: H5T__conv_schar_ulong
*
- * Purpose: Converts `signed char' to `unsigned long'
+ * Purpose: Converts `signed char' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5057,25 +5057,25 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_long
+ * Function: H5T__conv_uchar_long
*
- * Purpose: Converts `unsigned char' to `long'
+ * Purpose: Converts `unsigned char' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5083,24 +5083,24 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ulong
+ * Function: H5T__conv_uchar_ulong
*
- * Purpose: Converts `unsigned char' to `unsigned long'
+ * Purpose: Converts `unsigned char' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5108,25 +5108,25 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_llong
+ * Function: H5T__conv_schar_llong
*
- * Purpose: Converts `signed char' to `long long'
+ * Purpose: Converts `signed char' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5134,25 +5134,25 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ullong
+ * Function: H5T__conv_schar_ullong
*
- * Purpose: Converts `signed char' to `unsigned long long'
+ * Purpose: Converts `signed char' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5160,25 +5160,25 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_llong
+ * Function: H5T__conv_uchar_llong
*
- * Purpose: Converts `unsigned char' to `long long'
+ * Purpose: Converts `unsigned char' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5186,25 +5186,25 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ullong
+ * Function: H5T__conv_uchar_ullong
*
- * Purpose: Converts `unsigned char' to `unsigned long long'
+ * Purpose: Converts `unsigned char' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5212,25 +5212,25 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_schar
+ * Function: H5T__conv_short_schar
*
- * Purpose: Converts `short' to `signed char'
+ * Purpose: Converts `short' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5238,25 +5238,25 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_uchar
+ * Function: H5T__conv_short_uchar
*
- * Purpose: Converts `short' to `unsigned char'
+ * Purpose: Converts `short' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5264,25 +5264,25 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_schar
+ * Function: H5T__conv_ushort_schar
*
- * Purpose: Converts `unsigned short' to `signed char'
+ * Purpose: Converts `unsigned short' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5290,25 +5290,25 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_uchar
+ * Function: H5T__conv_ushort_uchar
*
- * Purpose: Converts `unsigned short' to `unsigned char'
+ * Purpose: Converts `unsigned short' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5316,25 +5316,25 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ushort
+ * Function: H5T__conv_short_ushort
*
- * Purpose: Converts `short' to `unsigned short'
+ * Purpose: Converts `short' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -5342,25 +5342,25 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_short
+ * Function: H5T__conv_ushort_short
*
- * Purpose: Converts `unsigned short' to `short'
+ * Purpose: Converts `unsigned short' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -5368,25 +5368,25 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_int
+ * Function: H5T__conv_short_int
*
- * Purpose: Converts `short' to `int'
+ * Purpose: Converts `short' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5394,25 +5394,25 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SHORT, INT, short, int, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_uint
+ * Function: H5T__conv_short_uint
*
- * Purpose: Converts `short' to `unsigned int'
+ * Purpose: Converts `short' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5420,25 +5420,25 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_int
+ * Function: H5T__conv_ushort_int
*
- * Purpose: Converts `unsigned short' to `int'
+ * Purpose: Converts `unsigned short' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5446,25 +5446,25 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_uint
+ * Function: H5T__conv_ushort_uint
*
- * Purpose: Converts `unsigned short' to `unsigned int'
+ * Purpose: Converts `unsigned short' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5472,25 +5472,25 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_long
+ * Function: H5T__conv_short_long
*
- * Purpose: Converts `short' to `long'
+ * Purpose: Converts `short' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5498,25 +5498,25 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SHORT, LONG, short, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ulong
+ * Function: H5T__conv_short_ulong
*
- * Purpose: Converts `short' to `unsigned long'
+ * Purpose: Converts `short' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5524,25 +5524,25 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_long
+ * Function: H5T__conv_ushort_long
*
- * Purpose: Converts `unsigned short' to `long'
+ * Purpose: Converts `unsigned short' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5550,25 +5550,25 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ulong
+ * Function: H5T__conv_ushort_ulong
*
- * Purpose: Converts `unsigned short' to `unsigned long'
+ * Purpose: Converts `unsigned short' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5576,25 +5576,25 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_llong
+ * Function: H5T__conv_short_llong
*
- * Purpose: Converts `short' to `long long'
+ * Purpose: Converts `short' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5602,25 +5602,25 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(SHORT, LLONG, short, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ullong
+ * Function: H5T__conv_short_ullong
*
- * Purpose: Converts `short' to `unsigned long long'
+ * Purpose: Converts `short' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5628,25 +5628,25 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_llong
+ * Function: H5T__conv_ushort_llong
*
- * Purpose: Converts `unsigned short' to `long long'
+ * Purpose: Converts `unsigned short' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5654,25 +5654,25 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ullong
+ * Function: H5T__conv_ushort_ullong
*
- * Purpose: Converts `unsigned short' to `unsigned long long'
+ * Purpose: Converts `unsigned short' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5680,25 +5680,25 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_schar
+ * Function: H5T__conv_int_schar
*
- * Purpose: Converts `int' to `signed char'
+ * Purpose: Converts `int' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5706,25 +5706,25 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_uchar
+ * Function: H5T__conv_int_uchar
*
- * Purpose: Converts `int' to `unsigned char'
+ * Purpose: Converts `int' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5732,25 +5732,25 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_schar
+ * Function: H5T__conv_uint_schar
*
- * Purpose: Converts `unsigned int' to `signed char'
+ * Purpose: Converts `unsigned int' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5758,25 +5758,25 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_uchar
+ * Function: H5T__conv_uint_uchar
*
- * Purpose: Converts `unsigned int' to `unsigned char'
+ * Purpose: Converts `unsigned int' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5784,25 +5784,25 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_short
+ * Function: H5T__conv_int_short
*
- * Purpose: Converts `int' to `short'
+ * Purpose: Converts `int' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5810,25 +5810,25 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ushort
+ * Function: H5T__conv_int_ushort
*
- * Purpose: Converts `int' to `unsigned short'
+ * Purpose: Converts `int' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5836,25 +5836,25 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_short
+ * Function: H5T__conv_uint_short
*
- * Purpose: Converts `unsigned int' to `short'
+ * Purpose: Converts `unsigned int' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5862,25 +5862,25 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ushort
+ * Function: H5T__conv_uint_ushort
*
- * Purpose: Converts `unsigned int' to `unsigned short'
+ * Purpose: Converts `unsigned int' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5888,25 +5888,25 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_uint
+ * Function: H5T__conv_int_uint
*
- * Purpose: Converts `int' to `unsigned int'
+ * Purpose: Converts `int' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -5914,24 +5914,24 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_su(INT, UINT, int, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_int
+ * Function: H5T__conv_uint_int
*
- * Purpose: Converts `unsigned int' to `int'
+ * Purpose: Converts `unsigned int' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -5939,24 +5939,24 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_long
+ * Function: H5T__conv_int_long
*
- * Purpose: Converts `int' to `long'
+ * Purpose: Converts `int' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5964,24 +5964,24 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(INT, LONG, int, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ulong
+ * Function: H5T__conv_int_ulong
*
- * Purpose: Converts `int' to `unsigned long'
+ * Purpose: Converts `int' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -5989,24 +5989,24 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(INT, LONG, int, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_long
+ * Function: H5T__conv_uint_long
*
- * Purpose: Converts `unsigned int' to `long'
+ * Purpose: Converts `unsigned int' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6014,24 +6014,24 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ulong
+ * Function: H5T__conv_uint_ulong
*
- * Purpose: Converts `unsigned int' to `unsigned long'
+ * Purpose: Converts `unsigned int' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6039,24 +6039,24 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_llong
+ * Function: H5T__conv_int_llong
*
- * Purpose: Converts `int' to `long long'
+ * Purpose: Converts `int' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6064,24 +6064,24 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(INT, LLONG, int, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ullong
+ * Function: H5T__conv_int_ullong
*
- * Purpose: Converts `int' to `unsigned long long'
+ * Purpose: Converts `int' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6089,24 +6089,24 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_llong
+ * Function: H5T__conv_uint_llong
*
- * Purpose: Converts `unsigned int' to `long long'
+ * Purpose: Converts `unsigned int' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6114,24 +6114,24 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ullong
+ * Function: H5T__conv_uint_ullong
*
- * Purpose: Converts `unsigned int' to `unsigned long long'
+ * Purpose: Converts `unsigned int' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6139,25 +6139,25 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_schar
+ * Function: H5T__conv_long_schar
*
- * Purpose: Converts `long' to `signed char'
+ * Purpose: Converts `long' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6165,24 +6165,24 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_uchar
+ * Function: H5T__conv_long_uchar
*
- * Purpose: Converts `long' to `unsigned char'
+ * Purpose: Converts `long' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6190,24 +6190,24 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_schar
+ * Function: H5T__conv_ulong_schar
*
- * Purpose: Converts `unsigned long' to `signed char'
+ * Purpose: Converts `unsigned long' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6215,25 +6215,25 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_uchar
+ * Function: H5T__conv_ulong_uchar
*
- * Purpose: Converts `unsigned long' to `unsigned char'
+ * Purpose: Converts `unsigned long' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6241,25 +6241,25 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_short
+ * Function: H5T__conv_long_short
*
- * Purpose: Converts `long' to `short'
+ * Purpose: Converts `long' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6267,24 +6267,24 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ushort
+ * Function: H5T__conv_long_ushort
*
- * Purpose: Converts `long' to `unsigned short'
+ * Purpose: Converts `long' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6292,25 +6292,25 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_short
+ * Function: H5T__conv_ulong_short
*
- * Purpose: Converts `unsigned long' to `short'
+ * Purpose: Converts `unsigned long' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6318,24 +6318,24 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ushort
+ * Function: H5T__conv_ulong_ushort
*
- * Purpose: Converts `unsigned long' to `unsigned short'
+ * Purpose: Converts `unsigned long' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6343,25 +6343,25 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_int
+ * Function: H5T__conv_long_int
*
- * Purpose: Converts `long' to `int'
+ * Purpose: Converts `long' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6369,24 +6369,24 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_uint
+ * Function: H5T__conv_long_uint
*
- * Purpose: Converts `long' to `unsigned int'
+ * Purpose: Converts `long' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6394,24 +6394,24 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_int
+ * Function: H5T__conv_ulong_int
*
- * Purpose: Converts `unsigned long' to `int'
+ * Purpose: Converts `unsigned long' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6419,24 +6419,24 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_uint
+ * Function: H5T__conv_ulong_uint
*
- * Purpose: Converts `unsigned long' to `unsigned int'
+ * Purpose: Converts `unsigned long' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6444,24 +6444,24 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ulong
+ * Function: H5T__conv_long_ulong
*
- * Purpose: Converts `long' to `unsigned long'
+ * Purpose: Converts `long' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -6469,24 +6469,24 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_long
+ * Function: H5T__conv_ulong_long
*
- * Purpose: Converts `unsigned long' to `long'
+ * Purpose: Converts `unsigned long' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -6494,24 +6494,24 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_llong
+ * Function: H5T__conv_long_llong
*
- * Purpose: Converts `long' to `long long'
+ * Purpose: Converts `long' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6519,24 +6519,24 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sS(LONG, LLONG, long, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ullong
+ * Function: H5T__conv_long_ullong
*
- * Purpose: Converts `long' to `unsigned long long'
+ * Purpose: Converts `long' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6544,25 +6544,25 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_llong
+ * Function: H5T__conv_ulong_llong
*
- * Purpose: Converts `unsigned long' to `long long'
+ * Purpose: Converts `unsigned long' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6570,25 +6570,25 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ullong
+ * Function: H5T__conv_ulong_ullong
*
- * Purpose: Converts `unsigned long' to `unsigned long long'
+ * Purpose: Converts `unsigned long' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6596,25 +6596,25 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_schar
+ * Function: H5T__conv_llong_schar
*
- * Purpose: Converts `long long' to `signed char'
+ * Purpose: Converts `long long' to `signed char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6622,25 +6622,25 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_uchar
+ * Function: H5T__conv_llong_uchar
*
- * Purpose: Converts `long long' to `unsigned char'
+ * Purpose: Converts `long long' to `unsigned char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6648,25 +6648,25 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_schar
+ * Function: H5T__conv_ullong_schar
*
- * Purpose: Converts `unsigned long long' to `signed char'
+ * Purpose: Converts `unsigned long long' to `signed char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6674,25 +6674,25 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_uchar
+ * Function: H5T__conv_ullong_uchar
*
- * Purpose: Converts `unsigned long long' to `unsigned char'
+ * Purpose: Converts `unsigned long long' to `unsigned char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6707,18 +6707,18 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_short
+ * Function: H5T__conv_llong_short
*
- * Purpose: Converts `long long' to `short'
+ * Purpose: Converts `long long' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6726,25 +6726,25 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ushort
+ * Function: H5T__conv_llong_ushort
*
- * Purpose: Converts `long long' to `unsigned short'
+ * Purpose: Converts `long long' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6752,25 +6752,25 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_short
+ * Function: H5T__conv_ullong_short
*
- * Purpose: Converts `unsigned long long' to `short'
+ * Purpose: Converts `unsigned long long' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6778,25 +6778,25 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ushort
+ * Function: H5T__conv_ullong_ushort
*
- * Purpose: Converts `unsigned long long' to `unsigned short'
+ * Purpose: Converts `unsigned long long' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6804,25 +6804,25 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_int
+ * Function: H5T__conv_llong_int
*
- * Purpose: Converts `long long' to `int'
+ * Purpose: Converts `long long' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6830,24 +6830,24 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_uint
+ * Function: H5T__conv_llong_uint
*
- * Purpose: Converts `long long' to `unsigned int'
+ * Purpose: Converts `long long' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6855,24 +6855,24 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_int
+ * Function: H5T__conv_ullong_int
*
- * Purpose: Converts `unsigned long long' to `int'
+ * Purpose: Converts `unsigned long long' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6880,24 +6880,24 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_uint
+ * Function: H5T__conv_ullong_uint
*
- * Purpose: Converts `unsigned long long' to `unsigned int'
+ * Purpose: Converts `unsigned long long' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6905,25 +6905,25 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_long
+ * Function: H5T__conv_llong_long
*
- * Purpose: Converts `long long' to `long'
+ * Purpose: Converts `long long' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6931,24 +6931,24 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
+ size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride,
void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ulong
+ * Function: H5T__conv_llong_ulong
*
- * Purpose: Converts `long long' to `unsigned long'
+ * Purpose: Converts `long long' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6956,25 +6956,25 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_long
+ * Function: H5T__conv_ullong_long
*
- * Purpose: Converts `unsigned long long' to `long'
+ * Purpose: Converts `unsigned long long' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -6982,25 +6982,25 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
- hid_t H5_ATTR_UNUSED dxpl_id)
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ulong
+ * Function: H5T__conv_ullong_ulong
*
- * Purpose: Converts `unsigned long long' to `unsigned long'
+ * Purpose: Converts `unsigned long long' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
* Modifications:
*
@@ -7008,25 +7008,25 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ullong
+ * Function: H5T__conv_llong_ullong
*
- * Purpose: Converts `long long' to `unsigned long long'
+ * Purpose: Converts `long long' to `unsigned long long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -7034,25 +7034,25 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_llong
+ * Function: H5T__conv_ullong_llong
*
- * Purpose: Converts `unsigned long long' to `long long'
+ * Purpose: Converts `unsigned long long' to `long long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
* Modifications:
*
@@ -7060,53 +7060,53 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_double
+ * Function: H5T__conv_float_double
*
- * Purpose: Convert native `float' to native `double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `float' to native `double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
* Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ldouble
+ * Function: H5T__conv_float_ldouble
*
- * Purpose: Convert native `float' to native `long double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `float' to native `long double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
* Modifications:
*
@@ -7115,7 +7115,7 @@ H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5_SIZEOF_LONG_DOUBLE != 0
herr_t
H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7123,49 +7123,49 @@ H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_float
+ * Function: H5T__conv_double_float
*
- * Purpose: Convert native `double' to native `float' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `double' to native `float' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
* Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
+ * Robb Matzke, 7 Jul 1998
+ * Added overflow handling.
*
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
+ * Robb Matzke, 1999-06-16
+ * Added support for non-zero strides. If BUF_STRIDE is non-zero
+ * then convert one value at each memory location advancing
+ * BUF_STRIDE bytes each time; otherwise assume both source and
+ * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ldouble
+ * Function: H5T__conv_double_ldouble
*
- * Purpose: Convert native `double' to native `long double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `double' to native `long double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
* Modifications:
*
@@ -7174,7 +7174,7 @@ H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5_SIZEOF_LONG_DOUBLE != 0
herr_t
H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7182,17 +7182,17 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_float
+ * Function: H5T__conv_ldouble_float
*
- * Purpose: Convert native `long double' to native `float' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `long double' to native `float' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
* Modifications:
*
@@ -7201,7 +7201,7 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5_SIZEOF_LONG_DOUBLE != 0
herr_t
H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7209,17 +7209,17 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_double
+ * Function: H5T__conv_ldouble_double
*
- * Purpose: Convert native `long double' to native `double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `long double' to native `double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
* Modifications:
*
@@ -7228,7 +7228,7 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5_SIZEOF_LONG_DOUBLE != 0
herr_t
H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7236,17 +7236,17 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_float
+ * Function: H5T__conv_schar_float
*
- * Purpose: Convert native signed char to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native signed char to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7254,24 +7254,24 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_double
+ * Function: H5T__conv_schar_double
*
- * Purpose: Convert native signed char to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native signed char to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7279,24 +7279,24 @@ H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ldouble
+ * Function: H5T__conv_schar_ldouble
*
- * Purpose: Convert native signed char to native long double using
+ * Purpose: Convert native signed char to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7304,24 +7304,24 @@ H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_float
+ * Function: H5T__conv_uchar_float
*
- * Purpose: Convert native unsigned char to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned char to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7329,24 +7329,24 @@ H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_double
+ * Function: H5T__conv_uchar_double
*
- * Purpose: Convert native unsigned char to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned char to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7354,24 +7354,24 @@ H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ldouble
+ * Function: H5T__conv_uchar_ldouble
*
- * Purpose: Convert native unsigned char to native long double using
+ * Purpose: Convert native unsigned char to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7379,24 +7379,24 @@ H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_float
+ * Function: H5T__conv_short_float
*
- * Purpose: Convert native short to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7404,24 +7404,24 @@ H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SHORT, FLOAT, short, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_double
+ * Function: H5T__conv_short_double
*
- * Purpose: Convert native short to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7429,24 +7429,24 @@ H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ldouble
+ * Function: H5T__conv_short_ldouble
*
- * Purpose: Convert native short to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7454,24 +7454,24 @@ H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_float
+ * Function: H5T__conv_ushort_float
*
- * Purpose: Convert native unsigned short to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned short to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7479,24 +7479,24 @@ H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_double
+ * Function: H5T__conv_ushort_double
*
- * Purpose: Convert native unsigned short to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned short to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7504,24 +7504,24 @@ H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ldouble
+ * Function: H5T__conv_ushort_ldouble
*
- * Purpose: Convert native unsigned short to native long double using
+ * Purpose: Convert native unsigned short to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7529,24 +7529,24 @@ H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_float
+ * Function: H5T__conv_int_float
*
- * Purpose: Convert native integer to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7554,24 +7554,24 @@ H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(INT, FLOAT, int, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_double
+ * Function: H5T__conv_int_double
*
- * Purpose: Convert native integer to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7579,24 +7579,24 @@ H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(INT, DOUBLE, int, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ldouble
+ * Function: H5T__conv_int_ldouble
*
- * Purpose: Convert native integer to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7604,24 +7604,24 @@ H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_float
+ * Function: H5T__conv_uint_float
*
- * Purpose: Convert native unsigned integer to native float using
+ * Purpose: Convert native unsigned integer to native float using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7629,24 +7629,24 @@ H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_double
+ * Function: H5T__conv_uint_double
*
- * Purpose: Convert native unsigned integer to native double using
+ * Purpose: Convert native unsigned integer to native double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7654,24 +7654,24 @@ H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ldouble
+ * Function: H5T__conv_uint_ldouble
*
- * Purpose: Convert native unsigned integer to native long double using
+ * Purpose: Convert native unsigned integer to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7679,24 +7679,24 @@ H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_float
+ * Function: H5T__conv_long_float
*
- * Purpose: Convert native long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7704,24 +7704,24 @@ H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(LONG, FLOAT, long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_double
+ * Function: H5T__conv_long_double
*
- * Purpose: Convert native long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7729,24 +7729,24 @@ H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(LONG, DOUBLE, long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ldouble
+ * Function: H5T__conv_long_ldouble
*
- * Purpose: Convert native long to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7754,24 +7754,24 @@ H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_float
+ * Function: H5T__conv_ulong_float
*
- * Purpose: Convert native unsigned long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7779,24 +7779,24 @@ H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_double
+ * Function: H5T__conv_ulong_double
*
- * Purpose: Convert native unsigned long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7804,24 +7804,24 @@ H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ldouble
+ * Function: H5T__conv_ulong_ldouble
*
- * Purpose: Convert native unsigned long to native long double using
+ * Purpose: Convert native unsigned long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7829,24 +7829,24 @@ H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_float
+ * Function: H5T__conv_llong_float
*
- * Purpose: Convert native long long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7854,24 +7854,24 @@ H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_double
+ * Function: H5T__conv_llong_double
*
- * Purpose: Convert native long long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7879,24 +7879,24 @@ H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ldouble
+ * Function: H5T__conv_llong_ldouble
*
- * Purpose: Convert native long long to native long double using
+ * Purpose: Convert native long long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7905,7 +7905,7 @@ H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5T_CONV_INTERNAL_LLONG_LDOUBLE
herr_t
H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7913,17 +7913,17 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_float
+ * Function: H5T__conv_ullong_float
*
- * Purpose: Convert native unsigned long long to native float using
+ * Purpose: Convert native unsigned long long to native float using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7931,24 +7931,24 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_double
+ * Function: H5T__conv_ullong_double
*
- * Purpose: Convert native unsigned long long to native double using
+ * Purpose: Convert native unsigned long long to native double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -7956,24 +7956,24 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ldouble
+ * Function: H5T__conv_ullong_ldouble
*
- * Purpose: Convert native unsigned long long to native long double using
+ * Purpose: Convert native unsigned long long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
* Modifications:
*
@@ -7982,7 +7982,7 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
#if H5T_CONV_INTERNAL_ULLONG_LDOUBLE
herr_t
H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
@@ -7990,17 +7990,17 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /*H5T_CONV_INTERNAL_ULLONG_LDOUBLE*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_schar
+ * Function: H5T__conv_float_schar
*
- * Purpose: Convert native float to native signed char using
+ * Purpose: Convert native float to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -8008,26 +8008,26 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
herr_t
H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_uchar
+ * Function: H5T__conv_float_uchar
*
- * Purpose: Convert native float to native unsigned char using
+ * Purpose: Convert native float to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -8035,350 +8035,326 @@ H5_GCC_DIAG_ON(float-equal)
*/
herr_t
H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_schar
+ * Function: H5T__conv_double_schar
*
- * Purpose: Convert native double to native signed char using
+ * Purpose: Convert native double to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_uchar
+ * Function: H5T__conv_double_uchar
*
- * Purpose: Convert native double to native unsigned char using
+ * Purpose: Convert native double to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_schar
+ * Function: H5T__conv_ldouble_schar
*
- * Purpose: Convert native long double to native signed char using
+ * Purpose: Convert native long double to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_uchar
+ * Function: H5T__conv_ldouble_uchar
*
- * Purpose: Convert native long double to native unsigned char using
+ * Purpose: Convert native long double to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_short
+ * Function: H5T__conv_float_short
*
- * Purpose: Convert native float to native short using
+ * Purpose: Convert native float to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ushort
+ * Function: H5T__conv_float_ushort
*
- * Purpose: Convert native float to native unsigned short using
+ * Purpose: Convert native float to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_short
+ * Function: H5T__conv_double_short
*
- * Purpose: Convert native double to native short using
+ * Purpose: Convert native double to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ushort
+ * Function: H5T__conv_double_ushort
*
- * Purpose: Convert native double to native unsigned short using
+ * Purpose: Convert native double to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_short
+ * Function: H5T__conv_ldouble_short
*
- * Purpose: Convert native long double to native short using
+ * Purpose: Convert native long double to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ushort
+ * Function: H5T__conv_ldouble_ushort
*
- * Purpose: Convert native long double to native unsigned short using
+ * Purpose: Convert native long double to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_int
+ * Function: H5T__conv_float_int
*
- * Purpose: Convert native float to native int using
+ * Purpose: Convert native float to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_uint
+ * Function: H5T__conv_float_uint
*
- * Purpose: Convert native float to native unsigned int using
+ * Purpose: Convert native float to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_int
+ * Function: H5T__conv_double_int
*
- * Purpose: Convert native double to native int using
+ * Purpose: Convert native double to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
* Modifications:
*
@@ -8386,432 +8362,406 @@ H5_GCC_DIAG_ON(float-equal)
*/
herr_t
H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_uint
+ * Function: H5T__conv_double_uint
*
- * Purpose: Convert native double to native unsigned int using
+ * Purpose: Convert native double to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_int
+ * Function: H5T__conv_ldouble_int
*
- * Purpose: Convert native long double to native int using
+ * Purpose: Convert native long double to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_uint
+ * Function: H5T__conv_ldouble_uint
*
- * Purpose: Convert native long double to native unsigned int using
+ * Purpose: Convert native long double to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_long
+ * Function: H5T__conv_float_long
*
- * Purpose: Convert native float to native long using
+ * Purpose: Convert native float to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ulong
+ * Function: H5T__conv_float_ulong
*
- * Purpose: Convert native float to native unsigned long using
+ * Purpose: Convert native float to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_long
+ * Function: H5T__conv_double_long
*
- * Purpose: Convert native double to native long using
+ * Purpose: Convert native double to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ulong
+ * Function: H5T__conv_double_ulong
*
- * Purpose: Convert native double to native unsigned long using
+ * Purpose: Convert native double to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_long
+ * Function: H5T__conv_ldouble_long
*
- * Purpose: Convert native long double to native long using
+ * Purpose: Convert native long double to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ulong
+ * Function: H5T__conv_ldouble_ulong
*
- * Purpose: Convert native long double to native unsigned long using
+ * Purpose: Convert native long double to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_llong
+ * Function: H5T__conv_float_llong
*
- * Purpose: Convert native float to native long long using
+ * Purpose: Convert native float to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ullong
+ * Function: H5T__conv_float_ullong
*
- * Purpose: Convert native float to native unsigned long long using
+ * Purpose: Convert native float to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX);
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_llong
+ * Function: H5T__conv_double_llong
*
- * Purpose: Convert native double to native long long using
+ * Purpose: Convert native double to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ullong
+ * Function: H5T__conv_double_ullong
*
- * Purpose: Convert native double to native unsigned long long using
+ * Purpose: Convert native double to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t dxpl_id)
{
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX);
+H5_GCC_DIAG_ON("float-equal")
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_llong
+ * Function: H5T__conv_ldouble_llong
*
- * Purpose: Convert native long double to native long long using
+ * Purpose: Convert native long double to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
#if H5T_CONV_INTERNAL_LDOUBLE_LLONG
herr_t
H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t H5_ATTR_UNUSED dxpl_id)
{
-H5_GCC_DIAG_OFF(float-equal)
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX);
-H5_GCC_DIAG_ON(float-equal)
+H5_GCC_DIAG_ON("float-equal")
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ullong
+ * Function: H5T__conv_ldouble_ullong
*
- * Purpose: Convert native long double to native unsigned long long using
+ * Purpose: Convert native long double to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
#if H5T_CONV_INTERNAL_LDOUBLE_ULLONG
herr_t
H5T__conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
+ size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg,
hid_t dxpl_id)
{
+H5_GCC_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX);
+H5_GCC_DIAG_ON("float-equal")
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_f_i
+ * Function: H5T__conv_f_i
*
- * Purpose: Convert one floating-point type to an integer. This is
+ * Purpose: Convert one floating-point type to an integer. This is
* the catch-all function for float-integer conversions and
* is probably not particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Wednesday, Jan 21, 2004
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * Wednesday, Jan 21, 2004
*
* Raymond Lu
* Wednesday, April 21, 2004
@@ -8829,28 +8779,28 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
hid_t dxpl_id)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev=NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- hssize_t expo; /*source exponent */
+ hssize_t expo; /*source exponent */
hssize_t sign; /*source sign bit value */
uint8_t *int_buf=NULL; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
- size_t i; /*miscellaneous counters */
- size_t first; /*first bit(MSB) in an integer */
- ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*miscellaneous counters */
+ size_t first; /*first bit(MSB) in an integer */
+ ssize_t sfirst; /*a signed version of `first' */
H5P_genplist_t *plist; /*Property list pointer */
H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */
hbool_t truncated; /*if fraction value is dropped */
@@ -9384,18 +9334,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_f_i() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_i_f
+ * Function: H5T__conv_i_f
*
- * Purpose: Convert one integer type to a floating-point type. This is
+ * Purpose: Convert one integer type to a floating-point type. This is
* the catch-all function for integer-float conversions and
* is probably not particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 6, 2004
+ * Programmer: Raymond Lu
+ * Friday, Feb 6, 2004
*
* Modifications:
*
@@ -9415,31 +9365,31 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
hid_t dxpl_id)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- hsize_t expo; /*destination exponent */
- hsize_t expo_max; /*maximal possible exponent value */
+ hsize_t expo; /*destination exponent */
+ hsize_t expo_max; /*maximal possible exponent value */
size_t sign; /*source sign bit value */
hbool_t is_max_neg; /*source is maximal negative value*/
hbool_t do_round; /*whether there is roundup */
uint8_t *int_buf = NULL; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
- size_t i; /*miscellaneous counters */
- size_t first; /*first bit(MSB) in an integer */
- ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*miscellaneous counters */
+ size_t first; /*first bit(MSB) in an integer */
+ ssize_t sfirst; /*a signed version of `first' */
H5P_genplist_t *plist; /*Property list pointer */
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
@@ -9548,8 +9498,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
#endif
- /*
- * Put the data in little endian order so our loops aren't so
+ /* Put the data in little endian order so our loops aren't so
* complicated. We'll do all the conversion stuff assuming
* little endian and then we'll fix the order at the end.
*/
@@ -9562,26 +9511,23 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
}
- /*zero-set all destination bits*/
+ /* Zero-set all destination bits*/
H5T__bit_set (d, dst.offset, dst.prec, FALSE);
/* Copy source into a temporary buffer */
H5T__bit_copy(int_buf, (size_t)0, s, src.offset, src.prec);
- /*
- * Find the sign bit value of the source.
- */
+ /* Find the sign bit value of the source */
if(H5T_SGN_2 == src.u.i.sign)
sign = (size_t)H5T__bit_get_d(int_buf, src.prec - 1, (size_t)1);
- /*
- * What is the bit position(starting from 0 as first one) for the most significant
- * bit(MSB) of S which is set?
+ /* What is the bit position(starting from 0 as first one) for the most significant
+ * bit(MSB) of S which is set?
*/
if(H5T_SGN_2 == src.u.i.sign) {
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE);
if(sign && sfirst < 0)
- /* The case 0x80...00, which is negative with maximal value */
+ /* The case 0x80...00, which is negative with maximal value */
is_max_neg = 1;
} else if(H5T_SGN_NONE == src.u.i.sign)
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE);
@@ -9590,9 +9536,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if(!sign && sfirst < 0)
goto padding;
- /*
- * Convert source integer if it's negative
- */
+ /* Convert source integer if it's negative */
if(H5T_SGN_2 == src.u.i.sign && sign) {
if(!is_max_neg) {
/* Equivalent to ~(i - 1) */
@@ -9600,10 +9544,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T__bit_neg(int_buf, (size_t)0, buf_size * 8);
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE);
} else {
- /* If it's maximal negative number 0x80...000, treat it as if it overflowed
- * (create a carry) to help conversion. i.e. a character type number 0x80
- * is treated as 0x100.
- */
+ /* If it's maximal negative number 0x80...000, treat it as if it overflowed
+ * (create a carry) to help conversion. i.e. a character type number 0x80
+ * is treated as 0x100.
+ */
sfirst = (ssize_t)(src.prec - 1);
is_max_neg = 0;
}
@@ -9612,7 +9556,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of
* sign bit to 0 in the temporary buffer because they're all negated from the previous
- * step. */
+ * step.
+ */
H5T__bit_set(int_buf, src.prec, (buf_size * 8) - src.prec, 0);
/* Set sign bit in destination */
@@ -9621,8 +9566,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
first = (size_t)sfirst;
- /*
- * Calculate the true destination exponent by adjusting according to
+ /* Calculate the true destination exponent by adjusting according to
* the destination exponent bias. Implied and non-implied normalization
* should be the same.
*/
@@ -9636,13 +9580,13 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if (H5T_NORM_IMPLIED==dst.u.f.norm) {
/* Imply first bit */
H5T__bit_set(int_buf, first, (size_t)1, 0);
- } else if (H5T_NORM_NONE==dst.u.f.norm) {
- first++;
- }
+ } else if (H5T_NORM_NONE==dst.u.f.norm) {
+ first++;
+ }
/* Roundup for mantissa */
if(first > dst.u.f.msize) {
- /* If the bit sequence is bigger than the mantissa part, there'll be some
+ /* If the bit sequence is bigger than the mantissa part, there'll be some
* precision loss. Let user's handler deal with the case if it's present
*/
if(cb_struct.func) {
@@ -9657,15 +9601,15 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} else if(except_ret == H5T_CONV_ABORT)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
- /* If user's exception handler does deal with it, we do it by dropping off the
- * extra bits at the end and do rounding. If we have .50...0(decimal) after radix
- * point, we do roundup when the least significant digit before radix is odd, we do
- * rounddown if it's even.
- */
+ /* If user's exception handler does deal with it, we do it by dropping off the
+ * extra bits at the end and do rounding. If we have .50...0(decimal) after radix
+ * point, we do roundup when the least significant digit before radix is odd, we do
+ * rounddown if it's even.
+ */
/* Check 1st dropoff bit, see if it's set. */
if(H5T__bit_get_d(int_buf, ((first - dst.u.f.msize) - 1), (size_t)1)) {
- /* Check all bits after 1st dropoff bit, see if any of them is set. */
+ /* Check all bits after 1st dropoff bit, see if any of them is set. */
if(((first - dst.u.f.msize) - 1) > 0 && H5T__bit_get_d(int_buf, (size_t)0, ((first - dst.u.f.msize) - 1)))
do_round = 1;
else { /* The .50...0 case */
@@ -9673,7 +9617,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if(H5T__bit_get_d(int_buf, (first - dst.u.f.msize), (size_t)1))
do_round = 1;
}
- }
+ }
/* Right shift to drop off extra bits */
H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, buf_size * 8);
@@ -9682,28 +9626,28 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T__bit_inc(int_buf, (size_t)0, buf_size * 8);
do_round = 0;
- /* If integer is like 0x0ff...fff and we need to round up the
- * last f, we get 0x100...000. Treat this special case here.
- */
- if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) {
- if (H5T_NORM_IMPLIED==dst.u.f.norm) {
- /* The bit at this 1's position was impled already, so this
- * number should be 0x200...000. We need to increment the
- * exponent in this case.
- */
- expo++;
- } else if (H5T_NORM_NONE==dst.u.f.norm) {
- /* Right shift 1 bit to let the carried 1 fit in the mantissa,
- * and increment exponent by 1.
- */
+ /* If integer is like 0x0ff...fff and we need to round up the
+ * last f, we get 0x100...000. Treat this special case here.
+ */
+ if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) {
+ if (H5T_NORM_IMPLIED==dst.u.f.norm) {
+ /* The bit at this 1's position was impled already, so this
+ * number should be 0x200...000. We need to increment the
+ * exponent in this case.
+ */
+ expo++;
+ } else if (H5T_NORM_NONE==dst.u.f.norm) {
+ /* Right shift 1 bit to let the carried 1 fit in the mantissa,
+ * and increment exponent by 1.
+ */
H5T__bit_shift(int_buf, (ssize_t)-1, (size_t)0, buf_size * 8);
- expo++;
- }
- }
+ expo++;
+ }
+ }
}
} else {
/* The bit sequence can fit mantissa part. Left shift to fit in from high-order of
- * bit position. */
+ * bit position. */
H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, dst.u.f.msize);
}
@@ -9813,11 +9757,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_i_f() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_reverse_order
+ * Function: H5T_reverse_order
*
- * Purpose: Internal assisting function to reverse the order of
+ * Purpose: Internal assisting function to reverse the order of
* a sequence of byte when it's big endian or VAX order.
* The byte sequence simulates the endian order.
*
@@ -9825,8 +9769,8 @@ done:
*
* Failure: Null
*
- * Programmer: Raymond Lu
- * April 26, 2004
+ * Programmer: Raymond Lu
+ * April 26, 2004
*
* Modifications:
*
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 533570b..19b25d1 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -16,18 +16,18 @@
* a "native" datatype for the H5T interface.
*/
-#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+#define H5T_PACKAGE /*suppress error about including H5Tpkg */
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5T_init_native_interface
+#define H5_INTERFACE_INIT_FUNC H5T_init_native_interface
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction,
@@ -41,7 +41,7 @@ static H5T_t* H5T_get_native_bitfield(size_t prec, H5T_direction_t direction,
static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size,
size_t nelems, size_t align, size_t *struct_align);
-
+
/*--------------------------------------------------------------------------
NAME
H5T_init_native_interface -- Initialize interface-specific information
@@ -63,7 +63,7 @@ H5T_init_native_interface(void)
FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_native_interface() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tget_native_type
*
@@ -130,7 +130,7 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5T_get_native_type
*
@@ -353,7 +353,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
case H5T_ENUM:
{
- H5T_path_t *tpath; /* Type conversion info */
+ H5T_path_t *tpath; /* Type conversion info */
hid_t super_type_id, nat_super_type_id;
/* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */
@@ -538,7 +538,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_get_native_type() */
-
+/* Disable warning for intentional identical branches here -QAK */
+/*
+ * This pragma only needs to surround the "duplicated branches" 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("duplicated-branches")
+
/*-------------------------------------------------------------------------
* Function: H5T_get_native_integer
*
@@ -678,8 +685,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_get_native_integer() */
+H5_GCC_DIAG_ON("duplicated-branches")
+
+/* Disable warning for intentional identical branches here -QAK */
+/*
+ * This pragma only needs to surround the "duplicated branches" 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("duplicated-branches")
-
/*-------------------------------------------------------------------------
* Function: H5T_get_native_float
*
@@ -700,7 +715,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
H5T_t *dt=NULL; /* Appropriate native datatype to copy */
hid_t tid=(-1); /* Datatype ID of appropriate native datatype */
size_t align=0; /* Alignment necessary for native datatype */
- size_t native_size=0; /* Datatype size of the native type */
+ size_t native_size=0; /* Datatype size of the native type */
enum match_type { /* The different kinds of floating point types we can match */
H5T_NATIVE_FLOAT_MATCH_FLOAT,
H5T_NATIVE_FLOAT_MATCH_DOUBLE,
@@ -718,50 +733,50 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
if(size<=sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
+ native_size = sizeof(float);
}
else if(size<=sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
+ native_size = sizeof(double);
}
#if H5_SIZEOF_LONG_DOUBLE !=0
else if(size<=sizeof(long double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
+ native_size = sizeof(long double);
}
#endif
else { /* If not match, return the biggest datatype */
#if H5_SIZEOF_LONG_DOUBLE !=0
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
+ native_size = sizeof(long double);
#else
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
native_size = sizeof(double);
#endif
- }
+ }
} else {
#if H5_SIZEOF_LONG_DOUBLE !=0
if(size>sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
+ native_size = sizeof(long double);
}
else if(size>sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
+ native_size = sizeof(double);
}
else {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
- }
+ native_size = sizeof(float);
+ }
#else
if(size>sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
+ native_size = sizeof(double);
}
else {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
- }
+ native_size = sizeof(float);
+ }
#endif
}
@@ -801,9 +816,17 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_get_native_float() */
+H5_GCC_DIAG_ON("duplicated-branches")
+
+/* Disable warning for intentional identical branches here -QAK */
+/*
+ * This pragma only needs to surround the "duplicated branches" 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("duplicated-branches")
-
/*-------------------------------------------------------------------------
* Function: H5T_get_native_bitfield
*
@@ -887,22 +910,23 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_get_native_bitfield() */
+H5_GCC_DIAG_ON("duplicated-branches")
+
-
/*-------------------------------------------------------------------------
- * Function: H5T_cmp_offset
+ * Function: H5T_cmp_offset
*
- * Purpose: This function is only for convenience. It computes the
+ * Purpose: This function is only for convenience. It computes the
* compound type size, offset of the member being considered
* and the alignment for the whole compound type.
*
- * Return: Success: Non-negative value.
+ * Return: Success: Non-negative value.
*
- * Failure: Negative value.
+ * Failure: Negative value.
*
- * Programmer: Raymond Lu
- * December 10, 2002
+ * Programmer: Raymond Lu
+ * December 10, 2002
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index fb323ea..ea46f1f 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -12,15 +12,15 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, October 10, 1997
*/
#ifndef H5VMprivate_H
#define H5VMprivate_H
/* Private headers needed by this file */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
/* Vector-Vector sequence operation callback */
typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
@@ -40,7 +40,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
/* Other functions */
#define H5VM_vector_cpy(N,DST,SRC) { \
- HDassert(sizeof(*(DST))==sizeof(*(SRC))); \
+ HDassert(sizeof(*(DST))==sizeof(*(SRC))); \
if (SRC) HDmemcpy (DST, SRC, (N)*sizeof(*(DST))); \
else HDmemset (DST, 0, (N)*sizeof(*(DST))); \
}
@@ -51,34 +51,34 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
#define H5VM_ZERO NULL
H5_DLL hsize_t H5VM_hyper_stride(unsigned n, const hsize_t *size,
- const hsize_t *total_size,
- const hsize_t *offset,
- hsize_t *stride);
+ const hsize_t *total_size,
+ const hsize_t *offset,
+ hsize_t *stride);
H5_DLL htri_t H5VM_hyper_disjointp(unsigned n, const hsize_t *offset1,
const uint32_t *size1, const hsize_t *offset2, const uint32_t *size2);
H5_DLL htri_t H5VM_hyper_eq(unsigned n, const hsize_t *offset1,
- const hsize_t *size1, const hsize_t *offset2,
- const hsize_t *size2);
+ const hsize_t *size1, const hsize_t *offset2,
+ const hsize_t *size2);
H5_DLL herr_t H5VM_hyper_fill(unsigned n, const hsize_t *_size,
- const hsize_t *total_size,
- const hsize_t *offset, void *_dst,
- unsigned fill_value);
+ const hsize_t *total_size,
+ const hsize_t *offset, void *_dst,
+ unsigned fill_value);
H5_DLL herr_t H5VM_hyper_copy(unsigned n, const hsize_t *size,
- const hsize_t *dst_total_size,
- const hsize_t *dst_offset, void *_dst,
- const hsize_t *src_total_size,
- const hsize_t *src_offset, const void *_src);
+ const hsize_t *dst_total_size,
+ const hsize_t *dst_offset, void *_dst,
+ const hsize_t *src_total_size,
+ const hsize_t *src_offset, const void *_src);
H5_DLL herr_t H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
- const hsize_t *stride, void *_dst,
- unsigned fill_value);
+ const hsize_t *stride, void *_dst,
+ unsigned fill_value);
H5_DLL herr_t H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size,
- const hsize_t *dst_stride, void *_dst,
- const hsize_t *src_stride, const void *_src);
+ const hsize_t *dst_stride, void *_dst,
+ const hsize_t *src_stride, const void *_src);
H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size,
- const hssize_t *dst_stride, void *_dst,
- const hssize_t *src_stride, const void *_src);
+ const hssize_t *dst_stride, void *_dst,
+ const hssize_t *src_stride, const void *_src);
H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size,
- size_t count);
+ size_t count);
H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size,
hsize_t *down);
H5_DLL hsize_t H5VM_array_offset_pre(unsigned n,
@@ -162,7 +162,7 @@ H5VM_vector_zerop_u(int n, const hsize_t *v)
if (!v)
HGOTO_DONE(TRUE)
while (n--)
- if (*v++)
+ if (*v++)
HGOTO_DONE(FALSE)
done:
@@ -197,7 +197,7 @@ H5VM_vector_zerop_s(int n, const hssize_t *v)
if (!v)
HGOTO_DONE(TRUE)
while (n--)
- if (*v++)
+ if (*v++)
HGOTO_DONE(FALSE)
done:
@@ -245,9 +245,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5VM_vector_cmp_s
+ * Function: H5VM_vector_cmp_s
*
* Purpose: Compares two vectors of the same size and determines if V1 is
* lexicographically less than, equal, or greater than V2.
@@ -258,7 +258,7 @@ done:
*
* Failure: 0 if N is zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 8, 1998
*
* Modifications:
@@ -287,7 +287,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_vector_inc
*
@@ -311,6 +311,7 @@ H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2)
/* Lookup table for general log2(n) routine */
static const unsigned char LogTable256[] =
{
+ /* clang-clang-format off */
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
@@ -327,9 +328,10 @@ static const unsigned char LogTable256[] =
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+ /* clang-clang-format on */
};
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_log2_gen
*
@@ -378,7 +380,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] =
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_log2_of2
*
@@ -406,7 +408,7 @@ H5VM_log2_of2(uint32_t n)
return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]);
} /* H5VM_log2_of2() */
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_limit_enc_size
*
@@ -429,15 +431,15 @@ H5VM_limit_enc_size(uint64_t limit)
static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_bit_get
*
* Purpose: Determine the value of the n'th bit in a buffer.
*
- * Note: No range checking on <offset> is performed!
+ * Note: No range checking on <offset> is performed!
*
- * Note #2: Bits are sequentially stored in the buffer, starting with bit
+ * Note #2: Bits are sequentially stored in the buffer, starting with bit
* offset 0 in the first byte's high-bit position, proceeding down
* to bit offset 7 in the first byte's low-bit position, then to
* bit offset 8 in the second byte's high-bit position, etc.
@@ -456,15 +458,15 @@ H5VM_bit_get(const unsigned char *buf, size_t offset)
return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE);
} /* end H5VM_bit_get() */
-
+
/*-------------------------------------------------------------------------
* Function: H5VM_bit_set
*
* Purpose: Set/reset the n'th bit in a buffer.
*
- * Note: No range checking on <offset> is performed!
+ * Note: No range checking on <offset> is performed!
*
- * Note #2: Bits are sequentially stored in the buffer, starting with bit
+ * Note #2: Bits are sequentially stored in the buffer, starting with bit
* offset 0 in the first byte's high-bit position, proceeding down
* to bit offset 7 in the first byte's low-bit position, then to
* bit offset 8 in the second byte's high-bit position, etc.
diff --git a/src/H5detect.c b/src/H5detect.c
index 9da82f0..de82839 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -43,12 +43,17 @@ static const char *FileHeader = "\n\
*/
#undef NDEBUG
#include "H5private.h"
-/* Do NOT use in this file as it is not linked with the library,
+/* 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")
+
#if defined(__has_attribute)
# if __has_attribute(no_sanitize_address)
# define HDF_NO_UBSAN __attribute__((no_sanitize_address))
@@ -115,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;
@@ -319,10 +324,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 */ \
\
@@ -429,10 +434,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 { \
@@ -810,7 +815,7 @@ done:\n\
#ifdef H5_HAVE_SIGLONGJMP
fprintf(rawoutstream, "/* siglongjmp() support: yes */\n");
#else
- (rawoutstream, "/* siglongjmp() support: no */\n");
+ fprintf(rawoutstream, "/* siglongjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGPROCMASK
fprintf(rawoutstream, "/* sigprocmask() support: yes */\n");
@@ -908,7 +913,7 @@ iprint(detected_t *d)
* Alignment
*/
if(0 == d->align) {
- (rawoutstream, " * Alignment: NOT CALCULATED\n");
+ fprintf(rawoutstream, " * Alignment: NOT CALCULATED\n");
}
else if(1 == d->align) {
fprintf(rawoutstream, " * Alignment: none\n");
@@ -1253,7 +1258,7 @@ bit.\n";
if(pwd || real_name[0] || host_name[0]) {
fprintf(rawoutstream, " *\t\t\t");
if(real_name[0])
- (rawoutstream, "%s <", real_name);
+ fprintf(rawoutstream, "%s <", real_name);
#ifdef H5_HAVE_GETPWUID
if(pwd) HDfputs(pwd->pw_name, rawoutstream);
#endif
@@ -1705,3 +1710,4 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
}
+H5_GCC_DIAG_ON("cast-align")
diff --git a/src/H5public.h b/src/H5public.h
index 4f07535..055543f 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -26,31 +26,32 @@
* it via H5public.h. The #ifndef _H5public_H guard above would
* prevent repeated include.
*/
-#include "H5pubconf.h" /*from configure */
+#include "H5pubconf.h" /* From configure */
/* API Version macro wrapper definitions */
#include "H5version.h"
#ifdef H5_HAVE_FEATURES_H
-#include <features.h> /*for setting POSIX, BSD, etc. compatibility */
+#include <features.h> /* For setting POSIX, BSD, etc. compatibility */
#endif
#ifdef H5_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef H5_STDC_HEADERS
-# include <limits.h> /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */
+# include <limits.h> /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */
+# include <stdarg.h> /* For variadic functions in H5VLpublic.h */
#endif
#ifndef __cplusplus
# ifdef H5_HAVE_STDINT_H
-# include <stdint.h> /*for C9x types */
+# include <stdint.h> /* For C9x types */
# endif
#else
# ifdef H5_HAVE_STDINT_H_CXX
-# include <stdint.h> /*for C9x types when include from C++ */
+# include <stdint.h> /* For C9x types (when included from C++) */
# endif
#endif
#ifdef H5_HAVE_INTTYPES_H
-# include <inttypes.h> /* For uint64_t on some platforms */
+# include <inttypes.h> /* C99/POSIX.1 header for uint64_t, PRIu64 */
#endif
#ifdef H5_HAVE_STDDEF_H
# include <stddef.h>
@@ -60,7 +61,7 @@
# define MPICH_SKIP_MPICXX 1
# define OMPI_SKIP_MPICXX 1
# include <mpi.h>
-#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */
+#ifndef MPI_FILE_NULL /* MPIO may be defined in mpi.h already */
# include <mpio.h>
#endif
#endif
@@ -80,12 +81,11 @@ extern "C" {
*/
/* These pragmas are only implemented usefully in gcc 4.6+ */
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
- #define H5_GCC_DIAG_STR(s) #s
- #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y)
- #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
- #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
+ #define H5_GCC_DIAG_JOINSTR(x, y) x y
+ #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x)
+ #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
- #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x))
+ #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR("-W",x))
#define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop)
#else
#define H5_GCC_DIAG_OFF(x)
@@ -93,9 +93,9 @@ extern "C" {
#endif
/* Version numbers TAB char must surround the H5_VERS_xxx number */
-#define H5_VERS_MAJOR 1 /* For major interface/format changes */
-#define H5_VERS_MINOR 8 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 22 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_MAJOR 1 /* For major interface/format changes */
+#define H5_VERS_MINOR 8 /* For minor interface/format changes */
+#define H5_VERS_RELEASE 22 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "snap11" /* For pre-releases like snap0 */
/* Empty string for real releases. */
#define H5_VERS_INFO "HDF5 library version: 1.8.22-snap11" /* Full version string */
@@ -117,12 +117,12 @@ extern "C" {
/*
* Status return values. Failed integer functions in HDF5 result almost
* always in a negative value (unsigned failing functions sometimes return
- * zero for failure) while successfull return is non-negative (often zero).
+ * zero for failure) while successful return is non-negative (often zero).
* The negative failure value is most commonly -1, but don't bet on it. The
* proper way to detect failure is something like:
*
- * if((dset = H5Dopen2(file, name)) < 0)
- * fprintf(stderr, "unable to open the requested dataset\n");
+ * if((dset = H5Dopen2(file, name)) < 0)
+ * fprintf(stderr, "unable to open the requested dataset\n");
*/
typedef int herr_t;
@@ -134,13 +134,13 @@ typedef int herr_t;
* (false), positive (true), or negative (failure). The proper way to test
* for truth from a htri_t function is:
*
- * if ((retval = H5Tcommitted(type))>0) {
- * printf("data type is committed\n");
- * } else if (!retval) {
- * printf("data type is not committed\n");
- * } else {
- * printf("error determining whether data type is committed\n");
- * }
+ * if ((retval = H5Tcommitted(type)) > 0) {
+ * printf("data type is committed\n");
+ * } else if (!retval) {
+ * printf("data type is not committed\n");
+ * } else {
+ * printf("error determining whether data type is committed\n");
+ * }
*/
typedef unsigned int hbool_t;
typedef int htri_t;
@@ -168,10 +168,10 @@ typedef long long ssize_t;
* type.
*/
#if H5_SIZEOF_LONG_LONG >= 8
-H5_GCC_DIAG_OFF(long-long)
-typedef unsigned long long hsize_t;
+H5_GCC_DIAG_OFF("long-long")
+typedef unsigned long long hsize_t;
typedef signed long long hssize_t;
-H5_GCC_DIAG_ON(long-long)
+H5_GCC_DIAG_ON("long-long")
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
#else
@@ -293,7 +293,7 @@ typedef enum {
} H5_iter_order_t;
/* Iteration callback values */
-/* (Actually, any postive value will cause the iterator to stop and pass back
+/* (Actually, any positive value will cause the iterator to stop and pass back
* that positive value to the function that called the iterator)
*/
#define H5_ITER_ERROR (-1)
@@ -306,10 +306,10 @@ typedef enum {
* links in groups/attributes on objects.
*/
typedef enum H5_index_t {
- H5_INDEX_UNKNOWN = -1, /* Unknown index type */
- H5_INDEX_NAME, /* Index on names */
- H5_INDEX_CRT_ORDER, /* Index on creation order */
- H5_INDEX_N /* Number of indices defined */
+ H5_INDEX_UNKNOWN = -1, /* Unknown index type */
+ H5_INDEX_NAME, /* Index on names */
+ H5_INDEX_CRT_ORDER, /* Index on creation order */
+ H5_INDEX_N /* Number of indices defined */
} H5_index_t;
/*
diff --git a/src/H5system.c b/src/H5system.c
index e185620..c471bc9 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5system.c
- * Aug 21 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5system.c
+ * Aug 21 2006
+ * Quincey Koziol
*
- * Purpose: System call wrapper implementations.
+ * Purpose: System call wrapper implementations.
*
*-------------------------------------------------------------------------
*/
@@ -30,10 +30,10 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5MMprivate.h" /* Memory management */
/****************/
@@ -73,7 +73,7 @@
/* Track whether tzset routine was called */
static hbool_t H5_ntzset = FALSE;
-
+
/*-------------------------------------------------------------------------
* Function: HDfprintf
*
@@ -105,8 +105,7 @@ static hbool_t H5_ntzset = FALSE;
* format_templ in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF("format-nonliteral")
int
HDfprintf(FILE *stream, const char *fmt, ...)
{
@@ -432,9 +431,8 @@ HDfprintf(FILE *stream, const char *fmt, ...)
HDva_end(ap);
return nout;
} /* end HDfprintf() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON("format-nonliteral")
-
/*-------------------------------------------------------------------------
* Function: HDstrtoll
*
@@ -475,8 +473,6 @@ HDfprintf(FILE *stream, const char *fmt, ...)
* Programmer: Robb Matzke
* Thursday, April 9, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef HDstrtoll
@@ -561,7 +557,7 @@ HDstrtoll(const char *s, const char **rest, int base)
return acc;
} /* end HDstrtoll() */
#endif
-
+
/*-------------------------------------------------------------------------
* Function: HDrand/HDsrand
*
@@ -597,7 +593,7 @@ void HDsrand(unsigned int seed)
#endif /* H5_HAVE_RAND_R */
-
+
/*-------------------------------------------------------------------------
* Function: H5_make_time
*
@@ -682,7 +678,7 @@ done:
/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosecond units */
#define _W32_FT_OFFSET (116444736000000000ULL)
-
+
/*-------------------------------------------------------------------------
* Function: Wgettimeofday
*
@@ -734,7 +730,7 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz)
return 0;
} /* end Wgettimeofday() */
-
+
/*-------------------------------------------------------------------------
* Function: Wsetenv
*
@@ -777,7 +773,7 @@ Wsetenv(const char *name, const char *value, int overwrite)
static char Wlogin_buffer[WloginBuffer_count];
char*
-Wgetlogin()
+Wgetlogin(void)
{
#ifdef H5_HAVE_WINSOCK2_H
@@ -832,7 +828,7 @@ Wnanosleep(const struct timespec *req, struct timespec *rem)
} /* end Wnanosleep() */
-
+
/*-------------------------------------------------------------------------
* Function: Wllround, Wllroundf, Wlround, Wlroundf, Wround, Wroundf
*
@@ -1010,7 +1006,7 @@ done:
#endif /* H5_HAVE_WIN32_API */
-
+
/*-------------------------------------------------------------------------
* Function: H5_build_extpath
*
@@ -1130,7 +1126,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5_build_extpath() */
-
+
/*--------------------------------------------------------------------------
* Function: H5_combine_path
*
@@ -1205,7 +1201,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5_combine_path() */
-
+
/*--------------------------------------------------------------------------
* Function: H5_nanosleep
*
@@ -1233,7 +1229,7 @@ H5_nanosleep(uint64_t nanosec)
FUNC_LEAVE_NOAPI_VOID
} /* end H5_nanosleep() */
-
+
/*--------------------------------------------------------------------------
* Function: H5_get_time
*
@@ -1269,7 +1265,7 @@ H5_get_time(void)
#define H5_WIN32_ENV_VAR_BUFFER_SIZE 32767
-
+
/*-------------------------------------------------------------------------
* Function: H5_expand_windows_env_vars()
*