diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-07-30 19:21:26 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-07-30 19:21:26 (GMT) |
commit | 617d269ceb3dda4f504ac48e3dd618d31b4b3fd8 (patch) | |
tree | a1d559fbb3e16313a97d92e311555d1ffbda48e6 /tools/lib/h5diff_dset.c | |
parent | 11bfbb10012b06894e70730735cf9c47bf565fe8 (diff) | |
download | hdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.zip hdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.tar.gz hdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.tar.bz2 |
Warnings reduction in tools
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r-- | tools/lib/h5diff_dset.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 79884fa..8fb24e1 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -277,9 +277,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { - opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j ); - opts->obj_name[0][j] = '\0'; + opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } @@ -289,9 +288,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { - opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j); - opts->obj_name[1][j] = '\0'; + opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -439,7 +437,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n } /* end if */ /* Assume entire data space to be printed */ - init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); for(i = 0; i < opts->rank; i++) { opts->p_max_idx[i] = opts->dims[i]; @@ -780,7 +778,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n opts->sm_pos[j] = low[j]; /* Assume entire data space to be printed */ - init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ |