Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 7, 2021
1 parent 46248a1 commit 6cbd304
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 58 deletions.
5 changes: 2 additions & 3 deletions hl/src/H5LT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,6 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
/* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */
if (str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) {
*len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;

}
else if (!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) {
*len += INCREMENT;
Expand Down Expand Up @@ -2384,9 +2383,9 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt)
herr_t
H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len)
{
size_t str_len = INCREMENT;
size_t str_len = INCREMENT;
char * text_str = NULL;
herr_t ret = SUCCEED;
herr_t ret = SUCCEED;

if (lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
goto out;
Expand Down
8 changes: 4 additions & 4 deletions hl/test/test_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
herr_t
create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims)
{
int rank = 4;
int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE};
long * buf = NULL;
int rank = 4;
int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE};
long * buf = NULL;
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
Expand Down
8 changes: 4 additions & 4 deletions hl/test/test_file_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int
test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
{
hid_t * file_id = NULL, *dset_id = NULL, file_space, plist; /* HDF5 ids */
hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */
hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */
hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED};
int data1[6] = {1, 2, 3, 4, 5, 6}; /* original contents of dataset */
int data2[6] = {7, 8, 9, 10, 11, 12}; /* "wrong" contents of dataset */
Expand All @@ -63,9 +63,9 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
hsize_t dims4[RANK] = {3, 5}; /* extended dimensions of datasets */
int data4[15] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
/* extended contents of dataset */
ssize_t * buf_size = NULL; /* pointer to array of buffer sizes */
void ** buf_ptr = NULL; /* pointer to array of pointers to image buffers */
char ** filename = NULL; /* pointer to array of pointers to filenames */
ssize_t * buf_size = NULL; /* pointer to array of buffer sizes */
void ** buf_ptr = NULL; /* pointer to array of pointers to image buffers */
char ** filename = NULL; /* pointer to array of pointers to filenames */
unsigned * input_flags = NULL; /* pointer to array of flag combinations */
size_t i, j, k, nrow, n_values;
herr_t status1;
Expand Down
4 changes: 2 additions & 2 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,8 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
* Check only the first sizeof(lib_str) char. Assume the information
* will fit within this size or enough significance.
*/
HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d%s%s",
H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, (*substr ? "-" : ""), substr);
HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d%s%s", H5_VERS_MAJOR,
H5_VERS_MINOR, H5_VERS_RELEASE, (*substr ? "-" : ""), substr);

