diff options
author | Sean McBride <sean@rogue-research.com> | 2021-03-10 18:42:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 18:42:35 (GMT) |
commit | d7b40604ef43c0617ba93369983657d77d9e976a (patch) | |
tree | ae6eef7cd8a34f3667b585ca37c290fb0cc97fce /tools | |
parent | a7a013782f0af93f511142b5d167c2bc8ca8505d (diff) | |
download | hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.zip hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.tar.gz hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.tar.bz2 |
Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451)
* Fixed all clang-tidy bugprone-suspicious-string-compare warnings
This change was generated entirely by clang-tidy itself.
* Reformat code with clang v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5diff.c | 10 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 4 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.c | 2 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 2 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 2 | ||||
-rw-r--r-- | tools/src/h5dump/h5dump.c | 2 | ||||
-rw-r--r-- | tools/src/h5import/h5import.c | 4 | ||||
-rw-r--r-- | tools/src/h5ls/h5ls.c | 2 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_main.c | 2 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_opttable.c | 2 | ||||
-rw-r--r-- | tools/src/misc/h5delete.c | 2 |
11 files changed, 17 insertions, 17 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 19a19b0..57cfaf2 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -687,7 +687,7 @@ 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)) { + if (HDstrncmp(objname1, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj1fullname, "/%s", objname1) < 0) @@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1)) { + if (HDstrncmp(objname2, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj2fullname, "/%s", objname2) < 0) @@ -1013,7 +1013,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, "/") || HDstrcmp(obj2fullname, "/")) + if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0) parallel_print("group1 group2\n"); else parallel_print("file1 file2\n"); @@ -1115,9 +1115,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, "/")) + if (HDstrcmp(grp1, "/") != 0) grp1_path = grp1; - if (HDstrcmp(grp2, "/")) + if (HDstrcmp(grp2, "/") != 0) grp2_path = grp2; /*------------------------------------------------------------------------- diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 4d19f1f..ab868db 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -2221,12 +2221,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char H5O_info2_t oinfo1, oinfo2; hbool_t ret_val = FALSE; - if (name1 && HDstrcmp(name1, ".")) + if (name1 && HDstrcmp(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, ".")) + if (name2 && HDstrcmp(name2, ".") != 0) H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC); diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 4643466..50f283d 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -200,7 +200,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) if ((thepath == NULL) || (HDstrlen(thepath) == 0)) return -1; /* Allow lookups on the root group, even though it doesn't have any link info */ - if (HDstrcmp(thepath, "/")) { + if (HDstrcmp(thepath, "/") != 0) { H5L_info2_t li; /* Check for external link first, so we don't return the OID of an object in another file */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index d509c54..5d6a90f 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -142,7 +142,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")))) { + if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(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 diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 41dcd6b..d0c299f 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -357,7 +357,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, ".")) + if (info->paths[idx].path && HDstrcmp(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); diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 18bb1d1..9f526da 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -1529,7 +1529,7 @@ main(int argc, const char *argv[]) } } else { - if (useschema_g && HDstrcmp(xmlnsprefix, "")) { + if (useschema_g && HDstrcmp(xmlnsprefix, "") != 0) { error_msg( "Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 2dc02bc..2a65591 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1570,7 +1570,7 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); #endif - if (HDstrcmp("H5T_VARIABLE;", temp)) { + if (HDstrcmp("H5T_VARIABLE;", temp) != 0) { char *more = temp; ival = (int)HDstrtol(more, &more, 10); if (getInputSize(in, ival) == -1) { @@ -1896,7 +1896,7 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); #endif } - while (HDstrcmp("}", temp)) { + while (HDstrcmp("}", temp) != 0) { if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 09bc323..94005ef 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -3088,7 +3088,7 @@ main(int argc, const char *argv[]) symlink_list.objs = NULL; /* Check for root group as object name */ - if (HDstrcmp(oname, root_name)) { + if (HDstrcmp(oname, root_name) != 0) { /* Check the type of link given */ if (H5Lget_info2(file_id, oname, &li, H5P_DEFAULT) < 0) { hsize_t curr_pos = 0; /* total data element position */ diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index c753e90..1f1b821 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -367,7 +367,7 @@ read_info(const char *filename, pack_opt_t *options) break; /* Info indicator must be for layout or filter */ - if (HDstrcmp(stype, "-l") && HDstrcmp(stype, "-f")) { + if (HDstrcmp(stype, "-l") != 0 && HDstrcmp(stype, "-f") != 0) { error_msg("bad file format for %s", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 2fd39fd..167506f 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -339,7 +339,7 @@ options_get_object(const char *path, pack_opttbl_t *table) for (i = 0; i < table->nelems; i++) { /* make full path (start with "/") to compare correctly */ - if (HDstrncmp(table->objs[i].path, "/", 1)) { + if (HDstrncmp(table->objs[i].path, "/", 1) != 0) { HDstrcpy(tbl_path, "/"); HDstrcat(tbl_path, table->objs[i].path); } diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index 6240d59..607b25e 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -37,7 +37,7 @@ main(int argc, const char *argv[]) switch (argc) { case 3: - if (HDstrcmp(argv[1], "-f")) { + if (HDstrcmp(argv[1], "-f") != 0) { usage(); return EXIT_FAILURE; } |