diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-02-21 20:30:34 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-02-21 20:30:34 (GMT) |
commit | 51b8c63864c72de9a7b40c00673fe07510fec27e (patch) | |
tree | 298e9a2584860a24f55d2bce1fc60faed2bef2dd /tools/src/h5repack/h5repack.c | |
parent | c4f785bc93c5f4e8677b325c321e0f9ed41c3baa (diff) | |
parent | c5ab2285639a801f87a77987db1a0b609a020314 (diff) | |
download | hdf5-51b8c63864c72de9a7b40c00673fe07510fec27e.zip hdf5-51b8c63864c72de9a7b40c00673fe07510fec27e.tar.gz hdf5-51b8c63864c72de9a7b40c00673fe07510fec27e.tar.bz2 |
Merge develop
Diffstat (limited to 'tools/src/h5repack/h5repack.c')
-rw-r--r-- | tools/src/h5repack/h5repack.c | 187 |
1 files changed, 100 insertions, 87 deletions
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 0183cbf..8eeaa0e 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -222,18 +222,27 @@ h5repack_addlayout(const char *str, pack_opt_t *options) hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ - named_dt_t *dt_ret = NULL; /* Datatype to return */ - H5O_info_t oinfo; /* Object info of input dtype */ - hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ + named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ + named_dt_t *dt_ret = NULL; /* Datatype to return */ + H5O_info2_t oinfo; /* Object info of input dtype */ + int token_cmp; + hid_t ret_value = H5I_INVALID_HID; - if (H5Oget_info2(type_in, &oinfo, H5O_INFO_BASIC) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); + if (H5Oget_info3(type_in, &oinfo, H5O_INFO_BASIC) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Oget_info failed"); if (*named_dt_head_p) { + if (H5Otoken_cmp(type_in, &dt->obj_token, &oinfo.token, &token_cmp) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to compare object tokens"); + /* Stack already exists, search for the datatype */ - while (dt && dt->addr_in != oinfo.addr) + while (dt && token_cmp) { dt = dt->next; + + if (H5Otoken_cmp(type_in, &dt->obj_token, &oinfo.token, &token_cmp) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to compare object tokens"); + } + dt_ret = dt; } else { @@ -244,18 +253,19 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt->next = *named_dt_head_p; *named_dt_head_p = dt; /* Update the address and id */ - dt->addr_in = travt->objs[i].objno; - dt->id_out = -1; + HDmemcpy(&dt->obj_token, &travt->objs[i].obj_token, sizeof(H5O_token_t)); + dt->id_out = H5I_INVALID_HID; /* Check if this type is the one requested */ - if (oinfo.addr == dt->addr_in) { + if (H5Otoken_cmp(type_in, &oinfo.token, &dt->obj_token, &token_cmp) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to compare object tokens"); + if (!token_cmp) dt_ret = dt; - } } /* end if named datatype */ } /* end for each object in traversal table */ } /* end else (create the stack) */ @@ -266,13 +276,13 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t if (!dt_ret) { /* Push the new datatype onto the stack */ if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; /* Update the address and id */ - dt_ret->addr_in = oinfo.addr; - dt_ret->id_out = -1; + HDmemcpy(&dt_ret->obj_token, &oinfo.token, sizeof(H5O_token_t)); + dt_ret->id_out = H5I_INVALID_HID; } /* end if requested datatype not found */ /* If the requested datatype does not yet exist in the output file, copy it @@ -284,9 +294,9 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t else dt_ret->id_out = H5Tcopy(type_in); if (dt_ret->id_out < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed"); + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Tget_native_type-H5Tcopy failed"); if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed"); + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Tcommit_anon failed"); } /* end if named datatype not yet in output file */ /* Set return value */ @@ -296,7 +306,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t * to close it. (TODO: fix scope envy) */ if (H5Iinc_ref(ret_value) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iinc_ref failed"); + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Iinc_ref failed"); done: return ret_value; @@ -312,12 +322,12 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { named_dt_t *dt = *named_dt_head_p; - int ret_value = -1; + int ret_value = -1; while (dt) { /* Pop the datatype off the stack and free it */ if (H5Tclose(dt->id_out) < 0 && !ignore_err) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Tclose failed"); dt = dt->next; HDfree(*named_dt_head_p); *named_dt_head_p = dt; @@ -343,12 +353,11 @@ done: int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - int ret_value = 0; - hid_t attr_id = -1; /* attr ID */ - hid_t attr_out = -1; /* attr ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file type ID */ - hid_t wtype_id = -1; /* read/write type ID */ + hid_t attr_id = H5I_INVALID_HID; /* attr ID */ + hid_t attr_out = H5I_INVALID_HID; /* attr ID */ + hid_t space_id = H5I_INVALID_HID; /* space ID */ + hid_t ftype_id = H5I_INVALID_HID; /* file type ID */ + hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */ size_t msize; /* size of type */ void *buf = NULL; /* data buffer */ hsize_t nelmts; /* number of elements in dataset */ @@ -356,14 +365,15 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ htri_t is_named; /* Whether the datatype is named */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ char name[255]; - H5O_info_t oinfo; /* object info */ + H5O_info2_t oinfo; /* object info */ int j; unsigned u; hbool_t is_ref = 0; H5T_class_t type_class = -1; + int ret_value = 0; - if (H5Oget_info2(loc_in, &oinfo, H5O_INFO_NUM_ATTRS) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); + if (H5Oget_info3(loc_in, &oinfo, H5O_INFO_NUM_ATTRS) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Oget_info failed"); /*------------------------------------------------------------------------- * copy all attributes @@ -372,33 +382,33 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ for (u = 0; u < (unsigned) oinfo.num_attrs; u++) { /* open attribute */ if ((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t) u, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Aopen_by_idx failed"); if (H5Aget_name(attr_id, (size_t) 255, name) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); /* get the file datatype */ if ((ftype_id = H5Aget_type(attr_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Aget_type failed"); /* Check if the datatype is committed */ if ((is_named = H5Tcommitted(ftype_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommitted failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Tcommitted failed"); if (is_named && travt) { - hid_t fidout = -1; + hid_t fidout = H5I_INVALID_HID; /* Create out file id */ if ((fidout = H5Iget_file_id(loc_out)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iget_file_id failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Iget_file_id failed"); /* Copy named dt */ if ((wtype_id = copy_named_datatype(ftype_id, fidout, named_dt_head_p, travt, options)) < 0) { H5Fclose(fidout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_named_datatype failed"); + H5TOOLS_GOTO_ERROR((-1), "copy_named_datatype failed"); } if (H5Fclose(fidout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Fclose failed"); } /* end if datatype is committed and we have a traversal table */ else { if (options->use_native == 1) @@ -409,18 +419,18 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ /* get the dataspace handle */ if ((space_id = H5Aget_space(attr_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Aget_space failed"); /* get dimensions */ if ((rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_dims failed"); nelmts = 1; for (j = 0; j < rank; j++) nelmts *= dims[j]; if ((msize = H5Tget_size(wtype_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Tget_size failed"); /*--------------------------------------------------------------------- * object references are a special case. We cannot just copy the @@ -432,12 +442,12 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ type_class = H5Tget_class(wtype_id); is_ref = (type_class == H5T_REFERENCE); if (type_class == H5T_VLEN || type_class == H5T_ARRAY) { - hid_t base_type = -1; + hid_t base_type = H5I_INVALID_HID; base_type = H5Tget_super(ftype_id); is_ref = (is_ref || (H5Tget_class(base_type) == H5T_REFERENCE)); if (H5Tclose(base_type) < 0) - H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); + H5TOOLS_ERROR((-1), "H5Tclose base_type failed"); } /* end if type_class is variable length or array */ if (type_class == H5T_COMPOUND) { @@ -447,7 +457,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j); H5T_class_t mtclass = H5Tget_class(mtid); if (H5Tclose(mtid) < 0) - H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed"); + H5TOOLS_ERROR((-1), "H5Tclose mtid failed"); if (mtclass == H5T_REFERENCE) { is_ref = 1; @@ -464,10 +474,10 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ buf = (void *)HDmalloc((size_t)(nelmts * msize)); if (buf == NULL) { - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); } /* end if */ if (H5Aread(attr_id, wtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); /*----------------------------------------------------------------- * copy @@ -475,18 +485,18 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ */ if ((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed on ,%s>", name); + H5TOOLS_GOTO_ERROR((-1), "H5Acreate2 failed on ,%s>", name); if (H5Awrite(attr_out, wtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Awrite failed"); /*close*/ if (H5Aclose(attr_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Aclose failed"); /* Check if we have VL data and string in the attribute's datatype that must * be reclaimed */ if (TRUE == h5tools_detect_vlen(wtype_id)) - H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf); + H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); HDfree(buf); buf = NULL; } /*H5T_REFERENCE*/ @@ -499,17 +509,17 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ *--------------------------------------------------------------------- */ if (H5Sclose(space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - space_id = -1; + H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed"); + space_id = H5I_INVALID_HID; if (H5Tclose(wtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - wtype_id = -1; + H5TOOLS_GOTO_ERROR((-1), "H5Tclose failed"); + wtype_id = H5I_INVALID_HID; if (H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - ftype_id = -1; + H5TOOLS_GOTO_ERROR((-1), "H5Tclose failed"); + ftype_id = H5I_INVALID_HID; if (H5Aclose(attr_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); - attr_id = -1; + H5TOOLS_GOTO_ERROR((-1), "H5Aclose failed"); + attr_id = H5I_INVALID_HID; } /* for u (each attribute) */ done: @@ -519,7 +529,9 @@ done: * datatype that must be reclaimed */ if (TRUE == h5tools_detect_vlen(wtype_id)) - H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf); + H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); + + /* Free buf */ HDfree(buf); } @@ -544,10 +556,10 @@ done: static int check_options(pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned int i; int k, j, has_cp = 0, has_ck = 0; char slayout[30]; + int ret_value = 0; /*------------------------------------------------------------------------- * Objects to layout @@ -571,10 +583,11 @@ check_options(pack_opt_t *options) break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid layout"); + H5TOOLS_GOTO_ERROR((-1), "invalid layout"); + break; default: strcpy(slayout, "invalid layout\n"); - HGOTO_DONE(FAIL); + H5TOOLS_GOTO_DONE((-1)); } HDprintf(" Apply %s layout to all", slayout); if (H5D_CHUNKED == options->layout_g) { @@ -609,7 +622,7 @@ check_options(pack_opt_t *options) } /* end for each object in options */ if (options->all_layout == 1 && has_ck) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid chunking input: 'all' option is present with other objects"); + H5TOOLS_GOTO_ERROR((-1), "invalid chunking input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * Objects to filter @@ -667,7 +680,7 @@ check_options(pack_opt_t *options) } /* end for each object in options table */ if (options->all_filter == 1 && has_cp) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid compression input: 'all' option is present with other objects"); + H5TOOLS_GOTO_ERROR((-1), "invalid compression input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * Check options for the latest format @@ -675,14 +688,14 @@ check_options(pack_opt_t *options) */ if (options->grp_compact < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid maximum number of links to store as header messages"); + H5TOOLS_GOTO_ERROR((-1), "invalid maximum number of links to store as header messages"); if (options->grp_indexed < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid minimum number of links to store in the indexed format"); + H5TOOLS_GOTO_ERROR((-1), "invalid minimum number of links to store in the indexed format"); if (options->grp_indexed > options->grp_compact) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "minimum indexed size is greater than the maximum compact size"); + H5TOOLS_GOTO_ERROR((-1), "minimum indexed size is greater than the maximum compact size"); for (i = 0; i < 8; i++) if (options->msg_size[i] < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid shared message size"); + H5TOOLS_GOTO_ERROR((-1), "invalid shared message size"); /*------------------------------------------------------------------------ * Verify new user userblock options; file name must be present @@ -696,7 +709,7 @@ check_options(pack_opt_t *options) } if (options->ublock_filename == NULL && options->ublock_size != 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file name missing for user block", options->ublock_filename); + H5TOOLS_GOTO_ERROR((-1), "file name missing for user block", options->ublock_filename); /*------------------------------------------------------------------------ * Verify alignment options; threshold is zero default but alignment not @@ -704,7 +717,7 @@ check_options(pack_opt_t *options) */ if (options->alignment == 0 && options->threshold != 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "alignment for H5Pset_alignment missing"); + H5TOOLS_GOTO_ERROR((-1), "alignment for H5Pset_alignment missing"); done: return ret_value; @@ -722,24 +735,24 @@ done: static int check_objects(const char* fname, pack_opt_t *options) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; unsigned int i; - int ifil; + int ifil; trav_table_t *travt = NULL; - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /* nothing to do */ if (options->op_tbl->nelems == 0) - HGOTO_DONE(0); + H5TOOLS_GOTO_DONE(0); /*------------------------------------------------------------------------- * open the file *------------------------------------------------------------------------- */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR); + H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR); /*------------------------------------------------------------------------- * get the list of objects in the file @@ -749,11 +762,11 @@ check_objects(const char* fname, pack_opt_t *options) /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); /* init table */ - trav_table_init(&travt); + trav_table_init(fid, &travt); /* get the list of objects in the file */ if (h5trav_gettable(fid, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); + H5TOOLS_GOTO_ERROR((-1), "h5trav_gettable failed"); /*------------------------------------------------------------------------- * compare with user supplied list @@ -772,14 +785,14 @@ check_objects(const char* fname, pack_opt_t *options) /* the input object names are present in the file and are valid */ if (h5trav_getindext(name, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n", + H5TOOLS_GOTO_ERROR((-1), "%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose ? "\n" : ""), name, fname); if (options->verbose) HDprintf("...Found\n"); for (ifil = 0; ifil < obj.nfilters; ifil++) { if (obj.filter[ifil].filtn < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + H5TOOLS_GOTO_ERROR((-1), "invalid filter"); /* check for extra filter conditions */ switch (obj.filter[ifil].filtn) { /* chunk size must be smaller than pixels per block */ @@ -798,25 +811,25 @@ check_objects(const char* fname, pack_opt_t *options) } else { if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Dopen2 failed"); if ((sid = H5Dget_space(did)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed"); if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_ndims failed"); HDmemset(dims, 0, sizeof dims); if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_dims failed"); for (j = 0; j < rank; j++) csize *= dims[j]; if (H5Sclose(sid) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed"); if (H5Dclose(did) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed"); } if (csize < ppb) { HDprintf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); - HGOTO_DONE(0); + H5TOOLS_GOTO_DONE(0); } } /* end case SZIP */ break; |