diff options
author | kmu <kmu@hdfgroup.org> | 2019-12-11 16:44:56 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2019-12-11 16:44:56 (GMT) |
commit | 45a62b2d46523c15a7d2bc7f52db2b756b40df26 (patch) | |
tree | 9be754803238d1c98cde34ca9d23b3b6e3e7651b /tools | |
parent | a00d71b2e26c06a299ac92552b7887ca017fd4d3 (diff) | |
download | hdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.zip hdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.tar.gz hdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.tar.bz2 |
fix and address comments
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5diff.c | 12 | ||||
-rw-r--r-- | tools/lib/h5diff_attr.c | 12 | ||||
-rw-r--r-- | tools/src/h5import/h5import.c | 4 | ||||
-rw-r--r-- | tools/test/h5repack/h5repackgentest.c | 2 |
4 files changed, 9 insertions, 21 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 5acdde8..d0371c7 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -907,15 +907,9 @@ h5diff(const char *fname1, parallel_print("file1 file2\n"); parallel_print("---------------------------------------\n"); for(u = 0; u < match_list->nobjs; u++) { - char c1, c2; - if (match_list->objs[u].flags[0]) - c1 = 'x'; - else - c1 = ' '; - if (match_list->objs[u].flags[1]) - c2 = 'x'; - else - c2 = ' '; + int c1, c2; + c1 = (match_list->objs[u].flags[0]) ? 'x' : ' '; + c2 = (match_list->objs[u].flags[1]) ? 'x' : ' '; parallel_print("%5c %6c %-15s\n", c1, c2, match_list->objs[u].name); } /* end for */ parallel_print ("\n"); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index a648be1..8f5ab0f 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -273,15 +273,9 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t parallel_print(" obj1 obj2\n"); parallel_print(" --------------------------------------\n"); for(i = 0; i < (unsigned int) table_lp->nattrs; i++) { - char c1, c2; - if (table_lp->attrs[i].exist[0]) - c1 = 'x'; - else - c1 = ' '; - if (table_lp->attrs[i].exist[1]) - c2 = 'x'; - else - c2 = ' '; + int c1, c2; + c1 = (table_lp->attrs[i].exist[0]) ? 'x' : ' '; + c2 = (table_lp->attrs[i].exist[1]) ? 'x' : ' '; parallel_print("%5c %6c %-15s\n", c1, c2, table_lp->attrs[i].name); } /* end for */ } diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 179dac4..f2e264c 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4709,12 +4709,12 @@ static int process(struct Options *opt) uint16_t swap_uint16(uint16_t val) { - return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); + return (uint16_t)((val << 8) | (val >> 8)); } int16_t swap_int16(int16_t val) { - return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); + return (uint16_t)((val << 8) | ((val >> 8) & 0xFF)); } uint32_t swap_uint32(uint32_t val) diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index c2398b6..77fb28a 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -266,7 +266,7 @@ generate_uint8be(hbool_t external) { for (i = 0, n = 0; i < dims[0]; i++) { for (j = 0; j < dims[1]; j++) { for (k = 0; k < dims[2]; k++, n++) { - H5_CHECKED_ASSIGN(wdata[n], uint8_t, n * ((n & 1) ? (-1) : (1)), int); + wdata[n] = (uint8_t)((n & 1) ? -n : n); } } } |