summaryrefslogtreecommitdiffstats
path: root/hl
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 /hl
parent06e367c49b1d0e0875a3aae69817fbceb4020aa9 (diff)
downloadhdf5-753adc730358861c489c1da7e4ccd018af6b351c.zip
hdf5-753adc730358861c489c1da7e4ccd018af6b351c.tar.gz
hdf5-753adc730358861c489c1da7e4ccd018af6b351c.tar.bz2
Merge clang-format changes from develop
Diffstat (limited to 'hl')
-rw-r--r--hl/CMakeLists.txt6
-rw-r--r--hl/c++/examples/CMakeLists.txt7
-rw-r--r--hl/c++/src/CMakeLists.txt13
-rw-r--r--hl/c++/test/CMakeLists.txt7
-rw-r--r--hl/examples/CMakeLists.txt7
-rw-r--r--hl/examples/pal_rgb.h515
-rw-r--r--hl/fortran/src/CMakeLists.txt13
-rw-r--r--hl/src/CMakeLists.txt17
-rw-r--r--hl/src/H5LT.c539
-rw-r--r--hl/test/CMakeLists.txt28
-rw-r--r--hl/test/pal_rgb.h521
-rw-r--r--hl/tools/gif2h5/CMakeLists.txt29
12 files changed, 913 insertions, 789 deletions
diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt
index 70c458d..083c60e 100644
--- a/hl/CMakeLists.txt
+++ b/hl/CMakeLists.txt
@@ -18,8 +18,6 @@ if (HDF5_BUILD_EXAMPLES)
endif ()
#-- Build the Unit testing if requested
-if (NOT HDF5_EXTERNALLY_CONFIGURED)
- if (BUILD_TESTING AND HDF5_TEST_SERIAL)
- add_subdirectory (test)
- endif ()
+if (BUILD_TESTING AND HDF5_TEST_SERIAL)
+ add_subdirectory (test)
endif ()
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index 22c9973..037bf8f 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -23,6 +23,13 @@ else ()
endif ()
set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_CPP_EXAMPLES_FORMAT ptExampleFL)
+endif ()
+
if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
endif ()
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index fbabc86..e4678fd 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -9,7 +9,7 @@ set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp)
set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h)
if (NOT ONLY_SHARED_LIBS)
- add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES})
+ add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES} ${HDF5_HL_CPP_HDRS})
target_include_directories (${HDF5_HL_CPP_LIB_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIB_TARGET})
+ else ()
+ clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIBSH_TARGET})
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
install (
diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt
index 5c224a8..246a670 100644
--- a/hl/c++/test/CMakeLists.txt
+++ b/hl/c++/test/CMakeLists.txt
@@ -25,6 +25,13 @@ else ()
endif ()
set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp)
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_CPP_TEST_FORMAT hl_ptableTest)
+endif ()
+
if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
endif ()
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index 1707ae9..9bce861 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -37,6 +37,13 @@ foreach (example ${examples})
target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
endif ()
set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_EXAMPLES_${example}_FORMAT hl_ex_${example})
+ endif ()
endforeach ()
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
diff --git a/hl/examples/pal_rgb.h b/hl/examples/pal_rgb.h
index f3905b3..488ee42 100644
--- a/hl/examples/pal_rgb.h
+++ b/hl/examples/pal_rgb.h
@@ -11,263 +11,266 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-const unsigned char pal_rgb[256*3] = {255,255,255,
-0,0,131,
-0,0,135,
-0,0,139,
-0,0,143,
-0,0,147,
-0,0,151,
-0,0,155,
-0,0,159,
-0,0,163,
-0,0,167,
-0,0,171,
-0,0,175,
-0,0,179,
-0,0,183,
-0,0,187,
-0,0,191,
-0,0,195,
-0,0,199,
-0,0,203,
-0,0,207,
-0,0,211,
-0,0,215,
-0,0,219,
-0,0,223,
-0,0,227,
-0,0,231,
-0,0,235,
-0,0,239,
-0,0,243,
-0,0,247,
-0,0,251,
-0,0,255,
-0,0,255,
-0,3,255,
-0,7,255,
-0,11,255,
-0,15,255,
-0,19,255,
-0,23,255,
-0,27,255,
-0,31,255,
-0,35,255,
-0,39,255,
-0,43,255,
-0,47,255,
-0,51,255,
-0,55,255,
-0,59,255,
-0,63,255,
-0,67,255,
-0,71,255,
-0,75,255,
-0,79,255,
-0,83,255,
-0,87,255,
-0,91,255,
-0,95,255,
-0,99,255,
-0,103,255,
-0,107,255,
-0,111,255,
-0,115,255,
-0,119,255,
-0,123,255,
-0,127,255,
-0,131,255,
-0,135,255,
-0,139,255,
-0,143,255,
-0,147,255,
-0,151,255,
-0,155,255,
-0,159,255,
-0,163,255,
-0,167,255,
-0,171,255,
-0,175,255,
-0,179,255,
-0,183,255,
-0,187,255,
-0,191,255,
-0,195,255,
-0,199,255,
-0,203,255,
-0,207,255,
-0,211,255,
-0,215,255,
-0,219,255,
-0,223,255,
-0,227,255,
-0,231,255,
-0,235,255,
-0,239,255,
-0,243,255,
-0,247,255,
-0,251,255,
-0,255,255,
-0,255,255,
-3,255,251,
-7,255,247,
-11,255,243,
-15,255,239,
-19,255,235,
-23,255,231,
-27,255,227,
-31,255,223,
-35,255,219,
-39,255,215,
-43,255,211,
-47,255,207,
-51,255,203,
-55,255,199,
-59,255,195,
-63,255,191,
-67,255,187,
-71,255,183,
-75,255,179,
-79,255,175,
-83,255,171,
-87,255,167,
-91,255,163,
-95,255,159,
-99,255,155,
-103,255,151,
-107,255,147,
-111,255,143,
-115,255,139,
-119,255,135,
-123,255,131,
-127,255,127,
-131,255,123,
-135,255,119,
-139,255,115,
-143,255,111,
-147,255,107,
-151,255,103,
-155,255,99,
-159,255,95,
-163,255,91,
-167,255,87,
-171,255,83,
-175,255,79,
-179,255,75,
-183,255,71,
-187,255,67,
-191,255,63,
-195,255,59,
-199,255,55,
-203,255,51,
-207,255,47,
-211,255,43,
-215,255,39,
-219,255,35,
-223,255,31,
-227,255,27,
-231,255,23,
-235,255,19,
-239,255,15,
-243,255,11,
-247,255,7,
-251,255,3,
-255,255,0,
-255,251,0,
-255,247,0,
-255,243,0,
-255,239,0,
-255,235,0,
-255,231,0,
-255,227,0,
-255,223,0,
-255,219,0,
-255,215,0,
-255,211,0,
-255,207,0,
-255,203,0,
-255,199,0,
-255,195,0,
-255,191,0,
-255,187,0,
-255,183,0,
-255,179,0,
-255,175,0,
-255,171,0,
-255,167,0,
-255,163,0,
-255,159,0,
-255,155,0,
-255,151,0,
-255,147,0,
-255,143,0,
-255,139,0,
-255,135,0,
-255,131,0,
-255,127,0,
-255,123,0,
-255,119,0,
-255,115,0,
-255,111,0,
-255,107,0,
-255,103,0,
-255,99,0,
-255,95,0,
-255,91,0,
-255,87,0,
-255,83,0,
-255,79,0,
-255,75,0,
-255,71,0,
-255,67,0,
-255,63,0,
-255,59,0,
-255,55,0,
-255,51,0,
-255,47,0,
-255,43,0,
-255,39,0,
-255,35,0,
-255,31,0,
-255,27,0,
-255,23,0,
-255,19,0,
-255,15,0,
-255,11,0,
-255,7,0,
-255,3,0,
-255,0,0,
-250,0,0,
-246,0,0,
-241,0,0,
-237,0,0,
-233,0,0,
-228,0,0,
-224,0,0,
-219,0,0,
-215,0,0,
-211,0,0,
-206,0,0,
-202,0,0,
-197,0,0,
-193,0,0,
-189,0,0,
-184,0,0,
-180,0,0,
-175,0,0,
-171,0,0,
-167,0,0,
-162,0,0,
-158,0,0,
-153,0,0,
-149,0,0,
-145,0,0,
-140,0,0,
-136,0,0,
-131,0,0,
-127,0,0
+/* clang-format off */
+const unsigned char pal_rgb[256*3] = {
+ 255,255,255,
+ 0,0,131,
+ 0,0,135,
+ 0,0,139,
+ 0,0,143,
+ 0,0,147,
+ 0,0,151,
+ 0,0,155,
+ 0,0,159,
+ 0,0,163,
+ 0,0,167,
+ 0,0,171,
+ 0,0,175,
+ 0,0,179,
+ 0,0,183,
+ 0,0,187,
+ 0,0,191,
+ 0,0,195,
+ 0,0,199,
+ 0,0,203,
+ 0,0,207,
+ 0,0,211,
+ 0,0,215,
+ 0,0,219,
+ 0,0,223,
+ 0,0,227,
+ 0,0,231,
+ 0,0,235,
+ 0,0,239,
+ 0,0,243,
+ 0,0,247,
+ 0,0,251,
+ 0,0,255,
+ 0,0,255,
+ 0,3,255,
+ 0,7,255,
+ 0,11,255,
+ 0,15,255,
+ 0,19,255,
+ 0,23,255,
+ 0,27,255,
+ 0,31,255,
+ 0,35,255,
+ 0,39,255,
+ 0,43,255,
+ 0,47,255,
+ 0,51,255,
+ 0,55,255,
+ 0,59,255,
+ 0,63,255,
+ 0,67,255,
+ 0,71,255,
+ 0,75,255,
+ 0,79,255,
+ 0,83,255,
+ 0,87,255,
+ 0,91,255,
+ 0,95,255,
+ 0,99,255,
+ 0,103,255,
+ 0,107,255,
+ 0,111,255,
+ 0,115,255,
+ 0,119,255,
+ 0,123,255,
+ 0,127,255,
+ 0,131,255,
+ 0,135,255,
+ 0,139,255,
+ 0,143,255,
+ 0,147,255,
+ 0,151,255,
+ 0,155,255,
+ 0,159,255,
+ 0,163,255,
+ 0,167,255,
+ 0,171,255,
+ 0,175,255,
+ 0,179,255,
+ 0,183,255,
+ 0,187,255,
+ 0,191,255,
+ 0,195,255,
+ 0,199,255,
+ 0,203,255,
+ 0,207,255,
+ 0,211,255,
+ 0,215,255,
+ 0,219,255,
+ 0,223,255,
+ 0,227,255,
+ 0,231,255,
+ 0,235,255,
+ 0,239,255,
+ 0,243,255,
+ 0,247,255,
+ 0,251,255,
+ 0,255,255,
+ 0,255,255,
+ 3,255,251,
+ 7,255,247,
+ 11,255,243,
+ 15,255,239,
+ 19,255,235,
+ 23,255,231,
+ 27,255,227,
+ 31,255,223,
+ 35,255,219,
+ 39,255,215,
+ 43,255,211,
+ 47,255,207,
+ 51,255,203,
+ 55,255,199,
+ 59,255,195,
+ 63,255,191,
+ 67,255,187,
+ 71,255,183,
+ 75,255,179,
+ 79,255,175,
+ 83,255,171,
+ 87,255,167,
+ 91,255,163,
+ 95,255,159,
+ 99,255,155,
+ 103,255,151,
+ 107,255,147,
+ 111,255,143,
+ 115,255,139,
+ 119,255,135,
+ 123,255,131,
+ 127,255,127,
+ 131,255,123,
+ 135,255,119,
+ 139,255,115,
+ 143,255,111,
+ 147,255,107,
+ 151,255,103,
+ 155,255,99,
+ 159,255,95,
+ 163,255,91,
+ 167,255,87,
+ 171,255,83,
+ 175,255,79,
+ 179,255,75,
+ 183,255,71,
+ 187,255,67,
+ 191,255,63,
+ 195,255,59,
+ 199,255,55,
+ 203,255,51,
+ 207,255,47,
+ 211,255,43,
+ 215,255,39,
+ 219,255,35,
+ 223,255,31,
+ 227,255,27,
+ 231,255,23,
+ 235,255,19,
+ 239,255,15,
+ 243,255,11,
+ 247,255,7,
+ 251,255,3,
+ 255,255,0,
+ 255,251,0,
+ 255,247,0,
+ 255,243,0,
+ 255,239,0,
+ 255,235,0,
+ 255,231,0,
+ 255,227,0,
+ 255,223,0,
+ 255,219,0,
+ 255,215,0,
+ 255,211,0,
+ 255,207,0,
+ 255,203,0,
+ 255,199,0,
+ 255,195,0,
+ 255,191,0,
+ 255,187,0,
+ 255,183,0,
+ 255,179,0,
+ 255,175,0,
+ 255,171,0,
+ 255,167,0,
+ 255,163,0,
+ 255,159,0,
+ 255,155,0,
+ 255,151,0,
+ 255,147,0,
+ 255,143,0,
+ 255,139,0,
+ 255,135,0,
+ 255,131,0,
+ 255,127,0,
+ 255,123,0,
+ 255,119,0,
+ 255,115,0,
+ 255,111,0,
+ 255,107,0,
+ 255,103,0,
+ 255,99,0,
+ 255,95,0,
+ 255,91,0,
+ 255,87,0,
+ 255,83,0,
+ 255,79,0,
+ 255,75,0,
+ 255,71,0,
+ 255,67,0,
+ 255,63,0,
+ 255,59,0,
+ 255,55,0,
+ 255,51,0,
+ 255,47,0,
+ 255,43,0,
+ 255,39,0,
+ 255,35,0,
+ 255,31,0,
+ 255,27,0,
+ 255,23,0,
+ 255,19,0,
+ 255,15,0,
+ 255,11,0,
+ 255,7,0,
+ 255,3,0,
+ 255,0,0,
+ 250,0,0,
+ 246,0,0,
+ 241,0,0,
+ 237,0,0,
+ 233,0,0,
+ 228,0,0,
+ 224,0,0,
+ 219,0,0,
+ 215,0,0,
+ 211,0,0,
+ 206,0,0,
+ 202,0,0,
+ 197,0,0,
+ 193,0,0,
+ 189,0,0,
+ 184,0,0,
+ 180,0,0,
+ 175,0,0,
+ 171,0,0,
+ 167,0,0,
+ 162,0,0,
+ 158,0,0,
+ 153,0,0,
+ 149,0,0,
+ 145,0,0,
+ 140,0,0,
+ 136,0,0,
+ 131,0,0,
+ 127,0,0
};
+/* clang-format on */
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 301c0a1..354d79f 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -22,7 +22,7 @@ set (HDF5_HL_F90_C_SOURCES
)
set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C)
-set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h)
+set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.h)
if (NOT ONLY_SHARED_LIBS)
add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
@@ -61,6 +61,17 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIB_TARGET})
+ else ()
+ clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIBSH_TARGET})
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Fortran Modules
#-----------------------------------------------------------------------------
set (HDF5_HL_F90_F_SRCS
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index 6a2fc61..6bf0ca2 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -28,6 +28,12 @@ set (HL_HEADERS
set (HL_PRIVATE_HEADERS
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5DSprivate.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5IMprivate.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5PTprivate.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5HLprivate2.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5LTprivate.h
+ ${HDF5_HL_SRC_SOURCE_DIR}/H5TBprivate.h
)
if (NOT ONLY_SHARED_LIBS)
@@ -62,6 +68,17 @@ if (BUILD_SHARED_LIBS)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIB_TARGET})
+ else ()
+ clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIBSH_TARGET})
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
install (
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 0074d02..4d0511d 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -11,11 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "H5LTprivate.h"
/* For Lex and Yacc */
@@ -29,19 +24,19 @@ char *myinput;
size_t indent = 0;
-/* File Image operations
-
- A file image is a representation of an HDF5 file in a memory
- buffer. In order to perform operations on an image in a similar way
+/* File Image operations
+
+ A file image is a representation of an HDF5 file in a memory
+ buffer. In order to perform operations on an image in a similar way
to a file, the application buffer is copied to a FAPL buffer, which
- in turn is copied to a VFD buffer. Buffer copying can decrease
- performance, especially when using large file images. A solution to
- this issue is to simulate the copying of the application buffer,
- when actually the same buffer is used for the FAPL and the VFD.
- This is implemented by using callbacks that simulate the standard
- functions for memory management (additional callbacks are used for
- the management of associated data structures). From the application
- standpoint, a file handle can be obtained from a file image by using
+ in turn is copied to a VFD buffer. Buffer copying can decrease
+ performance, especially when using large file images. A solution to
+ this issue is to simulate the copying of the application buffer,
+ when actually the same buffer is used for the FAPL and the VFD.
+ This is implemented by using callbacks that simulate the standard
+ functions for memory management (additional callbacks are used for
+ the management of associated data structures). From the application
+ standpoint, a file handle can be obtained from a file image by using
the API routine H5LTopen_file_image(). This function takes a flag
argument that indicates the HDF5 library how to handle the given image;
several flag values can be combined by using the bitwise OR operator.
@@ -61,19 +56,19 @@ size_t indent = 0;
well. The application is responsible to release the image buffer.
*/
-/* Data structure to pass application data to callbacks. */
+/* Data structure to pass application data to callbacks. */
typedef struct {
- void *app_image_ptr; /* Pointer to application buffer */
- size_t app_image_size; /* Size of application buffer */
- void *fapl_image_ptr; /* Pointer to FAPL buffer */
- size_t fapl_image_size; /* Size of FAPL buffer */
- int fapl_ref_count; /* Reference counter for FAPL buffer */
- void *vfd_image_ptr; /* Pointer to VFD buffer */
- size_t vfd_image_size; /* Size of VFD buffer */
- int vfd_ref_count; /* Reference counter for VFD buffer */
- unsigned flags; /* Flags indicate how the file image will */
+ void *app_image_ptr; /* Pointer to application buffer */
+ size_t app_image_size; /* Size of application buffer */
+ void *fapl_image_ptr; /* Pointer to FAPL buffer */
+ size_t fapl_image_size; /* Size of FAPL buffer */
+ int fapl_ref_count; /* Reference counter for FAPL buffer */
+ void *vfd_image_ptr; /* Pointer to VFD buffer */
+ size_t vfd_image_size; /* Size of VFD buffer */
+ int vfd_ref_count; /* Reference counter for VFD buffer */
+ unsigned flags; /* Flags indicate how the file image will */
/* be open */
- int ref_count; /* Reference counter on udata struct */
+ int ref_count; /* Reference counter on udata struct */
} H5LT_file_image_ud_t;
/* callbacks prototypes for file image ops */
@@ -86,19 +81,19 @@ static herr_t udata_free(void *udata);
/* Definition of callbacks for file image operations. */
-
+
/*-------------------------------------------------------------------------
-* Function: image_malloc
+* Function: image_malloc
*
* Purpose: Simulates malloc() function to avoid copying file images.
* The application buffer is set to the buffer on only one FAPL.
* Then the FAPL buffer can be copied to other FAPL buffers or
-* to only one VFD buffer.
+* to only one VFD buffer.
*
* Return: Address of "allocated" buffer, if successful. Otherwise, it returns
* NULL.
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -109,72 +104,72 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata)
{
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
void * return_value = NULL;
-
+
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch ( file_image_op ) {
/* the app buffer is "copied" to only one FAPL. Afterwards, FAPLs can be "copied" */
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
- if (udata->app_image_ptr == NULL)
+ if (udata->app_image_ptr == NULL)
goto out;
- if (udata->app_image_size != size)
+ if (udata->app_image_size != size)
goto out;
- if (udata->fapl_image_ptr != NULL)
+ if (udata->fapl_image_ptr != NULL)
goto out;
- if (udata->fapl_image_size != 0)
+ if (udata->fapl_image_size != 0)
goto out;
- if (udata->fapl_ref_count != 0)
+ if (udata->fapl_ref_count != 0)
goto out;
udata->fapl_image_ptr = udata->app_image_ptr;
udata->fapl_image_size = udata->app_image_size;
return_value = udata->fapl_image_ptr;
udata->fapl_ref_count++;
- break;
+ break;
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
- if (udata->fapl_image_ptr == NULL)
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
+ if (udata->fapl_image_ptr == NULL)
goto out;
- if (udata->fapl_image_size != size)
+ if (udata->fapl_image_size != size)
goto out;
- if (udata->fapl_ref_count == 0)
+ if (udata->fapl_ref_count == 0)
goto out;
return_value = udata->fapl_image_ptr;
udata->fapl_ref_count++;
- break;
+ break;
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET:
goto out;
case H5FD_FILE_IMAGE_OP_FILE_OPEN:
/* FAPL buffer is "copied" to only one VFD buffer */
- if (udata->vfd_image_ptr != NULL)
+ if (udata->vfd_image_ptr != NULL)
goto out;
- if (udata->vfd_image_size != 0)
+ if (udata->vfd_image_size != 0)
goto out;
- if (udata->vfd_ref_count != 0)
+ if (udata->vfd_ref_count != 0)
goto out;
- if (udata->fapl_image_ptr == NULL)
+ if (udata->fapl_image_ptr == NULL)
goto out;
- if (udata->fapl_image_size != size)
+ if (udata->fapl_image_size != size)
goto out;
- if (udata->fapl_ref_count == 0)
+ if (udata->fapl_ref_count == 0)
goto out;
udata->vfd_image_ptr = udata->fapl_image_ptr;
- udata->vfd_image_size = size;
+ udata->vfd_image_size = size;
udata->vfd_ref_count++;
return_value = udata->vfd_image_ptr;
break;
- /* added unused labels to shut the compiler up */
- case H5FD_FILE_IMAGE_OP_NO_OP:
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
- case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
- case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
+ /* added unused labels to shut the compiler up */
+ case H5FD_FILE_IMAGE_OP_NO_OP:
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
+ case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
+ case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
default:
goto out;
} /* end switch */
@@ -185,19 +180,19 @@ out:
return NULL;
} /* end image_malloc() */
-
+
/*-------------------------------------------------------------------------
* Function: image_memcpy
*
-* Purpose: Simulates memcpy() function to avoid copying file images.
+* Purpose: Simulates memcpy() function to avoid copying file images.
* The image buffer can be set to only one FAPL buffer, and
* "copied" to only one VFD buffer. The FAPL buffer can be
-* "copied" to other FAPLs buffers.
+* "copied" to other FAPLs buffers.
*
* Return: The address of the destination buffer, if successful. Otherwise, it
* returns NULL.
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -210,31 +205,31 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch(file_image_op) {
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
- if (dest != udata->fapl_image_ptr)
+ if (dest != udata->fapl_image_ptr)
goto out;
- if (src != udata->app_image_ptr)
+ if (src != udata->app_image_ptr)
goto out;
- if (size != udata->fapl_image_size)
+ if (size != udata->fapl_image_size)
goto out;
- if (size != udata->app_image_size)
+ if (size != udata->app_image_size)
goto out;
- if (udata->fapl_ref_count == 0)
+ if (udata->fapl_ref_count == 0)
goto out;
break;
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
- if (dest != udata->fapl_image_ptr)
+ if (dest != udata->fapl_image_ptr)
goto out;
- if (src != udata->fapl_image_ptr)
+ if (src != udata->fapl_image_ptr)
goto out;
- if (size != udata->fapl_image_size)
+ if (size != udata->fapl_image_size)
goto out;
- if (udata->fapl_ref_count < 2)
+ if (udata->fapl_ref_count < 2)
goto out;
break;
@@ -242,25 +237,25 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file
goto out;
case H5FD_FILE_IMAGE_OP_FILE_OPEN:
- if (dest != udata->vfd_image_ptr)
+ if (dest != udata->vfd_image_ptr)
goto out;
- if (src != udata->fapl_image_ptr)
+ if (src != udata->fapl_image_ptr)
goto out;
- if (size != udata->vfd_image_size)
+ if (size != udata->vfd_image_size)
goto out;
- if (size != udata->fapl_image_size)
+ if (size != udata->fapl_image_size)
goto out;
- if (udata->fapl_ref_count == 0)
+ if (udata->fapl_ref_count == 0)
goto out;
- if (udata->vfd_ref_count != 1)
+ if (udata->vfd_ref_count != 1)
goto out;
break;
- /* added unused labels to shut the compiler up */
- case H5FD_FILE_IMAGE_OP_NO_OP:
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
- case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
- case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
+ /* added unused labels to shut the compiler up */
+ case H5FD_FILE_IMAGE_OP_NO_OP:
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
+ case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
+ case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
default:
goto out;
} /* end switch */
@@ -271,17 +266,17 @@ out:
return NULL;
} /* end image_memcpy() */
-
+
/*-------------------------------------------------------------------------
-* Function: image_realloc
+* Function: image_realloc
*
* Purpose: Reallocates the shared application image buffer and updates data
-* structures that manage buffer "copying".
-*
+* structures that manage buffer "copying".
+*
* Return: Address of reallocated buffer, if successful. Otherwise, it returns
-* NULL.
+* NULL.
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -294,29 +289,29 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *
void * return_value = NULL;
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
- /* realloc() is not allowed when the HDF5 library won't release the image
+ /* realloc() is not allowed when the HDF5 library won't release the image
buffer because reallocation may change the address of the buffer. The
new address cannot be communicated to the application to release it. */
- if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)
- goto out;
+ if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)
+ goto out;
/* realloc() is not allowed if the image is open in read-only mode */
- if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW))
- goto out;
+ if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW))
+ goto out;
if (file_image_op == H5FD_FILE_IMAGE_OP_FILE_RESIZE) {
- if (udata->vfd_image_ptr != ptr)
- goto out;
+ if (udata->vfd_image_ptr != ptr)
+ goto out;
- if (udata->vfd_ref_count != 1)
+ if (udata->vfd_ref_count != 1)
goto out;
if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size)))
- goto out;
-
+ goto out;
+
udata->vfd_image_size = size;
return_value = udata->vfd_image_ptr;
} /* end if */
@@ -337,9 +332,9 @@ out:
* reference counters. Shared application buffer is actually
* deallocated if there are no outstanding references.
*
-* Return: SUCCEED or FAIL
+* Return: SUCCEED or FAIL
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -351,19 +346,19 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch(file_image_op) {
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
- if (udata->fapl_image_ptr != ptr)
+ if (udata->fapl_image_ptr != ptr)
goto out;
- if (udata->fapl_ref_count == 0)
+ if (udata->fapl_ref_count == 0)
goto out;
udata->fapl_ref_count--;
- /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
+ /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
HDfree(udata->fapl_image_ptr);
@@ -374,14 +369,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
break;
case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
- if (udata->vfd_image_ptr != ptr)
+ if (udata->vfd_image_ptr != ptr)
goto out;
- if (udata->vfd_ref_count != 1)
+ if (udata->vfd_ref_count != 1)
goto out;
udata->vfd_ref_count--;
- /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
+ /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
HDfree(udata->vfd_image_ptr);
@@ -391,14 +386,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
} /* end if */
break;
- /* added unused labels to keep the compiler quite */
- case H5FD_FILE_IMAGE_OP_NO_OP:
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
- case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET:
- case H5FD_FILE_IMAGE_OP_FILE_OPEN:
- case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
- default:
+ /* added unused labels to keep the compiler quite */
+ case H5FD_FILE_IMAGE_OP_NO_OP:
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
+ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET:
+ case H5FD_FILE_IMAGE_OP_FILE_OPEN:
+ case H5FD_FILE_IMAGE_OP_FILE_RESIZE:
+ default:
goto out;
} /* end switch */
@@ -408,9 +403,9 @@ out:
return(FAIL);
} /* end image_free() */
-
+
/*-------------------------------------------------------------------------
-* Function: udata_copy
+* Function: udata_copy
*
* Purpose: Simulates the copying of the user data structure utilized in the
* management of the "copying" of file images.
@@ -418,7 +413,7 @@ out:
* Return: Address of "newly allocated" structure, if successful. Otherwise, it
* returns NULL.
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -430,9 +425,9 @@ udata_copy(void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
- if (udata->ref_count == 0)
+ if (udata->ref_count == 0)
goto out;
udata->ref_count++;
@@ -449,11 +444,11 @@ out:
*
* Purpose: Simulates deallocation of the user data structure utilized in the
* management of the "copying" of file images. The data structure is
-* actually deallocated when there are no outstanding references.
+* actually deallocated when there are no outstanding references.
*
-* Return: SUCCEED or FAIL
+* Return: SUCCEED or FAIL
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -465,9 +460,9 @@ udata_free(void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
- if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
+ if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
- if (udata->ref_count == 0)
+ if (udata->ref_count == 0)
goto out;
udata->ref_count--;
@@ -479,7 +474,7 @@ udata_free(void *_udata)
return(SUCCEED);
-out:
+out:
return(FAIL);
} /* end udata_free */
@@ -504,7 +499,7 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Quincey Koziol, koziol@hdfgroup.org
+* Programmer: Quincey Koziol
*
* Date: October 10, 2007
*
@@ -522,7 +517,7 @@ H5LT_make_dataset_numerical( hid_t loc_id,
hid_t did = -1, sid = -1;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* Create the data space for the dataset. */
@@ -570,7 +565,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 19, 2001
*
@@ -599,7 +594,7 @@ herr_t H5LTmake_dataset( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -628,7 +623,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -657,7 +652,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -688,7 +683,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -717,7 +712,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -748,7 +743,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 14, 2001
*
@@ -778,7 +773,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: October 05, 2004
*
@@ -801,7 +796,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id,
size_t size;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* create a string data type */
@@ -848,15 +843,15 @@ out:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: H5LTopen_file_image
*
-* Purpose: Open a user supplied file image using the core file driver.
+* Purpose: Open a user supplied file image using the core file driver.
*
* Return: File identifier, Failure: -1
*
-* Programmer: Christian Chilan
+* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@@ -864,29 +859,29 @@ out:
*/
hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
{
- hid_t fapl=-1, file_id=-1; /* HDF5 identifiers */
+ hid_t fapl=-1, file_id=-1; /* HDF5 identifiers */
unsigned file_open_flags; /* Flags for image open */
- char file_name[64]; /* Filename buffer */
+ char file_name[64]; /* Filename buffer */
size_t alloc_incr; /* Buffer allocation increment */
size_t min_incr = 65536; /* Minimum buffer increment */
double buf_prcnt = 0.1f; /* Percentage of buffer size to set
as increment */
- static long file_name_counter;
- H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy,
- &image_realloc, &image_free,
- &udata_copy, &udata_free,
+ static long file_name_counter;
+ H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy,
+ &image_realloc, &image_free,
+ &udata_copy, &udata_free,
(void *)NULL};
/* check arguments */
- if (buf_ptr == NULL)
+ if (buf_ptr == NULL)
goto out;
- if (buf_size == 0)
+ if (buf_size == 0)
goto out;
if (flags & (unsigned)~(H5LT_FILE_IMAGE_ALL))
goto out;
/* Create FAPL to transmit file image */
- if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto out;
/* set allocation increment to a percentage of the supplied buffer size, or
@@ -898,12 +893,12 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
alloc_incr = min_incr;
/* Configure FAPL to use the core file driver */
- if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0)
+ if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0)
goto out;
/* Set callbacks for file image ops ONLY if the file image is NOT copied */
if (flags & H5LT_FILE_IMAGE_DONT_COPY) {
- H5LT_file_image_ud_t *udata; /* Pointer to udata structure */
+ H5LT_file_image_ud_t *udata; /* Pointer to udata structure */
/* Allocate buffer to communicate user data to callbacks */
if (NULL == (udata = (H5LT_file_image_ud_t *)HDmalloc(sizeof(H5LT_file_image_ud_t))))
@@ -932,10 +927,10 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
} /* end if */
/* Assign file image in user buffer to FAPL */
- if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0)
+ if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0)
goto out;
- /* set file open flags */
+ /* set file open flags */
if (flags & H5LT_FILE_IMAGE_OPEN_RW)
file_open_flags = H5F_ACC_RDWR;
else
@@ -943,17 +938,17 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
/* define a unique file name */
HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++);
-
- /* Assign file image in FAPL to the core file driver */
- if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0)
+
+ /* Assign file image in FAPL to the core file driver */
+ if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0)
goto out;
/* Close FAPL */
- if (H5Pclose(fapl) < 0)
+ if (H5Pclose(fapl) < 0)
goto out;
- /* Return file identifier */
- return file_id;
+ /* Return file identifier */
+ return file_id;
out:
H5E_BEGIN_TRY {
@@ -970,7 +965,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Quincey Koziol, koziol@hdfgroup.org
+* Programmer: Quincey Koziol
*
* Date: October 8, 2007
*
@@ -983,7 +978,7 @@ H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void
hid_t did;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* Open the dataset. */
@@ -1012,7 +1007,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: June 13, 2001
*
@@ -1035,7 +1030,7 @@ herr_t H5LTread_dataset(hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1056,7 +1051,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1077,7 +1072,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1098,7 +1093,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1119,7 +1114,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1141,7 +1136,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 5, 2001
*
@@ -1163,7 +1158,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: October 05, 2004
*
@@ -1178,7 +1173,7 @@ herr_t H5LTread_dataset_string( hid_t loc_id,
hid_t tid = -1;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* Open the dataset. */
@@ -1216,7 +1211,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 4, 2001
*
@@ -1231,7 +1226,7 @@ herr_t H5LTget_dataset_ndims( hid_t loc_id,
hid_t sid = -1;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* Open the dataset. */
@@ -1272,7 +1267,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 4, 2001
* Modified: February 28, 2006: checked for NULL parameters
@@ -1291,7 +1286,7 @@ herr_t H5LTget_dataset_info( hid_t loc_id,
hid_t sid = -1;
/* check the arguments */
- if (dset_name == NULL)
+ if (dset_name == NULL)
return -1;
/* open the dataset. */
@@ -1348,7 +1343,7 @@ out:
*
* Purpose: operator function used by H5LTfind_dataset
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: June 21, 2001
*
@@ -1368,9 +1363,9 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
int ret = 0;
/* check the arguments */
- if (name == NULL)
+ if (name == NULL)
return ret;
-
+
/* Shut the compiler up */
loc_id = loc_id;
linfo = linfo;
@@ -1392,7 +1387,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
* Purpose: Inquires if a dataset named dset_name exists attached
* to the object loc_id.
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: July 15, 2001
*
@@ -1408,12 +1403,13 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
*-------------------------------------------------------------------------
*/
+H5_GCC_DIAG_OFF("cast-qual")
herr_t
H5LTfind_dataset( hid_t loc_id, const char *dset_name )
{
return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
}
-
+H5_GCC_DIAG_ON("cast-qual")
/*-------------------------------------------------------------------------
*
@@ -1431,7 +1427,7 @@ H5LTfind_dataset( hid_t loc_id, const char *dset_name )
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: July 23, 2001
*
@@ -1455,11 +1451,11 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
size_t attr_size;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
- if (attr_data == NULL)
+ if (attr_data == NULL)
return -1;
/* Open the object */
@@ -1529,7 +1525,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: July 25, 2001
*
@@ -1552,9 +1548,9 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id,
int has_attr;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
/* Open the object */
@@ -1608,7 +1604,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 7, 2001
*
@@ -1638,7 +1634,7 @@ herr_t H5LTset_attribute_char( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -1669,7 +1665,7 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 7, 2001
*
@@ -1700,7 +1696,7 @@ herr_t H5LTset_attribute_short( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -1731,7 +1727,7 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 7, 2001
*
@@ -1762,7 +1758,7 @@ herr_t H5LTset_attribute_int( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -1794,7 +1790,7 @@ herr_t H5LTset_attribute_uint( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 7, 2001
*
@@ -1824,7 +1820,7 @@ herr_t H5LTset_attribute_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu
+* Programmer: Elena Pourmal
*
* Date: June 17, 2005
*
@@ -1856,7 +1852,7 @@ herr_t H5LTset_attribute_long_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -1888,7 +1884,7 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: July 25, 2001
*
@@ -1921,7 +1917,7 @@ herr_t H5LTset_attribute_float( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: November 7, 2001
*
@@ -1952,7 +1948,7 @@ herr_t H5LTset_attribute_double( hid_t loc_id,
*
* Purpose: operator function used by H5LT_find_attribute
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: June 21, 2001
*
@@ -1969,7 +1965,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
int ret = H5_ITER_CONT;
/* check the arguments */
- if (name == NULL)
+ if (name == NULL)
return H5_ITER_CONT;
/* Shut compiler up */
@@ -1993,7 +1989,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
* Purpose: Inquires if an attribute named attr_name exists attached to
* the object loc_id.
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: May 17, 2006
*
@@ -2015,7 +2011,7 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name )
*
* Purpose: Inquires if an attribute named attr_name exists attached to the object loc_id.
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: June 21, 2001
*
@@ -2034,12 +2030,13 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name )
*-------------------------------------------------------------------------
*/
+H5_GCC_DIAG_OFF("cast-qual")
herr_t
H5LT_find_attribute( hid_t loc_id, const char* attr_name )
{
return H5Aiterate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name);
}
-
+H5_GCC_DIAG_ON("cast-qual")
/*-------------------------------------------------------------------------
@@ -2049,7 +2046,7 @@ H5LT_find_attribute( hid_t loc_id, const char* attr_name )
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 4, 2001
*
@@ -2066,9 +2063,9 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
/* Open the object */
@@ -2119,7 +2116,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 4, 2001
*
@@ -2139,9 +2136,9 @@ herr_t H5LTget_attribute_info( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
/* Open the object */
@@ -2205,7 +2202,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Raymond Lu, slu@ncsa.uiuc.edu
+* Programmer: Raymond Lu
*
* Date: October 6, 2004
*
@@ -2220,7 +2217,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
hid_t type_id;
/* check the arguments */
- if (text == NULL)
+ if (text == NULL)
return -1;
if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
@@ -2255,7 +2252,7 @@ out:
*
* Return: void
*
-* Programmer: Raymond Lu, songyulu@hdfgroup.org
+* Programmer: Raymond Lu
*
* Date: 29 September 2011
*
@@ -2263,7 +2260,7 @@ out:
*
*-------------------------------------------------------------------------
*/
-static char*
+static char*
realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_add)
{
size_t size_str_to_add, size_str;
@@ -2288,17 +2285,17 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad
/* find the size of the current buffer */
size_str = HDstrlen(buf);
- /* Check to make sure the appended string does not
+ /* Check to make sure the appended string does not
* extend past the allocated buffer; if it does then truncate the string
*/
if(size_str < *len - 1) {
- if( size_str + size_str_to_add < *len - 1) {
- HDstrncat(buf, str_to_add, size_str_to_add);
- } else {
- HDstrncat(buf, str_to_add, (*len - 1) - size_str);
- }
+ if( size_str + size_str_to_add < *len - 1) {
+ HDstrncat(buf, str_to_add, size_str_to_add);
+ } else {
+ HDstrncat(buf, str_to_add, (*len - 1) - size_str);
+ }
} else {
- buf[*len-1] = '\0'; /* buffer is full, null terminate */
+ buf[*len-1] = '\0'; /* buffer is full, null terminate */
}
}
@@ -2315,7 +2312,7 @@ out:
*
* Return: void
*
-* Programmer: Raymond Lu, slu@ncsa.uiuc.edu
+* Programmer: Raymond Lu
*
* Date: December 6, 2005
*
@@ -2478,7 +2475,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Raymond Lu, slu@ncsa.uiuc.edu
+* Programmer: Raymond Lu
*
* Date: December 6, 2005
*
@@ -2525,7 +2522,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Raymond Lu, slu@ncsa.uiuc.edu
+* Programmer: Raymond Lu
*
* Date: December 20, 2005
*
@@ -2544,7 +2541,7 @@ char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *sl
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, NULL)))
goto out;
-
+
if(lang != H5LT_DDL) {
HDsnprintf(dt_str, *slen, "only DDL is supported for now");
goto out;
@@ -3056,15 +3053,15 @@ next:
HDsnprintf(dt_str, *slen, "H5T_NO_CLASS");
break;
case H5T_REFERENCE:
- if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) {
- HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }");
- }
- else {
- HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }");
- }
- break;
+ if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) {
+ HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }");
+ }
+ else {
+ HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }");
+ }
+ break;
case H5T_NCLASSES:
- break;
+ break;
default:
HDsnprintf(dt_str, *slen, "unknown data type");
}
@@ -3090,7 +3087,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3111,9 +3108,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
/* Open the object */
@@ -3121,9 +3118,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
return -1;
/* Get the attribute */
- if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 )
+ if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 )
{
- H5Oclose(obj_id);
+ H5Oclose(obj_id);
return -1;
}
@@ -3142,7 +3139,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3171,7 +3168,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -3202,7 +3199,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3231,7 +3228,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -3262,7 +3259,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3291,7 +3288,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -3322,7 +3319,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3351,7 +3348,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu
+* Programmer: Elena Pourmal
*
* Date: June 17, 2005
*
@@ -3381,7 +3378,7 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: March 8, 2004
*
@@ -3411,7 +3408,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3443,7 +3440,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3475,7 +3472,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3514,7 +3511,7 @@ herr_t H5LTget_attribute( hid_t loc_id,
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3537,9 +3534,9 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id,
hid_t attr_id = -1;
/* check the arguments */
- if (obj_name == NULL)
+ if (obj_name == NULL)
return -1;
- if (attr_name == NULL)
+ if (attr_name == NULL)
return -1;
/* Open the object */
@@ -3578,7 +3575,7 @@ out:
*
* Return: Success: 0, Failure: -1
*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: September 19, 2002
*
@@ -3620,7 +3617,7 @@ out:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: H5LT_set_attribute_string
*
@@ -3628,7 +3625,7 @@ out:
*
* Return: FAIL on error, SUCCESS on success
*
-* Programmer: pvn@ncsa.uiuc.edu
+* Programmer: Pedro Vicente
*
* Date: January 04, 2005
*
@@ -3740,12 +3737,12 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
if(HDstrncmp(path, ".", path_length) == 0) {
if(check_object_valid) {
obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT);
- ret_value = obj_exists;
- goto done;
+ ret_value = obj_exists;
+ goto done;
} else {
- ret_value = TRUE; /* Since the object is the identifier itself,
- * we can only check if loc_id is a valid type */
- goto done;
+ ret_value = TRUE; /* Since the object is the identifier itself,
+ * we can only check if loc_id is a valid type */
+ goto done;
}
}
@@ -3769,20 +3766,20 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
obj_exists = FALSE;
if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
- ret_value = FAIL;
- goto done;
+ ret_value = FAIL;
+ goto done;
}
/* If target link does not exist then no reason to
* continue checking the path */
if(link_exists != TRUE) {
- ret_value = FALSE;
- goto done;
+ ret_value = FALSE;
+ goto done;
}
-
+
/* Determine if link resolves to an actual object */
if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
- ret_value = FAIL;
+ ret_value = FAIL;
goto done;
}
@@ -3806,11 +3803,11 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
ret_value = link_exists;
/* Determine if link resolves to an actual object for check_object_valid TRUE */
if(check_object_valid == TRUE && link_exists == TRUE) {
- if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
- ret_value = FAIL;
- } else {
- ret_value = obj_exists;
- }
+ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ } else {
+ ret_value = obj_exists;
+ }
}
}
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index e91bba2..8d34d02 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -37,6 +37,13 @@ macro (HL_ADD_EXE hl_name)
)
endif ()
set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_TEST_${hl_name}_FORMAT hl_${hl_name})
+ endif ()
endmacro ()
macro (HL_ADD_ZEXE hl_name)
@@ -61,6 +68,13 @@ macro (HL_ADD_ZEXE hl_name)
)
endif ()
set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_TEST_${hl_name}_FORMAT hl_${hl_name})
+ endif ()
endmacro ()
HL_ADD_EXE (test_ds)
@@ -90,6 +104,13 @@ else ()
endif ()
set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl)
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_TEST_hl_test_packet_FORMAT hl_test_packet)
+endif ()
+
# --------------------------------------------------------------------
# This executable is used to generate test files for the test_ds test.
# It should only be run during development when new test files are needed
@@ -105,6 +126,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
${HDF5_LIB_TARGET}
)
set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_TEST_hl_gen_test_ds_FORMAT hl_gen_test_ds)
+ endif ()
endif ()
if (HDF5_TEST_SERIAL)
diff --git a/hl/test/pal_rgb.h b/hl/test/pal_rgb.h
index 4b22bea..488ee42 100644
--- a/hl/test/pal_rgb.h
+++ b/hl/test/pal_rgb.h
@@ -11,261 +11,270 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-const unsigned char pal_rgb[256*3] = {255,255,255,
-0,0,131,
-0,0,135,
-0,0,139,
-0,0,143,
-0,0,147,
-0,0,151,
-0,0,155,
-0,0,159,
-0,0,163,
-0,0,167,
-0,0,171,
-0,0,175,
-0,0,179,
-0,0,183,
-0,0,187,
-0,0,191,
-0,0,195,
-0,0,199,
-0,0,203,
-0,0,207,
-0,0,211,
-0,0,215,
-0,0,219,
-0,0,223,
-0,0,227,
-0,0,231,
-0,0,235,
-0,0,239,
-0,0,243,
-0,0,247,
-0,0,251,
-0,0,255,
-0,0,255,
-0,3,255,
-0,7,255,
-0,11,255,
-0,15,255,
-0,19,255,
-0,23,255,
-0,27,255,
-0,31,255,
-0,35,255,
-0,39,255,
-0,43,255,
-0,47,255,
-0,51,255,
-0,55,255,
-0,59,255,
-0,63,255,
-0,67,255,
-0,71,255,
-0,75,255,
-0,79,255,
-0,83,255,
-0,87,255,
-0,91,255,
-0,95,255,
-0,99,255,
-0,103,255,
-0,107,255,
-0,111,255,
-0,115,255,
-0,119,255,
-0,123,255,
-0,127,255,
-0,131,255,
-0,135,255,
-0,139,255,
-0,143,255,
-0,147,255,
-0,151,255,
-0,155,255,
-0,159,255,
-0,163,255,
-0,167,255,
-0,171,255,
-0,175,255,
-0,179,255,
-0,183,255,
-0,187,255,
-0,191,255,
-0,195,255,
-0,199,255,
-0,203,255,
-0,207,255,
-0,211,255,
-0,215,255,
-0,219,255,
-0,223,255,
-0,227,255,
-0,231,255,
-0,235,255,
-0,239,255,
-0,243,255,
-0,247,255,
-0,251,255,
-0,255,255,
-0,255,255,
-3,255,251,
-7,255,247,
-11,255,243,
-15,255,239,
-19,255,235,
-23,255,231,
-27,255,227,
-31,255,223,
-35,255,219,
-39,255,215,
-43,255,211,
-47,255,207,
-51,255,203,
-55,255,199,
-59,255,195,
-63,255,191,
-67,255,187,
-71,255,183,
-75,255,179,
-79,255,175,
-83,255,171,
-87,255,167,
-91,255,163,
-95,255,159,
-99,255,155,
-103,255,151,
-107,255,147,
-111,255,143,
-115,255,139,
-119,255,135,
-123,255,131,
-127,255,127,
-131,255,123,
-135,255,119,
-139,255,115,
-143,255,111,
-147,255,107,
-151,255,103,
-155,255,99,
-159,255,95,
-163,255,91,
-167,255,87,
-171,255,83,
-175,255,79,
-179,255,75,
-183,255,71,
-187,255,67,
-191,255,63,
-195,255,59,
-199,255,55,
-203,255,51,
-207,255,47,
-211,255,43,
-215,255,39,
-219,255,35,
-223,255,31,
-227,255,27,
-231,255,23,
-235,255,19,
-239,255,15,
-243,255,11,
-247,255,7,
-251,255,3,
-255,255,0,
-255,251,0,
-255,247,0,
-255,243,0,
-255,239,0,
-255,235,0,
-255,231,0,
-255,227,0,
-255,223,0,
-255,219,0,
-255,215,0,
-255,211,0,
-255,207,0,
-255,203,0,
-255,199,0,
-255,195,0,
-255,191,0,
-255,187,0,
-255,183,0,
-255,179,0,
-255,175,0,
-255,171,0,
-255,167,0,
-255,163,0,
-255,159,0,
-255,155,0,
-255,151,0,
-255,147,0,
-255,143,0,
-255,139,0,
-255,135,0,
-255,131,0,
-255,127,0,
-255,123,0,
-255,119,0,
-255,115,0,
-255,111,0,
-255,107,0,
-255,103,0,
-255,99,0,
-255,95,0,
-255,91,0,
-255,87,0,
-255,83,0,
-255,79,0,
-255,75,0,
-255,71,0,
-255,67,0,
-255,63,0,
-255,59,0,
-255,55,0,
-255,51,0,
-255,47,0,
-255,43,0,
-255,39,0,
-255,35,0,
-255,31,0,
-255,27,0,
-255,23,0,
-255,19,0,
-255,15,0,
-255,11,0,
-255,7,0,
-255,3,0,
-255,0,0,
-250,0,0,
-246,0,0,
-241,0,0,
-237,0,0,
-233,0,0,
-228,0,0,
-224,0,0,
-219,0,0,
-215,0,0,
-211,0,0,
-206,0,0,
-202,0,0,
-197,0,0,
-193,0,0,
-189,0,0,
-184,0,0,
-180,0,0,
-175,0,0,
-171,0,0,
-167,0,0,
-162,0,0,
-158,0,0,
-153,0,0,
-149,0,0,
-145,0,0,
-140,0,0,
-136,0,0,
-131,0,0,
-127,0,0
+/* clang-format off */
+const unsigned char pal_rgb[256*3] = {
+ 255,255,255,
+ 0,0,131,
+ 0,0,135,
+ 0,0,139,
+ 0,0,143,
+ 0,0,147,
+ 0,0,151,
+ 0,0,155,
+ 0,0,159,
+ 0,0,163,
+ 0,0,167,
+ 0,0,171,
+ 0,0,175,
+ 0,0,179,
+ 0,0,183,
+ 0,0,187,
+ 0,0,191,
+ 0,0,195,
+ 0,0,199,
+ 0,0,203,
+ 0,0,207,
+ 0,0,211,
+ 0,0,215,
+ 0,0,219,
+ 0,0,223,
+ 0,0,227,
+ 0,0,231,
+ 0,0,235,
+ 0,0,239,
+ 0,0,243,
+ 0,0,247,
+ 0,0,251,
+ 0,0,255,
+ 0,0,255,
+ 0,3,255,
+ 0,7,255,
+ 0,11,255,
+ 0,15,255,
+ 0,19,255,
+ 0,23,255,
+ 0,27,255,
+ 0,31,255,
+ 0,35,255,
+ 0,39,255,
+ 0,43,255,
+ 0,47,255,
+ 0,51,255,
+ 0,55,255,
+ 0,59,255,
+ 0,63,255,
+ 0,67,255,
+ 0,71,255,
+ 0,75,255,
+ 0,79,255,
+ 0,83,255,
+ 0,87,255,
+ 0,91,255,
+ 0,95,255,
+ 0,99,255,
+ 0,103,255,
+ 0,107,255,
+ 0,111,255,
+ 0,115,255,
+ 0,119,255,
+ 0,123,255,
+ 0,127,255,
+ 0,131,255,
+ 0,135,255,
+ 0,139,255,
+ 0,143,255,
+ 0,147,255,
+ 0,151,255,
+ 0,155,255,
+ 0,159,255,
+ 0,163,255,
+ 0,167,255,
+ 0,171,255,
+ 0,175,255,
+ 0,179,255,
+ 0,183,255,
+ 0,187,255,
+ 0,191,255,
+ 0,195,255,
+ 0,199,255,
+ 0,203,255,
+ 0,207,255,
+ 0,211,255,
+ 0,215,255,
+ 0,219,255,
+ 0,223,255,
+ 0,227,255,
+ 0,231,255,
+ 0,235,255,
+ 0,239,255,
+ 0,243,255,
+ 0,247,255,
+ 0,251,255,
+ 0,255,255,
+ 0,255,255,
+ 3,255,251,
+ 7,255,247,
+ 11,255,243,
+ 15,255,239,
+ 19,255,235,
+ 23,255,231,
+ 27,255,227,
+ 31,255,223,
+ 35,255,219,
+ 39,255,215,
+ 43,255,211,
+ 47,255,207,
+ 51,255,203,
+ 55,255,199,
+ 59,255,195,
+ 63,255,191,
+ 67,255,187,
+ 71,255,183,
+ 75,255,179,
+ 79,255,175,
+ 83,255,171,
+ 87,255,167,
+ 91,255,163,
+ 95,255,159,
+ 99,255,155,
+ 103,255,151,
+ 107,255,147,
+ 111,255,143,
+ 115,255,139,
+ 119,255,135,
+ 123,255,131,
+ 127,255,127,
+ 131,255,123,
+ 135,255,119,
+ 139,255,115,
+ 143,255,111,
+ 147,255,107,
+ 151,255,103,
+ 155,255,99,
+ 159,255,95,
+ 163,255,91,
+ 167,255,87,
+ 171,255,83,
+ 175,255,79,
+ 179,255,75,
+ 183,255,71,
+ 187,255,67,
+ 191,255,63,
+ 195,255,59,
+ 199,255,55,
+ 203,255,51,
+ 207,255,47,
+ 211,255,43,
+ 215,255,39,
+ 219,255,35,
+ 223,255,31,
+ 227,255,27,
+ 231,255,23,
+ 235,255,19,
+ 239,255,15,
+ 243,255,11,
+ 247,255,7,
+ 251,255,3,
+ 255,255,0,
+ 255,251,0,
+ 255,247,0,
+ 255,243,0,
+ 255,239,0,
+ 255,235,0,
+ 255,231,0,
+ 255,227,0,
+ 255,223,0,
+ 255,219,0,
+ 255,215,0,
+ 255,211,0,
+ 255,207,0,
+ 255,203,0,
+ 255,199,0,
+ 255,195,0,
+ 255,191,0,
+ 255,187,0,
+ 255,183,0,
+ 255,179,0,
+ 255,175,0,
+ 255,171,0,
+ 255,167,0,
+ 255,163,0,
+ 255,159,0,
+ 255,155,0,
+ 255,151,0,
+ 255,147,0,
+ 255,143,0,
+ 255,139,0,
+ 255,135,0,
+ 255,131,0,
+ 255,127,0,
+ 255,123,0,
+ 255,119,0,
+ 255,115,0,
+ 255,111,0,
+ 255,107,0,
+ 255,103,0,
+ 255,99,0,
+ 255,95,0,
+ 255,91,0,
+ 255,87,0,
+ 255,83,0,
+ 255,79,0,
+ 255,75,0,
+ 255,71,0,
+ 255,67,0,
+ 255,63,0,
+ 255,59,0,
+ 255,55,0,
+ 255,51,0,
+ 255,47,0,
+ 255,43,0,
+ 255,39,0,
+ 255,35,0,
+ 255,31,0,
+ 255,27,0,
+ 255,23,0,
+ 255,19,0,
+ 255,15,0,
+ 255,11,0,
+ 255,7,0,
+ 255,3,0,
+ 255,0,0,
+ 250,0,0,
+ 246,0,0,
+ 241,0,0,
+ 237,0,0,
+ 233,0,0,
+ 228,0,0,
+ 224,0,0,
+ 219,0,0,
+ 215,0,0,
+ 211,0,0,
+ 206,0,0,
+ 202,0,0,
+ 197,0,0,
+ 193,0,0,
+ 189,0,0,
+ 184,0,0,
+ 180,0,0,
+ 175,0,0,
+ 171,0,0,
+ 167,0,0,
+ 162,0,0,
+ 158,0,0,
+ 153,0,0,
+ 149,0,0,
+ 145,0,0,
+ 140,0,0,
+ 136,0,0,
+ 131,0,0,
+ 127,0,0
};
+/* clang-format on */
+
+
+
+
+
+
diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt
index 0b895a3..e165b54 100644
--- a/hl/tools/gif2h5/CMakeLists.txt
+++ b/hl/tools/gif2h5/CMakeLists.txt
@@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS)
)
endif ()
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5)
+ else ()
+ clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5-shared)
+ endif ()
+endif ()
+
#-- Add h52gif program
set (hdf2gif_SOURCES
${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c
@@ -71,6 +82,17 @@ if (BUILD_SHARED_LIBS)
)
endif ()
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif)
+ else ()
+ clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif-shared)
+ endif ()
+endif ()
+
if (BUILD_TESTING AND HDF5_TEST_SERIAL)
# --------------------------------------------------------------------
# This executable can generate the actual test files - Currently not
@@ -84,6 +106,13 @@ if (BUILD_TESTING AND HDF5_TEST_SERIAL)
target_link_libraries (hl_h52gifgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl)
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_HL_TOOLS_hl_h52gifgentest_FORMAT hl_h52gifgentest)
+ endif ()
+
# add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_h52gifgentest>)
endif ()