summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-22 17:56:54 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-22 17:56:54 (GMT)
commitef4aa562dd3af4b104cc3551d12fd5583f09ca1a (patch)
treeade5507502a71f97b70674f2195016ad27d7a78c /tools/h5repack
parent775fdbe92711de5e6929d825045f4ad63d01d51d (diff)
downloadhdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.zip
hdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.tar.gz
hdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.tar.bz2
HDFFV-10392,10393,01385 merge from develop
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/CMakeLists.txt4
-rw-r--r--tools/h5repack/h5repack_filters.c12
-rw-r--r--tools/h5repack/h5repack_parse.c10
3 files changed, 12 insertions, 14 deletions
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 4b15d7c..fd1ad3e 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -21,7 +21,6 @@ set (REPACK_COMMON_SRCS
)
add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
-TARGET_NAMING (h5repack STATIC)
TARGET_C_PROPERTIES (h5repack STATIC " " " ")
target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5repack PROPERTIES FOLDER tools)
@@ -31,7 +30,6 @@ set (H5_DEP_EXECUTABLES h5repack)
if (BUILD_SHARED_LIBS)
add_executable (h5repack-shared ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
- TARGET_NAMING (h5repack-shared SHARED)
TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ")
target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5repack-shared PROPERTIES FOLDER tools)
@@ -45,13 +43,11 @@ if (BUILD_TESTING)
# Add h5Repack test executables
# --------------------------------------------------------------------
add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
- TARGET_NAMING (testh5repack_detect_szip STATIC)
TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ")
target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools)
add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c)
- TARGET_NAMING (h5repacktest STATIC)
TARGET_C_PROPERTIES (h5repacktest STATIC " " " ")
target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (h5repacktest PROPERTIES FOLDER tools)
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index 1371691..eb8d724 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -84,7 +84,8 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
pack_opt_t *options, /* repack options */
pack_info_t *obj /*OUT*/) /* info about object to filter */
{
- char *pdest;
+ char *pdest = NULL;
+ char *pname = NULL;
int result;
unsigned int i;
@@ -94,11 +95,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
return (int) i;
}
- pdest = HDstrstr(name, options->op_tbl->objs[i].path);
- result = (int) (pdest - name);
+ pdest = options->op_tbl->objs[i].path;
+ if (pdest[0] == '/') pdest++;
+ pname = name;
+ if (pname[0] == '/') pname++;
- /* found at position 1, meaning without '/' */
- if (pdest != NULL && result == 1) {
+ if (HDstrcmp(pdest, pname) == 0) {
*obj = options->op_tbl->objs[i];
return (int) i;
}
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c
index 05af197..f646ee7 100644
--- a/tools/h5repack/h5repack_parse.c
+++ b/tools/h5repack/h5repack_parse.c
@@ -45,9 +45,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
int f, k, l, p, q, end_obj = -1, no_param = 0;
unsigned j, n;
char sobj[MAX_NC_NAME];
- char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- char stype[6] = {0, 0, 0, 0, 0, 0};
- char smask[3] = {0, 0, 0};
+ char scomp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ char stype[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ char smask[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
obj_list_t* obj_list = NULL;
unsigned pixels_per_block;
@@ -116,7 +116,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
if (c == '=' || i == len - 1) {
if (c == '=') { /*one more parameter */
scomp[k] = '\0'; /*cut space */
-
/*-------------------------------------------------------------------------
* H5Z_FILTER_SZIP
* szip has the format SZIP=<pixels per block,coding>
@@ -236,8 +235,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
filt->cd_nelmts = HDstrtoull(stype, NULL, 0);
p = 0;
}
- else
+ else {
filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0);
+ }
q = 0;
u++; /* skip ',' */
}