diff options
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 110 | ||||
-rw-r--r-- | tools/lib/h5diff.h | 8 | ||||
-rw-r--r-- | tools/lib/h5diff_array.c | 182 | ||||
-rw-r--r-- | tools/lib/h5diff_attr.c | 36 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 20 | ||||
-rw-r--r-- | tools/lib/h5diff_util.c | 2 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 260 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 48 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.c | 504 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.h | 64 | ||||
-rw-r--r-- | tools/lib/h5tools_error.h | 4 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.c | 8 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 64 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.c | 84 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.h | 6 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 72 | ||||
-rw-r--r-- | tools/lib/h5trav.h | 18 |
17 files changed, 745 insertions, 745 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 502b2ec..924f9f3 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -183,7 +183,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) while (NULL != exclude_path_ptr) { /* if exclude path is in group, exclude its members as well */ if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { - ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, HDstrlen(exclude_path_ptr->obj_path)); + ret_cmp = strncmp(exclude_path_ptr->obj_path, path, strlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) { /* found matching members */ size_t len_grp; @@ -192,7 +192,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) * This verifies if “/grp1/dset1” is only under “/grp1”, but * not under “/grp1xxx/” group. */ - len_grp = HDstrlen(exclude_path_ptr->obj_path); + len_grp = strlen(exclude_path_ptr->obj_path); if (path[len_grp] == '/') { /* belong to excluded group! */ ret_value = 1; @@ -202,7 +202,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) } /* exclude target is not group, just exclude the object */ else { - ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); + ret_cmp = strcmp(exclude_path_ptr->obj_path, path); if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; @@ -247,7 +247,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) while (NULL != exclude_ptr) { /* if exclude path is in group, exclude its members as well */ if (exclude_ptr->obj_type == H5TRAV_TYPE_GROUP) { - ret_cmp = HDstrncmp(exclude_ptr->obj_path, path, HDstrlen(exclude_ptr->obj_path)); + ret_cmp = strncmp(exclude_ptr->obj_path, path, strlen(exclude_ptr->obj_path)); if (ret_cmp == 0) { /* found matching members */ size_t len_grp; @@ -256,7 +256,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) * This verifies if “/grp1/dset1” is only under “/grp1”, but * not under “/grp1xxx/” group. */ - len_grp = HDstrlen(exclude_ptr->obj_path); + len_grp = strlen(exclude_ptr->obj_path); if (path[len_grp] == '/') { /* belong to excluded group! */ ret_value = 1; @@ -266,7 +266,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) } /* exclude target is not group, just exclude the object */ else { - ret_cmp = HDstrcmp(exclude_ptr->obj_path, path); + ret_cmp = strcmp(exclude_ptr->obj_path, path); if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; @@ -368,11 +368,11 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2, H5TOOLS_DEBUG("objname1 = %s objname2 = %s ", objname1, objname2); /* if obj1 is not root */ - if (HDstrcmp(objname1, "/") != 0) - path1_offset = HDstrlen(objname1); + if (strcmp(objname1, "/") != 0) + path1_offset = strlen(objname1); /* if obj2 is not root */ - if (HDstrcmp(objname2, "/") != 0) - path2_offset = HDstrlen(objname2); + if (strcmp(objname2, "/") != 0) + path2_offset = strlen(objname2); /*-------------------------------------------------- * build the list @@ -384,7 +384,7 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2, type2_l = info2->paths[curr2].type; /* criteria is string compare */ - cmp = HDstrcmp(path1_lp, path2_lp); + cmp = strcmp(path1_lp, path2_lp); if (cmp == 0) { if (!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; @@ -508,7 +508,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) } else if (ret_value == 0) { /* no dangling link option given and detect dangling link */ - tinfo->symlink_visited.dangle_link = TRUE; + tinfo->symlink_visited.dangle_link = true; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = H5DIFF_ERR; /* make dangling link is error */ @@ -523,7 +523,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) if (symlink_visit_add(&(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) H5TOOLS_GOTO_DONE(SUCCEED); - if (h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, tinfo, + if (h5trav_visit(tinfo->fid, path, true, true, trav_grp_objs, trav_grp_symlinks, tinfo, H5O_INFO_BASIC) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = H5DIFF_ERR; @@ -537,7 +537,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) } else if (ret_value == 0) { /* no dangling link option given and detect dangling link */ - tinfo->symlink_visited.dangle_link = TRUE; + tinfo->symlink_visited.dangle_link = true; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = H5DIFF_ERR; /* make dangling link is error */ @@ -555,7 +555,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) if (symlink_visit_add(&(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) H5TOOLS_GOTO_DONE(SUCCEED); - if (h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, tinfo, + if (h5trav_visit(tinfo->fid, path, true, true, trav_grp_objs, trav_grp_symlinks, tinfo, H5O_INFO_BASIC) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = H5DIFF_ERR; @@ -703,47 +703,47 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* if any object is specified */ if (objname1) { /* make the given object1 fullpath, start with "/" */ - if (HDstrncmp(objname1, "/", 1) != 0) { + if (strncmp(objname1, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (asprintf(&obj1fullname, "/%s", objname1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj1fullname = (char *)malloc(HDstrlen(objname1) + 2)) == NULL) + if ((obj1fullname = (char *)malloc(strlen(objname1) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); - HDstrcpy(obj1fullname, "/"); - HDstrcat(obj1fullname, objname1); + strcpy(obj1fullname, "/"); + strcat(obj1fullname, objname1); #endif /* H5_HAVE_ASPRINTF */ } else - obj1fullname = HDstrdup(objname1); + obj1fullname = strdup(objname1); H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1) != 0) { + if (strncmp(objname2, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (asprintf(&obj2fullname, "/%s", objname2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj2fullname = (char *)malloc(HDstrlen(objname2) + 2)) == NULL) + if ((obj2fullname = (char *)malloc(strlen(objname2) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); - HDstrcpy(obj2fullname, "/"); - HDstrcat(obj2fullname, objname2); + strcpy(obj2fullname, "/"); + strcat(obj2fullname, objname2); #endif /* H5_HAVE_ASPRINTF */ } else - obj2fullname = HDstrdup(objname2); + obj2fullname = strdup(objname2); H5TOOLS_DEBUG("obj2fullname = %s", obj2fullname); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ H5TOOLS_DEBUG("h5diff check if obj1=%s is root, group, single object or symlink", obj1fullname); - if (!HDstrcmp(obj1fullname, "/")) { + if (!strcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } else { @@ -793,7 +793,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char * check if obj2 is root, group, single object or symlink */ H5TOOLS_DEBUG("h5diff check if obj2=%s is root, group, single object or symlink", obj2fullname); - if (!HDstrcmp(obj2fullname, "/")) { + if (!strcmp(obj2fullname, "/")) { obj2type = H5TRAV_TYPE_GROUP; } else { @@ -843,9 +843,9 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char else { H5TOOLS_DEBUG("h5diff no object specified"); /* set root group */ - obj1fullname = (char *)HDstrdup("/"); + obj1fullname = (char *)strdup("/"); obj1type = H5TRAV_TYPE_GROUP; - obj2fullname = (char *)HDstrdup("/"); + obj2fullname = (char *)strdup("/"); obj2type = H5TRAV_TYPE_GROUP; } @@ -961,7 +961,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); if (both_objs_grp) { - H5TOOLS_DEBUG("h5diff both_objs_grp TRUE"); + H5TOOLS_DEBUG("h5diff both_objs_grp true"); /* * traverse group1 */ @@ -969,7 +969,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* optional data pass */ info1_grp->opts = (diff_opt_t *)opts; - if (h5trav_visit(file1_id, obj1fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info1_grp, + if (h5trav_visit(file1_id, obj1fullname, true, true, trav_grp_objs, trav_grp_symlinks, info1_grp, H5O_INFO_BASIC) < 0) { parallel_print("Error: Could not get file contents\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not get file contents"); @@ -983,7 +983,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* optional data pass */ info2_grp->opts = (diff_opt_t *)opts; - if (h5trav_visit(file2_id, obj2fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info2_grp, + if (h5trav_visit(file2_id, obj2fullname, true, true, trav_grp_objs, trav_grp_symlinks, info2_grp, H5O_INFO_BASIC) < 0) { parallel_print("Error: Could not get file contents\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not get file contents"); @@ -996,13 +996,13 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char if (g_Parallel) { int i; - if ((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { + if ((strlen(fname1) > MAX_FILENAME) || (strlen(fname2) > MAX_FILENAME)) { fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ - HDstrcpy(filenames[0], fname1); - HDstrcpy(filenames[1], fname2); + strcpy(filenames[0], fname1); + strcpy(filenames[1], fname2); /* Alert the worker tasks that there's going to be work. */ for (i = 1; i < g_nTasks; i++) @@ -1028,7 +1028,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char parallel_print("\n"); /* if given objects is group under root */ - if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0) + if (strcmp(obj1fullname, "/") != 0 || strcmp(obj2fullname, "/") != 0) parallel_print("group1 group2\n"); else parallel_print("file1 file2\n"); @@ -1126,9 +1126,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, * if not root, prepare object name to be pre-appended to group path to * make full path */ - if (HDstrcmp(grp1, "/") != 0) + if (strcmp(grp1, "/") != 0) grp1_path = grp1; - if (HDstrcmp(grp2, "/") != 0) + if (strcmp(grp2, "/") != 0) grp2_path = grp2; /*------------------------------------------------------------------------- @@ -1186,13 +1186,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj1_fullpath = (char *)malloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj1_fullpath = (char *)malloc(strlen(grp1_path) + strlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } else { - HDstrcpy(obj1_fullpath, grp1_path); - HDstrcat(obj1_fullpath, table->objs[i].name); + strcpy(obj1_fullpath, grp1_path); + strcat(obj1_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ H5TOOLS_DEBUG("diff_match path1 - %s", obj1_fullpath); @@ -1204,22 +1204,22 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj2_fullpath = (char *)malloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj2_fullpath = (char *)malloc(strlen(grp2_path) + strlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } else { - HDstrcpy(obj2_fullpath, grp2_path); - HDstrcat(obj2_fullpath, table->objs[i].name); + strcpy(obj2_fullpath, grp2_path); + strcat(obj2_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ H5TOOLS_DEBUG("diff_match path2 - %s", obj2_fullpath); /* get index to figure out type of the object in file1 */ - while (info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) + while (info1->paths[idx1].path && (strcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ - while (info2->paths[idx2].path && (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) + while (info2->paths[idx2].path && (strcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) idx2++; /* Set argdata to pass other args into diff() */ @@ -1246,14 +1246,14 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, */ /*Set up args to pass to worker task. */ - if (HDstrlen(obj1_fullpath) > 255 || HDstrlen(obj2_fullpath) > 255) { + if (strlen(obj1_fullpath) > 255 || strlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ /* set args struct to pass */ - HDstrcpy(args.name1, obj1_fullpath); - HDstrcpy(args.name2, obj2_fullpath); + strcpy(args.name1, obj1_fullpath); + strcpy(args.name2, obj2_fullpath); args.opts = *opts; args.argdata.type[0] = info1->paths[idx1].type; args.argdata.type[1] = info2->paths[idx2].type; @@ -1534,9 +1534,9 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ hid_t type2_id = H5I_INVALID_HID; hid_t grp1_id = H5I_INVALID_HID; hid_t grp2_id = H5I_INVALID_HID; - hbool_t is_dangle_link1 = FALSE; - hbool_t is_dangle_link2 = FALSE; - hbool_t is_hard_link = FALSE; + bool is_dangle_link1 = false; + bool is_dangle_link2 = false; + bool is_hard_link = false; hsize_t nfound = 0; h5trav_type_t object_type; diff_err_t ret_value = opts->err_stat; @@ -1577,7 +1577,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } else - is_dangle_link1 = TRUE; + is_dangle_link1 = true; } /* target object2 - get type and name */ @@ -1592,7 +1592,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } else - is_dangle_link2 = TRUE; + is_dangle_link2 = true; } /* found dangling link */ @@ -1810,7 +1810,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ */ case H5TRAV_TYPE_LINK: { H5TOOLS_DEBUG("H5TRAV_TYPE_LINK 1:%s 2:%s ", path1, path2); - status = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); + status = strcmp(linkinfo1.trg_path, linkinfo2.trg_path); /* if the target link name is not same then the links are "different" */ nfound = (status != 0) ? 1 : 0; diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index d16c855..12bf56a 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -27,7 +27,7 @@ *------------------------------------------------------------------------*/ typedef struct { h5trav_type_t type[2]; - hbool_t is_same_trgobj; + bool is_same_trgobj; } diff_args_t; /*------------------------------------------------------------------------- * command line options @@ -61,7 +61,7 @@ typedef struct { int use_system_epsilon; /* flag to use system epsilon (1 or 0) */ int percent_bool; /* relative error to compare*/ double percent; /* relative error value */ - hbool_t follow_links; /* follow symbolic links */ + bool follow_links; /* follow symbolic links */ int no_dangle_links; /* return error when find dangling link */ int cmn_objs; /* do we have common objects */ int not_cmp; /* are the objects comparable */ @@ -90,8 +90,8 @@ typedef struct { struct subset_t *sset[2]; /* subsetting parameters */ h5tools_vol_info_t vol_info[2]; /* VOL information for input file, output file */ h5tools_vfd_info_t vfd_info[2]; /* VFD information for input file, output file */ - hbool_t custom_vol[2]; /* Using a custom input, output VOL? */ - hbool_t custom_vfd[2]; /* Using a custom input, output VFD? */ + bool custom_vol[2]; /* Using a custom input, output VOL? */ + bool custom_vfd[2]; /* Using a custom input, output VFD? */ } diff_opt_t; /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index abb81b9..d8c9ac6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -80,32 +80,32 @@ *------------------------------------------------------------------------- */ -static hbool_t not_comparable; +static bool not_comparable; #define PER(A, B) \ do { \ per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ + not_comparable = false; \ + both_zero = false; \ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \ - both_zero = TRUE; \ + both_zero = true; \ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \ per = (double)ABS((double)((B) - (A)) / (double)(A)); \ else \ - not_comparable = TRUE; \ + not_comparable = true; \ } while (0) #define PER_UNSIGN(TYPE, A, B) \ do { \ per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ + not_comparable = false; \ + both_zero = false; \ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \ - both_zero = TRUE; \ + both_zero = true; \ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \ per = ABS((double)((TYPE)((B) - (A))) / (double)(A)); \ else \ - not_comparable = TRUE; \ + not_comparable = true; \ } while (0) #define PDIFF(a, b) (((b) > (a)) ? ((b) - (a)) : ((a) - (b))) @@ -121,14 +121,14 @@ typedef struct mcomp_t { * local prototypes *------------------------------------------------------------------------- */ -static hbool_t all_zero(const void *_mem, size_t size); +static bool all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts); static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts); -static hbool_t equal_float(float value, float expected, diff_opt_t *opts); -static hbool_t equal_double(double value, double expected, diff_opt_t *opts); -static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts); +static bool equal_float(float value, float expected, diff_opt_t *opts); +static bool equal_double(double value, double expected, diff_opt_t *opts); +static bool equal_ldouble(long double value, long double expected, diff_opt_t *opts); static int print_data(diff_opt_t *opts); static void print_pos(diff_opt_t *opts, hsize_t elemtno, size_t u); @@ -444,8 +444,8 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co unsigned nmembs; unsigned j; size_t size = 0; - hbool_t iszero1; - hbool_t iszero2; + bool iszero1; + bool iszero2; hsize_t nfound = 0; /* differences found */ diff_err_t ret_value = opts->err_stat; @@ -519,14 +519,14 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to first string */ s1 = *(char **)((void *)mem1); if (s1) - size1 = HDstrlen(s1); + size1 = strlen(s1); else size1 = 0; /* Get pointer to second string */ s2 = *(char **)((void *)mem2); if (s2) - size2 = HDstrlen(s2); + size2 = strlen(s2); else size2 = 0; } @@ -535,7 +535,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to first string */ s1 = (char *)mem1; if (s1) - size1 = HDstrlen(s1); + size1 = strlen(s1); else size1 = 0; @@ -545,7 +545,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to second string */ s2 = (char *)mem2; if (s2) - size2 = HDstrlen(s2); + size2 = strlen(s2); else size2 = 0; @@ -648,11 +648,11 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co */ err1 = H5Tenum_nameof(opts->m_tid, mem1, enum_name1, sizeof enum_name1); if (err1 < 0) - HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); + snprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); err2 = H5Tenum_nameof(opts->m_tid, mem2, enum_name2, sizeof enum_name2); if (err2 < 0) - HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); + snprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); /* One or more bad enum values */ if (err1 < 0 || err2 < 0) { @@ -669,7 +669,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co } else { /* Both enum values were valid */ - if (HDstrcmp(enum_name1, enum_name2) != 0) { + if (strcmp(enum_name1, enum_name2) != 0) { nfound = 1; opts->print_percentage = 0; print_pos(opts, elemtno, 0); @@ -1270,20 +1270,20 @@ done: * * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: true if all bytes are zero; false otherwise *------------------------------------------------------------------------- */ -static hbool_t +static bool all_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *)_mem; while (size-- > 0) if (mem[size]) - return FALSE; + return false; - return TRUE; + return true; } /*------------------------------------------------------------------------- @@ -1592,7 +1592,7 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hbool_t both_zero = FALSE; + bool both_zero = false; double per; /* both_zero is set in the PER_UNSIGN macro but not used in this function */ @@ -1667,9 +1667,9 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d float temp1_float; float temp2_float; double per; - hbool_t both_zero = FALSE; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + bool both_zero = false; + bool isnan1 = false; + bool isnan2 = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -1688,8 +1688,8 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); + isnan1 = isnan(temp1_float); + isnan2 = isnan(temp2_float); } /* both not NaN, do the comparison */ @@ -1725,8 +1725,8 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); + isnan1 = isnan(temp1_float); + isnan2 = isnan(temp2_float); } /* both not NaN, do the comparison */ if ((!isnan1 && !isnan2)) { @@ -1773,8 +1773,8 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); + isnan1 = isnan(temp1_float); + isnan2 = isnan(temp2_float); } /* both not NaN, do the comparison */ @@ -1817,7 +1817,7 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d *------------------------------------------------------------------------- */ else { - if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + if (equal_float(temp1_float, temp2_float, opts) == false) { opts->print_percentage = 0; print_pos(opts, elem_idx, 0); if (print_data(opts)) { @@ -1847,9 +1847,9 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, double temp1_double; double temp2_double; double per; - hbool_t both_zero = FALSE; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + bool both_zero = false; + bool isnan1 = false; + bool isnan2 = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -1866,8 +1866,8 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ @@ -1902,8 +1902,8 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { @@ -1948,8 +1948,8 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ @@ -1990,7 +1990,7 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ else { - if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + if (equal_double(temp1_double, temp2_double, opts) == false) { opts->print_percentage = 0; print_pos(opts, elem_idx, 0); if (print_data(opts)) { @@ -2020,9 +2020,9 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, long double temp1_double; long double temp2_double; double per; - hbool_t both_zero = FALSE; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + bool both_zero = false; + bool isnan1 = false; + bool isnan2 = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2041,8 +2041,8 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2076,8 +2076,8 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2123,8 +2123,8 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, *------------------------------------------------------------------------- */ if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); + isnan1 = isnan(temp1_double); + isnan2 = isnan(temp2_double); } /* both not NaN, do the comparison */ @@ -2164,7 +2164,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + else if (equal_ldouble(temp1_double, temp2_double, opts) == false) { opts->print_percentage = 0; print_pos(opts, elem_idx, 0); if (print_data(opts)) { @@ -2193,7 +2193,7 @@ diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d char temp1_char; char temp2_char; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); memcpy(&temp1_char, mem1, sizeof(char)); @@ -2281,7 +2281,7 @@ diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d unsigned char temp1_uchar; unsigned char temp2_uchar; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2369,7 +2369,7 @@ diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d short temp1_short; short temp2_short; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2457,7 +2457,7 @@ diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, unsigned short temp1_ushort; unsigned short temp2_ushort; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2549,7 +2549,7 @@ diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, dif int temp1_int; int temp2_int; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2637,7 +2637,7 @@ diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di unsigned int temp1_uint; unsigned int temp2_uint; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2725,7 +2725,7 @@ diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di long temp1_long; long temp2_long; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2813,7 +2813,7 @@ diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d unsigned long temp1_ulong; unsigned long temp2_ulong; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2903,7 +2903,7 @@ diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d long long temp1_llong; long long temp2_llong; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -2997,7 +2997,7 @@ diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, unsigned long long temp2_ullong; float f1, f2; double per; - hbool_t both_zero = FALSE; + bool both_zero = false; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); @@ -3132,7 +3132,7 @@ done: * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t +static bool equal_double(double value, double expected, diff_opt_t *opts) { if (opts->do_nans) { @@ -3140,36 +3140,36 @@ equal_double(double value, double expected, diff_opt_t *opts) * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = HDisnan(value); - hbool_t isnan2 = HDisnan(expected); + bool isnan1 = isnan(value); + bool isnan2 = isnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ if (isnan1 && isnan2) - return TRUE; + return true; /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - return FALSE; + return false; } if (opts->use_system_epsilon) { /* Check equality within some epsilon */ if (H5_DBL_ABS_EQUAL(value, expected)) - return TRUE; + return true; } else { /* Check bits */ if (!memcmp(&value, &expected, sizeof(double))) - return TRUE; + return true; } - return FALSE; + return false; } /*------------------------------------------------------------------------- @@ -3179,7 +3179,7 @@ equal_double(double value, double expected, diff_opt_t *opts) *------------------------------------------------------------------------- */ -static hbool_t +static bool equal_ldouble(long double value, long double expected, diff_opt_t *opts) { if (opts->do_nans) { @@ -3187,36 +3187,36 @@ equal_ldouble(long double value, long double expected, diff_opt_t *opts) * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = HDisnan(value); - hbool_t isnan2 = HDisnan(expected); + bool isnan1 = isnan(value); + bool isnan2 = isnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ if (isnan1 && isnan2) - return TRUE; + return true; /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - return FALSE; + return false; } if (opts->use_system_epsilon) { /* Check equality within some epsilon */ if (H5_LDBL_ABS_EQUAL(value, expected)) - return TRUE; + return true; } else { /* Check bits */ if (!memcmp(&value, &expected, sizeof(long double))) - return TRUE; + return true; } - return FALSE; + return false; } /*------------------------------------------------------------------------- @@ -3225,7 +3225,7 @@ equal_ldouble(long double value, long double expected, diff_opt_t *opts) * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t +static bool equal_float(float value, float expected, diff_opt_t *opts) { if (opts->do_nans) { @@ -3233,36 +3233,36 @@ equal_float(float value, float expected, diff_opt_t *opts) * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = HDisnan(value); - hbool_t isnan2 = HDisnan(expected); + bool isnan1 = isnan(value); + bool isnan2 = isnan(expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ if (isnan1 && isnan2) - return TRUE; + return true; /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - return FALSE; + return false; } if (opts->use_system_epsilon) { /* Check equality within some epsilon */ if (H5_FLT_ABS_EQUAL(value, expected)) - return TRUE; + return true; } else { /* Check bits */ if (!memcmp(&value, &expected, sizeof(float))) - return TRUE; + return true; } - return FALSE; + return false; } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 0c377af..2521177 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -112,7 +112,7 @@ table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table) table->attrs[curr_val].exist[0] = exist[0]; table->attrs[curr_val].exist[1] = exist[1]; if (name) - table->attrs[curr_val].name = (char *)HDstrdup(name); + table->attrs[curr_val].name = (char *)strdup(name); table->nattrs++; } } @@ -186,7 +186,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name second attribute failed"); /* criteria is string compare */ - cmp = HDstrcmp(name1, name2); + cmp = strcmp(name1, name2); if (cmp == 0) { infile[0] = 1; @@ -326,8 +326,8 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na size_t msize2; /* memory size of memory type */ void *buf1 = NULL; /* data buffer */ void *buf2 = NULL; /* data buffer */ - hbool_t buf1hasdata = FALSE; /* buffer has data */ - hbool_t buf2hasdata = FALSE; /* buffer has data */ + bool buf1hasdata = false; /* buffer has data */ + bool buf2hasdata = false; /* buffer has data */ int rank1; /* rank of dataset */ int rank2; /* rank of dataset */ hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ @@ -384,19 +384,19 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); if (name1) { - sz = HDstrlen(name1); + sz = strlen(name1); H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); if (sz > 0) { opts->obj_name[0] = (char *)malloc(sz + 1); - HDstrncpy(opts->obj_name[0], name1, sz + 1); + strncpy(opts->obj_name[0], name1, sz + 1); } } if (name2) { - sz = HDstrlen(name2); + sz = strlen(name2); H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); if (sz > 0) { opts->obj_name[1] = (char *)malloc(sz + 1); - HDstrncpy(opts->obj_name[1], name2, sz + 1); + strncpy(opts->obj_name[1], name2, sz + 1); } } H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); @@ -443,7 +443,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type first attribute failed"); } else - buf1hasdata = TRUE; + buf1hasdata = true; H5TOOLS_DEBUG("attr H5Aread 1"); if (H5Aread(attr2_id, mtype2_id, buf2) < 0) { @@ -451,7 +451,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type second attribute failed"); } else - buf2hasdata = TRUE; + buf2hasdata = true; H5TOOLS_DEBUG("attr H5Aread 2"); /* format output string */ @@ -464,17 +464,17 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { - sz = HDstrlen(name1) + HDstrlen(path1) + 7; + sz = strlen(name1) + strlen(path1) + 7; H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); opts->obj_name[0] = (char *)calloc(sz + 1, sizeof(char)); - HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); + snprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); opts->obj_name[0][sz] = '\0'; } if (name2) { - sz = HDstrlen(name2) + HDstrlen(path2) + 7; + sz = strlen(name2) + strlen(path2) + 7; H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); opts->obj_name[1] = (char *)calloc(sz + 1, sizeof(char)); - HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); + snprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); opts->obj_name[1][sz] = '\0'; } @@ -530,12 +530,12 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na /* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any * VLEN memory first */ - if (TRUE == h5tools_detect_vlen(mtype1_id)) + if (true == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); free(buf1); buf1 = NULL; - if (TRUE == h5tools_detect_vlen(mtype2_id)) + if (true == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); free(buf2); buf2 = NULL; @@ -559,12 +559,12 @@ done: H5E_BEGIN_TRY { if (buf1) { - if (buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) + if (buf1hasdata && true == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); free(buf1); } /* end if */ if (buf2) { - if (buf2hasdata && TRUE == h5tools_detect_vlen(mtype2_id)) + if (buf2hasdata && true == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); free(buf2); } /* end if */ diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 78f52bc..3d4b25a 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -274,21 +274,21 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); opts->obj_name[0] = NULL; if (obj1_name) { - j = (int)HDstrlen(obj1_name); + j = (int)strlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { opts->obj_name[0] = (char *)malloc((size_t)j + 1); - HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); + strncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } opts->obj_name[1] = NULL; if (obj2_name) { - j = (int)HDstrlen(obj2_name); + j = (int)strlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { opts->obj_name[1] = (char *)malloc((size_t)j + 1); - HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); + strncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -351,10 +351,10 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n /* Check if type is either VLEN-data or VLEN-string to reclaim any * VLEN memory buffer later */ - if (TRUE == h5tools_detect_vlen(m_tid1)) - vl_data1 = TRUE; - if (TRUE == h5tools_detect_vlen(m_tid2)) - vl_data2 = TRUE; + if (true == h5tools_detect_vlen(m_tid1)) + vl_data1 = true; + if (true == h5tools_detect_vlen(m_tid2)) + vl_data2 = true; H5TOOLS_DEBUG("h5tools_detect_vlen %d:%d - errstat:%d", vl_data1, vl_data2, opts->err_stat); /*------------------------------------------------------------------------ @@ -431,9 +431,9 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n opts->obj_name[1] = NULL; if (obj1_name) - opts->obj_name[0] = HDstrdup(diff_basename(obj1_name)); + opts->obj_name[0] = strdup(diff_basename(obj1_name)); if (obj2_name) - opts->obj_name[1] = HDstrdup(diff_basename(obj2_name)); + opts->obj_name[1] = strdup(diff_basename(obj2_name)); H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); H5TOOLS_DEBUG("read/compare"); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index fc74a39..4641c93 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -190,7 +190,7 @@ diff_basename(const char *name) return NULL; /* Find the end of the base name */ - i = HDstrlen(name); + i = strlen(name); while (i > 0 && '/' == name[i - 1]) --i; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 0e063c7..36e304d 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -246,7 +246,7 @@ h5tools_set_data_output_file(const char *fname, int is_bin) if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) - HDperror("closing rawdatastream"); + perror("closing rawdatastream"); else rawdatastream = NULL; } @@ -294,7 +294,7 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (rawattrstream && rawattrstream != stdout) { if (fclose(rawattrstream)) - HDperror("closing rawattrstream"); + perror("closing rawattrstream"); else rawattrstream = NULL; } @@ -343,7 +343,7 @@ h5tools_set_input_file(const char *fname, int is_bin) if (rawinstream && rawinstream != stdin) { if (fclose(rawinstream)) - HDperror("closing rawinstream"); + perror("closing rawinstream"); else rawinstream = NULL; } @@ -391,7 +391,7 @@ h5tools_set_output_file(const char *fname, int is_bin) if (rawoutstream && rawoutstream != stdout) { if (fclose(rawoutstream)) - HDperror("closing rawoutstream"); + perror("closing rawoutstream"); else rawoutstream = NULL; } @@ -438,7 +438,7 @@ h5tools_set_error_file(const char *fname, int is_bin) if (rawerrorstream && rawerrorstream != stderr) { if (fclose(rawerrorstream)) - HDperror("closing rawerrorstream"); + perror("closing rawerrorstream"); else rawerrorstream = NULL; } @@ -485,12 +485,12 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) switch (vfd_info->type) { case VFD_BY_NAME: /* Determine which driver the user wants to open the file with */ - if (!HDstrcmp(vfd_info->u.name, drivernames[SEC2_VFD_IDX])) { + if (!strcmp(vfd_info->u.name, drivernames[SEC2_VFD_IDX])) { /* SEC2 Driver */ if (H5Pset_fapl_sec2(fapl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[DIRECT_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[DIRECT_VFD_IDX])) { #ifdef H5_HAVE_DIRECT /* Direct Driver */ if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0) @@ -499,14 +499,14 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[LOG_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[LOG_VFD_IDX])) { unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; /* Log Driver */ if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t)0) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[WINDOWS_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[WINDOWS_VFD_IDX])) { #ifdef H5_HAVE_WINDOWS /* There is no Windows VFD - use SEC2 */ if (H5Pset_fapl_sec2(fapl_id) < 0) @@ -515,17 +515,17 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[STDIO_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[STDIO_VFD_IDX])) { /* Stdio Driver */ if (H5Pset_fapl_stdio(fapl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[CORE_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[CORE_VFD_IDX])) { /* Core Driver */ - if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, TRUE) < 0) + if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, true) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[FAMILY_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[FAMILY_VFD_IDX])) { /* FAMILY Driver */ /* Set member size to be 0 to indicate the current first member size * is the member size. @@ -533,17 +533,17 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) if (H5Pset_fapl_family(fapl_id, (hsize_t)0, H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[SPLIT_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[SPLIT_VFD_IDX])) { /* SPLIT Driver */ if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[MULTI_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[MULTI_VFD_IDX])) { /* MULTI Driver */ - if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0) + if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, true) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[MPIO_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[MPIO_VFD_IDX])) { #ifdef H5_HAVE_PARALLEL int mpi_initialized, mpi_finalized; @@ -561,7 +561,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled"); #endif /* H5_HAVE_PARALLEL */ } - else if (!HDstrcmp(vfd_info->u.name, drivernames[ROS3_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); @@ -575,7 +575,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[HDFS_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid"); @@ -585,7 +585,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) { #if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_SUBFILING_VFD) int mpi_initialized, mpi_finalized; @@ -601,7 +601,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "The Subfiling VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) { /* Onion driver */ if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "Onion VFD info is invalid"); @@ -676,10 +676,10 @@ h5tools_set_fapl_vol(hid_t fapl_id, h5tools_vol_info_t *vol_info) /* Check for VOL connectors that ship with the library, then try * registering by name if that fails. */ - if (!HDstrcmp(vol_info->u.name, H5VL_NATIVE_NAME)) { + if (!strcmp(vol_info->u.name, H5VL_NATIVE_NAME)) { connector_id = H5VL_NATIVE; } - else if (!HDstrcmp(vol_info->u.name, H5VL_PASSTHRU_NAME)) { + else if (!strcmp(vol_info->u.name, H5VL_PASSTHRU_NAME)) { connector_id = H5VL_PASSTHRU; } else { @@ -822,9 +822,9 @@ done: herr_t h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size) { - hid_t fapl_vol_id = H5I_INVALID_HID; - hbool_t is_native = FALSE; - herr_t ret_value = SUCCEED; + hid_t fapl_vol_id = H5I_INVALID_HID; + bool is_native = false; + herr_t ret_value = SUCCEED; if (fapl_id < 0) H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); @@ -895,7 +895,7 @@ h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t driverna else driver_name = "unknown"; - HDstrncpy(drivername, driver_name, drivername_size); + strncpy(drivername, driver_name, drivername_size); drivername[drivername_size - 1] = '\0'; } @@ -915,14 +915,14 @@ done: * * The 'use_specific_driver' parameter is used to control the * VFD/VOL connector that this routine uses to open the file - * with. If 'use_specific_driver' is set to TRUE, this routine + * with. If 'use_specific_driver' is set to true, this routine * assumes that the caller has already set a specific VFD or VOL * connector on the given FAPL and will attempt to directly use * the FAPL for opening the file. We assume that the caller knows * what they are doing; if the file is unable to be opened using * that FAPL, this routine will return H5I_INVALID_HID. * - * However, if 'use_specific_driver' is set to FALSE, this + * However, if 'use_specific_driver' is set to false, this * routine assumes that the caller HAS NOT set a specific VFD or * VOL connector on the given FAPL and will instead loop through * the various available VFL drivers and VOL connectors trying to @@ -951,7 +951,7 @@ done: *------------------------------------------------------------------------- */ hid_t -h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_specific_driver, char *drivername, +h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, bool use_specific_driver, char *drivername, size_t drivername_size) { hid_t fid = H5I_INVALID_HID; @@ -989,7 +989,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec /* * If we failed to open the file and the caller specified 'use_specific_driver' - * as TRUE, we should return failure now since the file couldn't be opened with + * as true, we should return failure now since the file couldn't be opened with * the VFL driver/VOL connector that was set on the FAPL by the caller. */ if (use_specific_driver) @@ -1037,7 +1037,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec /* Can we open the file with this combo? */ H5E_BEGIN_TRY { - fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size); + fid = h5tools_fopen(fname, flags, tmp_fapl_id, true, drivername, drivername_size); } H5E_END_TRY @@ -1060,7 +1060,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec continue; /* Can we open the file with this connector? */ - if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size)) >= 0) { + if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, true, drivername, drivername_size)) >= 0) { used_fapl_id = tmp_fapl_id; H5TOOLS_GOTO_DONE(fid); } @@ -1121,24 +1121,24 @@ h5tools_count_ncols(const char *s) * * Purpose: Recursive check for any variable length data in given type. * - * Return: TRUE : type contains any variable length data - * FALSE : type doesn't contain any variable length data + * Return: true : type contains any variable length data + * false : type doesn't contain any variable length data * Negative value: failed *------------------------------------------------------------------------- */ htri_t h5tools_detect_vlen(hid_t tid) { - htri_t ret = FALSE; + htri_t ret = false; /* recursive detect any vlen data values in type (compound, array ...) */ ret = H5Tdetect_class(tid, H5T_VLEN); - if ((ret == TRUE) || (ret < 0)) + if ((ret == true) || (ret < 0)) goto done; /* recursive detect any vlen string in type (compound, array ...) */ ret = h5tools_detect_vlen_str(tid); - if ((ret == TRUE) || (ret < 0)) + if ((ret == true) || (ret < 0)) goto done; done: @@ -1150,8 +1150,8 @@ done: * * Purpose: Recursive check for variable length string of a datatype. * - * Return: TRUE : type contains any variable length string - * FALSE : type doesn't contain any variable length string + * Return: true : type contains any variable length string + * false : type doesn't contain any variable length string * Negative value: failed *------------------------------------------------------------------------- */ @@ -1159,10 +1159,10 @@ htri_t h5tools_detect_vlen_str(hid_t tid) { H5T_class_t tclass = -1; - htri_t ret = FALSE; + htri_t ret = false; ret = H5Tis_variable_str(tid); - if ((ret == TRUE) || (ret < 0)) + if ((ret == true) || (ret < 0)) goto done; tclass = H5Tget_class(tid); @@ -1174,7 +1174,7 @@ h5tools_detect_vlen_str(hid_t tid) goto done; } ret = h5tools_detect_vlen_str(btid); - if ((ret == TRUE) || (ret < 0)) { + if ((ret == true) || (ret < 0)) { H5Tclose(btid); goto done; } @@ -1194,7 +1194,7 @@ h5tools_detect_vlen_str(hid_t tid) hid_t mtid = H5Tget_member_type(tid, u); ret = h5tools_detect_vlen_str(mtid); - if ((ret == TRUE) || (ret < 0)) { + if ((ret == true) || (ret < 0)) { H5Tclose(mtid); goto done; } @@ -1241,7 +1241,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context ctx->cur_column, info->idx_fmt, info->line_suf); if (ctx->cur_column) { PUTSTREAM(OPT(info->line_suf, ""), stream); - HDputc('\n', stream); + putc('\n', stream); PUTSTREAM(OPT(info->line_sep, ""), stream); } H5TOOLS_DEBUG("after CR elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); @@ -1334,7 +1334,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_ /* Terminate previous line, if any */ if (ctx->cur_column) { PUTSTREAM(OPT(info->line_suf, ""), stream); - HDputc('\n', stream); + putc('\n', stream); PUTSTREAM(OPT(info->line_sep, ""), stream); } @@ -1411,16 +1411,16 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_ * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter) { - hbool_t dimension_break = TRUE; - char *s = NULL; - char *section = NULL; /* a section of output */ - int secnum; /* section sequence number */ - int multiline; /* datum was multiline */ + bool dimension_break = true; + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ if (stream == NULL) return dimension_break; @@ -1436,23 +1436,23 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one * line, then start this element at the beginning of a line. */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; } - else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its * own line. */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; } H5TOOLS_DEBUG("ctx->need_prefix=%d", ctx->need_prefix); } @@ -1464,11 +1464,11 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex */ if (info->arr_linebreak && ctx->cur_elmt) { if (ctx->size_last_dim && (ctx->cur_elmt % ctx->size_last_dim) == 0) - ctx->need_prefix = TRUE; + ctx->need_prefix = true; if (elmt_counter == ctx->size_last_dim) { - ctx->need_prefix = TRUE; - dimension_break = FALSE; + ctx->need_prefix = true; + dimension_break = false; } H5TOOLS_DEBUG("ctx->need_prefix=%d", ctx->need_prefix); } @@ -1481,9 +1481,9 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * beginning of the line. */ if (info->line_multi_new == 1 && ctx->prev_multiline && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) - ctx->need_prefix = TRUE; + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) + ctx->need_prefix = true; H5TOOLS_DEBUG("ctx->need_prefix=%d", ctx->need_prefix); /* @@ -1491,7 +1491,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * start a new line. */ if (info->line_per_line > 0 && ctx->cur_elmt >= info->line_per_line) - ctx->need_prefix = TRUE; + ctx->need_prefix = true; H5TOOLS_DEBUG("ctx->need_prefix=%d", ctx->need_prefix); /* @@ -1500,7 +1500,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * one-at a time. */ multiline = 0; - for (secnum = 0, multiline = 0; (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { + for (secnum = 0, multiline = 0; (section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line * information would cause the output to wrap then we need to @@ -1510,8 +1510,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex /* * check for displaying prefix for each section */ - if ((ctx->cur_column + HDstrlen(section) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + if ((ctx->cur_column + strlen(section) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1535,13 +1535,13 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { PUTSTREAM(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); + ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); } H5TOOLS_DEBUG("section=%s", section); /* Print the section */ PUTSTREAM(section, stream); - ctx->cur_column += HDstrlen(section); + ctx->cur_column += strlen(section); } ctx->prev_multiline = multiline; @@ -1576,16 +1576,16 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter) { - hbool_t dimension_break = TRUE; - char *s = NULL; - char *section = NULL; /* a section of output */ - int secnum; /* section sequence number */ - int multiline; /* datum was multiline */ + bool dimension_break = true; + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ H5TOOLS_START_DEBUG(" "); H5TOOLS_DEBUG("elmt_counter=%ld - local_elmt_counter=%ld", elmt_counter, local_elmt_counter); @@ -1597,23 +1597,23 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one * line, then start this element at the beginning of a line. */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; } - else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its * own line. */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; } } @@ -1624,11 +1624,11 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools */ if (info->arr_linebreak && ctx->cur_elmt) { if (ctx->size_last_dim && (ctx->cur_elmt % ctx->size_last_dim) == 0) - ctx->need_prefix = TRUE; + ctx->need_prefix = true; if (elmt_counter == ctx->size_last_dim) { - ctx->need_prefix = TRUE; - dimension_break = FALSE; + ctx->need_prefix = true; + dimension_break = false; } } @@ -1638,16 +1638,16 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * beginning of the line. */ if (info->line_multi_new == 1 && ctx->prev_multiline && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) - ctx->need_prefix = TRUE; + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) + ctx->need_prefix = true; /* * If too many elements have already been printed then we need to * start a new line. */ if (info->line_per_line > 0 && ctx->cur_elmt >= info->line_per_line) - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* * Each OPTIONAL_LINE_BREAK embedded in the rendered string can cause @@ -1655,7 +1655,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * one-at a time. */ multiline = 0; - for (secnum = 0, multiline = 0; (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { + for (secnum = 0, multiline = 0; (section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line * information would cause the output to wrap then we need to @@ -1667,8 +1667,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * this check to happen for the first line */ if ((!info->skip_first || local_elmt_counter) && - (ctx->cur_column + HDstrlen(section) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + strlen(section) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1690,12 +1690,12 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { PUTSTREAM(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); + ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); } /* Print the section */ PUTSTREAM(section, stream); - ctx->cur_column += HDstrlen(section); + ctx->cur_column += strlen(section); } ctx->prev_multiline = multiline; @@ -1788,7 +1788,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t size_t size; /* datum size */ hsize_t block_index; H5T_class_t type_class; - hbool_t past_catch = FALSE; + bool past_catch = false; int ret_value = 0; H5TOOLS_START_DEBUG(" "); @@ -1838,7 +1838,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t if (H5Tis_variable_str(tid)) { s = *(char **)((void *)mem); if (s != NULL) - size = HDstrlen(s); + size = strlen(s); else H5TOOLS_THROW((-1), "NULL string"); } @@ -2036,7 +2036,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai size_t type_size; hid_t mem_space = H5I_INVALID_HID; void *region_buf = NULL; - hbool_t past_catch = FALSE; + bool past_catch = false; hsize_t blkndx; hid_t sid1 = H5I_INVALID_HID; int ret_value = -1; @@ -2121,7 +2121,7 @@ done:; * True otherwise *------------------------------------------------------------------------- */ -hbool_t +bool render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container) { hssize_t snblocks; @@ -2132,30 +2132,30 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea unsigned ndims; hid_t dtype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; - hbool_t past_catch = FALSE; - hbool_t ret_value = TRUE; + bool past_catch = false; + bool ret_value = true; H5TOOLS_START_DEBUG(" "); if ((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) - H5TOOLS_THROW(FALSE, "H5Sget_select_hyper_nblocks failed"); + H5TOOLS_THROW(false, "H5Sget_select_hyper_nblocks failed"); nblocks = (hsize_t)snblocks; /* Print block information */ if ((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) - H5TOOLS_THROW(FALSE, "H5Sget_simple_extent_ndims failed"); + H5TOOLS_THROW(false, "H5Sget_simple_extent_ndims failed"); ndims = (unsigned)sndims; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); if ((ptdata = (hsize_t *)malloc((size_t)alloc_size)) == NULL) - H5TOOLS_GOTO_ERROR(FALSE, "Could not allocate buffer for ptdata"); + H5TOOLS_GOTO_ERROR(false, "Could not allocate buffer for ptdata"); if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) - H5TOOLS_GOTO_ERROR(FALSE, "H5Rget_select_hyper_blocklist failed"); + H5TOOLS_GOTO_ERROR(false, "H5Rget_select_hyper_blocklist failed"); if ((dtype = H5Dget_type(region_id)) < 0) - H5TOOLS_GOTO_ERROR(FALSE, "H5Dget_type failed"); + H5TOOLS_GOTO_ERROR(false, "H5Dget_type failed"); if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) - H5TOOLS_GOTO_ERROR(FALSE, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(false, "H5Tget_native_type failed"); render_bin_output_region_data_blocks(region_id, stream, container, ndims, type_id, nblocks, ptdata); @@ -2163,12 +2163,12 @@ done: free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) - H5TOOLS_ERROR(FALSE, "H5Tclose failed"); + H5TOOLS_ERROR(false, "H5Tclose failed"); if (dtype > 0 && H5Tclose(dtype) < 0) - H5TOOLS_ERROR(FALSE, "H5Tclose failed"); + H5TOOLS_ERROR(false, "H5Tclose failed"); - H5_LEAVE(TRUE); + H5_LEAVE(true); CATCH H5TOOLS_ENDDEBUG(" "); @@ -2246,7 +2246,7 @@ done: * True otherwise *------------------------------------------------------------------------- */ -hbool_t +bool render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container) { hssize_t snpoints; @@ -2255,33 +2255,33 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *strea unsigned ndims; hid_t dtype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; - hbool_t past_catch = FALSE; - hbool_t ret_value = TRUE; + bool past_catch = false; + bool ret_value = true; H5TOOLS_START_DEBUG(" "); if ((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0) - H5TOOLS_THROW(FALSE, "H5Sget_select_elem_npoints failed"); + H5TOOLS_THROW(false, "H5Sget_select_elem_npoints failed"); npoints = (hsize_t)snpoints; /* Allocate space for the dimension array */ if ((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) - H5TOOLS_THROW(FALSE, "H5Sget_simple_extent_ndims failed"); + H5TOOLS_THROW(false, "H5Sget_simple_extent_ndims failed"); ndims = (unsigned)sndims; if ((dtype = H5Dget_type(region_id)) < 0) - H5TOOLS_GOTO_ERROR(FALSE, "H5Dget_type failed"); + H5TOOLS_GOTO_ERROR(false, "H5Dget_type failed"); if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) - H5TOOLS_GOTO_ERROR(FALSE, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(false, "H5Tget_native_type failed"); render_bin_output_region_data_points(region_space, region_id, stream, container, ndims, type_id, npoints); done: if (type_id > 0 && H5Tclose(type_id) < 0) - H5TOOLS_ERROR(FALSE, "H5Tclose failed"); + H5TOOLS_ERROR(false, "H5Tclose failed"); if (dtype > 0 && H5Tclose(dtype) < 0) - H5TOOLS_ERROR(FALSE, "H5Tclose failed"); + H5TOOLS_ERROR(false, "H5Tclose failed"); H5_LEAVE(ret_value); CATCH @@ -2294,20 +2294,20 @@ done: * * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero - * FALSE otherwise + * Return: true if all bytes are zero + * false otherwise *------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool h5tools_is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *)_mem; while (size-- > 0) if (mem[size]) - return FALSE; + return false; - return TRUE; + return true; } /*------------------------------------------------------------------------- @@ -2323,22 +2323,22 @@ h5tools_is_zero(const void *_mem, size_t size) * char *name1: link name of the first object. * Use "." or NULL if loc_id2 is the object to be compared. * - * Return: TRUE if it is the same object - * FALSE otherwise. + * Return: true if it is the same object + * false otherwise. *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2) { H5O_info2_t oinfo1, oinfo2; - hbool_t ret_val = FALSE; + bool ret_val = false; - if (name1 && HDstrcmp(name1, ".") != 0) + if (name1 && strcmp(name1, ".") != 0) H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC); - if (name2 && HDstrcmp(name2, ".") != 0) + if (name2 && strcmp(name2, ".") != 0) H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC); @@ -2349,7 +2349,7 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char H5Otoken_cmp(loc_id1, &oinfo1.token, &oinfo2.token, &token_cmp_val); if (!token_cmp_val) - ret_val = TRUE; + ret_val = true; } return ret_val; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 98ced40..b636806 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -40,7 +40,7 @@ #define PUTSTREAM(X, S) \ do { \ if (S != NULL) \ - HDfputs(X, S); \ + fputs(X, S); \ } while (0) /* @@ -291,7 +291,7 @@ typedef struct h5tool_format_t { * * Numeric data is also subject to the formats for individual elements. */ - hbool_t raw; + bool raw; const char *fmt_raw; const char *fmt_int; const char *fmt_uint; @@ -674,17 +674,17 @@ H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, h5tools_vfd_info_t *vfd_info); H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size); -H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, +H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, bool use_specific_driver, char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); -H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); +H5TOOLS_DLL bool h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); H5TOOLS_DLL void init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx); H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, const hsize_t *acc, hsize_t *pos); -H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size); +H5TOOLS_DLL bool h5tools_is_zero(const void *_mem, size_t size); H5TOOLS_DLL int h5tools_canreadf(const char *name, hid_t dcpl_id); H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); @@ -694,25 +694,25 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_ h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); -H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); -H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, - unsigned ndims, hid_t type_id, hsize_t nblocks, - const hsize_t *ptdata); -H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, - hid_t container); -H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, - hid_t container, unsigned ndims, hid_t type_id, - hsize_t npoints); -H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, - hid_t container); - -H5TOOLS_DLL hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, - hsize_t local_elmt_counter, hsize_t elmt_counter); -H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, h5tools_str_t *buffer, - hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, - hsize_t local_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); +H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, + unsigned ndims, hid_t type_id, hsize_t nblocks, + const hsize_t *ptdata); +H5TOOLS_DLL bool render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, + hid_t container); +H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, + hid_t container, unsigned ndims, hid_t type_id, + hsize_t npoints); +H5TOOLS_DLL bool render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, + hid_t container); + +H5TOOLS_DLL bool h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, + hsize_t local_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL bool h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, + hsize_t local_elmt_counter, hsize_t elmt_counter); #ifdef __cplusplus } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 2986de7..efaddee 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -248,7 +248,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont unsigned char *mem = (unsigned char *)_mem; hsize_t i; /* element counter */ size_t size; /* size of each datum */ - hbool_t dimension_break = TRUE; + bool dimension_break = true; size_t ncols = 80; /* available output width */ h5tools_str_t buffer; /* string into which to render */ hsize_t curr_pos = 0; /* total data element position */ @@ -299,7 +299,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont dimension_break = h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); /* Render the data element end*/ - if (FALSE == dimension_break) + if (false == dimension_break) elmt_counter = 0; } /* end for (i = 0; i < nelmts... */ H5TOOLS_DEBUG("data render finish"); @@ -334,7 +334,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, /* in,out */ h5tools_str_t *buffer, /* string into which to render */ @@ -342,13 +342,13 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format size_t ncols, hsize_t region_elmt_counter, /* element counter */ hsize_t elmt_counter) { - hbool_t dimension_break = TRUE; + bool dimension_break = true; hid_t atype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; hid_t region_space = H5I_INVALID_HID; h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */ - hbool_t past_catch = FALSE; - hbool_t ret_value = TRUE; + bool past_catch = false; + bool ret_value = true; assert(info); assert(ctx); @@ -379,31 +379,31 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format H5TOOLS_GOTO_ERROR(dimension_break, "H5Tget_native_type failed"); ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the datatype element begin */ h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s %s ", h5tools_dump_header_format->datatypebegin, h5tools_dump_header_format->datatypeblockbegin); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; ctx->indent_level++; - h5tools_print_datatype(stream, buffer, info, ctx, atype, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, atype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the datatype element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the dataspace element begin */ h5tools_str_reset(buffer); @@ -411,12 +411,12 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -424,9 +424,9 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format /* Render the dataspace element end */ if (region_output) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; - h5tools_dump_data(stream, &outputformat, ctx, region_id, FALSE); + h5tools_dump_data(stream, &outputformat, ctx, region_id, false); } done: @@ -440,7 +440,7 @@ done: H5TOOLS_ERROR(dimension_break, "H5Sclose failed"); ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the region } element begin */ h5tools_str_reset(buffer); @@ -482,7 +482,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for size_t ncols, unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata) { - hbool_t dimension_break = TRUE; + bool dimension_break = true; hsize_t *dims1 = NULL; hsize_t *start = NULL; hsize_t *count = NULL; @@ -495,7 +495,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for hsize_t numindex; unsigned indx; unsigned jndx; - hbool_t past_catch = FALSE; + bool past_catch = false; size_t type_size; hid_t mem_space = H5I_INVALID_HID; hid_t sid1 = H5I_INVALID_HID; @@ -551,7 +551,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for ctx.prev_multiline = cur_ctx->prev_multiline; ctx.ndims = ndims; for (blkndx = 0; blkndx < nblocks; blkndx++) { - ctx.need_prefix = TRUE; + ctx.need_prefix = true; ctx.cur_elmt = 0; for (indx = 0; indx < ndims; indx++) { start[indx] = ptdata[indx + blkndx * ndims * 2]; @@ -600,7 +600,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for ncols, ptdata, numindex, elmtno); /* Render the region data element end */ - if (FALSE == dimension_break) + if (false == dimension_break) elmtno = 0; } /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */ } @@ -658,7 +658,7 @@ done: * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, /* in,out */ h5tools_str_t *buffer, /* string into which to render */ @@ -666,7 +666,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea size_t ncols, hsize_t region_elmt_counter, /* element counter */ hsize_t elmt_counter) { - hbool_t dimension_break = TRUE; + bool dimension_break = true; hssize_t snblocks; hsize_t nblocks; hsize_t alloc_size; @@ -677,8 +677,8 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea hid_t dtype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */ - hbool_t past_catch = FALSE; - hbool_t ret_value = TRUE; + bool past_catch = false; + bool ret_value = true; assert(info); assert(ctx); @@ -711,7 +711,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea /* Render the region { element end */ ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the region datatype info and indices element begin */ h5tools_str_reset(buffer); @@ -749,7 +749,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region datatype info and indices element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; if ((dtype = H5Dget_type(region_id)) < 0) H5TOOLS_GOTO_ERROR(dimension_break, "H5Dget_type failed"); @@ -762,22 +762,22 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_dump_header_format->datatypeblockbegin); ctx->indent_level++; - h5tools_print_datatype(stream, buffer, info, ctx, dtype, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, dtype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the datatype element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the dataspace element begin */ h5tools_str_reset(buffer); @@ -785,12 +785,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -798,7 +798,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea /* Render the dataspace element end */ if (region_output) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the databegin element begin */ h5tools_str_reset(buffer); @@ -808,7 +808,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea region_elmt_counter, elmt_counter); /* Render the databegin element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_print_region_data_blocks(region_id, rawdatastream, info, ctx, buffer, ncols, ndims, type_id, nblocks, ptdata); @@ -824,17 +824,17 @@ done: H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); if (region_output) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the dataend element begin */ h5tools_str_reset(buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataend); dimension_break = h5tools_render_element(stream, &outputformat, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); @@ -842,7 +842,7 @@ done: } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the region } element begin */ h5tools_str_reset(buffer); @@ -884,7 +884,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre h5tools_str_t *buffer, size_t ncols, unsigned ndims, hid_t type_id, hsize_t npoints, hsize_t *ptdata) { - hbool_t dimension_break = TRUE; + bool dimension_break = true; hsize_t *dims1 = NULL; hsize_t elmtno; /* element index */ hsize_t curr_pos = 0; @@ -896,7 +896,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre hid_t mem_space = H5I_INVALID_HID; void *region_buf = NULL; h5tools_context_t ctx; - hbool_t past_catch = FALSE; + bool past_catch = false; int ret_value = 0; assert(info); @@ -936,7 +936,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre H5TOOLS_DEBUG("data render start:%ld", npoints); elmtno = 0; for (jndx = 0; jndx < npoints; jndx++, elmtno++) { - ctx.need_prefix = TRUE; + ctx.need_prefix = true; ctx.cur_elmt = 0; /* points are always 0 */ ctx.indent_level++; @@ -974,7 +974,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre dimension_break = h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos, ncols, ptdata, (hsize_t)0, elmtno); /* Render the point element end */ - if (FALSE == dimension_break) + if (false == dimension_break) elmtno = 0; } else { @@ -1019,13 +1019,13 @@ done: * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ -hbool_t +bool h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, hsize_t elmt_counter) { - hbool_t dimension_break = TRUE; + bool dimension_break = true; hssize_t snpoints; hsize_t npoints; hsize_t alloc_size; @@ -1036,8 +1036,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea hid_t dtype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */ - hbool_t past_catch = FALSE; - hbool_t ret_value = TRUE; + bool past_catch = false; + bool ret_value = true; assert(info); assert(ctx); @@ -1070,7 +1070,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea /* Render the region { element end */ ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the region datatype info and indices element begin */ h5tools_str_reset(buffer); @@ -1103,7 +1103,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region datatype info and indices element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; if ((dtype = H5Dget_type(region_id)) < 0) H5TOOLS_GOTO_ERROR(dimension_break, "H5Dget_type failed"); @@ -1116,22 +1116,22 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_dump_header_format->datatypeblockbegin); ctx->indent_level++; - h5tools_print_datatype(stream, buffer, info, ctx, dtype, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, dtype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the datatype element end */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the dataspace element begin */ h5tools_str_reset(buffer); @@ -1139,12 +1139,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -1152,7 +1152,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea /* Render the dataspace element end */ if (region_output) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the databegin element begin */ h5tools_str_reset(buffer); @@ -1163,7 +1163,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_print_region_data_points(region_space, region_id, rawdatastream, info, ctx, buffer, ncols, ndims, type_id, npoints, ptdata); @@ -1179,17 +1179,17 @@ done: H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); if (region_output) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the dataend element begin */ h5tools_str_reset(buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataend); dimension_break = h5tools_render_element(stream, &outputformat, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); @@ -1197,7 +1197,7 @@ done: } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; /* Render the region } element begin */ h5tools_str_reset(buffer); @@ -1271,7 +1271,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */ hsize_t size_row_block; /* size for blocks along rows */ hsize_t row_counter = 0; - hbool_t past_catch = FALSE; + bool past_catch = false; /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ herr_t ret_value = SUCCEED; @@ -1283,8 +1283,8 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size_row_block = ctx->sset->block.data[row_dim]; /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; + if (h5tools_detect_vlen(p_type) == true) + vl_data = true; /* display loop */ for (; hyperslab_count > 0; temp_start[row_dim] += temp_stride[row_dim], hyperslab_count--) { @@ -1364,7 +1364,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c } ctx->sm_pos += low[ctx->ndims - 1]; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; if (h5tools_dump_simple_data(stream, info, ctx, dset, flags, sm_nelmts, p_type, sm_buf) < 0) H5TOOLS_THROW(FAIL, "h5tools_dump_simple_data failed"); @@ -1566,7 +1566,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co int sndims; hid_t f_space = H5I_INVALID_HID; /* file data space */ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ - hbool_t past_catch = FALSE; + bool past_catch = false; herr_t ret_value = SUCCEED; H5TOOLS_START_DEBUG(" "); @@ -1624,7 +1624,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont hsize_t zero[8]; /* vector of zeros */ unsigned int flags; /* buffer extent flags */ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ - hbool_t past_catch = FALSE; + bool past_catch = false; /* Print info */ size_t p_type_nbytes; /* size of memory type */ @@ -1679,8 +1679,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont } /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; + if (h5tools_detect_vlen(p_type) == true) + vl_data = true; /* * Determine the strip mine size and allocate a buffer. The strip mine is @@ -1805,7 +1805,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte unsigned i; /* counters */ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ hsize_t p_nelmts; /* total selected elmts */ - hbool_t past_catch = FALSE; + bool past_catch = false; unsigned char *buf = NULL; /* buffer for raw data */ int ret_value = 0; @@ -1844,8 +1844,8 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte H5_LEAVE(SUCCEED); /* nothing to print */ /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; + if (h5tools_detect_vlen(p_type) == true) + vl_data = true; alloc_size = p_nelmts * H5Tget_size(p_type); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ @@ -2062,8 +2062,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ H5T_order_t order; H5T_class_t type_class; H5T_sign_t sign; /* sign scheme value */ - htri_t is_vlstr = FALSE; - hbool_t past_catch = FALSE; + htri_t is_vlstr = false; + bool past_catch = false; const char *sign_s = NULL; /* sign scheme string */ const char *order_s = NULL; /* byte order string */ int ret_value = 0; @@ -2102,57 +2102,57 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ switch (type_class) { case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE) == TRUE) + if (H5Tequal(type, H5T_STD_I8BE) == true) h5tools_str_append(buffer, "H5T_STD_I8BE"); - else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) + else if (H5Tequal(type, H5T_STD_I8LE) == true) h5tools_str_append(buffer, "H5T_STD_I8LE"); - else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) + else if (H5Tequal(type, H5T_STD_I16BE) == true) h5tools_str_append(buffer, "H5T_STD_I16BE"); - else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) + else if (H5Tequal(type, H5T_STD_I16LE) == true) h5tools_str_append(buffer, "H5T_STD_I16LE"); - else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) + else if (H5Tequal(type, H5T_STD_I32BE) == true) h5tools_str_append(buffer, "H5T_STD_I32BE"); - else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) + else if (H5Tequal(type, H5T_STD_I32LE) == true) h5tools_str_append(buffer, "H5T_STD_I32LE"); - else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) + else if (H5Tequal(type, H5T_STD_I64BE) == true) h5tools_str_append(buffer, "H5T_STD_I64BE"); - else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) + else if (H5Tequal(type, H5T_STD_I64LE) == true) h5tools_str_append(buffer, "H5T_STD_I64LE"); - else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) + else if (H5Tequal(type, H5T_STD_U8BE) == true) h5tools_str_append(buffer, "H5T_STD_U8BE"); - else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) + else if (H5Tequal(type, H5T_STD_U8LE) == true) h5tools_str_append(buffer, "H5T_STD_U8LE"); - else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) + else if (H5Tequal(type, H5T_STD_U16BE) == true) h5tools_str_append(buffer, "H5T_STD_U16BE"); - else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) + else if (H5Tequal(type, H5T_STD_U16LE) == true) h5tools_str_append(buffer, "H5T_STD_U16LE"); - else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) + else if (H5Tequal(type, H5T_STD_U32BE) == true) h5tools_str_append(buffer, "H5T_STD_U32BE"); - else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) + else if (H5Tequal(type, H5T_STD_U32LE) == true) h5tools_str_append(buffer, "H5T_STD_U32LE"); - else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) + else if (H5Tequal(type, H5T_STD_U64BE) == true) h5tools_str_append(buffer, "H5T_STD_U64BE"); - else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) + else if (H5Tequal(type, H5T_STD_U64LE) == true) h5tools_str_append(buffer, "H5T_STD_U64LE"); - else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_SCHAR) == true) h5tools_str_append(buffer, "H5T_NATIVE_SCHAR"); - else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_UCHAR) == true) h5tools_str_append(buffer, "H5T_NATIVE_UCHAR"); - else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_SHORT) == true) h5tools_str_append(buffer, "H5T_NATIVE_SHORT"); - else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_USHORT) == true) h5tools_str_append(buffer, "H5T_NATIVE_USHORT"); - else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_INT) == true) h5tools_str_append(buffer, "H5T_NATIVE_INT"); - else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_UINT) == true) h5tools_str_append(buffer, "H5T_NATIVE_UINT"); - else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_LONG) == true) h5tools_str_append(buffer, "H5T_NATIVE_LONG"); - else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_ULONG) == true) h5tools_str_append(buffer, "H5T_NATIVE_ULONG"); - else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_LLONG) == true) h5tools_str_append(buffer, "H5T_NATIVE_LLONG"); - else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_ULLONG) == true) h5tools_str_append(buffer, "H5T_NATIVE_ULLONG"); else { @@ -2190,21 +2190,21 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) + if (H5Tequal(type, H5T_IEEE_F32BE) == true) h5tools_str_append(buffer, "H5T_IEEE_F32BE"); - else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) + else if (H5Tequal(type, H5T_IEEE_F32LE) == true) h5tools_str_append(buffer, "H5T_IEEE_F32LE"); - else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) + else if (H5Tequal(type, H5T_IEEE_F64BE) == true) h5tools_str_append(buffer, "H5T_IEEE_F64BE"); - else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) + else if (H5Tequal(type, H5T_IEEE_F64LE) == true) h5tools_str_append(buffer, "H5T_IEEE_F64LE"); - else if (H5Tequal(type, H5T_VAX_F32) == TRUE) + else if (H5Tequal(type, H5T_VAX_F32) == true) h5tools_str_append(buffer, "H5T_VAX_F32"); - else if (H5Tequal(type, H5T_VAX_F64) == TRUE) + else if (H5Tequal(type, H5T_VAX_F64) == true) h5tools_str_append(buffer, "H5T_VAX_F64"); - else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_FLOAT) == true) h5tools_str_append(buffer, "H5T_NATIVE_FLOAT"); - else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) + else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == true) h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE"); else { /* print what the library knows */ @@ -2250,7 +2250,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); @@ -2261,7 +2261,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); @@ -2301,7 +2301,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); @@ -2340,7 +2340,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); @@ -2415,7 +2415,7 @@ found_string_type: (hsize_t)0); ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); if (H5Tclose(str_type) < 0) @@ -2427,21 +2427,21 @@ found_string_type: break; case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE) == TRUE) + if (H5Tequal(type, H5T_STD_B8BE) == true) h5tools_str_append(buffer, "H5T_STD_B8BE"); - else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) + else if (H5Tequal(type, H5T_STD_B8LE) == true) h5tools_str_append(buffer, "H5T_STD_B8LE"); - else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) + else if (H5Tequal(type, H5T_STD_B16BE) == true) h5tools_str_append(buffer, "H5T_STD_B16BE"); - else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) + else if (H5Tequal(type, H5T_STD_B16LE) == true) h5tools_str_append(buffer, "H5T_STD_B16LE"); - else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) + else if (H5Tequal(type, H5T_STD_B32BE) == true) h5tools_str_append(buffer, "H5T_STD_B32BE"); - else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) + else if (H5Tequal(type, H5T_STD_B32LE) == true) h5tools_str_append(buffer, "H5T_STD_B32LE"); - else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) + else if (H5Tequal(type, H5T_STD_B64BE) == true) h5tools_str_append(buffer, "H5T_STD_B64BE"); - else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) + else if (H5Tequal(type, H5T_STD_B64LE) == true) h5tools_str_append(buffer, "H5T_STD_B64LE"); else h5tools_str_append(buffer, "undefined bitfield"); @@ -2458,7 +2458,7 @@ found_string_type: if (NULL == (ttag = H5Tget_tag(type))) H5TOOLS_THROW((-1), "H5Tget_tag failed"); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); @@ -2468,7 +2468,7 @@ found_string_type: H5free_memory(ttag); if ((size = H5Tget_size(type)) <= 0) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_SIZE \"%zu\";", size); @@ -2478,7 +2478,7 @@ found_string_type: } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->opaqblockend); @@ -2497,10 +2497,10 @@ found_string_type: for (i = 0; i < nmembers; i++) { mname = H5Tget_member_name(type, i); if ((mtype = H5Tget_member_type(type, i)) >= 0) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); - h5tools_print_datatype(stream, buffer, info, ctx, mtype, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, mtype, true); h5tools_str_append(buffer, " \"%s\";", mname); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, @@ -2514,7 +2514,7 @@ found_string_type: } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->cmpdblockend); @@ -2522,13 +2522,13 @@ found_string_type: case H5T_REFERENCE: h5tools_str_append(buffer, "%s", h5tools_dump_header_format->refblockbegin); - if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) { + if (H5Tequal(type, H5T_STD_REF_DSETREG) == true) { h5tools_str_append(buffer, "H5T_STD_REF_DSETREG"); } - else if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) { + else if (H5Tequal(type, H5T_STD_REF_OBJ) == true) { h5tools_str_append(buffer, "H5T_STD_REF_OBJECT"); } - else if (H5Tequal(type, H5T_STD_REF) == TRUE) { + else if (H5Tequal(type, H5T_STD_REF) == true) { h5tools_str_append(buffer, "H5T_STD_REF"); } else { @@ -2546,10 +2546,10 @@ found_string_type: (hsize_t)0); ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); - h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, super, true); if (H5Tclose(super) < 0) H5TOOLS_ERROR((-1), "H5Tclose failed"); @@ -2562,7 +2562,7 @@ found_string_type: ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend); @@ -2575,7 +2575,7 @@ found_string_type: h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockbegin); - h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, super, true); if (H5Tclose(super) < 0) H5TOOLS_ERROR((-1), "H5Tclose failed"); @@ -2607,7 +2607,7 @@ found_string_type: /* Get array base type */ if ((super = H5Tget_super(type)) >= 0) { /* Print base type */ - h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + h5tools_print_datatype(stream, buffer, info, ctx, super, true); /* Close array base type */ if (H5Tclose(super) < 0) H5TOOLS_ERROR((-1), "H5Tclose failed"); @@ -2649,7 +2649,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space) hsize_t maxsize[H5TOOLS_DUMP_MAX_RANK]; int ndims = -1; H5S_class_t space_type = -1; - hbool_t past_catch = FALSE; + bool past_catch = false; int i; int ret_value = 0; @@ -2738,7 +2738,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i size_t dst_size; /*destination value type size */ size_t ncols = 80; /*available output width */ hsize_t curr_pos = 0; /* total data element position */ - hbool_t past_catch = FALSE; + bool past_catch = false; int ret_value = 0; H5TOOLS_START_DEBUG(" "); @@ -2802,12 +2802,12 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i for (i = 0; i < nmembs; i++) { int nchars; /*number of output characters */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "\"%s\"", name[i]); - nchars = (int)HDstrlen(name[i]); + nchars = (int)strlen(name[i]); h5tools_str_append(buffer, "%*s ", MAX(0, 16 - nchars), ""); if (native < 0) { @@ -2885,18 +2885,18 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context if (info->line_ncols > 0) ncols = info->line_ncols; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->datatypebegin, h5tools_dump_header_format->datatypeblockbegin); - h5tools_print_datatype(stream, &buffer, info, ctx, type, TRUE); - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + h5tools_print_datatype(stream, &buffer, info, ctx, type, true); + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2931,19 +2931,19 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_contex if (info->line_ncols > 0) ncols = info->line_ncols; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", h5tools_dump_header_format->dataspacebegin); h5tools_print_dataspace(&buffer, type); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2978,7 +2978,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c if (info->line_ncols > 0) ncols = info->line_ncols; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s %" PRId64 " %s", OBJID, BEGIN, oid, END); @@ -3004,7 +3004,7 @@ h5tools_print_virtual_selection(hid_t vspace, FILE *stream, const h5tool_format_ { switch (H5Sget_select_type(vspace)) { case H5S_SEL_NONE: /* Nothing selected */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_NONE); @@ -3017,7 +3017,7 @@ h5tools_print_virtual_selection(hid_t vspace, FILE *stream, const h5tool_format_ h5tools_str_append(buffer, " %s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_HYPERSLABS: /* "New-style" hyperslab selection defined */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); if (H5Sis_regular_hyperslab(vspace)) { @@ -3035,7 +3035,7 @@ h5tools_print_virtual_selection(hid_t vspace, FILE *stream, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); @@ -3044,13 +3044,13 @@ h5tools_print_virtual_selection(hid_t vspace, FILE *stream, const h5tool_format_ } h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_ALL: /* Entire extent selected */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_ALL); @@ -3082,7 +3082,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); - if (h5tools_detect_vlen(type_id) == TRUE) + if (h5tools_detect_vlen(type_id) == true) vl_data = true; size = H5Tget_size(n_type); @@ -3154,13 +3154,13 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (dcpl_id >= 0) nfilters = H5Pget_nfilters(dcpl_id); - HDstrcpy(f_name, "\0"); + strcpy(f_name, "\0"); /*------------------------------------------------------------------------- * STORAGE_LAYOUT *------------------------------------------------------------------------- */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); @@ -3172,7 +3172,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * switch (stl) { case H5D_CHUNKED: ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", CHUNKED); @@ -3186,7 +3186,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); @@ -3241,14 +3241,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * break; case H5D_COMPACT: ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", COMPACT); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size); @@ -3266,14 +3266,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * /* EXTERNAL FILE */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); @@ -3284,7 +3284,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * for (j = 0; j < (unsigned)n_external; j++) { H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILENAME %s SIZE %" PRIuHSIZE, name, size); @@ -3298,7 +3298,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3311,14 +3311,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * /* NORMAL FILE */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size); @@ -3332,7 +3332,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (supported & H5VL_OPT_QUERY_SUPPORTED) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); ioffset = H5Dget_offset(dset_id); @@ -3362,7 +3362,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * hid_t virtual_vspace = H5Pget_virtual_vspace(dcpl_id, curr_vmap); hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, curr_vmap); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %zu %s ", VDS_MAPPING, curr_vmap, BEGIN); @@ -3371,7 +3371,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_VIRTUAL, BEGIN); @@ -3385,14 +3385,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SOURCE, BEGIN); @@ -3410,7 +3410,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * assert((size_t)ssize_out < sizeof(name)); H5Pget_virtual_dsetname(dcpl_id, curr_vmap, dsetname, sizeof(dsetname)); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_FILE, @@ -3420,7 +3420,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_DATASET, @@ -3435,7 +3435,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3444,7 +3444,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3464,7 +3464,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0); } /*switch*/ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3475,7 +3475,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * *------------------------------------------------------------------------- */ if (H5D_VIRTUAL != stl) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); @@ -3492,7 +3492,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (filtn < 0) continue; /* nothing to print for invalid filter */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); switch (filtn) { @@ -3522,14 +3522,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); if (szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) @@ -3539,7 +3539,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); if (szip_options_mask & H5_SZIP_EC_OPTION_MASK) @@ -3549,7 +3549,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); if (szip_options_mask & H5_SZIP_LSB_OPTION_MASK) @@ -3560,7 +3560,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0, (hsize_t)0); if (szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "HEADER %s", "RAW"); @@ -3570,7 +3570,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3595,7 +3595,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILTER_ID %d", filtn); @@ -3603,7 +3603,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0, (hsize_t)0); if (f_name[0] != '\0') { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT %s", f_name); @@ -3611,7 +3611,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0, (hsize_t)0); } if (cd_nelmts) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", "PARAMS", BEGIN); @@ -3623,7 +3623,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3634,7 +3634,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } /*i*/ } /*nfilters*/ else { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NONE"); @@ -3643,7 +3643,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3654,7 +3654,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * * FILLVALUE *------------------------------------------------------------------------- */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); @@ -3662,7 +3662,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILL_TIME "); @@ -3687,7 +3687,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", "VALUE "); @@ -3715,7 +3715,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3726,7 +3726,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * *------------------------------------------------------------------------- */ if (H5D_VIRTUAL != stl) { - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); @@ -3734,7 +3734,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); @@ -3761,7 +3761,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3816,7 +3816,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ if (cmt_bufsize > 0) { comment[cmt_bufsize] = '\0'; /* necessary because null char is not returned */ - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT \"%s\"", comment); @@ -3858,7 +3858,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex if (info->line_ncols > 0) ncols = info->line_ncols; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->attributebegin, attr_name, @@ -3884,7 +3884,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex h5tools_dump_oid(stream, info, ctx, attr_id); if (data_output || attr_data_output) - h5tools_dump_data(stream, info, ctx, attr_id, FALSE); + h5tools_dump_data(stream, info, ctx, attr_id, false); ctx->indent_level--; @@ -3893,16 +3893,16 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex H5Aclose(attr_id); } - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { + if (strlen(h5tools_dump_header_format->attributeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3946,25 +3946,25 @@ h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) hid_t n_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if (H5Tget_class(n_type) == H5T_INTEGER) { - if (H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) + if (H5Tequal(n_type, H5T_NATIVE_SCHAR) == true) packed_bits_size = 8 * sizeof(char); - else if (H5Tequal(n_type, H5T_NATIVE_UCHAR) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_UCHAR) == true) packed_bits_size = 8 * sizeof(unsigned char); - else if (H5Tequal(n_type, H5T_NATIVE_SHORT) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_SHORT) == true) packed_bits_size = 8 * sizeof(short); - else if (H5Tequal(n_type, H5T_NATIVE_USHORT) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_USHORT) == true) packed_bits_size = 8 * sizeof(unsigned short); - else if (H5Tequal(n_type, H5T_NATIVE_INT) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_INT) == true) packed_bits_size = 8 * sizeof(int); - else if (H5Tequal(n_type, H5T_NATIVE_UINT) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_UINT) == true) packed_bits_size = 8 * sizeof(unsigned int); - else if (H5Tequal(n_type, H5T_NATIVE_LONG) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_LONG) == true) packed_bits_size = 8 * sizeof(long); - else if (H5Tequal(n_type, H5T_NATIVE_ULONG) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_ULONG) == true) packed_bits_size = 8 * sizeof(unsigned long); - else if (H5Tequal(n_type, H5T_NATIVE_LLONG) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_LLONG) == true) packed_bits_size = 8 * sizeof(long long); - else if (H5Tequal(n_type, H5T_NATIVE_ULLONG) == TRUE) + else if (H5Tequal(n_type, H5T_NATIVE_ULLONG) == true) packed_bits_size = 8 * sizeof(unsigned long long); else error_msg("Packed Bit not valid for this datatype"); @@ -3999,7 +3999,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool if (info->line_ncols > 0) ncols = info->line_ncols; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, @@ -4008,7 +4008,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool ctx->indent_level++; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, @@ -4018,7 +4018,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool h5tools_dump_header_format->startblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->stridebegin, @@ -4028,7 +4028,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool h5tools_dump_header_format->strideblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->countbegin, @@ -4043,7 +4043,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool h5tools_dump_header_format->countblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->blockbegin, @@ -4088,7 +4088,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex datactx = *ctx; /* print context */ /* Assume entire data space to be printed */ - datactx.need_prefix = TRUE; + datactx.need_prefix = true; memset(&buffer, 0, sizeof(h5tools_str_t)); for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { @@ -4097,7 +4097,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); - datactx.need_prefix = TRUE; + datactx.need_prefix = true; h5tools_str_reset(&buffer); H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i); h5tools_str_sprint(&buffer, info, container, H5T_STD_REF, &ref_buf[i], &datactx); @@ -4113,7 +4113,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex case H5O_TYPE_DATASET: if ((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { datactx.indent_level++; - h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + h5tools_dump_data(stream, info, &datactx, new_obj_id, true); // h5tools_dump_dset(stream, info, &datactx, new_obj_id); datactx.indent_level--; if (H5Dclose(new_obj_id) < 0) @@ -4139,7 +4139,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1"); if ((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { datactx.indent_level++; - h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + h5tools_dump_data(stream, info, &datactx, new_obj_id, true); // h5tools_dump_dset(stream, info, &datactx, new_obj_id); datactx.indent_level--; if (H5Dclose(new_obj_id) < 0) @@ -4158,7 +4158,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex case H5O_TYPE_DATASET: if ((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { datactx.indent_level++; - h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + h5tools_dump_data(stream, info, &datactx, new_obj_id, true); // h5tools_dump_dset(stream, info, &datactx, new_obj_id); datactx.indent_level--; if (H5Oclose(new_obj_id) < 0) @@ -4200,14 +4200,14 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - datactx.need_prefix = TRUE; + datactx.need_prefix = true; datactx.indent_level++; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NULL"); h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); datactx.indent_level--; - datactx.need_prefix = TRUE; + datactx.need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "}"); @@ -4260,14 +4260,14 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - datactx.need_prefix = TRUE; + datactx.need_prefix = true; datactx.indent_level++; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NULL"); h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); datactx.indent_level--; - datactx.need_prefix = TRUE; + datactx.need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "}"); @@ -4297,7 +4297,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex /*------------------------------------------------------------------------- * Function: dump_data * - * Purpose: Dump attribute, obj_data is FALSE, or dataset data, obj_data is TRUE + * Purpose: Dump attribute, obj_data is false, or dataset data, obj_data is true * * Return: void *------------------------------------------------------------------------- @@ -4358,7 +4358,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; } - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->databegin, h5tools_dump_header_format->datablockbegin); @@ -4381,7 +4381,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5Sget_simple_extent_dims(space, total_size, NULL); init_acc_pos(datactx.ndims, total_size, datactx.acc, datactx.pos, datactx.p_min_idx); - datactx.need_prefix = TRUE; + datactx.need_prefix = true; if (NULL != (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { @@ -4420,18 +4420,18 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * */ string_dataformat.idx_fmt = "\""; datactx.indent_level++; - datactx.need_prefix = TRUE; + datactx.need_prefix = true; h5tools_simple_prefix(stream, &string_dataformat, &datactx, (hsize_t)0, 0); string_dataformat.line_multi_new = 1; string_dataformat.str_repeat = 8; - string_dataformat.ascii = TRUE; + string_dataformat.ascii = true; string_dataformat.elmt_suf1 = ""; string_dataformat.elmt_suf2 = ""; string_dataformat.line_suf = "\""; } else { - datactx.need_prefix = TRUE; + datactx.need_prefix = true; } /* Print all the values. */ @@ -4453,7 +4453,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (datactx.display_char && H5Tget_size(f_type) == 1 && H5Tget_class(f_type) == H5T_INTEGER) { H5TOOLS_DEBUG("Print 1-byte integer data as an ASCII character string eol=%s", string_dataformat.line_suf); - datactx.need_prefix = FALSE; + datactx.need_prefix = false; string_dataformat.arr_linebreak = 0; string_dataformat.idx_fmt = ""; string_dataformat.line_multi_new = 0; @@ -4474,17 +4474,17 @@ done: H5Sclose(space); H5Tclose(f_type); - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataend); h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -4492,16 +4492,16 @@ done: if (ctx->sset && obj_data) { ctx->indent_level--; - ctx->need_prefix = TRUE; + ctx->need_prefix = true; h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->subsettingblockend)) { + if (strlen(h5tools_dump_header_format->subsettingblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingblockend); - if (HDstrlen(h5tools_dump_header_format->subsettingend)) + if (strlen(h5tools_dump_header_format->subsettingend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->subsettingend)) + if (strlen(h5tools_dump_header_format->subsettingend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingend); h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index c8e1992..e57158a 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -42,40 +42,40 @@ H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5to H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, hid_t container, unsigned flags, hsize_t nelmts, hid_t type, void *_mem); -H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, hid_t type); -H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, hid_t space); -H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, const char *attr_name, - hid_t attr_id); -H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, hid_t oid); -H5TOOLS_DLL void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, hid_t dcpl, hid_t type_id, - hid_t obj_id); -H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, hid_t obj_id); -H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t obj_id, int obj_data); -H5TOOLS_DLL void h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t container, H5R_ref_t *ref_buf, int ndims); -H5TOOLS_DLL hbool_t h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, - hsize_t *curr_pos, size_t ncols, - hsize_t region_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t type); +H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t space); +H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, const char *attr_name, + hid_t attr_id); +H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t oid); +H5TOOLS_DLL void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t dcpl, hid_t type_id, + hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t obj_id, int obj_data); +H5TOOLS_DLL void h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t container, H5R_ref_t *ref_buf, int ndims); +H5TOOLS_DLL bool h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, + hsize_t elmt_counter); -H5TOOLS_DLL hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, - const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, - hsize_t *curr_pos, size_t ncols, - hsize_t region_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL bool h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, + const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, + hsize_t elmt_counter); -H5TOOLS_DLL hbool_t h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *stream, - const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, - hsize_t *curr_pos, size_t ncols, - hsize_t region_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL bool h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *stream, + const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, + hsize_t elmt_counter); H5TOOLS_DLL int h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer /*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 8a7414c..b564511 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -36,7 +36,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; char lib_str[256]; \ \ /* Initialize library version string for error class */ \ - HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); \ + snprintf(lib_str, sizeof(lib_str), "%d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); \ \ /* Create new HDF5 error stack for the tools to use */ \ if ((H5tools_ERR_STACK_g = H5Ecreate_stack()) < 0) \ @@ -213,7 +213,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; */ #define CATCH \ catch_except:; \ - past_catch = TRUE; + past_catch = true; /* * H5_LEAVE macro, used to facilitate control flow in a function. The argument diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index d89c546..a1466bc 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -132,7 +132,7 @@ init_ref_path_table(void) return (-1); /* Iterate over objects in this file */ - if (h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL, H5O_INFO_BASIC) < 0) { + if (h5trav_visit(thefile, "/", true, true, init_ref_path_cb, NULL, NULL, H5O_INFO_BASIC) < 0) { error_msg("unable to construct reference path table\n"); h5tools_setstatus(EXIT_FAILURE); } /* end if */ @@ -180,10 +180,10 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) { H5O_info2_t oi; - if ((thepath == NULL) || (HDstrlen(thepath) == 0)) + if ((thepath == NULL) || (strlen(thepath) == 0)) return -1; /* Allow lookups on the root group, even though it doesn't have any link info */ - if (HDstrcmp(thepath, "/") != 0) { + if (strcmp(thepath, "/") != 0) { H5L_info2_t li; /* Check for external link first, so we don't return the OID of an object in another file */ @@ -231,7 +231,7 @@ ref_path_table_put(const char *path, const H5O_token_t *token) return (-1); memcpy(&new_node->obj_token, token, sizeof(H5O_token_t)); - new_node->path = HDstrdup(path); + new_node->path = strdup(path); return (H5SL_insert(ref_path_table, new_node, &(new_node->obj_token))); } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index bd75879..5ef86fb 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -43,10 +43,10 @@ typedef struct H5LD_memb_t { /* Variable length string datatype */ #define STR_INIT_LEN 4096 /*initial length */ -static char *h5tools_escape(char *s, size_t size); -static hbool_t h5tools_str_is_zero(const void *_mem, size_t size); -static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch); -void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx); +static char *h5tools_escape(char *s, size_t size); +static bool h5tools_str_is_zero(const void *_mem, size_t size); +static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch); +void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx); /*------------------------------------------------------------------------- * Function: h5tools_str_close @@ -106,7 +106,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) if (!str->s || str->nalloc <= 0) h5tools_str_reset(str); - if (HDstrlen(fmt) == 0) + if (strlen(fmt) == 0) /* nothing to print */ return str->s; @@ -117,17 +117,17 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) size_t avail = str->nalloc - str->len; va_start(ap, fmt); - nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); + nchars = vsnprintf(str->s + str->len, avail, fmt, ap); va_end(ap); - /* Note: HDvsnprintf() behaves differently on Windows as Unix, when + /* Note: vsnprintf() behaves differently on Windows as Unix, when * buffer is smaller than source string. On Unix, this function * returns length of the source string and copy string up to the * buffer size with NULL at the end of the buffer. However on * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. * Because of this different return results, the strlen of the new string - * is used to handle when HDvsnprintf() returns -1 on Windows due + * is used to handle when vsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more * buffer size before return NULL. */ @@ -135,7 +135,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) /* failure, such as bad format */ return NULL; - if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) { + if ((size_t)nchars >= avail || (0 == nchars && (strcmp(fmt, "%s") != 0))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is @@ -230,14 +230,14 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) assert(fmt); /* If the format string is simply "%s" then don't bother doing anything */ - if (!HDstrcmp(fmt, "%s")) + if (!strcmp(fmt, "%s")) return str->s; /* * Save the input value if there is a `%' anywhere in FMT. Otherwise * don't bother because we don't need a temporary copy. */ - if (HDstrchr(fmt, '%')) { + if (strchr(fmt, '%')) { size_t n = sizeof(_temp); if (str->len - start + 1 > n) { n = str->len - start + 1; @@ -245,7 +245,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) assert(temp); } - HDstrncpy(temp, str->s + start, n - 1); + strncpy(temp, str->s + start, n - 1); temp[n - 1] = '\0'; } @@ -669,8 +669,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5TOOLS_START_DEBUG(" "); /* Build default formats for long long types */ if (!fmt_llong[0]) { - HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%lld"); - HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu"); + snprintf(fmt_llong, sizeof(fmt_llong), "%%lld"); + snprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu"); } /* Append value depending on data type */ @@ -741,10 +741,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai quote = '\0'; if (H5Tis_variable_str(type)) { /* cp_vp is the pointer into the struct where a `char*' is stored. So we have - * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ + * to dereference the pointer to get the `char*' to pass to strlen(). */ s = *(char **)((void *)cp_vp); if (s != NULL) - size = HDstrlen(s); + size = strlen(s); } else { s = cp_vp; @@ -1494,7 +1494,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) size_t i; const char *escape; char octal[8]; - size_t n = HDstrlen(s); + size_t n = strlen(s); for (i = 0; i < n; i++) { switch (s[i]) { @@ -1533,7 +1533,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) break; default: if (!isprint(s[i])) { - HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char)s[i]); + snprintf(octal, sizeof(octal), "\\%03o", (unsigned char)s[i]); escape = octal; } else @@ -1543,7 +1543,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) } if (escape) { - size_t esc_size = HDstrlen(escape); + size_t esc_size = strlen(escape); if (n + esc_size + 1 > size) /*would overflow*/ @@ -1564,20 +1564,20 @@ h5tools_escape(char *s /*in,out*/, size_t size) * * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: true if all bytes are zero; false otherwise * *------------------------------------------------------------------------- */ -static hbool_t +static bool h5tools_str_is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *)_mem; while (size-- > 0) if (mem[size]) - return FALSE; + return false; - return TRUE; + return true; } /*------------------------------------------------------------------------- @@ -1601,26 +1601,26 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem char *head = NULL; if (substr == NULL || replacement == NULL) - return HDstrdup(string); - newstr = HDstrdup(string); + return strdup(string); + newstr = strdup(string); head = newstr; - while ((tok = HDstrstr(head, substr))) { + while ((tok = strstr(head, substr))) { char *oldstr; oldstr = newstr; - newstr = (char *)malloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); + newstr = (char *)malloc(strlen(oldstr) - strlen(substr) + strlen(replacement) + 1); if (newstr == NULL) { free(oldstr); return NULL; } memcpy(newstr, oldstr, (size_t)(tok - oldstr)); - memcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); - memcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr), - HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr)); - memset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1); + memcpy(newstr + (tok - oldstr), replacement, strlen(replacement)); + memcpy(newstr + (tok - oldstr) + strlen(replacement), tok + strlen(substr), + strlen(oldstr) - strlen(substr) - (size_t)(tok - oldstr)); + memset(newstr + strlen(oldstr) - strlen(substr) + strlen(replacement), 0, 1); /* move back head right after the last replacement */ - head = newstr + (tok - oldstr) + HDstrlen(replacement); + head = newstr + (tok - oldstr) + strlen(replacement); free(oldstr); } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index fc9a646..dfffac6 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -51,7 +51,7 @@ static void init_table(hid_t fid, table_t **tbl); #ifdef H5DUMP_DEBUG static void dump_table(hid_t fid, char *tablename, table_t *table); #endif /* H5DUMP_DEBUG */ -static void add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool_t recorded); +static void add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, bool recorded); /*------------------------------------------------------------------------- * Function: parallel_print @@ -68,10 +68,10 @@ parallel_print(const char *format, ...) va_start(ap, format); if (!g_Parallel) - HDvprintf(format, ap); + vprintf(format, ap); else { if (overflow_file == NULL) /*no overflow has occurred yet */ { - bytes_written = HDvsnprintf(outBuff + outBuffOffset, OUTBUFF_SIZE - outBuffOffset, format, ap); + bytes_written = vsnprintf(outBuff + outBuffOffset, OUTBUFF_SIZE - outBuffOffset, format, ap); va_end(ap); va_start(ap, format); @@ -84,13 +84,13 @@ parallel_print(const char *format, ...) fprintf(rawerrorstream, "warning: could not create overflow file. Output may be truncated.\n"); else - bytes_written = HDvfprintf(overflow_file, format, ap); + bytes_written = vfprintf(overflow_file, format, ap); } else outBuffOffset += (unsigned)bytes_written; } else - bytes_written = HDvfprintf(overflow_file, format, ap); + bytes_written = vfprintf(overflow_file, format, ap); } va_end(ap); } @@ -114,7 +114,7 @@ error_msg(const char *fmt, ...) FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); fprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); - HDvfprintf(rawerrorstream, fmt, ap); + vfprintf(rawerrorstream, fmt, ap); va_end(ap); } @@ -138,7 +138,7 @@ warn_msg(const char *fmt, ...) FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); fprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); - HDvfprintf(rawerrorstream, fmt, ap); + vfprintf(rawerrorstream, fmt, ap); va_end(ap); } @@ -241,10 +241,10 @@ parse_subset_params(const char *dset) H5TOOLS_START_DEBUG(" - dset:%s", dset); /* if dset name is quoted wait till after second quote to look for subset brackets */ if (*dset == '"') - q_dset = HDstrchr(dset, '"'); + q_dset = strchr(dset, '"'); else q_dset = dset; - if ((brace = HDstrrchr(q_dset, '[')) != NULL) { + if ((brace = strrchr(q_dset, '[')) != NULL) { *brace++ = '\0'; s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); @@ -388,8 +388,8 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create destination string */ - start++; /* advance past opening paren '(' */ - cpy = (char *)malloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ + start++; /* advance past opening paren '(' */ + cpy = (char *)malloc(sizeof(char) * (strlen(start))); /* no +1; less '(' */ if (cpy == NULL) { ret_value = FAIL; goto done; @@ -660,7 +660,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see switch (oinfo->type) { case H5O_TYPE_GROUP: if (NULL == already_seen) - add_obj(info->group_table, &oinfo->token, name, TRUE); + add_obj(info->group_table, &oinfo->token, name, true); break; case H5O_TYPE_DATASET: @@ -668,7 +668,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see hid_t dset = H5I_INVALID_HID; /* Add the dataset to the list of objects */ - add_obj(info->dset_table, &oinfo->token, name, TRUE); + add_obj(info->dset_table, &oinfo->token, name, true); /* Check for a dataset that uses a named datatype */ if ((dset = H5Dopen2(info->fid, name, H5P_DEFAULT)) >= 0) { @@ -679,7 +679,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see H5Oget_info3(type, &type_oinfo, H5O_INFO_BASIC); if (search_obj(info->type_table, &type_oinfo.token) == NULL) - add_obj(info->type_table, &type_oinfo.token, name, FALSE); + add_obj(info->type_table, &type_oinfo.token, name, false); } /* end if */ H5Tclose(type); @@ -695,14 +695,14 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see obj_t *found_obj; if ((found_obj = search_obj(info->type_table, &oinfo->token)) == NULL) - add_obj(info->type_table, &oinfo->token, name, TRUE); + add_obj(info->type_table, &oinfo->token, name, true); else { /* Use latest version of name */ free(found_obj->objname); - found_obj->objname = HDstrdup(name); + found_obj->objname = strdup(name); /* Mark named datatype as having valid name */ - found_obj->recorded = TRUE; + found_obj->recorded = true; } /* end else */ } /* end if */ break; @@ -744,7 +744,7 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table, table_t **dset_ta info->dset_table = *dset_table; /* Find all shared objects */ - if ((ret_value = h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info, H5O_INFO_BASIC)) < 0) + if ((ret_value = h5trav_visit(fid, "/", true, true, find_objs_cb, NULL, info, H5O_INFO_BASIC)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "finding shared objects failed"); done: @@ -770,7 +770,7 @@ done: *------------------------------------------------------------------------- */ static void -add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool_t record) +add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, bool record) { size_t u; @@ -785,7 +785,7 @@ add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool /* Set information about object */ memcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t)); - table->objs[u].objname = HDstrdup(objname); + table->objs[u].objname = strdup(objname); table->objs[u].recorded = record; table->objs[u].displayed = 0; } @@ -831,7 +831,7 @@ tmpfile(void) *-------------------------------------------------------------------------*/ int H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t *link_info, - hbool_t get_obj_type) + bool get_obj_type) { htri_t l_ret; H5O_info2_t trg_oinfo; @@ -843,7 +843,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t link_info->trg_type = H5O_TYPE_UNKNOWN; /* if path is root, return group type */ - if (!HDstrcmp(linkpath, "/")) { + if (!strcmp(linkpath, "/")) { link_info->trg_type = H5O_TYPE_GROUP; H5TOOLS_GOTO_DONE(2); } @@ -905,7 +905,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t l_ret = H5Oexists_by_name(file_id, linkpath, lapl); /* detect dangling link */ - if (l_ret == FALSE) { + if (l_ret == false) { H5TOOLS_GOTO_DONE(0); } else if (l_ret < 0) { /* function failed */ @@ -994,7 +994,7 @@ h5tools_getenv_update_hyperslab_bufsize(void) int ret_value = 1; /* check if environment variable is set for the hyperslab buffer size */ - if (NULL != (env_str = HDgetenv("H5TOOLS_BUFSIZE"))) { + if (NULL != (env_str = getenv("H5TOOLS_BUFSIZE"))) { errno = 0; hyperslab_bufsize_mb = strtol(env_str, (char **)NULL, 10); if (errno != 0 || hyperslab_bufsize_mb <= 0) @@ -1146,7 +1146,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_ext_t *fa, const char **values) printf(" preset fapl with default values\n"); } fa->fa.version = H5FD_CURR_ROS3_FAPL_T_VERSION; - fa->fa.authenticate = FALSE; + fa->fa.authenticate = false; *(fa->fa.aws_region) = '\0'; *(fa->fa.secret_id) = '\0'; *(fa->fa.secret_key) = '\0'; @@ -1188,55 +1188,55 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_ext_t *fa, const char **values) * fail if value would overflow */ if (*values[0] != '\0' && *values[1] != '\0') { - if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { + if (strlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { if (show_progress) { printf(" ERROR: aws_region value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.aws_region, values[0], (HDstrlen(values[0]) + 1)); + memcpy(fa->fa.aws_region, values[0], (strlen(values[0]) + 1)); if (show_progress) { printf(" aws_region set\n"); } - if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { + if (strlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { if (show_progress) { printf(" ERROR: secret_id value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.secret_id, values[1], (HDstrlen(values[1]) + 1)); + memcpy(fa->fa.secret_id, values[1], (strlen(values[1]) + 1)); if (show_progress) { printf(" secret_id set\n"); } - if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { + if (strlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { if (show_progress) { printf(" ERROR: secret_key value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.secret_key, values[2], (HDstrlen(values[2]) + 1)); + memcpy(fa->fa.secret_key, values[2], (strlen(values[2]) + 1)); if (show_progress) { printf(" secret_key set\n"); } - if (HDstrlen(values[3]) > H5FD_ROS3_MAX_SECRET_TOK_LEN) { + if (strlen(values[3]) > H5FD_ROS3_MAX_SECRET_TOK_LEN) { if (show_progress) { printf(" ERROR: token value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->token, values[3], (HDstrlen(values[3]) + 1)); + memcpy(fa->token, values[3], (strlen(values[3]) + 1)); if (show_progress) { printf(" token set\n"); } - fa->fa.authenticate = TRUE; + fa->fa.authenticate = true; if (show_progress) { printf(" set to authenticate\n"); } @@ -1288,22 +1288,22 @@ h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t * WARNING: No error-checking is done on length of input strings... * Silent overflow is possible, albeit unlikely. */ - if (HDstrncmp(props[0], "", 1)) { - HDstrncpy(fapl_config_out->namenode_name, (const char *)props[0], HDstrlen(props[0])); + if (strncmp(props[0], "", 1)) { + strncpy(fapl_config_out->namenode_name, (const char *)props[0], strlen(props[0])); } - if (HDstrncmp(props[1], "", 1)) { + if (strncmp(props[1], "", 1)) { k = strtoul((const char *)props[1], NULL, 0); if (errno == ERANGE) H5TOOLS_GOTO_ERROR(FAIL, "supposed port number wasn't"); fapl_config_out->namenode_port = (int32_t)k; } - if (HDstrncmp(props[2], "", 1)) { - HDstrncpy(fapl_config_out->kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); + if (strncmp(props[2], "", 1)) { + strncpy(fapl_config_out->kerberos_ticket_cache, (const char *)props[2], strlen(props[2])); } - if (HDstrncmp(props[3], "", 1)) { - HDstrncpy(fapl_config_out->user_name, (const char *)props[3], HDstrlen(props[3])); + if (strncmp(props[3], "", 1)) { + strncpy(fapl_config_out->user_name, (const char *)props[3], strlen(props[3])); } - if (HDstrncmp(props[4], "", 1)) { + if (strncmp(props[4], "", 1)) { k = strtoul((const char *)props[4], NULL, 0); if (errno == ERANGE) H5TOOLS_GOTO_ERROR(FAIL, "supposed buffersize number wasn't"); diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 2efa53f..ce5a24a 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -41,8 +41,8 @@ H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE; typedef struct obj_t { H5O_token_t obj_token; char *objname; - hbool_t displayed; /* Flag to indicate that the object has been displayed */ - hbool_t recorded; /* Flag for named datatypes to indicate they were found in the group hierarchy */ + bool displayed; /* Flag to indicate that the object has been displayed */ + bool recorded; /* Flag for named datatypes to indicate they were found in the group hierarchy */ } obj_t; /*struct for the tables that the find_objs function uses*/ @@ -126,7 +126,7 @@ typedef struct { /* Definitions of routines */ H5TOOLS_DLL int H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t *link_info, - hbool_t get_obj_type); + bool get_obj_type); H5TOOLS_DLL const char *h5tools_getprogname(void); H5TOOLS_DLL void h5tools_setprogname(const char *progname); H5TOOLS_DLL int h5tools_getstatus(void); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 5ae379e..017e062 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -38,7 +38,7 @@ typedef struct { typedef struct { trav_addr_t *seen; /* List of addresses seen already */ const trav_visitor_t *visitor; /* Information for visiting each link/object */ - hbool_t is_absolute; /* Whether the traversal has absolute paths */ + bool is_absolute; /* Whether the traversal has absolute paths */ const char *base_grp_name; /* Name of the group that serves as the base * for iteration */ unsigned fields; /* Fields needed in H5O_info2_t struct */ @@ -126,7 +126,7 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) /* Append it */ idx = visited->nused++; memcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t)); - visited->objs[idx].path = HDstrdup(path); + visited->objs[idx].path = strdup(path); } /* end trav_token_add() */ /*------------------------------------------------------------------------- @@ -134,7 +134,7 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) * * Purpose: Check if an object token has already been seen * - * Return: TRUE/FALSE + * Return: true/false *------------------------------------------------------------------------- */ H5_ATTR_PURE static const char * @@ -172,17 +172,17 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda /* Create the full path name for the link */ if (udata->is_absolute) { - size_t base_len = HDstrlen(udata->base_grp_name); + size_t base_len = strlen(udata->base_grp_name); size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1; - size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1 + + size_t new_name_len = base_len + add_slash + strlen(path) + 1 + 3; /* Extra "+3" to quiet GCC warning - 2019/07/05, QAK */ if (NULL == (new_name = (char *)malloc(new_name_len))) return (H5_ITER_ERROR); if (add_slash) - HDsnprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); + snprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); else - HDsnprintf(new_name, new_name_len, "%s%s", udata->base_grp_name, path); + snprintf(new_name, new_name_len, "%s%s", udata->base_grp_name, path); full_name = new_name; } /* end if */ else @@ -241,8 +241,8 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda *------------------------------------------------------------------------- */ static int -traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, hbool_t recurse, - const trav_visitor_t *visitor, unsigned fields) +traverse(hid_t file_id, const char *grp_name, bool visit_start, bool recurse, const trav_visitor_t *visitor, + unsigned fields) { H5O_info2_t oinfo; /* Object info for starting group */ int ret_value = 0; @@ -326,7 +326,7 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) /* Append it */ idx = info->nused++; - info->paths[idx].path = HDstrdup(path); + info->paths[idx].path = strdup(path); info->paths[idx].type = obj_type; info->paths[idx].fileno = 0; @@ -349,7 +349,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) H5O_info2_t oinfo; size_t idx = info->nused - 1; - if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0) + if (info->paths[idx].path && strcmp(info->paths[idx].path, ".") != 0) H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC); @@ -428,7 +428,7 @@ h5trav_getinfo(hid_t file_id, trav_info_t *info) info_visitor.udata = info; /* Traverse all objects in the file, visiting each object & link */ - if (traverse(file_id, "/", TRUE, TRUE, &info_visitor, H5O_INFO_BASIC) < 0) + if (traverse(file_id, "/", true, true, &info_visitor, H5O_INFO_BASIC) < 0) H5TOOLS_GOTO_ERROR((-1), "traverse failed"); done: @@ -452,11 +452,11 @@ h5trav_getindex(const trav_info_t *info, const char *obj) /* Loop over all paths in 'info' struct, looking for object */ for (u = 0; u < info->nused; u++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(obj, info->paths[u].path) == 0) + if (strcmp(obj, info->paths[u].path) == 0) return ((ssize_t)u); /* Check for object name without leading '/' */ - if (HDstrcmp(obj, (info->paths[u].path + 1)) == 0) + if (strcmp(obj, (info->paths[u].path + 1)) == 0) return ((ssize_t)u); } /* end for */ @@ -486,7 +486,7 @@ trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) info->symlink_visited.nused = 0; info->symlink_visited.nalloc = 0; info->symlink_visited.objs = NULL; - info->symlink_visited.dangle_link = FALSE; + info->symlink_visited.dangle_link = false; *_info = info; } /* end trav_info_init() */ @@ -587,7 +587,7 @@ h5trav_gettable(hid_t fid, trav_table_t *table) table_visitor.udata = table; /* Traverse all objects in the file, visiting each object & link */ - if (traverse(fid, "/", TRUE, TRUE, &table_visitor, H5O_INFO_BASIC) < 0) + if (traverse(fid, "/", true, true, &table_visitor, H5O_INFO_BASIC) < 0) H5TOOLS_GOTO_ERROR((-1), "traverse failed"); done: @@ -611,11 +611,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) if (table) { for (i = 0; i < table->nobjs; i++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(name, table->objs[i].name) == 0) + if (strcmp(name, table->objs[i].name) == 0) return ((int)i); /* Check for object name without leading '/' */ - if (HDstrcmp(name, table->objs[i].name + 1) == 0) + if (strcmp(name, table->objs[i].name + 1) == 0) return ((int)i); /* search also in the list of links */ @@ -624,11 +624,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for (j = 0; j < table->objs[i].nlinks; j++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(name, table->objs[i].links[j].new_name) == 0) + if (strcmp(name, table->objs[i].links[j].new_name) == 0) return ((int)i); /* Check for object name without leading '/' */ - if (HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) + if (strcmp(name, table->objs[i].links[j].new_name + 1) == 0) return ((int)i); } /* end for */ } /* end if */ @@ -664,7 +664,7 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info2_t *oinfo) table->objs[new_obj].obj_token = H5O_TOKEN_UNDEF; table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(path); + table->objs[new_obj].name = (char *)strdup(path); table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; table->objs[new_obj].nlinks = 0; table->objs[new_obj].sizelinks = 0; @@ -694,7 +694,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char size_t n; /* already inserted? */ - if (HDstrcmp(table->objs[i].name, path) == 0) + if (strcmp(table->objs[i].name, path) == 0) return; /* allocate space if necessary */ @@ -706,7 +706,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char /* insert it */ n = table->objs[i].nlinks++; - table->objs[i].links[n].new_name = (char *)HDstrdup(path); + table->objs[i].links[n].new_name = (char *)strdup(path); return; } /* end if */ @@ -741,7 +741,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ table->objs[new_obj].flags[0] = flags[0]; table->objs[new_obj].flags[1] = flags[1]; table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(name); + table->objs[new_obj].name = (char *)strdup(name); table->objs[new_obj].type = type; table->objs[new_obj].nlinks = 0; table->objs[new_obj].sizelinks = 0; @@ -1017,7 +1017,7 @@ h5trav_print(hid_t fid) print_visitor.udata = &print_udata; /* Traverse all objects in the file, visiting each object & link */ - if (traverse(fid, "/", TRUE, TRUE, &print_visitor, H5O_INFO_BASIC) < 0) + if (traverse(fid, "/", true, true, &print_visitor, H5O_INFO_BASIC) < 0) H5TOOLS_GOTO_ERROR(FAIL, "traverse failed"); done: @@ -1034,8 +1034,8 @@ done: *------------------------------------------------------------------------- */ int -h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, hbool_t recurse, - h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata, unsigned fields) +h5trav_visit(hid_t fid, const char *grp_name, bool visit_start, bool recurse, h5trav_obj_func_t visit_obj, + h5trav_lnk_func_t visit_lnk, void *udata, unsigned fields) { trav_visitor_t visitor; /* Visitor structure for objects */ int ret_value = 0; @@ -1086,13 +1086,13 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->objs[idx].path = NULL; if (type == H5L_TYPE_EXTERNAL) { - if (NULL == (visited->objs[idx].file = HDstrdup(file))) { + if (NULL == (visited->objs[idx].file = strdup(file))) { visited->nused--; H5TOOLS_GOTO_ERROR(FAIL, "visited data structure name allocation failed"); } /* end if */ } /* end if */ - if (NULL == (visited->objs[idx].path = HDstrdup(path))) { + if (NULL == (visited->objs[idx].path = strdup(path))) { visited->nused--; if (visited->objs[idx].file) free(visited->objs[idx].file); @@ -1108,10 +1108,10 @@ done: * * Purpose: Check if an symbolic link has already been visited * - * Return: TRUE/FALSE + * Return: true/false *------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { size_t u; /* Local index variable */ @@ -1120,16 +1120,16 @@ symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, c for (u = 0; u < visited->nused; u++) { /* Check for symlink values already in array */ /* check type and path pair to distinguish between symbolic links */ - if ((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) { + if ((visited->objs[u].type == type) && !strcmp(visited->objs[u].path, path)) { /* if external link, file need to be matched as well */ if (visited->objs[u].type == H5L_TYPE_EXTERNAL) - if (!HDstrcmp(visited->objs[u].file, file)) - return (TRUE); + if (!strcmp(visited->objs[u].file, file)) + return (true); - return (TRUE); + return (true); } /* end if */ } /* end for */ /* Didn't find symlink */ - return (FALSE); + return (false); } /* end symlink_is_visited() */ diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 8f3e175..40ceaae 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -57,7 +57,7 @@ typedef struct symlink_trav_t { size_t nalloc; size_t nused; symlink_trav_path_t *objs; - hbool_t dangle_link; + bool dangle_link; } symlink_trav_t; typedef struct trav_path_t { @@ -93,7 +93,7 @@ typedef struct trav_link_t { typedef struct trav_obj_t { H5O_token_t obj_token; /* object token */ unsigned flags[2]; /* h5diff.object is present or not in both files*/ - hbool_t is_same_trgobj; /* same target object? no need to compare */ + bool is_same_trgobj; /* same target object? no need to compare */ char *name; /* name */ h5trav_type_t type; /* type of object */ trav_link_t *links; /* array of possible link names */ @@ -126,14 +126,14 @@ extern "C" { * "h5trav general" public functions *------------------------------------------------------------------------- */ -H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order); -H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_start, hbool_t recurse, - h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata, - unsigned fields); -H5TOOLS_DLL herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, +H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order); +H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, bool visit_start, bool recurse, + h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata, + unsigned fields); +H5TOOLS_DLL herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, + const char *path); +H5TOOLS_DLL bool symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path); -H5TOOLS_DLL hbool_t symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, - const char *path); /*------------------------------------------------------------------------- * "h5trav info" public functions |