if (HDstrcmp(lib_str, H5_lib_vers_info_g) != 0) {
HDfputs("Warning! Library version information error.\n"
Expand Down
6 changes: 3 additions & 3 deletions src/H5CX.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ H5CX_get_ring(void)
hbool_t
H5CX_get_coll_metadata_read(void)
{
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
hbool_t coll_md_read = FALSE;

FUNC_ENTER_NOAPI_NOINIT_NOERR
Expand Down Expand Up @@ -1834,7 +1834,7 @@ H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype)
hbool_t
H5CX_get_mpi_file_flushing(void)
{
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
hbool_t flushing = FALSE;

FUNC_ENTER_NOAPI_NOINIT_NOERR
Expand Down Expand Up @@ -1865,7 +1865,7 @@ H5CX_get_mpi_file_flushing(void)
hbool_t
H5CX_get_mpio_rank0_bcast(void)
{
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
H5CX_node_t **head = NULL; /* Pointer to head of API context list */
hbool_t do_rank0_bcast = FALSE;

FUNC_ENTER_NOAPI_NOINIT_NOERR
Expand Down
14 changes: 8 additions & 6 deletions src/H5Dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
(cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && (idx < cause_strings_len);
cause <<= 1, idx++) {
if (cause & local_no_collective_cause) {
size_t local_buffer_space = sizeof(local_no_collective_cause_string)
- HDstrlen(local_no_collective_cause_string) - 1;
size_t local_buffer_space = sizeof(local_no_collective_cause_string) -
HDstrlen(local_no_collective_cause_string) - 1;

/* Check if there were any previous error messages included. If so, prepend a
* semicolon to separate the messages.
Expand All @@ -861,14 +861,15 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
}

if (local_buffer_space)
HDstrncat(local_no_collective_cause_string, cause_strings[idx], local_buffer_space);
HDstrncat(local_no_collective_cause_string, cause_strings[idx],
local_buffer_space);

local_error_message_previously_written = TRUE;
} /* end if */

if (cause & global_no_collective_cause) {
size_t global_buffer_space = sizeof(global_no_collective_cause_string)
- HDstrlen(global_no_collective_cause_string) - 1;
size_t global_buffer_space = sizeof(global_no_collective_cause_string) -
HDstrlen(global_no_collective_cause_string) - 1;

/* Check if there were any previous error messages included. If so, prepend a
* semicolon to separate the messages.
Expand All @@ -879,7 +880,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
}

if (global_buffer_space)
HDstrncat(global_no_collective_cause_string, cause_strings[idx], global_buffer_space);
HDstrncat(global_no_collective_cause_string, cause_strings[idx],
global_buffer_space);

global_error_message_previously_written = TRUE;
} /* end if */
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDsplitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
info->wo_path[H5FD_SPLITTER_PATH_MAX] = '\0';
HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX + 1);
info->log_file_path[H5FD_SPLITTER_PATH_MAX] = '\0';
info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */

/* Set non-default channel FAPL IDs in splitter configuration info */
if (H5P_DEFAULT != vfd_config->rw_fapl_id) {
Expand Down
4 changes: 2 additions & 2 deletions test/chunk_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ test_get_chunk_info_highest_v18(hid_t fapl)
int fillvalue = -1; /* Fill value */
hsize_t offset[2] = {0, 0}; /* Offset coordinates of a chunk */
#ifdef H5_HAVE_FILTER_DEFLATE
int aggression = 9; /* Compression aggression setting */
const Bytef *z_src = (const Bytef *)(direct_buf);
int aggression = 9; /* Compression aggression setting */
const Bytef *z_src = (const Bytef *)(direct_buf);
Bytef * z_dst; /* Destination buffer */
uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(CHK_SIZE);
uLong z_src_nbytes = (uLong)CHK_SIZE;
Expand Down
34 changes: 17 additions & 17 deletions test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,29 @@ const char *FILENAME[] = {"dataset", /* 0 */
#define FILE_DEFLATE_NAME "deflate.h5"

/* Dataset names for testing filters */
#define DSET_DEFAULT_NAME "default"
#define DSET_CHUNKED_NAME "chunked"
#define DSET_COMPACT_NAME "compact"
#define DSET_SIMPLE_IO_NAME "simple_io"
#define DSET_USERBLOCK_IO_NAME "userblock_io"
#define DSET_COMPACT_IO_NAME "compact_io"
#define DSET_COMPACT_MAX_NAME "max_compact"
#define DSET_COMPACT_MAX2_NAME "max_compact_2"
#define DSET_CONV_BUF_NAME "conv_buf"
#define DSET_TCONV_NAME "tconv"
#define DSET_DEFAULT_NAME "default"
#define DSET_CHUNKED_NAME "chunked"
#define DSET_COMPACT_NAME "compact"
#define DSET_SIMPLE_IO_NAME "simple_io"
#define DSET_USERBLOCK_IO_NAME "userblock_io"
#define DSET_COMPACT_IO_NAME "compact_io"
#define DSET_COMPACT_MAX_NAME "max_compact"
#define DSET_COMPACT_MAX2_NAME "max_compact_2"
#define DSET_CONV_BUF_NAME "conv_buf"
#define DSET_TCONV_NAME "tconv"
#ifdef H5_HAVE_FILTER_DEFLATE
#define DSET_DEFLATE_NAME "deflate"
#define DSET_DEFLATE_NAME "deflate"
#endif
#define DSET_SHUFFLE_NAME "shuffle"
#define DSET_FLETCHER32_NAME "fletcher32"
#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
#define DSET_SHUFFLE_NAME "shuffle"
#define DSET_FLETCHER32_NAME "fletcher32"
#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
#ifdef H5_HAVE_FILTER_DEFLATE
#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32"
#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2"
#endif
#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space"
#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type"
#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space"
#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type"
#ifdef H5_HAVE_FILTER_SZIP
#define DSET_SZIP_NAME "szip"
#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32"
Expand Down
4 changes: 2 additions & 2 deletions test/file_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test_properties(void)
* property list functions. In the file driver tests further down, this will
* not be the case.
*/
size = (size_t)count * sizeof(char);
size = (size_t)count * sizeof(char);
if (NULL == (buffer = (char *)HDmalloc(size)))
TEST_ERROR
for (i = 0; i < count - 1; i++)
Expand Down Expand Up @@ -339,7 +339,7 @@ test_callbacks(void)
H5FD_file_image_callbacks_t callbacks;
hid_t fapl_1;
hid_t fapl_2;
udata_t * udata = NULL;
udata_t * udata = NULL;
char * file_image = NULL;
char * temp_file_image;
int count = 10;
Expand Down
4 changes: 2 additions & 2 deletions test/h5test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@ h5_set_info_object(void)
valp++;

/* copy key/value pair into temporary buffer */
len = strcspn(valp, ";");
next = &valp[len];
len = strcspn(valp, ";");
next = &valp[len];
if (NULL == (key_val = (char *)HDcalloc(1, len + 1)))
return -1;

Expand Down
15 changes: 12 additions & 3 deletions test/objcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4498,7 +4498,10 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
TESTING("H5Ocopy(): compressed dataset");

#ifndef H5_HAVE_FILTER_DEFLATE
(void)fcpl_src; (void)fcpl_dst; (void)src_fapl; (void)dst_fapl; /* Silence compiler */
(void)fcpl_src;
(void)fcpl_dst;
(void)src_fapl;
(void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
Expand Down Expand Up @@ -4924,7 +4927,10 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
}

#ifndef H5_HAVE_FILTER_DEFLATE
(void)fcpl_src; (void)fcpl_dst; (void)src_fapl; (void)dst_fapl; /* Silence compiler */
(void)fcpl_src;
(void)fcpl_dst;
(void)src_fapl;
(void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
Expand Down Expand Up @@ -7279,7 +7285,10 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
TESTING("H5Ocopy(): compressed dataset with VLEN datatype");

#ifndef H5_HAVE_FILTER_DEFLATE
(void)fcpl_src; (void)fcpl_dst; (void)src_fapl; (void)dst_fapl; /* Silence compiler */
(void)fcpl_src;
(void)fcpl_dst;
(void)src_fapl;
(void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
Expand Down
4 changes: 2 additions & 2 deletions testpar/t_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,8 @@ test_file_properties(void)
void
test_delete(void)
{
hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
hid_t fapl_id = H5I_INVALID_HID; /* File access plist */
hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
hid_t fapl_id = H5I_INVALID_HID; /* File access plist */
const char *filename = NULL;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
Expand Down
10 changes: 5 additions & 5 deletions tools/src/h5dump/h5dump_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,12 +2365,12 @@ xml_dump_named_datatype(hid_t type, const char *name)
h5tools_context_t ctx; /* print context */
h5tool_format_t * outputformat = &xml_dataformat;
h5tool_format_t string_dataformat;
char * tmp = NULL;
char * dtxid = NULL;
char * tmp = NULL;
char * dtxid = NULL;
char * parentxid = NULL;
char * t_tmp = NULL;
char * t_prefix = NULL;
char * t_name = NULL;
char * t_tmp = NULL;
char * t_prefix = NULL;
char * t_name = NULL;

tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (tmp == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion tools/src/h5import/h5import.c
Original file line number Diff line number Diff line change
Expand Up @@ -3780,7 +3780,7 @@ getExternalFilename(struct Input *in, FILE *strm)
return (-1);
}

temp_len = HDstrlen(temp);
temp_len = HDstrlen(temp);
in->externFilename = (char *)HDmalloc((temp_len + 1) * sizeof(char));
(void)HDstrcpy(in->externFilename, temp);
in->externFilename[temp_len] = '\0';
Expand Down

0 comments on commit 6cbd304

Please sign in to comment.